diff --git a/README.md b/README.md index 8dbf2674..06503302 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ APIv4 provides operations related to spot, margin, and contract trading, includi This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: v4.106.8 -- Package version: 7.2.8 +- API version: v4.106.123 +- Package version: 7.2.123 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://www.gate.com/page/contacts](https://www.gate.com/page/contacts) @@ -77,23 +77,31 @@ from gate_api.exceptions import ApiException, GateApiException # Defining the host is optional and defaults to https://api.gateio.ws/api/v4 # See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization configuration = gate_api.Configuration( - host = "https://api.gateio.ws/api/v4" + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" ) api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.EarnUniApi(api_client) +api_instance = gate_api.ActivityApi(api_client) try: - # Query lending currency list - api_response = api_instance.list_uni_currencies() + # My activity entry + api_response = api_instance.get_my_activity_entry() print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling EarnUniApi->list_uni_currencies: %s\n" % e) + print("Exception when calling ActivityApi->get_my_activity_entry: %s\n" % e) ``` @@ -105,6 +113,67 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*ActivityApi* | [**get_my_activity_entry**](docs/ActivityApi.md#get_my_activity_entry) | **GET** /rewards/activity/my-activity-entry | My activity entry +*ActivityApi* | [**list_activities**](docs/ActivityApi.md#list_activities) | **GET** /rewards/activity/activity-list | Recommended activity list +*ActivityApi* | [**list_activity_types**](docs/ActivityApi.md#list_activity_types) | **GET** /rewards/activity/activity-type | Activity type list +*CFDApi* | [**query_mt5_account_info**](docs/CFDApi.md#query_mt5_account_info) | **GET** /tradfi/users/mt5-account | Query MT5 account information +*CFDApi* | [**query_categories**](docs/CFDApi.md#query_categories) | **GET** /tradfi/symbols/categories | Query trading symbol categories +*CFDApi* | [**query_symbol_commissions**](docs/CFDApi.md#query_symbol_commissions) | **GET** /tradfi/symbols/commissions | Query symbol commission rates +*CFDApi* | [**query_symbols**](docs/CFDApi.md#query_symbols) | **GET** /tradfi/symbols | Query trading symbol list +*CFDApi* | [**query_symbol_detail**](docs/CFDApi.md#query_symbol_detail) | **GET** /tradfi/symbols/detail | Query trading symbol details +*CFDApi* | [**query_symbol_kline**](docs/CFDApi.md#query_symbol_kline) | **GET** /tradfi/symbols/{symbol}/klines | Query trading symbol klines +*CFDApi* | [**query_symbol_ticker**](docs/CFDApi.md#query_symbol_ticker) | **GET** /tradfi/symbols/{symbol}/tickers | Query trading symbol ticker +*CFDApi* | [**create_trad_fi_user**](docs/CFDApi.md#create_trad_fi_user) | **POST** /tradfi/users | Create CFD user +*CFDApi* | [**query_user_assets**](docs/CFDApi.md#query_user_assets) | **GET** /tradfi/users/assets | Query account assets +*CFDApi* | [**query_transaction**](docs/CFDApi.md#query_transaction) | **GET** /tradfi/transactions | Query Fund Transfer In/Out Records +*CFDApi* | [**create_transaction**](docs/CFDApi.md#create_transaction) | **POST** /tradfi/transactions | Fund transfer +*CFDApi* | [**query_order_list**](docs/CFDApi.md#query_order_list) | **GET** /tradfi/orders | Query active order list +*CFDApi* | [**create_trad_fi_order**](docs/CFDApi.md#create_trad_fi_order) | **POST** /tradfi/orders | Create order +*CFDApi* | [**update_order**](docs/CFDApi.md#update_order) | **PUT** /tradfi/orders/{order_id} | Modify order +*CFDApi* | [**delete_order**](docs/CFDApi.md#delete_order) | **DELETE** /tradfi/orders/{order_id} | Cancel order +*CFDApi* | [**query_order_history_list**](docs/CFDApi.md#query_order_history_list) | **GET** /tradfi/orders/history | Query historical order list +*CFDApi* | [**query_order_log**](docs/CFDApi.md#query_order_log) | **GET** /tradfi/orders/log/{log_id} | Get order details by log ID +*CFDApi* | [**query_position_list**](docs/CFDApi.md#query_position_list) | **GET** /tradfi/positions | Query active position list +*CFDApi* | [**update_position**](docs/CFDApi.md#update_position) | **PUT** /tradfi/positions/{position_id} | Modify position +*CFDApi* | [**close_position**](docs/CFDApi.md#close_position) | **POST** /tradfi/positions/{position_id}/close | Close position +*CFDApi* | [**query_position_history_list**](docs/CFDApi.md#query_position_history_list) | **GET** /tradfi/positions/history | Query historical position list +*CrossExApi* | [**list_crossex_rule_symbols**](docs/CrossExApi.md#list_crossex_rule_symbols) | **GET** /crossex/rule/symbols | Query symbol information +*CrossExApi* | [**list_crossex_rule_risk_limits**](docs/CrossExApi.md#list_crossex_rule_risk_limits) | **GET** /crossex/rule/risk_limits | Query risk limit information +*CrossExApi* | [**list_crossex_transfer_coins**](docs/CrossExApi.md#list_crossex_transfer_coins) | **GET** /crossex/transfers/coin | Query supported transfer currencies +*CrossExApi* | [**list_crossex_transfers**](docs/CrossExApi.md#list_crossex_transfers) | **GET** /crossex/transfers | Query Fund Transfer History +*CrossExApi* | [**create_crossex_transfer**](docs/CrossExApi.md#create_crossex_transfer) | **POST** /crossex/transfers | Fund Transfer +*CrossExApi* | [**create_crossex_order**](docs/CrossExApi.md#create_crossex_order) | **POST** /crossex/orders | Create order +*CrossExApi* | [**cancel_batch_crossex_orders**](docs/CrossExApi.md#cancel_batch_crossex_orders) | **POST** /crossex/batch_cancel_orders | Batch cancel orders +*CrossExApi* | [**get_crossex_order**](docs/CrossExApi.md#get_crossex_order) | **GET** /crossex/orders/{order_id} | Query order details +*CrossExApi* | [**update_crossex_order**](docs/CrossExApi.md#update_crossex_order) | **PUT** /crossex/orders/{order_id} | Modify Order +*CrossExApi* | [**cancel_crossex_order**](docs/CrossExApi.md#cancel_crossex_order) | **DELETE** /crossex/orders/{order_id} | Cancel Order +*CrossExApi* | [**create_crossex_convert_quote**](docs/CrossExApi.md#create_crossex_convert_quote) | **POST** /crossex/convert/quote | Flash Swap Inquiry +*CrossExApi* | [**create_crossex_convert_order**](docs/CrossExApi.md#create_crossex_convert_order) | **POST** /crossex/convert/orders | Flash Swap Transaction +*CrossExApi* | [**get_crossex_account**](docs/CrossExApi.md#get_crossex_account) | **GET** /crossex/accounts | Query Account Assets +*CrossExApi* | [**update_crossex_account**](docs/CrossExApi.md#update_crossex_account) | **PUT** /crossex/accounts | Modify Account Contract Position Mode and Account Mode +*CrossExApi* | [**get_crossex_positions_leverage**](docs/CrossExApi.md#get_crossex_positions_leverage) | **GET** /crossex/positions/leverage | Query Contract Trading Pair Leverage Multiplier +*CrossExApi* | [**update_crossex_positions_leverage**](docs/CrossExApi.md#update_crossex_positions_leverage) | **POST** /crossex/positions/leverage | Modify Contract Trading Pair Leverage Multiplier +*CrossExApi* | [**get_crossex_margin_positions_leverage**](docs/CrossExApi.md#get_crossex_margin_positions_leverage) | **GET** /crossex/margin_positions/leverage | Query Leveraged Trading Pair Leverage Multiplier +*CrossExApi* | [**update_crossex_margin_positions_leverage**](docs/CrossExApi.md#update_crossex_margin_positions_leverage) | **POST** /crossex/margin_positions/leverage | Modify Leveraged Trading Pair Leverage Multiplier +*CrossExApi* | [**close_crossex_position**](docs/CrossExApi.md#close_crossex_position) | **POST** /crossex/position | Full Close Position +*CrossExApi* | [**get_crossex_positions_margin_mode**](docs/CrossExApi.md#get_crossex_positions_margin_mode) | **GET** /crossex/positions/margin_mode | Get futures position margin mode +*CrossExApi* | [**update_crossex_positions_margin_mode**](docs/CrossExApi.md#update_crossex_positions_margin_mode) | **POST** /crossex/positions/margin_mode | Update futures position margin mode +*CrossExApi* | [**update_crossex_positions_margin**](docs/CrossExApi.md#update_crossex_positions_margin) | **POST** /crossex/positions/margin | Increase or decrease isolated margin +*CrossExApi* | [**get_crossex_interest_rate**](docs/CrossExApi.md#get_crossex_interest_rate) | **GET** /crossex/interest_rate | Query margin asset interest rates +*CrossExApi* | [**get_crossex_fee**](docs/CrossExApi.md#get_crossex_fee) | **GET** /crossex/fee | Query User Fee Rates +*CrossExApi* | [**list_crossex_positions**](docs/CrossExApi.md#list_crossex_positions) | **GET** /crossex/positions | Query Contract Positions +*CrossExApi* | [**list_crossex_margin_positions**](docs/CrossExApi.md#list_crossex_margin_positions) | **GET** /crossex/margin_positions | Query Leveraged Positions +*CrossExApi* | [**list_crossex_adl_rank**](docs/CrossExApi.md#list_crossex_adl_rank) | **GET** /crossex/adl_rank | Query ADL Position Reduction Ranking +*CrossExApi* | [**list_crossex_open_orders**](docs/CrossExApi.md#list_crossex_open_orders) | **GET** /crossex/open_orders | Query All Current Open Orders +*CrossExApi* | [**list_crossex_history_orders**](docs/CrossExApi.md#list_crossex_history_orders) | **GET** /crossex/history_orders | Query order history +*CrossExApi* | [**list_crossex_history_positions**](docs/CrossExApi.md#list_crossex_history_positions) | **GET** /crossex/history_positions | Query Contract Position History +*CrossExApi* | [**list_crossex_history_margin_positions**](docs/CrossExApi.md#list_crossex_history_margin_positions) | **GET** /crossex/history_margin_positions | Query Leveraged Position History +*CrossExApi* | [**list_crossex_history_margin_interests**](docs/CrossExApi.md#list_crossex_history_margin_interests) | **GET** /crossex/history_margin_interests | Query Leveraged Interest Deduction History +*CrossExApi* | [**list_crossex_history_trades**](docs/CrossExApi.md#list_crossex_history_trades) | **GET** /crossex/history_trades | Query filled history +*CrossExApi* | [**list_crossex_account_book**](docs/CrossExApi.md#list_crossex_account_book) | **GET** /crossex/account_book | Query Account Asset Change History +*CrossExApi* | [**list_crossex_coin_discount_rate**](docs/CrossExApi.md#list_crossex_coin_discount_rate) | **GET** /crossex/coin_discount_rate | Query Currency Discount Rate +*CrossExApi* | [**list_crossex_market_tickers**](docs/CrossExApi.md#list_crossex_market_tickers) | **GET** /crossex/market/tickers | Get exchange tickers +*CrossExApi* | [**list_crossex_market_funding_info**](docs/CrossExApi.md#list_crossex_market_funding_info) | **GET** /crossex/market/funding_info | Get exchange futures funding rate information *EarnUniApi* | [**list_uni_currencies**](docs/EarnUniApi.md#list_uni_currencies) | **GET** /earn/uni/currencies | Query lending currency list *EarnUniApi* | [**get_uni_currency**](docs/EarnUniApi.md#get_uni_currency) | **GET** /earn/uni/currencies/{currency} | Query single lending currency details *EarnUniApi* | [**list_user_uni_lends**](docs/EarnUniApi.md#list_user_uni_lends) | **GET** /earn/uni/lends | Query user's lending order list @@ -124,6 +193,37 @@ Class | Method | HTTP request | Description *MarginUniApi* | [**list_uni_loan_records**](docs/MarginUniApi.md#list_uni_loan_records) | **GET** /margin/uni/loan_records | Query loan records *MarginUniApi* | [**list_uni_loan_interest_records**](docs/MarginUniApi.md#list_uni_loan_interest_records) | **GET** /margin/uni/interest_records | Query interest deduction records *MarginUniApi* | [**get_uni_borrowable**](docs/MarginUniApi.md#get_uni_borrowable) | **GET** /margin/uni/borrowable | Query maximum borrowable amount by currency +*OTCApi* | [**create_otc_quote**](docs/OTCApi.md#create_otc_quote) | **POST** /otc/quote | Fiat and stablecoin quote +*OTCApi* | [**create_otc_order**](docs/OTCApi.md#create_otc_order) | **POST** /otc/order/create | Create fiat order +*OTCApi* | [**create_stable_coin_order**](docs/OTCApi.md#create_stable_coin_order) | **POST** /otc/stable_coin/order/create | Create stablecoin order +*OTCApi* | [**get_bank_list_inner_path**](docs/OTCApi.md#get_bank_list_inner_path) | **GET** /otc/bank/list | Get user bank card list +*OTCApi* | [**create_otc_bank**](docs/OTCApi.md#create_otc_bank) | **POST** /otc/bank/create | Create bank card +*OTCApi* | [**delete_otc_bank**](docs/OTCApi.md#delete_otc_bank) | **POST** /otc/bank/delete | Delete bank card +*OTCApi* | [**set_default_otc_bank**](docs/OTCApi.md#set_default_otc_bank) | **POST** /otc/bank/set_default | Set default bank card +*OTCApi* | [**get_otc_bank_supplement_checklist**](docs/OTCApi.md#get_otc_bank_supplement_checklist) | **GET** /otc/bank/bank_supplement_checklist | Query the checklist of materials to supplement for a bank card +*OTCApi* | [**submit_otc_bank_personal_supplement**](docs/OTCApi.md#submit_otc_bank_personal_supplement) | **POST** /otc/bank/personal/bank_supplement | Submit Bank Card Supplement Materials (Personal) +*OTCApi* | [**submit_otc_bank_enterprise_supplement**](docs/OTCApi.md#submit_otc_bank_enterprise_supplement) | **POST** /otc/bank/enterprise/bank_supplement | Submit Bank Card Supplement Materials (Enterprise) +*OTCApi* | [**mark_otc_order_paid**](docs/OTCApi.md#mark_otc_order_paid) | **POST** /otc/order/paid | Mark fiat order as paid (deposit confirmation) +*OTCApi* | [**cancel_otc_order**](docs/OTCApi.md#cancel_otc_order) | **POST** /otc/order/cancel | Fiat order cancellation +*OTCApi* | [**list_otc_orders**](docs/OTCApi.md#list_otc_orders) | **GET** /otc/order/list | Fiat order list +*OTCApi* | [**list_stable_coin_orders**](docs/OTCApi.md#list_stable_coin_orders) | **GET** /otc/stable_coin/order/list | Stablecoin order list +*OTCApi* | [**get_otc_order_detail**](docs/OTCApi.md#get_otc_order_detail) | **GET** /otc/order/detail | Fiat order details +*StockApi* | [**query_stock_user_assets**](docs/StockApi.md#query_stock_user_assets) | **GET** /stock/users/assets | Query user assets +*StockApi* | [**query_stock_symbols**](docs/StockApi.md#query_stock_symbols) | **GET** /stock/symbols | Query symbol list +*StockApi* | [**query_stock_symbol_detail**](docs/StockApi.md#query_stock_symbol_detail) | **GET** /stock/symbols/detail | Query symbol details +*StockApi* | [**query_stock_order_book**](docs/StockApi.md#query_stock_order_book) | **GET** /stock/market/{symbol}/orderbook | Query market order book +*StockApi* | [**query_stock_order_list**](docs/StockApi.md#query_stock_order_list) | **GET** /stock/orders | Query open order list +*StockApi* | [**create_stock_order**](docs/StockApi.md#create_stock_order) | **POST** /stock/orders | Create order +*StockApi* | [**delete_all_stock_orders**](docs/StockApi.md#delete_all_stock_orders) | **DELETE** /stock/orders | Cancel all open orders +*StockApi* | [**query_stock_order_history**](docs/StockApi.md#query_stock_order_history) | **GET** /stock/orders/history | Query historical order list +*StockApi* | [**update_stock_order**](docs/StockApi.md#update_stock_order) | **PUT** /stock/orders/{order_id} | Modify order +*StockApi* | [**delete_stock_order**](docs/StockApi.md#delete_stock_order) | **DELETE** /stock/orders/{order_id} | Cancel order +*StockApi* | [**query_stock_positions**](docs/StockApi.md#query_stock_positions) | **GET** /stock/positions | Query current position list +*StockApi* | [**close_stock_position**](docs/StockApi.md#close_stock_position) | **POST** /stock/positions/close | Close position +*StockApi* | [**query_stock_transactions**](docs/StockApi.md#query_stock_transactions) | **GET** /stock/transactions | Query transaction records +*StockApi* | [**create_stock_transaction**](docs/StockApi.md#create_stock_transaction) | **POST** /stock/transactions | Fund transfer +*StockApi* | [**query_stock_exchanges**](docs/StockApi.md#query_stock_exchanges) | **GET** /stock/exchanges | Query supported exchanges +*StockApi* | [**query_stock_fee_rate**](docs/StockApi.md#query_stock_fee_rate) | **GET** /stock/fee-rate | Query fee rates for Japanese and Korean stocks *SubAccountApi* | [**list_sub_accounts**](docs/SubAccountApi.md#list_sub_accounts) | **GET** /sub_accounts | List sub-accounts *SubAccountApi* | [**create_sub_accounts**](docs/SubAccountApi.md#create_sub_accounts) | **POST** /sub_accounts | Create a new sub-account *SubAccountApi* | [**get_sub_account**](docs/SubAccountApi.md#get_sub_account) | **GET** /sub_accounts/{user_id} | Get sub-account @@ -151,12 +251,17 @@ Class | Method | HTTP request | Description *UnifiedApi* | [**list_currency_discount_tiers**](docs/UnifiedApi.md#list_currency_discount_tiers) | **GET** /unified/currency_discount_tiers | Query unified account tiered *UnifiedApi* | [**list_loan_margin_tiers**](docs/UnifiedApi.md#list_loan_margin_tiers) | **GET** /unified/loan_margin_tiers | Query unified account tiered loan margin *UnifiedApi* | [**calculate_portfolio_margin**](docs/UnifiedApi.md#calculate_portfolio_margin) | **POST** /unified/portfolio_calculator | Portfolio margin calculator +*UnifiedApi* | [**set_user_leverage**](docs/UnifiedApi.md#set_user_leverage) | **POST** /unified/leverage/user_setting | Set leverage for all of the user's borrowed currencies *UnifiedApi* | [**get_user_leverage_currency_config**](docs/UnifiedApi.md#get_user_leverage_currency_config) | **GET** /unified/leverage/user_currency_config | Maximum and minimum currency leverage that can be set *UnifiedApi* | [**get_user_leverage_currency_setting**](docs/UnifiedApi.md#get_user_leverage_currency_setting) | **GET** /unified/leverage/user_currency_setting | Get user currency leverage *UnifiedApi* | [**set_user_leverage_currency_setting**](docs/UnifiedApi.md#set_user_leverage_currency_setting) | **POST** /unified/leverage/user_currency_setting | Set loan currency leverage *UnifiedApi* | [**list_unified_currencies**](docs/UnifiedApi.md#list_unified_currencies) | **GET** /unified/currencies | List of loan currencies supported by unified account *UnifiedApi* | [**get_history_loan_rate**](docs/UnifiedApi.md#get_history_loan_rate) | **GET** /unified/history_loan_rate | Get historical lending rates *UnifiedApi* | [**set_unified_collateral**](docs/UnifiedApi.md#set_unified_collateral) | **POST** /unified/collateral_currencies | Set collateral currency +*UnifiedApi* | [**get_estimated_quick_repayment**](docs/UnifiedApi.md#get_estimated_quick_repayment) | **GET** /unified/estimated_quick_repayment | Estimated quick repayment details +*UnifiedApi* | [**create_quick_repayment**](docs/UnifiedApi.md#create_quick_repayment) | **POST** /unified/quick_repayment | Quick repayment +*UnifiedApi* | [**get_unified_delta_neutral**](docs/UnifiedApi.md#get_unified_delta_neutral) | **GET** /unified/delta_neutral | Query the account Delta-neutral strategy mode setting +*UnifiedApi* | [**set_unified_delta_neutral**](docs/UnifiedApi.md#set_unified_delta_neutral) | **POST** /unified/delta_neutral | Set the account Delta-neutral strategy mode *AccountApi* | [**get_account_detail**](docs/AccountApi.md#get_account_detail) | **GET** /account/detail | Retrieve user account information *AccountApi* | [**get_account_main_keys**](docs/AccountApi.md#get_account_main_keys) | **GET** /account/main_keys | Query All Main Account Key Information *AccountApi* | [**get_account_rate_limit**](docs/AccountApi.md#get_account_rate_limit) | **GET** /account/rate_limit | Get user transaction rate limit information @@ -167,16 +272,34 @@ Class | Method | HTTP request | Description *AccountApi* | [**delete_stp_group_users**](docs/AccountApi.md#delete_stp_group_users) | **DELETE** /account/stp_groups/{stp_id}/users | Delete users from the STP user group *AccountApi* | [**get_debit_fee**](docs/AccountApi.md#get_debit_fee) | **GET** /account/debit_fee | Query GT fee deduction configuration *AccountApi* | [**set_debit_fee**](docs/AccountApi.md#set_debit_fee) | **POST** /account/debit_fee | Configure GT fee deduction -*CollateralLoanApi* | [**list_collateral_loan_orders**](docs/CollateralLoanApi.md#list_collateral_loan_orders) | **GET** /loan/collateral/orders | Query collateral loan order list -*CollateralLoanApi* | [**create_collateral_loan**](docs/CollateralLoanApi.md#create_collateral_loan) | **POST** /loan/collateral/orders | Place collateral loan order -*CollateralLoanApi* | [**get_collateral_loan_order_detail**](docs/CollateralLoanApi.md#get_collateral_loan_order_detail) | **GET** /loan/collateral/orders/{order_id} | Query single order details -*CollateralLoanApi* | [**repay_collateral_loan**](docs/CollateralLoanApi.md#repay_collateral_loan) | **POST** /loan/collateral/repay | Collateral loan repayment -*CollateralLoanApi* | [**list_repay_records**](docs/CollateralLoanApi.md#list_repay_records) | **GET** /loan/collateral/repay_records | Query collateral loan repayment records -*CollateralLoanApi* | [**list_collateral_records**](docs/CollateralLoanApi.md#list_collateral_records) | **GET** /loan/collateral/collaterals | Query collateral adjustment records -*CollateralLoanApi* | [**operate_collateral**](docs/CollateralLoanApi.md#operate_collateral) | **POST** /loan/collateral/collaterals | Increase or redeem collateral -*CollateralLoanApi* | [**get_user_total_amount**](docs/CollateralLoanApi.md#get_user_total_amount) | **GET** /loan/collateral/total_amount | Query user's total borrowing and collateral amount -*CollateralLoanApi* | [**get_user_ltv_info**](docs/CollateralLoanApi.md#get_user_ltv_info) | **GET** /loan/collateral/ltv | Query user's collateralization ratio and remaining borrowable currencies -*CollateralLoanApi* | [**list_collateral_currencies**](docs/CollateralLoanApi.md#list_collateral_currencies) | **GET** /loan/collateral/currencies | Query supported borrowing and collateral currencies +*AlphaApi* | [**list_alpha_accounts**](docs/AlphaApi.md#list_alpha_accounts) | **GET** /alpha/accounts | Alpha Account API +*AlphaApi* | [**list_alpha_account_book**](docs/AlphaApi.md#list_alpha_account_book) | **GET** /alpha/account_book | Alpha Account Transaction History API +*AlphaApi* | [**quote_alpha_order**](docs/AlphaApi.md#quote_alpha_order) | **POST** /alpha/quote | Alpha Quote API +*AlphaApi* | [**list_alpha_order**](docs/AlphaApi.md#list_alpha_order) | **GET** /alpha/orders | Alpha Order List API +*AlphaApi* | [**place_alpha_order**](docs/AlphaApi.md#place_alpha_order) | **POST** /alpha/orders | Alpha Order API +*AlphaApi* | [**get_alpha_order**](docs/AlphaApi.md#get_alpha_order) | **GET** /alpha/order | Alpha Single Order Query API +*AlphaApi* | [**list_alpha_currencies**](docs/AlphaApi.md#list_alpha_currencies) | **GET** /alpha/currencies | Query currency information +*AlphaApi* | [**list_alpha_tickers**](docs/AlphaApi.md#list_alpha_tickers) | **GET** /alpha/tickers | Query currency ticker +*AlphaApi* | [**list_alpha_tokens**](docs/AlphaApi.md#list_alpha_tokens) | **GET** /alpha/tokens | Query Token Information +*AssetswapApi* | [**list_asset_swap_assets**](docs/AssetswapApi.md#list_asset_swap_assets) | **GET** /asset-swap/asset/list | Portfolio optimization — currency list +*AssetswapApi* | [**get_asset_swap_config**](docs/AssetswapApi.md#get_asset_swap_config) | **GET** /asset-swap/config | Portfolio optimization — configuration +*AssetswapApi* | [**evaluate_asset_swap**](docs/AssetswapApi.md#evaluate_asset_swap) | **GET** /asset-swap/evaluate | Portfolio optimization — valuation +*AssetswapApi* | [**create_asset_swap_order_v1**](docs/AssetswapApi.md#create_asset_swap_order_v1) | **POST** /asset-swap/order/create | Portfolio optimization — place order +*AssetswapApi* | [**list_asset_swap_orders_v1**](docs/AssetswapApi.md#list_asset_swap_orders_v1) | **GET** /asset-swap/order/list | Portfolio optimization — order list +*AssetswapApi* | [**preview_asset_swap_order_v1**](docs/AssetswapApi.md#preview_asset_swap_order_v1) | **POST** /asset-swap/order/preview | Portfolio optimization — preview +*AssetswapApi* | [**get_asset_swap_order_v1**](docs/AssetswapApi.md#get_asset_swap_order_v1) | **GET** /asset-swap/order/{order_id} | Portfolio optimization — query order +*BotApi* | [**get_ai_hub_strategy_recommend**](docs/BotApi.md#get_ai_hub_strategy_recommend) | **GET** /bot/strategy/recommend | Get AIHub strategy recommendations +*BotApi* | [**post_ai_hub_spot_grid_create**](docs/BotApi.md#post_ai_hub_spot_grid_create) | **POST** /bot/spot-grid/create | Create spot grid +*BotApi* | [**post_ai_hub_margin_grid_create**](docs/BotApi.md#post_ai_hub_margin_grid_create) | **POST** /bot/margin-grid/create | Create a lever grid +*BotApi* | [**post_ai_hub_infinite_grid_create**](docs/BotApi.md#post_ai_hub_infinite_grid_create) | **POST** /bot/infinite-grid/create | Create infinite grid +*BotApi* | [**post_ai_hub_futures_grid_create**](docs/BotApi.md#post_ai_hub_futures_grid_create) | **POST** /bot/futures-grid/create | Create a contract grid +*BotApi* | [**post_ai_hub_spot_martingale_create**](docs/BotApi.md#post_ai_hub_spot_martingale_create) | **POST** /bot/spot-martingale/create | Create Spot Martin +*BotApi* | [**post_ai_hub_contract_martingale_create**](docs/BotApi.md#post_ai_hub_contract_martingale_create) | **POST** /bot/contract-martingale/create | Create contract martin +*BotApi* | [**get_ai_hub_portfolio_running**](docs/BotApi.md#get_ai_hub_portfolio_running) | **GET** /bot/portfolio/running | Query the list of running policies +*BotApi* | [**get_ai_hub_portfolio_detail**](docs/BotApi.md#get_ai_hub_portfolio_detail) | **GET** /bot/portfolio/detail | Query order policy details +*BotApi* | [**post_ai_hub_portfolio_stop**](docs/BotApi.md#post_ai_hub_portfolio_stop) | **POST** /bot/portfolio/stop | Terminate a single running policy +*CouponApi* | [**list_user_coupons**](docs/CouponApi.md#list_user_coupons) | **GET** /coupon/user-coupon-list | Coupon Center list +*CouponApi* | [**get_user_coupon_detail**](docs/CouponApi.md#get_user_coupon_detail) | **GET** /coupon/user-coupon-detail | Coupon Center details *DeliveryApi* | [**list_delivery_contracts**](docs/DeliveryApi.md#list_delivery_contracts) | **GET** /delivery/{settle}/contracts | Query all futures contracts *DeliveryApi* | [**get_delivery_contract**](docs/DeliveryApi.md#get_delivery_contract) | **GET** /delivery/{settle}/contracts/{contract} | Query single contract information *DeliveryApi* | [**list_delivery_order_book**](docs/DeliveryApi.md#list_delivery_order_book) | **GET** /delivery/{settle}/order_book | Query futures market depth information @@ -206,25 +329,49 @@ Class | Method | HTTP request | Description *DeliveryApi* | [**cancel_price_triggered_delivery_order_list**](docs/DeliveryApi.md#cancel_price_triggered_delivery_order_list) | **DELETE** /delivery/{settle}/price_orders | Cancel all auto orders *DeliveryApi* | [**get_price_triggered_delivery_order**](docs/DeliveryApi.md#get_price_triggered_delivery_order) | **GET** /delivery/{settle}/price_orders/{order_id} | Query single auto order details *DeliveryApi* | [**cancel_price_triggered_delivery_order**](docs/DeliveryApi.md#cancel_price_triggered_delivery_order) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel single auto order -*EarnApi* | [**swap_eth2**](docs/EarnApi.md#swap_eth2) | **POST** /earn/staking/eth2/swap | ETH swap -*EarnApi* | [**rate_list_eth2**](docs/EarnApi.md#rate_list_eth2) | **GET** /earn/staking/eth2/rate_records | GTETH historical return rate query *EarnApi* | [**list_dual_investment_plans**](docs/EarnApi.md#list_dual_investment_plans) | **GET** /earn/dual/investment_plan | Dual Investment product list *EarnApi* | [**list_dual_orders**](docs/EarnApi.md#list_dual_orders) | **GET** /earn/dual/orders | Dual Investment order list *EarnApi* | [**place_dual_order**](docs/EarnApi.md#place_dual_order) | **POST** /earn/dual/orders | Place Dual Investment order -*EarnApi* | [**list_structured_products**](docs/EarnApi.md#list_structured_products) | **GET** /earn/structured/products | Structured Product List -*EarnApi* | [**list_structured_orders**](docs/EarnApi.md#list_structured_orders) | **GET** /earn/structured/orders | Structured Product Order List -*EarnApi* | [**place_structured_order**](docs/EarnApi.md#place_structured_order) | **POST** /earn/structured/orders | Place Structured Product Order +*EarnApi* | [**list_dual_balance**](docs/EarnApi.md#list_dual_balance) | **GET** /earn/dual/balance | Dual-Currency Earning Assets +*EarnApi* | [**get_dual_order_refund_preview**](docs/EarnApi.md#get_dual_order_refund_preview) | **GET** /earn/dual/order-refund-preview | Dual-currency early redemption preview +*EarnApi* | [**place_dual_order_refund**](docs/EarnApi.md#place_dual_order_refund) | **POST** /earn/dual/order-refund | Dual-currency order early redemption +*EarnApi* | [**modify_dual_order_reinvest**](docs/EarnApi.md#modify_dual_order_reinvest) | **POST** /earn/dual/modify-order-reinvest | Modify dual-currency order reinvest +*EarnApi* | [**get_dual_project_recommend**](docs/EarnApi.md#get_dual_project_recommend) | **GET** /earn/dual/project-recommend | Dual-currency recommended projects *EarnApi* | [**find_coin**](docs/EarnApi.md#find_coin) | **GET** /earn/staking/coins | Staking coins *EarnApi* | [**swap_staking_coin**](docs/EarnApi.md#swap_staking_coin) | **POST** /earn/staking/swap | On-chain token swap for earned coins *EarnApi* | [**order_list**](docs/EarnApi.md#order_list) | **GET** /earn/staking/order_list | List of on-chain coin-earning orders *EarnApi* | [**award_list**](docs/EarnApi.md#award_list) | **GET** /earn/staking/award_list | On-chain coin-earning dividend records *EarnApi* | [**asset_list**](docs/EarnApi.md#asset_list) | **GET** /earn/staking/assets | On-chain coin-earning assets +*EarnApi* | [**create_auto_invest_plan**](docs/EarnApi.md#create_auto_invest_plan) | **POST** /earn/autoinvest/plans/create | Create auto invest plan +*EarnApi* | [**update_auto_invest_plan**](docs/EarnApi.md#update_auto_invest_plan) | **POST** /earn/autoinvest/plans/update | UpdateAuto invest plan +*EarnApi* | [**stop_auto_invest_plan**](docs/EarnApi.md#stop_auto_invest_plan) | **POST** /earn/autoinvest/plans/stop | StopAuto invest plan +*EarnApi* | [**add_position_auto_invest_plan**](docs/EarnApi.md#add_position_auto_invest_plan) | **POST** /earn/autoinvest/plans/add_position | Add position immediately +*EarnApi* | [**list_auto_invest_coins**](docs/EarnApi.md#list_auto_invest_coins) | **GET** /earn/autoinvest/coins | QueryCurrencies supporting auto invest +*EarnApi* | [**get_auto_invest_min_amount**](docs/EarnApi.md#get_auto_invest_min_amount) | **POST** /earn/autoinvest/min_invest_amount | Get minimum investment amount +*EarnApi* | [**list_auto_invest_plan_records**](docs/EarnApi.md#list_auto_invest_plan_records) | **GET** /earn/autoinvest/plans/records | List plan execution records +*EarnApi* | [**list_auto_invest_orders**](docs/EarnApi.md#list_auto_invest_orders) | **GET** /earn/autoinvest/orders | List plan execution recordsDetails(OrderDetails) +*EarnApi* | [**list_auto_invest_config**](docs/EarnApi.md#list_auto_invest_config) | **GET** /earn/autoinvest/config | List investment currency configuration +*EarnApi* | [**get_auto_invest_plan_detail**](docs/EarnApi.md#get_auto_invest_plan_detail) | **GET** /earn/autoinvest/plans/detail | QueryAuto invest planDetails +*EarnApi* | [**list_auto_invest_plans**](docs/EarnApi.md#list_auto_invest_plans) | **GET** /earn/autoinvest/plans/list_info | QueryAuto invest planList +*EarnApi* | [**list_earn_fixed_term_products**](docs/EarnApi.md#list_earn_fixed_term_products) | **GET** /earn/fixed-term/product | Get product list +*EarnApi* | [**list_earn_fixed_term_products_by_asset**](docs/EarnApi.md#list_earn_fixed_term_products_by_asset) | **GET** /earn/fixed-term/product/{asset}/list | Get product list by single currency +*EarnApi* | [**list_earn_fixed_term_lends**](docs/EarnApi.md#list_earn_fixed_term_lends) | **GET** /earn/fixed-term/user/lend | Subscription list +*EarnApi* | [**create_earn_fixed_term_lend**](docs/EarnApi.md#create_earn_fixed_term_lend) | **POST** /earn/fixed-term/user/lend | Subscription +*EarnApi* | [**create_earn_fixed_term_pre_redeem**](docs/EarnApi.md#create_earn_fixed_term_pre_redeem) | **POST** /earn/fixed-term/user/pre-redeem | Redeem +*EarnApi* | [**list_earn_fixed_term_history**](docs/EarnApi.md#list_earn_fixed_term_history) | **GET** /earn/fixed-term/user/history | Subscription history *FlashSwapApi* | [**list_flash_swap_currency_pair**](docs/FlashSwapApi.md#list_flash_swap_currency_pair) | **GET** /flash_swap/currency_pairs | List All Supported Currency Pairs In Flash Swap *FlashSwapApi* | [**list_flash_swap_orders**](docs/FlashSwapApi.md#list_flash_swap_orders) | **GET** /flash_swap/orders | Query flash swap order list *FlashSwapApi* | [**create_flash_swap_order**](docs/FlashSwapApi.md#create_flash_swap_order) | **POST** /flash_swap/orders | Create a flash swap order *FlashSwapApi* | [**get_flash_swap_order**](docs/FlashSwapApi.md#get_flash_swap_order) | **GET** /flash_swap/orders/{order_id} | Query single flash swap order *FlashSwapApi* | [**preview_flash_swap_order**](docs/FlashSwapApi.md#preview_flash_swap_order) | **POST** /flash_swap/orders/preview | Flash swap order preview +*FlashSwapApi* | [**create_flash_swap_multi_currency_many_to_one_order**](docs/FlashSwapApi.md#create_flash_swap_multi_currency_many_to_one_order) | **POST** /flash_swap/multi-currency/many-to-one/order/create | Flash Swap - Multi-currency exchange - Place order (many-to-one) +*FlashSwapApi* | [**preview_flash_swap_multi_currency_many_to_one_order**](docs/FlashSwapApi.md#preview_flash_swap_multi_currency_many_to_one_order) | **POST** /flash_swap/multi-currency/many-to-one/order/preview | Flash Swap - Multi-currency exchange - Preview (many-to-one) +*FlashSwapApi* | [**create_flash_swap_order_v1**](docs/FlashSwapApi.md#create_flash_swap_order_v1) | **POST** /flash_swap/order/create | Flash Swap - Place order (one-to-one) +*FlashSwapApi* | [**create_flash_swap_multi_currency_one_to_many_order**](docs/FlashSwapApi.md#create_flash_swap_multi_currency_one_to_many_order) | **POST** /flash_swap/multi-currency/one-to-many/order/create | Flash Swap - Multi-currency exchange - Place order (one-to-many) +*FlashSwapApi* | [**preview_flash_swap_multi_currency_one_to_many_order**](docs/FlashSwapApi.md#preview_flash_swap_multi_currency_one_to_many_order) | **POST** /flash_swap/multi-currency/one-to-many/order/preview | Flash Swap - Multi-currency exchange - Preview (one-to-many) +*FlashSwapApi* | [**preview_flash_swap_order_v1**](docs/FlashSwapApi.md#preview_flash_swap_order_v1) | **GET** /flash_swap/order/preview | Flash Swap - Preview (one-to-one) *FuturesApi* | [**list_futures_contracts**](docs/FuturesApi.md#list_futures_contracts) | **GET** /futures/{settle}/contracts | Query all futures contracts +*FuturesApi* | [**list_futures_contracts_all**](docs/FuturesApi.md#list_futures_contracts_all) | **GET** /futures/{settle}/contracts_all | Query all contract information (including delisted) *FuturesApi* | [**get_futures_contract**](docs/FuturesApi.md#get_futures_contract) | **GET** /futures/{settle}/contracts/{contract} | Query single contract information *FuturesApi* | [**list_futures_order_book**](docs/FuturesApi.md#list_futures_order_book) | **GET** /futures/{settle}/order_book | Query futures market depth information *FuturesApi* | [**list_futures_trades**](docs/FuturesApi.md#list_futures_trades) | **GET** /futures/{settle}/trades | Futures market transaction records @@ -232,6 +379,7 @@ Class | Method | HTTP request | Description *FuturesApi* | [**list_futures_premium_index**](docs/FuturesApi.md#list_futures_premium_index) | **GET** /futures/{settle}/premium_index | Premium Index K-line chart *FuturesApi* | [**list_futures_tickers**](docs/FuturesApi.md#list_futures_tickers) | **GET** /futures/{settle}/tickers | Get all futures trading statistics *FuturesApi* | [**list_futures_funding_rate_history**](docs/FuturesApi.md#list_futures_funding_rate_history) | **GET** /futures/{settle}/funding_rate | Futures market historical funding rate +*FuturesApi* | [**list_batch_futures_funding_rates**](docs/FuturesApi.md#list_batch_futures_funding_rates) | **POST** /futures/{settle}/funding_rates | Batch Query Historical Funding Rate Data for Perpetual Contracts *FuturesApi* | [**list_futures_insurance_ledger**](docs/FuturesApi.md#list_futures_insurance_ledger) | **GET** /futures/{settle}/insurance | Futures market insurance fund history *FuturesApi* | [**list_contract_stats**](docs/FuturesApi.md#list_contract_stats) | **GET** /futures/{settle}/contract_stats | Futures statistics *FuturesApi* | [**get_index_constituents**](docs/FuturesApi.md#get_index_constituents) | **GET** /futures/{settle}/index_constituents/{index} | Query index constituents @@ -240,13 +388,17 @@ Class | Method | HTTP request | Description *FuturesApi* | [**list_futures_accounts**](docs/FuturesApi.md#list_futures_accounts) | **GET** /futures/{settle}/accounts | Get futures account *FuturesApi* | [**list_futures_account_book**](docs/FuturesApi.md#list_futures_account_book) | **GET** /futures/{settle}/account_book | Query futures account change history *FuturesApi* | [**list_positions**](docs/FuturesApi.md#list_positions) | **GET** /futures/{settle}/positions | Get user position list +*FuturesApi* | [**list_positions_timerange**](docs/FuturesApi.md#list_positions_timerange) | **GET** /futures/{settle}/positions_timerange | Get user's historical position information list by time *FuturesApi* | [**get_position**](docs/FuturesApi.md#get_position) | **GET** /futures/{settle}/positions/{contract} | Get single position information +*FuturesApi* | [**get_leverage**](docs/FuturesApi.md#get_leverage) | **GET** /futures/{settle}/get_leverage/{contract} | Get Leverage Information for Specified Mode *FuturesApi* | [**update_position_margin**](docs/FuturesApi.md#update_position_margin) | **POST** /futures/{settle}/positions/{contract}/margin | Update position margin *FuturesApi* | [**update_position_leverage**](docs/FuturesApi.md#update_position_leverage) | **POST** /futures/{settle}/positions/{contract}/leverage | Update position leverage +*FuturesApi* | [**update_contract_position_leverage**](docs/FuturesApi.md#update_contract_position_leverage) | **POST** /futures/{settle}/positions/{contract}/set_leverage | Update Leverage for Specified Mode *FuturesApi* | [**update_position_cross_mode**](docs/FuturesApi.md#update_position_cross_mode) | **POST** /futures/{settle}/positions/cross_mode | Switch Position Margin Mode *FuturesApi* | [**update_dual_comp_position_cross_mode**](docs/FuturesApi.md#update_dual_comp_position_cross_mode) | **POST** /futures/{settle}/dual_comp/positions/cross_mode | Switch Between Cross and Isolated Margin Modes Under Hedge Mode *FuturesApi* | [**update_position_risk_limit**](docs/FuturesApi.md#update_position_risk_limit) | **POST** /futures/{settle}/positions/{contract}/risk_limit | Update position risk limit *FuturesApi* | [**set_dual_mode**](docs/FuturesApi.md#set_dual_mode) | **POST** /futures/{settle}/dual_mode | Set position mode +*FuturesApi* | [**set_position_mode**](docs/FuturesApi.md#set_position_mode) | **POST** /futures/{settle}/set_position_mode | Set Position Holding Mode, replacing the dual_mode interface *FuturesApi* | [**get_dual_mode_position**](docs/FuturesApi.md#get_dual_mode_position) | **GET** /futures/{settle}/dual_comp/positions/{contract} | Get position information in Hedge Mode *FuturesApi* | [**update_dual_mode_position_margin**](docs/FuturesApi.md#update_dual_mode_position_margin) | **POST** /futures/{settle}/dual_comp/positions/{contract}/margin | Update position margin in Hedge Mode *FuturesApi* | [**update_dual_mode_position_leverage**](docs/FuturesApi.md#update_dual_mode_position_leverage) | **POST** /futures/{settle}/dual_comp/positions/{contract}/leverage | Update position leverage in Hedge Mode @@ -270,12 +422,24 @@ Class | Method | HTTP request | Description *FuturesApi* | [**amend_batch_future_orders**](docs/FuturesApi.md#amend_batch_future_orders) | **POST** /futures/{settle}/batch_amend_orders | Batch modify orders by specified IDs *FuturesApi* | [**get_futures_risk_limit_table**](docs/FuturesApi.md#get_futures_risk_limit_table) | **GET** /futures/{settle}/risk_limit_table | Query risk limit table by table_id *FuturesApi* | [**create_futures_bbo_order**](docs/FuturesApi.md#create_futures_bbo_order) | **POST** /futures/{settle}/bbo_orders | Level-based BBO Contract Order Placement +*FuturesApi* | [**create_trail_order**](docs/FuturesApi.md#create_trail_order) | **POST** /futures/{settle}/autoorder/v1/trail/create | Create trail order +*FuturesApi* | [**stop_trail_order**](docs/FuturesApi.md#stop_trail_order) | **POST** /futures/{settle}/autoorder/v1/trail/stop | Terminate trail order +*FuturesApi* | [**stop_all_trail_orders**](docs/FuturesApi.md#stop_all_trail_orders) | **POST** /futures/{settle}/autoorder/v1/trail/stop_all | Batch terminate trail orders +*FuturesApi* | [**get_trail_orders**](docs/FuturesApi.md#get_trail_orders) | **GET** /futures/{settle}/autoorder/v1/trail/list | Get trail order list +*FuturesApi* | [**get_trail_order_detail**](docs/FuturesApi.md#get_trail_order_detail) | **GET** /futures/{settle}/autoorder/v1/trail/detail | Get trail order details +*FuturesApi* | [**update_trail_order**](docs/FuturesApi.md#update_trail_order) | **POST** /futures/{settle}/autoorder/v1/trail/update | Update trail order +*FuturesApi* | [**get_trail_order_change_log**](docs/FuturesApi.md#get_trail_order_change_log) | **GET** /futures/{settle}/autoorder/v1/trail/change_log | Get trail order user modification records +*FuturesApi* | [**create_chase_order**](docs/FuturesApi.md#create_chase_order) | **POST** /futures/{settle}/autoorder/v1/chase/create | Create a chase order +*FuturesApi* | [**stop_chase_order**](docs/FuturesApi.md#stop_chase_order) | **POST** /futures/{settle}/autoorder/v1/chase/stop | Stop a chase order +*FuturesApi* | [**stop_all_chase_orders**](docs/FuturesApi.md#stop_all_chase_orders) | **POST** /futures/{settle}/autoorder/v1/chase/stop_all | Stop chase orders in batch +*FuturesApi* | [**get_chase_orders**](docs/FuturesApi.md#get_chase_orders) | **GET** /futures/{settle}/autoorder/v1/chase/list | List chase orders +*FuturesApi* | [**get_chase_order_detail**](docs/FuturesApi.md#get_chase_order_detail) | **GET** /futures/{settle}/autoorder/v1/chase/detail | Get chase order detail *FuturesApi* | [**list_price_triggered_orders**](docs/FuturesApi.md#list_price_triggered_orders) | **GET** /futures/{settle}/price_orders | Query auto order list *FuturesApi* | [**create_price_triggered_order**](docs/FuturesApi.md#create_price_triggered_order) | **POST** /futures/{settle}/price_orders | Create price-triggered order *FuturesApi* | [**cancel_price_triggered_order_list**](docs/FuturesApi.md#cancel_price_triggered_order_list) | **DELETE** /futures/{settle}/price_orders | Cancel all auto orders *FuturesApi* | [**get_price_triggered_order**](docs/FuturesApi.md#get_price_triggered_order) | **GET** /futures/{settle}/price_orders/{order_id} | Query single auto order details -*FuturesApi* | [**update_price_triggered_order**](docs/FuturesApi.md#update_price_triggered_order) | **PUT** /futures/{settle}/price_orders/{order_id} | Modify a Single Auto Order *FuturesApi* | [**cancel_price_triggered_order**](docs/FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel single auto order +*FuturesApi* | [**update_price_triggered_order**](docs/FuturesApi.md#update_price_triggered_order) | **PUT** /futures/{settle}/price_orders/amend | Modify a Single Auto Order *MarginApi* | [**list_margin_accounts**](docs/MarginApi.md#list_margin_accounts) | **GET** /margin/accounts | Margin account list *MarginApi* | [**list_margin_account_book**](docs/MarginApi.md#list_margin_account_book) | **GET** /margin/account_book | Query margin account balance change history *MarginApi* | [**list_funding_accounts**](docs/MarginApi.md#list_funding_accounts) | **GET** /margin/funding_accounts | Funding account list @@ -296,7 +460,7 @@ Class | Method | HTTP request | Description *MultiCollateralLoanApi* | [**list_multi_collateral_records**](docs/MultiCollateralLoanApi.md#list_multi_collateral_records) | **GET** /loan/multi_collateral/mortgage | Query collateral adjustment records *MultiCollateralLoanApi* | [**operate_multi_collateral**](docs/MultiCollateralLoanApi.md#operate_multi_collateral) | **POST** /loan/multi_collateral/mortgage | Add or withdraw collateral *MultiCollateralLoanApi* | [**list_user_currency_quota**](docs/MultiCollateralLoanApi.md#list_user_currency_quota) | **GET** /loan/multi_collateral/currency_quota | Query user's collateral and borrowing currency quota information -*MultiCollateralLoanApi* | [**list_multi_collateral_currencies**](docs/MultiCollateralLoanApi.md#list_multi_collateral_currencies) | **GET** /loan/multi_collateral/currencies | Query supported borrowing and collateral currencies for multi-currency collateral +*MultiCollateralLoanApi* | [**list_multi_collateral_currencies**](docs/MultiCollateralLoanApi.md#list_multi_collateral_currencies) | **GET** /loan/multi_collateral/currencies | Query borrow currencies and collateral currencies supported by multi-currency collateral *MultiCollateralLoanApi* | [**get_multi_collateral_ltv**](docs/MultiCollateralLoanApi.md#get_multi_collateral_ltv) | **GET** /loan/multi_collateral/ltv | Query collateralization ratio information *MultiCollateralLoanApi* | [**get_multi_collateral_fix_rate**](docs/MultiCollateralLoanApi.md#get_multi_collateral_fix_rate) | **GET** /loan/multi_collateral/fixed_rate | Query currency's 7-day and 30-day fixed interest rates *MultiCollateralLoanApi* | [**get_multi_collateral_current_rate**](docs/MultiCollateralLoanApi.md#get_multi_collateral_current_rate) | **GET** /loan/multi_collateral/current_rate | Query currency's current interest rate @@ -322,12 +486,32 @@ Class | Method | HTTP request | Description *OptionsApi* | [**create_options_order**](docs/OptionsApi.md#create_options_order) | **POST** /options/orders | Create an options order *OptionsApi* | [**cancel_options_orders**](docs/OptionsApi.md#cancel_options_orders) | **DELETE** /options/orders | Cancel all orders with 'open' status *OptionsApi* | [**get_options_order**](docs/OptionsApi.md#get_options_order) | **GET** /options/orders/{order_id} | Query single order details +*OptionsApi* | [**amend_options_order**](docs/OptionsApi.md#amend_options_order) | **PUT** /options/orders/{order_id} | Option Order Modification *OptionsApi* | [**cancel_options_order**](docs/OptionsApi.md#cancel_options_order) | **DELETE** /options/orders/{order_id} | Cancel single order *OptionsApi* | [**countdown_cancel_all_options**](docs/OptionsApi.md#countdown_cancel_all_options) | **POST** /options/countdown_cancel_all | Countdown cancel orders *OptionsApi* | [**list_my_options_trades**](docs/OptionsApi.md#list_my_options_trades) | **GET** /options/my_trades | Query personal trading records *OptionsApi* | [**get_options_mmp**](docs/OptionsApi.md#get_options_mmp) | **GET** /options/mmp | MMP Query. *OptionsApi* | [**set_options_mmp**](docs/OptionsApi.md#set_options_mmp) | **POST** /options/mmp | MMP Settings *OptionsApi* | [**reset_options_mmp**](docs/OptionsApi.md#reset_options_mmp) | **POST** /options/mmp/reset | MMP Reset +*P2pApi* | [**p2p_merchant_query_spot_balance**](docs/P2pApi.md#p2p_merchant_query_spot_balance) | **GET** /spot/accounts | Query spot balance +*P2pApi* | [**p2p_merchant_account_get_user_info**](docs/P2pApi.md#p2p_merchant_account_get_user_info) | **POST** /p2p/merchant/account/get_user_info | Get account information +*P2pApi* | [**p2p_merchant_account_get_counterparty_user_info**](docs/P2pApi.md#p2p_merchant_account_get_counterparty_user_info) | **POST** /p2p/merchant/account/get_counterparty_user_info | Get counterparty information +*P2pApi* | [**p2p_merchant_account_get_myself_payment**](docs/P2pApi.md#p2p_merchant_account_get_myself_payment) | **POST** /p2p/merchant/account/get_myself_payment | Get payment method list +*P2pApi* | [**p2p_merchant_account_set_merchant_work_hours**](docs/P2pApi.md#p2p_merchant_account_set_merchant_work_hours) | **POST** /p2p/merchant/account/set_merchant_work_hours | Set merchant working status and custom working hours +*P2pApi* | [**p2p_merchant_transaction_get_pending_transaction_list**](docs/P2pApi.md#p2p_merchant_transaction_get_pending_transaction_list) | **POST** /p2p/merchant/transaction/get_pending_transaction_list | Get pending orders +*P2pApi* | [**p2p_merchant_transaction_get_completed_transaction_list**](docs/P2pApi.md#p2p_merchant_transaction_get_completed_transaction_list) | **POST** /p2p/merchant/transaction/get_completed_transaction_list | Get all/historical orders +*P2pApi* | [**p2p_merchant_transaction_get_transaction_details**](docs/P2pApi.md#p2p_merchant_transaction_get_transaction_details) | **POST** /p2p/merchant/transaction/get_transaction_details | Query order details +*P2pApi* | [**p2p_merchant_transaction_confirm_payment**](docs/P2pApi.md#p2p_merchant_transaction_confirm_payment) | **POST** /p2p/merchant/transaction/confirm-payment | Confirm payment +*P2pApi* | [**p2p_merchant_transaction_confirm_receipt**](docs/P2pApi.md#p2p_merchant_transaction_confirm_receipt) | **POST** /p2p/merchant/transaction/confirm-receipt | Confirm receipt +*P2pApi* | [**p2p_merchant_transaction_cancel**](docs/P2pApi.md#p2p_merchant_transaction_cancel) | **POST** /p2p/merchant/transaction/cancel | Cancel order +*P2pApi* | [**p2p_merchant_books_place_biz_push_order**](docs/P2pApi.md#p2p_merchant_books_place_biz_push_order) | **POST** /p2p/merchant/books/place_biz_push_order | Publish ad order +*P2pApi* | [**p2p_merchant_books_ads_update_status**](docs/P2pApi.md#p2p_merchant_books_ads_update_status) | **POST** /p2p/merchant/books/ads_update_status | Update ad status +*P2pApi* | [**p2p_merchant_books_ads_detail**](docs/P2pApi.md#p2p_merchant_books_ads_detail) | **POST** /p2p/merchant/books/ads_detail | Query ad details +*P2pApi* | [**p2p_merchant_books_my_ads_list**](docs/P2pApi.md#p2p_merchant_books_my_ads_list) | **POST** /p2p/merchant/books/my_ads_list | Get my ad list +*P2pApi* | [**p2p_merchant_books_ads_list**](docs/P2pApi.md#p2p_merchant_books_ads_list) | **POST** /p2p/merchant/books/ads_list | Get Advertisement List +*P2pApi* | [**p2p_merchant_chat_get_chats_list**](docs/P2pApi.md#p2p_merchant_chat_get_chats_list) | **POST** /p2p/merchant/chat/get_chats_list | Get chat history +*P2pApi* | [**p2p_merchant_chat_send_chat_message**](docs/P2pApi.md#p2p_merchant_chat_send_chat_message) | **POST** /p2p/merchant/chat/send_chat_message | Send text message +*P2pApi* | [**p2p_merchant_chat_upload_chat_file**](docs/P2pApi.md#p2p_merchant_chat_upload_chat_file) | **POST** /p2p/merchant/chat/upload_chat_file | Upload chat file *RebateApi* | [**agency_transaction_history**](docs/RebateApi.md#agency_transaction_history) | **GET** /rebate/agency/transaction_history | Broker obtains transaction history of recommended users *RebateApi* | [**agency_commissions_history**](docs/RebateApi.md#agency_commissions_history) | **GET** /rebate/agency/commission_history | Broker obtains rebate history of recommended users *RebateApi* | [**partner_transaction_history**](docs/RebateApi.md#partner_transaction_history) | **GET** /rebate/partner/transaction_history | Partner obtains transaction history of recommended users @@ -337,6 +521,9 @@ Class | Method | HTTP request | Description *RebateApi* | [**rebate_broker_transaction_history**](docs/RebateApi.md#rebate_broker_transaction_history) | **GET** /rebate/broker/transaction_history | Broker obtains user's trading history *RebateApi* | [**rebate_user_info**](docs/RebateApi.md#rebate_user_info) | **GET** /rebate/user/info | User obtains rebate information *RebateApi* | [**user_sub_relation**](docs/RebateApi.md#user_sub_relation) | **GET** /rebate/user/sub_relation | User subordinate relationship +*RebateApi* | [**get_partner_application_recent**](docs/RebateApi.md#get_partner_application_recent) | **GET** /rebate/partner/applications/recent | Get recent partner application records +*RebateApi* | [**get_partner_eligibility**](docs/RebateApi.md#get_partner_eligibility) | **GET** /rebate/partner/eligibility | Check partner application eligibility +*RebateApi* | [**get_partner_agent_data_aggregated**](docs/RebateApi.md#get_partner_agent_data_aggregated) | **GET** /rebate/partner/data/aggregated | Aggregated partner agent statistics *SpotApi* | [**list_currencies**](docs/SpotApi.md#list_currencies) | **GET** /spot/currencies | Query all currency information *SpotApi* | [**get_currency**](docs/SpotApi.md#get_currency) | **GET** /spot/currencies/{currency} | Query single currency information *SpotApi* | [**list_currency_pairs**](docs/SpotApi.md#list_currency_pairs) | **GET** /spot/currency_pairs | Query all supported currency pairs @@ -347,13 +534,12 @@ Class | Method | HTTP request | Description *SpotApi* | [**list_candlesticks**](docs/SpotApi.md#list_candlesticks) | **GET** /spot/candlesticks | Market K-line chart *SpotApi* | [**get_fee**](docs/SpotApi.md#get_fee) | **GET** /spot/fee | Query account fee rates *SpotApi* | [**get_batch_spot_fee**](docs/SpotApi.md#get_batch_spot_fee) | **GET** /spot/batch_fee | Batch query account fee rates -*SpotApi* | [**list_spot_accounts**](docs/SpotApi.md#list_spot_accounts) | **GET** /spot/accounts | List spot trading accounts *SpotApi* | [**list_spot_account_book**](docs/SpotApi.md#list_spot_account_book) | **GET** /spot/account_book | Query spot account transaction history *SpotApi* | [**create_batch_orders**](docs/SpotApi.md#create_batch_orders) | **POST** /spot/batch_orders | Batch place orders *SpotApi* | [**list_all_open_orders**](docs/SpotApi.md#list_all_open_orders) | **GET** /spot/open_orders | List all open orders *SpotApi* | [**create_cross_liquidate_order**](docs/SpotApi.md#create_cross_liquidate_order) | **POST** /spot/cross_liquidate_orders | Close position when cross-currency is disabled *SpotApi* | [**list_orders**](docs/SpotApi.md#list_orders) | **GET** /spot/orders | List orders -*SpotApi* | [**create_order**](docs/SpotApi.md#create_order) | **POST** /spot/orders | Create an order +*SpotApi* | [**create_order**](docs/SpotApi.md#create_order) | **POST** /spot/orders | Create order *SpotApi* | [**cancel_orders**](docs/SpotApi.md#cancel_orders) | **DELETE** /spot/orders | Cancel all `open` orders in specified currency pair *SpotApi* | [**cancel_batch_orders**](docs/SpotApi.md#cancel_batch_orders) | **POST** /spot/cancel_batch_orders | Cancel batch orders by specified ID list *SpotApi* | [**get_order**](docs/SpotApi.md#get_order) | **GET** /spot/orders/{order_id} | Query single order details @@ -369,21 +555,29 @@ Class | Method | HTTP request | Description *SpotApi* | [**cancel_spot_price_triggered_order_list**](docs/SpotApi.md#cancel_spot_price_triggered_order_list) | **DELETE** /spot/price_orders | Cancel all auto orders *SpotApi* | [**get_spot_price_triggered_order**](docs/SpotApi.md#get_spot_price_triggered_order) | **GET** /spot/price_orders/{order_id} | Query single auto order details *SpotApi* | [**cancel_spot_price_triggered_order**](docs/SpotApi.md#cancel_spot_price_triggered_order) | **DELETE** /spot/price_orders/{order_id} | Cancel single auto order +*SpotApi* | [**list_spot_pov_orders**](docs/SpotApi.md#list_spot_pov_orders) | **GET** /spot/pov_orders | List Spot POV orders +*SpotApi* | [**create_spot_pov_order**](docs/SpotApi.md#create_spot_pov_order) | **POST** /spot/pov_orders | Create a Spot POV order +*SpotApi* | [**cancel_spot_pov_orders**](docs/SpotApi.md#cancel_spot_pov_orders) | **POST** /spot/pov_orders/cancel | Cancel Spot POV orders +*SpotApi* | [**get_spot_pov_order**](docs/SpotApi.md#get_spot_pov_order) | **GET** /spot/pov_orders/{order_id} | Query Spot POV order details +*SpotApi* | [**cancel_spot_pov_order**](docs/SpotApi.md#cancel_spot_pov_order) | **POST** /spot/pov_orders/{order_id}/cancel | Cancel a Spot POV order +*SquareApi* | [**list_square_ai_search**](docs/SquareApi.md#list_square_ai_search) | **GET** /social/message/search | AI MCP Dynamic Search +*SquareApi* | [**list_live_replay**](docs/SquareApi.md#list_live_replay) | **GET** /social/live/tag_coin_live_replay | Gate AI Assistant live stream data retrieval *WalletApi* | [**list_currency_chains**](docs/WalletApi.md#list_currency_chains) | **GET** /wallet/currency_chains | Query chains supported for specified currency *WalletApi* | [**get_deposit_address**](docs/WalletApi.md#get_deposit_address) | **GET** /wallet/deposit_address | Generate currency deposit address *WalletApi* | [**list_withdrawals**](docs/WalletApi.md#list_withdrawals) | **GET** /wallet/withdrawals | Get withdrawal records *WalletApi* | [**list_deposits**](docs/WalletApi.md#list_deposits) | **GET** /wallet/deposits | Get deposit records +*WalletApi* | [**get_transfer**](docs/WalletApi.md#get_transfer) | **GET** /wallet/transfers | Get trading account transfer *WalletApi* | [**transfer**](docs/WalletApi.md#transfer) | **POST** /wallet/transfers | Transfer between trading accounts *WalletApi* | [**list_sub_account_transfers**](docs/WalletApi.md#list_sub_account_transfers) | **GET** /wallet/sub_account_transfers | Get transfer records between main and sub accounts *WalletApi* | [**transfer_with_sub_account**](docs/WalletApi.md#transfer_with_sub_account) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts *WalletApi* | [**sub_account_to_sub_account**](docs/WalletApi.md#sub_account_to_sub_account) | **POST** /wallet/sub_account_to_sub_account | Transfer between sub-accounts -*WalletApi* | [**get_transfer_order_status**](docs/WalletApi.md#get_transfer_order_status) | **GET** /wallet/order_status | Transfer status query +*WalletApi* | [**get_transfer_order_status**](docs/WalletApi.md#get_transfer_order_status) | **GET** /wallet/order_status | Main-Sub Account Transfer Status Query *WalletApi* | [**list_withdraw_status**](docs/WalletApi.md#list_withdraw_status) | **GET** /wallet/withdraw_status | Query withdrawal status *WalletApi* | [**list_sub_account_balances**](docs/WalletApi.md#list_sub_account_balances) | **GET** /wallet/sub_account_balances | Query sub-account balance information *WalletApi* | [**list_sub_account_margin_balances**](docs/WalletApi.md#list_sub_account_margin_balances) | **GET** /wallet/sub_account_margin_balances | Query sub-account isolated margin account balance information *WalletApi* | [**list_sub_account_futures_balances**](docs/WalletApi.md#list_sub_account_futures_balances) | **GET** /wallet/sub_account_futures_balances | Query sub-account perpetual futures account balance information *WalletApi* | [**list_sub_account_cross_margin_balances**](docs/WalletApi.md#list_sub_account_cross_margin_balances) | **GET** /wallet/sub_account_cross_margin_balances | Query sub-account cross margin account balance information -*WalletApi* | [**list_saved_address**](docs/WalletApi.md#list_saved_address) | **GET** /wallet/saved_address | Query withdrawal address whitelist +*WalletApi* | [**list_saved_address**](docs/WalletApi.md#list_saved_address) | **GET** /wallet/saved_address | Query saved address *WalletApi* | [**get_trade_fee**](docs/WalletApi.md#get_trade_fee) | **GET** /wallet/fee | Query personal trading fees *WalletApi* | [**get_total_balance**](docs/WalletApi.md#get_total_balance) | **GET** /wallet/total_balance | Query personal account totals *WalletApi* | [**list_small_balance**](docs/WalletApi.md#list_small_balance) | **GET** /wallet/small_balance | Get list of convertible small balance currencies @@ -391,6 +585,10 @@ Class | Method | HTTP request | Description *WalletApi* | [**list_small_balance_history**](docs/WalletApi.md#list_small_balance_history) | **GET** /wallet/small_balance_history | Get convertible small balance currency history *WalletApi* | [**list_push_orders**](docs/WalletApi.md#list_push_orders) | **GET** /wallet/push | Get UID transfer history *WalletApi* | [**get_low_cap_exchange_list**](docs/WalletApi.md#get_low_cap_exchange_list) | **GET** /wallet/getLowCapExchangeList | Retrieve the list of low-liquidity or low-cap tokens +*WelfareApi* | [**get_user_identity**](docs/WelfareApi.md#get_user_identity) | **GET** /rewards/getUserIdentity | Get user identity +*WelfareApi* | [**get_beginner_task_list**](docs/WelfareApi.md#get_beginner_task_list) | **GET** /rewards/getBeginnerTaskList | Get beginner task list +*WelfareApi* | [**claim_task**](docs/WelfareApi.md#claim_task) | **POST** /rewards/claimTask | Get the task +*WelfareApi* | [**claim_reward**](docs/WelfareApi.md#claim_reward) | **POST** /rewards/claimReward | Receive mission rewards *WithdrawalApi* | [**withdraw**](docs/WithdrawalApi.md#withdraw) | **POST** /withdrawals | Withdraw *WithdrawalApi* | [**withdraw_push_order**](docs/WithdrawalApi.md#withdraw_push_order) | **POST** /withdrawals/push | UID transfer *WithdrawalApi* | [**cancel_withdrawal**](docs/WithdrawalApi.md#cancel_withdrawal) | **DELETE** /withdrawals/{withdrawal_id} | Cancel withdrawal with specified ID @@ -398,63 +596,195 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AIHubCreateData](docs/AIHubCreateData.md) + - [AIHubCreateSuccessResponse](docs/AIHubCreateSuccessResponse.md) + - [AIHubDiscoverData](docs/AIHubDiscoverData.md) + - [AIHubDiscoverSuccessResponse](docs/AIHubDiscoverSuccessResponse.md) + - [AIHubPortfolioBaseInfo](docs/AIHubPortfolioBaseInfo.md) + - [AIHubPortfolioDetailData](docs/AIHubPortfolioDetailData.md) + - [AIHubPortfolioDetailSuccessResponse](docs/AIHubPortfolioDetailSuccessResponse.md) + - [AIHubPortfolioMetrics](docs/AIHubPortfolioMetrics.md) + - [AIHubPortfolioPosition](docs/AIHubPortfolioPosition.md) + - [AIHubPortfolioRunningData](docs/AIHubPortfolioRunningData.md) + - [AIHubPortfolioRunningItem](docs/AIHubPortfolioRunningItem.md) + - [AIHubPortfolioRunningSuccessResponse](docs/AIHubPortfolioRunningSuccessResponse.md) + - [AIHubPortfolioStopData](docs/AIHubPortfolioStopData.md) + - [AIHubPortfolioStopRequest](docs/AIHubPortfolioStopRequest.md) + - [AIHubPortfolioStopSuccessResponse](docs/AIHubPortfolioStopSuccessResponse.md) + - [AIHubRecommendation](docs/AIHubRecommendation.md) - [AccountBalance](docs/AccountBalance.md) + - [AccountBookResponse](docs/AccountBookResponse.md) - [AccountDetail](docs/AccountDetail.md) - [AccountDetailKey](docs/AccountDetailKey.md) - [AccountKeyInfo](docs/AccountKeyInfo.md) - [AccountKeyInfoPerms](docs/AccountKeyInfoPerms.md) - [AccountRateLimit](docs/AccountRateLimit.md) + - [AccountTransferDetail](docs/AccountTransferDetail.md) + - [AccountsResponse](docs/AccountsResponse.md) + - [AdsDetailRequest](docs/AdsDetailRequest.md) + - [AdsListRequest](docs/AdsListRequest.md) + - [AdsUpdateStatus](docs/AdsUpdateStatus.md) - [AgencyCommission](docs/AgencyCommission.md) - [AgencyCommissionHistory](docs/AgencyCommissionHistory.md) - [AgencyTransaction](docs/AgencyTransaction.md) - [AgencyTransactionHistory](docs/AgencyTransactionHistory.md) + - [AlphaCurrency](docs/AlphaCurrency.md) + - [AlphaTicker](docs/AlphaTicker.md) + - [AmendOptionsOrderRequest](docs/AmendOptionsOrderRequest.md) + - [ApiResponseAssetSwapConfig](docs/ApiResponseAssetSwapConfig.md) + - [ApiResponseAssetSwapEvaluate](docs/ApiResponseAssetSwapEvaluate.md) + - [ApiResponseAssetSwapListAssets](docs/ApiResponseAssetSwapListAssets.md) + - [ApiResponseAssetSwapOrderCreateV1](docs/ApiResponseAssetSwapOrderCreateV1.md) + - [ApiResponseAssetSwapOrderListV1](docs/ApiResponseAssetSwapOrderListV1.md) + - [ApiResponseAssetSwapOrderPreviewV1](docs/ApiResponseAssetSwapOrderPreviewV1.md) + - [ApiResponseAssetSwapOrderQueryV1](docs/ApiResponseAssetSwapOrderQueryV1.md) + - [ApiResponseExSkillClaimRewardResp](docs/ApiResponseExSkillClaimRewardResp.md) + - [ApiResponseExSkillClaimRewardRespData](docs/ApiResponseExSkillClaimRewardRespData.md) + - [ApiResponseExSkillClaimTaskResp](docs/ApiResponseExSkillClaimTaskResp.md) + - [ApiResponseExSkillGetBeginnerTaskListResp](docs/ApiResponseExSkillGetBeginnerTaskListResp.md) + - [ApiResponseExSkillGetBeginnerTaskListRespData](docs/ApiResponseExSkillGetBeginnerTaskListRespData.md) + - [ApiResponseExSkillGetBeginnerTaskListRespDataTasks](docs/ApiResponseExSkillGetBeginnerTaskListRespDataTasks.md) + - [ApiResponseExSkillGetUserIdentityResp](docs/ApiResponseExSkillGetUserIdentityResp.md) + - [AssetListResp](docs/AssetListResp.md) + - [AssetSwapFrontend](docs/AssetSwapFrontend.md) + - [AutoInvestCoinsItem](docs/AutoInvestCoinsItem.md) + - [AutoInvestConfigItem](docs/AutoInvestConfigItem.md) + - [AutoInvestMinInvestAmount](docs/AutoInvestMinInvestAmount.md) + - [AutoInvestMinInvestAmountItems](docs/AutoInvestMinInvestAmountItems.md) + - [AutoInvestMinInvestAmountResp](docs/AutoInvestMinInvestAmountResp.md) + - [AutoInvestOrderItem](docs/AutoInvestOrderItem.md) + - [AutoInvestPlanAddPosition](docs/AutoInvestPlanAddPosition.md) + - [AutoInvestPlanCreate](docs/AutoInvestPlanCreate.md) + - [AutoInvestPlanCreateItems](docs/AutoInvestPlanCreateItems.md) + - [AutoInvestPlanCreateResp](docs/AutoInvestPlanCreateResp.md) + - [AutoInvestPlanDetail](docs/AutoInvestPlanDetail.md) + - [AutoInvestPlanListInfoResp](docs/AutoInvestPlanListInfoResp.md) + - [AutoInvestPlanRecordItem](docs/AutoInvestPlanRecordItem.md) + - [AutoInvestPlanRecordsResp](docs/AutoInvestPlanRecordsResp.md) + - [AutoInvestPlanStop](docs/AutoInvestPlanStop.md) + - [AutoInvestPlanUpdate](docs/AutoInvestPlanUpdate.md) + - [AutoInvestPortfolioItem](docs/AutoInvestPortfolioItem.md) - [AutoRepaySetting](docs/AutoRepaySetting.md) - [AwardListStruct](docs/AwardListStruct.md) - [AwardListStructList](docs/AwardListStructList.md) + - [BaseResponse](docs/BaseResponse.md) - [BatchAmendItem](docs/BatchAmendItem.md) - [BatchAmendOrderReq](docs/BatchAmendOrderReq.md) + - [BatchFundingRatesRequest](docs/BatchFundingRatesRequest.md) + - [BatchFundingRatesResponse](docs/BatchFundingRatesResponse.md) - [BatchFuturesOrder](docs/BatchFuturesOrder.md) - [BatchOrder](docs/BatchOrder.md) - [BorrowCurrencyInfo](docs/BorrowCurrencyInfo.md) - [BrokerCommission](docs/BrokerCommission.md) - - [BrokerCommission1](docs/BrokerCommission1.md) + - [BrokerCommissionItem](docs/BrokerCommissionItem.md) - [BrokerCommissionSubBrokerInfo](docs/BrokerCommissionSubBrokerInfo.md) - [BrokerTransaction](docs/BrokerTransaction.md) - - [BrokerTransaction1](docs/BrokerTransaction1.md) + - [BrokerTransactionHistory](docs/BrokerTransactionHistory.md) - [CancelBatchOrder](docs/CancelBatchOrder.md) + - [CancelOrder](docs/CancelOrder.md) - [CancelOrderResult](docs/CancelOrderResult.md) + - [Categories](docs/Categories.md) + - [CategoriesData](docs/CategoriesData.md) + - [CategoriesDataList](docs/CategoriesDataList.md) + - [ChaseOrder](docs/ChaseOrder.md) + - [ClaimRewardError](docs/ClaimRewardError.md) + - [ClaimTaskError](docs/ClaimTaskError.md) + - [ClosePosition](docs/ClosePosition.md) + - [ClosePositionData](docs/ClosePositionData.md) - [CollateralAdjust](docs/CollateralAdjust.md) - [CollateralAdjustRes](docs/CollateralAdjustRes.md) - - [CollateralAlign](docs/CollateralAlign.md) - [CollateralCurrency](docs/CollateralCurrency.md) - [CollateralCurrencyInfo](docs/CollateralCurrencyInfo.md) - [CollateralCurrencyRes](docs/CollateralCurrencyRes.md) - [CollateralCurrentRate](docs/CollateralCurrentRate.md) - [CollateralFixRate](docs/CollateralFixRate.md) - - [CollateralLoanCurrency](docs/CollateralLoanCurrency.md) - [CollateralLtv](docs/CollateralLtv.md) - - [CollateralOrder](docs/CollateralOrder.md) - - [CollateralRecord](docs/CollateralRecord.md) + - [ConfirmPayment](docs/ConfirmPayment.md) + - [ConfirmReceipt](docs/ConfirmReceipt.md) - [Contract](docs/Contract.md) + - [ContractDetail](docs/ContractDetail.md) + - [ContractDetailData](docs/ContractDetailData.md) + - [ContractDetailDataList](docs/ContractDetailDataList.md) + - [ContractMartingaleCreateParams](docs/ContractMartingaleCreateParams.md) + - [ContractMartingaleCreateRequest](docs/ContractMartingaleCreateRequest.md) + - [ContractMartingaleDirection](docs/ContractMartingaleDirection.md) - [ContractStat](docs/ContractStat.md) + - [ConvertCurrenciesV2Item](docs/ConvertCurrenciesV2Item.md) - [ConvertSmallBalance](docs/ConvertSmallBalance.md) - [CountdownCancelAllFuturesTask](docs/CountdownCancelAllFuturesTask.md) - [CountdownCancelAllOptionsTask](docs/CountdownCancelAllOptionsTask.md) - [CountdownCancelAllSpotTask](docs/CountdownCancelAllSpotTask.md) - - [CreateCollateralOrder](docs/CreateCollateralOrder.md) + - [CreateChaseOrderReq](docs/CreateChaseOrderReq.md) + - [CreateChaseOrderResp](docs/CreateChaseOrderResp.md) + - [CreateEarnFixedTermLendResponse](docs/CreateEarnFixedTermLendResponse.md) + - [CreateEarnFixedTermLendResponseData](docs/CreateEarnFixedTermLendResponseData.md) + - [CreateEarnFixedTermPreRedeemResponse](docs/CreateEarnFixedTermPreRedeemResponse.md) - [CreateMultiCollateralOrder](docs/CreateMultiCollateralOrder.md) + - [CreateOrder](docs/CreateOrder.md) + - [CreateOrder2](docs/CreateOrder2.md) + - [CreateOrder2Data](docs/CreateOrder2Data.md) + - [CreateOrderDetail](docs/CreateOrderDetail.md) + - [CreateParam](docs/CreateParam.md) + - [CreateTrailOrder](docs/CreateTrailOrder.md) + - [CreateTrailOrderResponse](docs/CreateTrailOrderResponse.md) + - [CreateTrailOrderResult](docs/CreateTrailOrderResult.md) + - [CreateTransaction](docs/CreateTransaction.md) + - [CreateTransaction2](docs/CreateTransaction2.md) - [CreateUniLend](docs/CreateUniLend.md) - [CreateUniLoan](docs/CreateUniLoan.md) + - [CreateUserResp](docs/CreateUserResp.md) + - [CreateUserRespData](docs/CreateUserRespData.md) - [CrossMarginBalance](docs/CrossMarginBalance.md) - [CrossMarginLoan](docs/CrossMarginLoan.md) - [CrossMarginRepayment](docs/CrossMarginRepayment.md) + - [CrossexAccount](docs/CrossexAccount.md) + - [CrossexAccountAsset](docs/CrossexAccountAsset.md) + - [CrossexAccountBookRecord](docs/CrossexAccountBookRecord.md) + - [CrossexAccountUpdateRequest](docs/CrossexAccountUpdateRequest.md) + - [CrossexAccountUpdateResponse](docs/CrossexAccountUpdateResponse.md) + - [CrossexAdlRank](docs/CrossexAdlRank.md) + - [CrossexBatchCancelOrderRequest](docs/CrossexBatchCancelOrderRequest.md) + - [CrossexBatchCancelOrderResponse](docs/CrossexBatchCancelOrderResponse.md) + - [CrossexClosePositionRequest](docs/CrossexClosePositionRequest.md) + - [CrossexCoinDiscountRate](docs/CrossexCoinDiscountRate.md) + - [CrossexConvertOrderRequest](docs/CrossexConvertOrderRequest.md) + - [CrossexConvertOrderResponse](docs/CrossexConvertOrderResponse.md) + - [CrossexConvertQuoteRequest](docs/CrossexConvertQuoteRequest.md) + - [CrossexConvertQuoteResponse](docs/CrossexConvertQuoteResponse.md) + - [CrossexHistoricalMarginPosition](docs/CrossexHistoricalMarginPosition.md) + - [CrossexHistoricalPosition](docs/CrossexHistoricalPosition.md) + - [CrossexInterestRate](docs/CrossexInterestRate.md) + - [CrossexIsolatedMarginRequest](docs/CrossexIsolatedMarginRequest.md) + - [CrossexIsolatedMarginResponse](docs/CrossexIsolatedMarginResponse.md) + - [CrossexLeverageRequest](docs/CrossexLeverageRequest.md) + - [CrossexLeverageResponse](docs/CrossexLeverageResponse.md) + - [CrossexMarginInterestRecord](docs/CrossexMarginInterestRecord.md) + - [CrossexMarginModeRequest](docs/CrossexMarginModeRequest.md) + - [CrossexMarginModeResponse](docs/CrossexMarginModeResponse.md) + - [CrossexMarginPosition](docs/CrossexMarginPosition.md) + - [CrossexOrder](docs/CrossexOrder.md) + - [CrossexOrderActionResponse](docs/CrossexOrderActionResponse.md) + - [CrossexOrderRequest](docs/CrossexOrderRequest.md) + - [CrossexOrderUpdateRequest](docs/CrossexOrderUpdateRequest.md) + - [CrossexPosition](docs/CrossexPosition.md) + - [CrossexRiskLimit](docs/CrossexRiskLimit.md) + - [CrossexRiskLimitTier](docs/CrossexRiskLimitTier.md) + - [CrossexSpecialFee](docs/CrossexSpecialFee.md) + - [CrossexTrade](docs/CrossexTrade.md) + - [CrossexTransferCoin](docs/CrossexTransferCoin.md) + - [CrossexTransferRecord](docs/CrossexTransferRecord.md) + - [CrossexTransferRequest](docs/CrossexTransferRequest.md) + - [CrossexTransferResponse](docs/CrossexTransferResponse.md) - [Currency](docs/Currency.md) - [CurrencyChain](docs/CurrencyChain.md) - [CurrencyPair](docs/CurrencyPair.md) - [CurrencyQuota](docs/CurrencyQuota.md) - [DebitFee](docs/DebitFee.md) + - [DeleteOrder](docs/DeleteOrder.md) + - [DeletePosition](docs/DeletePosition.md) - [DeliveryAccount](docs/DeliveryAccount.md) - [DeliveryAccountBook](docs/DeliveryAccountBook.md) + - [DeliveryAccountHistory](docs/DeliveryAccountHistory.md) - [DeliveryCandlestick](docs/DeliveryCandlestick.md) - [DeliveryContract](docs/DeliveryContract.md) - [DeliveryLimitRiskTiers](docs/DeliveryLimitRiskTiers.md) @@ -462,21 +792,72 @@ Class | Method | HTTP request | Description - [DeliveryMyTrade](docs/DeliveryMyTrade.md) - [DeliveryOrder](docs/DeliveryOrder.md) - [DeliveryOrderBook](docs/DeliveryOrderBook.md) + - [DeliveryOrderBookItem](docs/DeliveryOrderBookItem.md) - [DeliveryPosition](docs/DeliveryPosition.md) - [DeliveryPositionClose](docs/DeliveryPositionClose.md) - [DeliverySettlement](docs/DeliverySettlement.md) - [DeliveryTicker](docs/DeliveryTicker.md) - [DeliveryTrade](docs/DeliveryTrade.md) + - [DeltaNeutralEnabled](docs/DeltaNeutralEnabled.md) - [DepositAddress](docs/DepositAddress.md) - [DepositRecord](docs/DepositRecord.md) + - [DiscoverScene](docs/DiscoverScene.md) + - [DualGetBalance](docs/DualGetBalance.md) - [DualGetOrders](docs/DualGetOrders.md) - [DualGetPlans](docs/DualGetPlans.md) - - [Eth2RateList](docs/Eth2RateList.md) - - [Eth2Swap](docs/Eth2Swap.md) - - [FindCoin](docs/FindCoin.md) + - [DualModifyOrderReinvestParams](docs/DualModifyOrderReinvestParams.md) + - [DualOrderRefundParams](docs/DualOrderRefundParams.md) + - [DualOrderRefundPreview](docs/DualOrderRefundPreview.md) + - [DualProjectRecommend](docs/DualProjectRecommend.md) + - [EarnFixedTermPreRedeemRequest](docs/EarnFixedTermPreRedeemRequest.md) + - [Eligibility](docs/Eligibility.md) + - [EligibilityResponse](docs/EligibilityResponse.md) + - [EligibilityResponseAllOf](docs/EligibilityResponseAllOf.md) + - [ErrCodeMsg](docs/ErrCodeMsg.md) + - [ErrorResponse](docs/ErrorResponse.md) + - [EvaluateItem](docs/EvaluateItem.md) + - [EvaluateResp](docs/EvaluateResp.md) + - [ExSkillClaimRewardReq](docs/ExSkillClaimRewardReq.md) + - [ExSkillClaimTaskReq](docs/ExSkillClaimTaskReq.md) + - [Exchanges](docs/Exchanges.md) + - [ExchangesData](docs/ExchangesData.md) + - [ExchangesDataList](docs/ExchangesDataList.md) + - [FeeRate](docs/FeeRate.md) + - [FeeRateData](docs/FeeRateData.md) + - [FeeRateDataList](docs/FeeRateDataList.md) + - [FixedTermBonusInfo](docs/FixedTermBonusInfo.md) + - [FixedTermCouponInfo](docs/FixedTermCouponInfo.md) + - [FixedTermHistoryRecord](docs/FixedTermHistoryRecord.md) + - [FixedTermLendOrder](docs/FixedTermLendOrder.md) + - [FixedTermLendRequest](docs/FixedTermLendRequest.md) + - [FixedTermProduct](docs/FixedTermProduct.md) + - [FixedTermProductInfo](docs/FixedTermProductInfo.md) + - [FixedTermProductSimple](docs/FixedTermProductSimple.md) - [FlashSwapCurrencyPair](docs/FlashSwapCurrencyPair.md) + - [FlashSwapErrorResponse](docs/FlashSwapErrorResponse.md) + - [FlashSwapMultiCurrencyCreateParam](docs/FlashSwapMultiCurrencyCreateParam.md) + - [FlashSwapMultiCurrencyManyToOneOrderCreateReq](docs/FlashSwapMultiCurrencyManyToOneOrderCreateReq.md) + - [FlashSwapMultiCurrencyManyToOneOrderCreateResp](docs/FlashSwapMultiCurrencyManyToOneOrderCreateResp.md) + - [FlashSwapMultiCurrencyManyToOneOrderCreateRespData](docs/FlashSwapMultiCurrencyManyToOneOrderCreateRespData.md) + - [FlashSwapMultiCurrencyManyToOneOrderPreviewReq](docs/FlashSwapMultiCurrencyManyToOneOrderPreviewReq.md) + - [FlashSwapMultiCurrencyManyToOneOrderPreviewResp](docs/FlashSwapMultiCurrencyManyToOneOrderPreviewResp.md) + - [FlashSwapMultiCurrencyManyToOneOrderPreviewRespData](docs/FlashSwapMultiCurrencyManyToOneOrderPreviewRespData.md) + - [FlashSwapMultiCurrencyOneToManyOrderCreateReq](docs/FlashSwapMultiCurrencyOneToManyOrderCreateReq.md) + - [FlashSwapMultiCurrencyOneToManyOrderCreateResp](docs/FlashSwapMultiCurrencyOneToManyOrderCreateResp.md) + - [FlashSwapMultiCurrencyOneToManyOrderCreateRespData](docs/FlashSwapMultiCurrencyOneToManyOrderCreateRespData.md) + - [FlashSwapMultiCurrencyOneToManyOrderPreviewReq](docs/FlashSwapMultiCurrencyOneToManyOrderPreviewReq.md) + - [FlashSwapMultiCurrencyOneToManyOrderPreviewResp](docs/FlashSwapMultiCurrencyOneToManyOrderPreviewResp.md) + - [FlashSwapMultiCurrencyOneToManyOrderPreviewRespData](docs/FlashSwapMultiCurrencyOneToManyOrderPreviewRespData.md) + - [FlashSwapMultiCurrencyOrder](docs/FlashSwapMultiCurrencyOrder.md) + - [FlashSwapMultiCurrencyPreviewOrder](docs/FlashSwapMultiCurrencyPreviewOrder.md) + - [FlashSwapMultiCurrencyPreviewParam](docs/FlashSwapMultiCurrencyPreviewParam.md) - [FlashSwapOrder](docs/FlashSwapOrder.md) + - [FlashSwapOrderCreateReq](docs/FlashSwapOrderCreateReq.md) + - [FlashSwapOrderCreateResp](docs/FlashSwapOrderCreateResp.md) + - [FlashSwapOrderCreateRespData](docs/FlashSwapOrderCreateRespData.md) - [FlashSwapOrderPreview](docs/FlashSwapOrderPreview.md) + - [FlashSwapOrderPreviewResp](docs/FlashSwapOrderPreviewResp.md) + - [FlashSwapOrderPreviewRespData](docs/FlashSwapOrderPreviewRespData.md) - [FlashSwapOrderRequest](docs/FlashSwapOrderRequest.md) - [FlashSwapPreviewRequest](docs/FlashSwapPreviewRequest.md) - [FundingAccount](docs/FundingAccount.md) @@ -489,9 +870,13 @@ Class | Method | HTTP request | Description - [FuturesBBOOrder](docs/FuturesBBOOrder.md) - [FuturesBatchAmendOrderRequest](docs/FuturesBatchAmendOrderRequest.md) - [FuturesCandlestick](docs/FuturesCandlestick.md) + - [FuturesDirection](docs/FuturesDirection.md) - [FuturesFee](docs/FuturesFee.md) + - [FuturesGridCreateParams](docs/FuturesGridCreateParams.md) + - [FuturesGridCreateRequest](docs/FuturesGridCreateRequest.md) - [FuturesIndexConstituents](docs/FuturesIndexConstituents.md) - [FuturesInitialOrder](docs/FuturesInitialOrder.md) + - [FuturesLeverage](docs/FuturesLeverage.md) - [FuturesLimitRiskTiers](docs/FuturesLimitRiskTiers.md) - [FuturesLiqOrder](docs/FuturesLiqOrder.md) - [FuturesLiquidate](docs/FuturesLiquidate.md) @@ -499,7 +884,7 @@ Class | Method | HTTP request | Description - [FuturesOrderAmendment](docs/FuturesOrderAmendment.md) - [FuturesOrderBook](docs/FuturesOrderBook.md) - [FuturesOrderBookItem](docs/FuturesOrderBookItem.md) - - [FuturesOrderBookItem1](docs/FuturesOrderBookItem1.md) + - [FuturesOrderTimerange](docs/FuturesOrderTimerange.md) - [FuturesPositionCrossMode](docs/FuturesPositionCrossMode.md) - [FuturesPremiumIndex](docs/FuturesPremiumIndex.md) - [FuturesPriceTrigger](docs/FuturesPriceTrigger.md) @@ -508,16 +893,72 @@ Class | Method | HTTP request | Description - [FuturesTicker](docs/FuturesTicker.md) - [FuturesTrade](docs/FuturesTrade.md) - [FuturesUpdatePriceTriggeredOrder](docs/FuturesUpdatePriceTriggeredOrder.md) + - [GateErrorResponse](docs/GateErrorResponse.md) + - [GetBeginnerTaskListError](docs/GetBeginnerTaskListError.md) + - [GetChaseOrderDetailResp](docs/GetChaseOrderDetailResp.md) + - [GetChaseOrdersResp](docs/GetChaseOrdersResp.md) + - [GetChatsListRequest](docs/GetChatsListRequest.md) + - [GetCompletedTransactionListRequest](docs/GetCompletedTransactionListRequest.md) + - [GetCounterpartyUserInfoRequest](docs/GetCounterpartyUserInfoRequest.md) + - [GetMyActivityEntryResponse](docs/GetMyActivityEntryResponse.md) + - [GetMyActivityEntryResponseData](docs/GetMyActivityEntryResponseData.md) + - [GetMyselfPaymentRequest](docs/GetMyselfPaymentRequest.md) + - [GetPendingTransactionListRequest](docs/GetPendingTransactionListRequest.md) + - [GetTransactionDetailsRequest](docs/GetTransactionDetailsRequest.md) + - [GetUserCouponDetailResponse](docs/GetUserCouponDetailResponse.md) + - [GetUserCouponDetailResponseData](docs/GetUserCouponDetailResponseData.md) + - [GetUserIdentityError](docs/GetUserIdentityError.md) + - [I18nTxt](docs/I18nTxt.md) - [IndexConstituent](docs/IndexConstituent.md) - - [InlineObject](docs/InlineObject.md) + - [InfiniteGridCreateParams](docs/InfiniteGridCreateParams.md) + - [InfiniteGridCreateRequest](docs/InfiniteGridCreateRequest.md) - [InlineResponse200](docs/InlineResponse200.md) - [InlineResponse2001](docs/InlineResponse2001.md) + - [InlineResponse2002](docs/InlineResponse2002.md) - [InsuranceRecord](docs/InsuranceRecord.md) + - [Klines](docs/Klines.md) + - [KlinesData](docs/KlinesData.md) + - [KlinesDataList](docs/KlinesDataList.md) + - [LadderApr](docs/LadderApr.md) - [LedgerRecord](docs/LedgerRecord.md) + - [LeverageFailedCurrencies](docs/LeverageFailedCurrencies.md) - [LiquidateOrder](docs/LiquidateOrder.md) + - [ListActivitiesResponse](docs/ListActivitiesResponse.md) + - [ListActivitiesResponseData](docs/ListActivitiesResponseData.md) + - [ListActivitiesResponseDataList](docs/ListActivitiesResponseDataList.md) + - [ListActivityTypesResponse](docs/ListActivityTypesResponse.md) + - [ListActivityTypesResponseData](docs/ListActivityTypesResponseData.md) + - [ListActivityTypesResponseDataList](docs/ListActivityTypesResponseDataList.md) + - [ListEarnFixedTermHistoryResponse](docs/ListEarnFixedTermHistoryResponse.md) + - [ListEarnFixedTermHistoryResponseData](docs/ListEarnFixedTermHistoryResponseData.md) + - [ListEarnFixedTermLendsResponse](docs/ListEarnFixedTermLendsResponse.md) + - [ListEarnFixedTermLendsResponseData](docs/ListEarnFixedTermLendsResponseData.md) + - [ListEarnFixedTermProductsByAssetResponse](docs/ListEarnFixedTermProductsByAssetResponse.md) + - [ListEarnFixedTermProductsByAssetResponseData](docs/ListEarnFixedTermProductsByAssetResponseData.md) + - [ListEarnFixedTermProductsResponse](docs/ListEarnFixedTermProductsResponse.md) + - [ListEarnFixedTermProductsResponseData](docs/ListEarnFixedTermProductsResponseData.md) + - [ListLiveReplayError](docs/ListLiveReplayError.md) + - [ListLiveReplayResponse](docs/ListLiveReplayResponse.md) + - [ListLiveReplayResponseData](docs/ListLiveReplayResponseData.md) + - [ListLiveReplayResponseDataList](docs/ListLiveReplayResponseDataList.md) + - [ListLiveReplayResponseDataLive](docs/ListLiveReplayResponseDataLive.md) + - [ListLiveReplayResponseDataLiveHost](docs/ListLiveReplayResponseDataLiveHost.md) + - [ListLiveReplayResponseDataVideo](docs/ListLiveReplayResponseDataVideo.md) + - [ListSquareAiSearchError](docs/ListSquareAiSearchError.md) + - [ListSquareAiSearchResponse](docs/ListSquareAiSearchResponse.md) + - [ListSquareAiSearchResponseData](docs/ListSquareAiSearchResponseData.md) + - [ListSquareAiSearchResponseDataItems](docs/ListSquareAiSearchResponseDataItems.md) + - [ListUserCouponsResponse](docs/ListUserCouponsResponse.md) + - [ListUserCouponsResponseData](docs/ListUserCouponsResponseData.md) + - [ListUserCouponsResponseDataHelpUrl](docs/ListUserCouponsResponseDataHelpUrl.md) + - [ListUserCouponsResponseDataJumpUrl](docs/ListUserCouponsResponseDataJumpUrl.md) + - [ListUserCouponsResponseDataList](docs/ListUserCouponsResponseDataList.md) + - [ListUserCouponsResponseDataProgressConfig](docs/ListUserCouponsResponseDataProgressConfig.md) - [MarginAccount](docs/MarginAccount.md) - [MarginAccountBook](docs/MarginAccountBook.md) - [MarginAccountCurrency](docs/MarginAccountCurrency.md) + - [MarginGridCreateParams](docs/MarginGridCreateParams.md) + - [MarginGridCreateRequest](docs/MarginGridCreateRequest.md) - [MarginLeverageTier](docs/MarginLeverageTier.md) - [MarginMarketLeverage](docs/MarginMarketLeverage.md) - [MarginTiers](docs/MarginTiers.md) @@ -531,6 +972,8 @@ Class | Method | HTTP request | Description - [MockRiskUnit](docs/MockRiskUnit.md) - [MockSpotBalance](docs/MockSpotBalance.md) - [MockSpotOrder](docs/MockSpotOrder.md) + - [Mt5Account](docs/Mt5Account.md) + - [Mt5AccountData](docs/Mt5AccountData.md) - [MultiChainAddressItem](docs/MultiChainAddressItem.md) - [MultiCollateralCurrency](docs/MultiCollateralCurrency.md) - [MultiCollateralItem](docs/MultiCollateralItem.md) @@ -541,6 +984,7 @@ Class | Method | HTTP request | Description - [MultiLoanRepayItem](docs/MultiLoanRepayItem.md) - [MultiRepayRecord](docs/MultiRepayRecord.md) - [MultiRepayResp](docs/MultiRepayResp.md) + - [MyAdsListRequest](docs/MyAdsListRequest.md) - [MyFuturesTrade](docs/MyFuturesTrade.md) - [MyFuturesTradeTimeRange](docs/MyFuturesTradeTimeRange.md) - [OpenOrders](docs/OpenOrders.md) @@ -564,48 +1008,189 @@ Class | Method | HTTP request | Description - [OptionsUnderlyingTicker](docs/OptionsUnderlyingTicker.md) - [Order](docs/Order.md) - [OrderBook](docs/OrderBook.md) + - [OrderBook2](docs/OrderBook2.md) + - [OrderBook2Data](docs/OrderBook2Data.md) + - [OrderBookPrice](docs/OrderBookPrice.md) - [OrderCancel](docs/OrderCancel.md) + - [OrderCreateV1Req](docs/OrderCreateV1Req.md) + - [OrderCreateV1Resp](docs/OrderCreateV1Resp.md) + - [OrderHistoryList](docs/OrderHistoryList.md) + - [OrderHistoryList2](docs/OrderHistoryList2.md) + - [OrderHistoryList2Data](docs/OrderHistoryList2Data.md) + - [OrderHistoryListData](docs/OrderHistoryListData.md) + - [OrderHistoryListDataList](docs/OrderHistoryListDataList.md) + - [OrderHistoryListItem](docs/OrderHistoryListItem.md) + - [OrderHistoryListItemStatusDetail](docs/OrderHistoryListItemStatusDetail.md) + - [OrderList](docs/OrderList.md) + - [OrderList2](docs/OrderList2.md) + - [OrderList2Data](docs/OrderList2Data.md) + - [OrderListData](docs/OrderListData.md) + - [OrderListDataList](docs/OrderListDataList.md) + - [OrderListItem](docs/OrderListItem.md) - [OrderListStruct](docs/OrderListStruct.md) - [OrderListStructList](docs/OrderListStructList.md) + - [OrderListV1Resp](docs/OrderListV1Resp.md) + - [OrderLog](docs/OrderLog.md) + - [OrderLogData](docs/OrderLogData.md) - [OrderPatch](docs/OrderPatch.md) + - [OrderPreviewV1Req](docs/OrderPreviewV1Req.md) + - [OrderPreviewV1Resp](docs/OrderPreviewV1Resp.md) - [OrderResp](docs/OrderResp.md) + - [OrderResponse](docs/OrderResponse.md) + - [OtcActionResponse](docs/OtcActionResponse.md) + - [OtcBankCreateMultipartRequest](docs/OtcBankCreateMultipartRequest.md) + - [OtcBankCreateResponse](docs/OtcBankCreateResponse.md) + - [OtcBankCreateResponseData](docs/OtcBankCreateResponseData.md) + - [OtcBankEnterpriseSupplementMultipartRequest](docs/OtcBankEnterpriseSupplementMultipartRequest.md) + - [OtcBankIdRequest](docs/OtcBankIdRequest.md) + - [OtcBankListItem](docs/OtcBankListItem.md) + - [OtcBankListResponse](docs/OtcBankListResponse.md) + - [OtcBankListResult](docs/OtcBankListResult.md) + - [OtcBankPersonalSupplementMultipartRequest](docs/OtcBankPersonalSupplementMultipartRequest.md) + - [OtcBankSupplementChecklistItem](docs/OtcBankSupplementChecklistItem.md) + - [OtcBankSupplementChecklistResponse](docs/OtcBankSupplementChecklistResponse.md) + - [OtcBankSupplementChecklistResponseData](docs/OtcBankSupplementChecklistResponseData.md) + - [OtcMarkOrderPaidRequest](docs/OtcMarkOrderPaidRequest.md) + - [OtcOrderDetail](docs/OtcOrderDetail.md) + - [OtcOrderDetailResponse](docs/OtcOrderDetailResponse.md) + - [OtcOrderListCryptoCurrencyInfo](docs/OtcOrderListCryptoCurrencyInfo.md) + - [OtcOrderListFiatCurrencyInfo](docs/OtcOrderListFiatCurrencyInfo.md) + - [OtcOrderListItem](docs/OtcOrderListItem.md) + - [OtcOrderListResponse](docs/OtcOrderListResponse.md) + - [OtcOrderListResult](docs/OtcOrderListResult.md) + - [OtcOrderRequest](docs/OtcOrderRequest.md) + - [OtcQuoteRequest](docs/OtcQuoteRequest.md) + - [OtcQuoteResponse](docs/OtcQuoteResponse.md) + - [OtcQuoteResult](docs/OtcQuoteResult.md) + - [OtcStableCoinOrderCreateResponse](docs/OtcStableCoinOrderCreateResponse.md) + - [OtcStableCoinOrderListItem](docs/OtcStableCoinOrderListItem.md) + - [OtcStableCoinOrderListResponse](docs/OtcStableCoinOrderListResponse.md) + - [OtcStableCoinOrderListResult](docs/OtcStableCoinOrderListResult.md) + - [OtcStableCoinOrderRequest](docs/OtcStableCoinOrderRequest.md) + - [OtherContact](docs/OtherContact.md) + - [P2pAdDetail](docs/P2pAdDetail.md) + - [P2pAdDetailResponse](docs/P2pAdDetailResponse.md) + - [P2pAdsListItem](docs/P2pAdsListItem.md) + - [P2pAdsListResponse](docs/P2pAdsListResponse.md) + - [P2pAdsListTradeMethod](docs/P2pAdsListTradeMethod.md) + - [P2pAdsUpdateStatusResponse](docs/P2pAdsUpdateStatusResponse.md) + - [P2pAdsUpdateStatusResult](docs/P2pAdsUpdateStatusResult.md) + - [P2pChatListResponse](docs/P2pChatListResponse.md) + - [P2pChatListResult](docs/P2pChatListResult.md) + - [P2pChatMessage](docs/P2pChatMessage.md) + - [P2pChatMessagePayload](docs/P2pChatMessagePayload.md) + - [P2pCounterpartyUserInfo](docs/P2pCounterpartyUserInfo.md) + - [P2pCounterpartyUserInfoResponse](docs/P2pCounterpartyUserInfoResponse.md) + - [P2pMerchantBooksPlaceBizPushOrderResponse](docs/P2pMerchantBooksPlaceBizPushOrderResponse.md) + - [P2pMerchantBooksPlaceBizPushOrderResponseData](docs/P2pMerchantBooksPlaceBizPushOrderResponseData.md) + - [P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent](docs/P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent.md) + - [P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction](docs/P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction.md) + - [P2pMerchantMarketInfo](docs/P2pMerchantMarketInfo.md) + - [P2pMerchantUserInfo](docs/P2pMerchantUserInfo.md) + - [P2pMerchantUserInfoResponse](docs/P2pMerchantUserInfoResponse.md) + - [P2pMerchantWorkHours](docs/P2pMerchantWorkHours.md) + - [P2pMerchantWorkHoursResponse](docs/P2pMerchantWorkHoursResponse.md) + - [P2pMyAd](docs/P2pMyAd.md) + - [P2pMyAdsListResponse](docs/P2pMyAdsListResponse.md) + - [P2pMyAdsListResult](docs/P2pMyAdsListResult.md) + - [P2pPaymentMethodAccount](docs/P2pPaymentMethodAccount.md) + - [P2pPaymentMethodGroup](docs/P2pPaymentMethodGroup.md) + - [P2pPaymentMethodsResponse](docs/P2pPaymentMethodsResponse.md) + - [P2pSendChatMessageResponse](docs/P2pSendChatMessageResponse.md) + - [P2pSendChatMessageResult](docs/P2pSendChatMessageResult.md) + - [P2pTransactionActionResponse](docs/P2pTransactionActionResponse.md) + - [P2pTransactionConvertInfo](docs/P2pTransactionConvertInfo.md) + - [P2pTransactionDetail](docs/P2pTransactionDetail.md) + - [P2pTransactionDetailPayOthers](docs/P2pTransactionDetailPayOthers.md) + - [P2pTransactionDetailResponse](docs/P2pTransactionDetailResponse.md) + - [P2pTransactionListItem](docs/P2pTransactionListItem.md) + - [P2pTransactionListResponse](docs/P2pTransactionListResponse.md) + - [P2pTransactionListResult](docs/P2pTransactionListResult.md) + - [P2pTransactionListResultPayOthers](docs/P2pTransactionListResultPayOthers.md) + - [P2pTransactionTimeMarker](docs/P2pTransactionTimeMarker.md) + - [P2pUploadChatFileResponse](docs/P2pUploadChatFileResponse.md) + - [P2pUploadChatFileResult](docs/P2pUploadChatFileResult.md) + - [PartnerApplication](docs/PartnerApplication.md) + - [PartnerApplicationResponse](docs/PartnerApplicationResponse.md) + - [PartnerApplicationResponseAllOf](docs/PartnerApplicationResponseAllOf.md) - [PartnerCommissionHistory](docs/PartnerCommissionHistory.md) + - [PartnerDataAggregated](docs/PartnerDataAggregated.md) + - [PartnerDataAggregatedResponse](docs/PartnerDataAggregatedResponse.md) + - [PartnerDataAggregatedResponseAllOf](docs/PartnerDataAggregatedResponseAllOf.md) - [PartnerSub](docs/PartnerSub.md) - [PartnerSubList](docs/PartnerSubList.md) - [PartnerTransactionHistory](docs/PartnerTransactionHistory.md) - [PatchUniLend](docs/PatchUniLend.md) + - [PlaceBizPushOrder](docs/PlaceBizPushOrder.md) - [PlaceDualInvestmentOrder](docs/PlaceDualInvestmentOrder.md) + - [PlaceDualInvestmentOrderParams](docs/PlaceDualInvestmentOrderParams.md) + - [PlaceOrderRequest](docs/PlaceOrderRequest.md) + - [PlaceOrderResponse](docs/PlaceOrderResponse.md) - [Position](docs/Position.md) - [PositionClose](docs/PositionClose.md) - [PositionCloseOrder](docs/PositionCloseOrder.md) + - [PositionHistoryList](docs/PositionHistoryList.md) + - [PositionHistoryListData](docs/PositionHistoryListData.md) + - [PositionHistoryListDataCloseDetail](docs/PositionHistoryListDataCloseDetail.md) + - [PositionHistoryListDataList](docs/PositionHistoryListDataList.md) + - [PositionHistoryListDataRealizedPnlDetail](docs/PositionHistoryListDataRealizedPnlDetail.md) + - [PositionList](docs/PositionList.md) + - [PositionList2](docs/PositionList2.md) + - [PositionList2Data](docs/PositionList2Data.md) + - [PositionListData](docs/PositionListData.md) + - [PositionListDataList](docs/PositionListDataList.md) + - [PositionListItem](docs/PositionListItem.md) + - [PositionTimerange](docs/PositionTimerange.md) + - [PreviewFromParam](docs/PreviewFromParam.md) + - [PreviewOrder](docs/PreviewOrder.md) + - [PreviewOrderDetail](docs/PreviewOrderDetail.md) + - [PreviewToParam](docs/PreviewToParam.md) - [ProfitLossRange](docs/ProfitLossRange.md) + - [QuickEstimatedRepayment](docs/QuickEstimatedRepayment.md) + - [QuickRepaymentRequest](docs/QuickRepaymentRequest.md) + - [QuickRepaymentResponse](docs/QuickRepaymentResponse.md) + - [QuoteRequest](docs/QuoteRequest.md) + - [QuoteResponse](docs/QuoteResponse.md) - [RebateUserInfo](docs/RebateUserInfo.md) + - [Recommend](docs/Recommend.md) + - [RecommendV2Scheme](docs/RecommendV2Scheme.md) + - [RecommendV2Strategy](docs/RecommendV2Strategy.md) - [RepayCurrencyRes](docs/RepayCurrencyRes.md) - - [RepayLoan](docs/RepayLoan.md) - [RepayMultiLoan](docs/RepayMultiLoan.md) - - [RepayRecord](docs/RepayRecord.md) - [RepayRecordCurrency](docs/RepayRecordCurrency.md) - [RepayRecordLeftInterest](docs/RepayRecordLeftInterest.md) - [RepayRecordRepaidCurrency](docs/RepayRecordRepaidCurrency.md) - [RepayRecordTotalInterest](docs/RepayRecordTotalInterest.md) - - [RepayResp](docs/RepayResp.md) - [RiskUnits](docs/RiskUnits.md) - [SavedAddress](docs/SavedAddress.md) + - [SendChatMessageRequest](docs/SendChatMessageRequest.md) + - [SetMerchantWorkHoursRequest](docs/SetMerchantWorkHoursRequest.md) - [SmallBalance](docs/SmallBalance.md) - [SmallBalanceHistory](docs/SmallBalanceHistory.md) - - [SpotAccount](docs/SpotAccount.md) - [SpotAccountBook](docs/SpotAccountBook.md) - [SpotCurrencyChain](docs/SpotCurrencyChain.md) - [SpotFee](docs/SpotFee.md) + - [SpotGridCreateParams](docs/SpotGridCreateParams.md) + - [SpotGridCreateRequest](docs/SpotGridCreateRequest.md) - [SpotInsuranceHistory](docs/SpotInsuranceHistory.md) + - [SpotMartingaleCreateParams](docs/SpotMartingaleCreateParams.md) + - [SpotMartingaleCreateRequest](docs/SpotMartingaleCreateRequest.md) + - [SpotOrderStopLoss](docs/SpotOrderStopLoss.md) + - [SpotOrderStopProfit](docs/SpotOrderStopProfit.md) + - [SpotPovOrder](docs/SpotPovOrder.md) + - [SpotPovOrderCreator](docs/SpotPovOrderCreator.md) - [SpotPricePutOrder](docs/SpotPricePutOrder.md) - [SpotPriceTrigger](docs/SpotPriceTrigger.md) - [SpotPriceTriggeredOrder](docs/SpotPriceTriggeredOrder.md) + - [StopAllChaseOrdersReq](docs/StopAllChaseOrdersReq.md) + - [StopAllChaseOrdersResp](docs/StopAllChaseOrdersResp.md) + - [StopAllTrailOrders](docs/StopAllTrailOrders.md) + - [StopChaseOrderReq](docs/StopChaseOrderReq.md) + - [StopChaseOrderResp](docs/StopChaseOrderResp.md) + - [StopTrailOrder](docs/StopTrailOrder.md) - [StpGroup](docs/StpGroup.md) - [StpGroupUser](docs/StpGroupUser.md) - - [StructuredBuy](docs/StructuredBuy.md) - - [StructuredGetProjectList](docs/StructuredGetProjectList.md) - - [StructuredOrderList](docs/StructuredOrderList.md) + - [StrategyType](docs/StrategyType.md) - [SubAccount](docs/SubAccount.md) - [SubAccountBalance](docs/SubAccountBalance.md) - [SubAccountCrossMarginBalance](docs/SubAccountCrossMarginBalance.md) @@ -620,12 +1205,52 @@ Class | Method | HTTP request | Description - [SubUserMode](docs/SubUserMode.md) - [SwapCoin](docs/SwapCoin.md) - [SwapCoinStruct](docs/SwapCoinStruct.md) + - [Symbol](docs/Symbol.md) + - [SymbolCommissions](docs/SymbolCommissions.md) + - [SymbolCommissionsData](docs/SymbolCommissionsData.md) + - [SymbolCommissionsDataList](docs/SymbolCommissionsDataList.md) + - [SymbolDetail](docs/SymbolDetail.md) + - [SymbolDetailData](docs/SymbolDetailData.md) + - [SymbolDetailItem](docs/SymbolDetailItem.md) + - [SymbolDetailItemSymbolDescs](docs/SymbolDetailItemSymbolDescs.md) + - [SymbolListItem](docs/SymbolListItem.md) + - [Symbols](docs/Symbols.md) + - [Symbols2](docs/Symbols2.md) + - [Symbols2Data](docs/Symbols2Data.md) + - [SymbolsData](docs/SymbolsData.md) + - [SymbolsDataList](docs/SymbolsDataList.md) - [SystemTime](docs/SystemTime.md) - [Ticker](docs/Ticker.md) + - [Tokens](docs/Tokens.md) - [TotalBalance](docs/TotalBalance.md) + - [TradFiClosePositionRequest](docs/TradFiClosePositionRequest.md) + - [TradFiError](docs/TradFiError.md) + - [TradFiOrderRequest](docs/TradFiOrderRequest.md) + - [TradFiOrderUpdateRequest](docs/TradFiOrderUpdateRequest.md) + - [TradFiPositionUpdateRequest](docs/TradFiPositionUpdateRequest.md) + - [TradFiSpotClosePositionRequest](docs/TradFiSpotClosePositionRequest.md) + - [TradFiSpotError](docs/TradFiSpotError.md) + - [TradFiSpotOrderRequest](docs/TradFiSpotOrderRequest.md) + - [TradFiSpotOrderUpdateRequest](docs/TradFiSpotOrderUpdateRequest.md) + - [TradFiSpotTransactionRequest](docs/TradFiSpotTransactionRequest.md) + - [TradFiTicker](docs/TradFiTicker.md) + - [TradFiTickerData](docs/TradFiTickerData.md) + - [TradFiTransactionRequest](docs/TradFiTransactionRequest.md) - [Trade](docs/Trade.md) - [TradeFee](docs/TradeFee.md) + - [TrailChangeLog](docs/TrailChangeLog.md) + - [TrailOrder](docs/TrailOrder.md) + - [TrailOrderChangeLogResponse](docs/TrailOrderChangeLogResponse.md) + - [TrailOrderDetailResponse](docs/TrailOrderDetailResponse.md) + - [TrailOrderListResponse](docs/TrailOrderListResponse.md) + - [TrailOrderResponse](docs/TrailOrderResponse.md) - [TransactionID](docs/TransactionID.md) + - [TransactionItem](docs/TransactionItem.md) + - [TransactionList](docs/TransactionList.md) + - [TransactionList2](docs/TransactionList2.md) + - [TransactionList2Data](docs/TransactionList2Data.md) + - [TransactionListData](docs/TransactionListData.md) + - [TransactionListDataList](docs/TransactionListDataList.md) - [Transfer](docs/Transfer.md) - [TransferOrderStatus](docs/TransferOrderStatus.md) - [TransferablesResult](docs/TransferablesResult.md) @@ -634,9 +1259,11 @@ Class | Method | HTTP request | Description - [UidPushOrder](docs/UidPushOrder.md) - [UidPushWithdrawal](docs/UidPushWithdrawal.md) - [UidPushWithdrawalResp](docs/UidPushWithdrawalResp.md) + - [UniChartPoint](docs/UniChartPoint.md) - [UniCurrency](docs/UniCurrency.md) - [UniCurrencyInterest](docs/UniCurrencyInterest.md) - [UniCurrencyPair](docs/UniCurrencyPair.md) + - [UniEstimatedRate](docs/UniEstimatedRate.md) - [UniInterestRecord](docs/UniInterestRecord.md) - [UniLend](docs/UniLend.md) - [UniLendInterest](docs/UniLendInterest.md) @@ -647,7 +1274,6 @@ Class | Method | HTTP request | Description - [UnifiedAccount](docs/UnifiedAccount.md) - [UnifiedBalance](docs/UnifiedBalance.md) - [UnifiedBorrowable](docs/UnifiedBorrowable.md) - - [UnifiedBorrowable1](docs/UnifiedBorrowable1.md) - [UnifiedCollateralReq](docs/UnifiedCollateralReq.md) - [UnifiedCollateralRes](docs/UnifiedCollateralRes.md) - [UnifiedCurrency](docs/UnifiedCurrency.md) @@ -664,13 +1290,28 @@ Class | Method | HTTP request | Description - [UnifiedModeSet](docs/UnifiedModeSet.md) - [UnifiedPortfolioInput](docs/UnifiedPortfolioInput.md) - [UnifiedPortfolioOutput](docs/UnifiedPortfolioOutput.md) + - [UnifiedQuickRepayAvailableItem](docs/UnifiedQuickRepayAvailableItem.md) + - [UnifiedQuickRepayDebtItem](docs/UnifiedQuickRepayDebtItem.md) + - [UnifiedQuickRepayRepaidInfo](docs/UnifiedQuickRepayRepaidInfo.md) + - [UnifiedQuickRepayUsedInfo](docs/UnifiedQuickRepayUsedInfo.md) - [UnifiedRiskUnits](docs/UnifiedRiskUnits.md) - [UnifiedSettings](docs/UnifiedSettings.md) - [UnifiedTransferable](docs/UnifiedTransferable.md) - - [UserLtvInfo](docs/UserLtvInfo.md) + - [UpdateDualCompPositionCrossModeRequest](docs/UpdateDualCompPositionCrossModeRequest.md) + - [UpdateOrder](docs/UpdateOrder.md) + - [UpdateOrder2](docs/UpdateOrder2.md) + - [UpdateOrder2Data](docs/UpdateOrder2Data.md) + - [UpdateOrderData](docs/UpdateOrderData.md) + - [UpdatePosition](docs/UpdatePosition.md) + - [UpdateTrailOrder](docs/UpdateTrailOrder.md) + - [UploadChatFile](docs/UploadChatFile.md) + - [UserAssetResp](docs/UserAssetResp.md) + - [UserAssetResp2](docs/UserAssetResp2.md) + - [UserAssetResp2Data](docs/UserAssetResp2Data.md) + - [UserAssetRespData](docs/UserAssetRespData.md) + - [UserLeverageSetting](docs/UserLeverageSetting.md) - [UserSub](docs/UserSub.md) - [UserSubRelation](docs/UserSubRelation.md) - - [UserTotalAmount](docs/UserTotalAmount.md) - [WithdrawStatus](docs/WithdrawStatus.md) - [WithdrawalRecord](docs/WithdrawalRecord.md) - [WithdrawalsDel](docs/WithdrawalsDel.md) diff --git a/docs/AIHubCreateData.md b/docs/AIHubCreateData.md new file mode 100644 index 00000000..4e9186be --- /dev/null +++ b/docs/AIHubCreateData.md @@ -0,0 +1,15 @@ +# AIHubCreateData + +Policy information returned after the policy is successfully created. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_id** | **str** | | +**strategy_type** | [**StrategyType**](StrategyType.md) | | +**market** | **str** | | +**status** | **str** | The initial state after successful creation, usually `running` | +**jump_url** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubCreateSuccessResponse.md b/docs/AIHubCreateSuccessResponse.md new file mode 100644 index 00000000..cfb4d97b --- /dev/null +++ b/docs/AIHubCreateSuccessResponse.md @@ -0,0 +1,14 @@ +# AIHubCreateSuccessResponse + +The response body when the creation strategy is successful. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**AIHubCreateData**](AIHubCreateData.md) | | +**trace_id** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubDiscoverData.md b/docs/AIHubDiscoverData.md new file mode 100644 index 00000000..6bb9421a --- /dev/null +++ b/docs/AIHubDiscoverData.md @@ -0,0 +1,13 @@ +# AIHubDiscoverData + +Strategy recommendation result data. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scene** | [**DiscoverScene**](DiscoverScene.md) | | +**recommendations** | [**list[AIHubRecommendation]**](AIHubRecommendation.md) | | +**unsupported_filters** | **list[str]** | Filter conditions not supported in this issue | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubDiscoverSuccessResponse.md b/docs/AIHubDiscoverSuccessResponse.md new file mode 100644 index 00000000..a9e2bf4d --- /dev/null +++ b/docs/AIHubDiscoverSuccessResponse.md @@ -0,0 +1,14 @@ +# AIHubDiscoverSuccessResponse + +Get the response body when the strategy recommendation is successful. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**AIHubDiscoverData**](AIHubDiscoverData.md) | | +**trace_id** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioBaseInfo.md b/docs/AIHubPortfolioBaseInfo.md new file mode 100644 index 00000000..be8e92cc --- /dev/null +++ b/docs/AIHubPortfolioBaseInfo.md @@ -0,0 +1,16 @@ +# AIHubPortfolioBaseInfo + +Strategy detail base info. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_name** | **str** | | +**created_at** | **str** | Created time | +**running_duration** | **int** | Runtime duration in seconds. | +**invest_amount** | **str** | | +**total_profit** | **str** | | +**profit_rate** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioDetailData.md b/docs/AIHubPortfolioDetailData.md new file mode 100644 index 00000000..a99af911 --- /dev/null +++ b/docs/AIHubPortfolioDetailData.md @@ -0,0 +1,18 @@ +# AIHubPortfolioDetailData + +Policy details data. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_id** | **str** | | +**strategy_type** | [**StrategyType**](StrategyType.md) | | +**market** | **str** | | +**status** | **str** | | +**base_info** | [**AIHubPortfolioBaseInfo**](AIHubPortfolioBaseInfo.md) | | +**metrics** | [**AIHubPortfolioMetrics**](AIHubPortfolioMetrics.md) | | +**position** | [**AIHubPortfolioPosition**](AIHubPortfolioPosition.md) | | [optional] +**stop_supported** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioDetailSuccessResponse.md b/docs/AIHubPortfolioDetailSuccessResponse.md new file mode 100644 index 00000000..f2bab25d --- /dev/null +++ b/docs/AIHubPortfolioDetailSuccessResponse.md @@ -0,0 +1,14 @@ +# AIHubPortfolioDetailSuccessResponse + +The response body when querying policy details is successful. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**AIHubPortfolioDetailData**](AIHubPortfolioDetailData.md) | | +**trace_id** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioMetrics.md b/docs/AIHubPortfolioMetrics.md new file mode 100644 index 00000000..88051543 --- /dev/null +++ b/docs/AIHubPortfolioMetrics.md @@ -0,0 +1,23 @@ +# AIHubPortfolioMetrics + +Strategy detail metrics; fields returned depend on strategy type. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**grid_profit** | **str** | | [optional] +**floating_pnl** | **str** | | [optional] +**arbitrage_count** | **int** | | [optional] +**price_range** | **str** | | [optional] +**grid_count** | **int** | | [optional] +**estimated_liquidation_price** | **str** | | [optional] +**price_floor** | **str** | | [optional] +**grid_profit_rate** | **str** | | [optional] +**realized_pnl** | **str** | | [optional] +**finished_rounds** | **int** | | [optional] +**avg_cost** | **str** | | [optional] +**take_profit_price** | **str** | | [optional] +**maintenance_margin_ratio** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioPosition.md b/docs/AIHubPortfolioPosition.md new file mode 100644 index 00000000..9076d506 --- /dev/null +++ b/docs/AIHubPortfolioPosition.md @@ -0,0 +1,16 @@ +# AIHubPortfolioPosition + +Strategy detail position info; fields returned depend on strategy type. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **str** | | [optional] +**entry_price** | **str** | | [optional] +**quote_amount** | **str** | | [optional] +**position_value** | **str** | | [optional] +**margin** | **str** | | [optional] +**side** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioRunningData.md b/docs/AIHubPortfolioRunningData.md new file mode 100644 index 00000000..1d14670a --- /dev/null +++ b/docs/AIHubPortfolioRunningData.md @@ -0,0 +1,14 @@ +# AIHubPortfolioRunningData + +Running policy list data. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**list[AIHubPortfolioRunningItem]**](AIHubPortfolioRunningItem.md) | | +**page** | **int** | | +**page_size** | **int** | | +**total** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioRunningItem.md b/docs/AIHubPortfolioRunningItem.md new file mode 100644 index 00000000..18b5c6c7 --- /dev/null +++ b/docs/AIHubPortfolioRunningItem.md @@ -0,0 +1,19 @@ +# AIHubPortfolioRunningItem + +A single record in the list of running policies. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_id** | **str** | | +**strategy_type** | [**StrategyType**](StrategyType.md) | | +**strategy_name** | **str** | | +**market** | **str** | | +**status** | **str** | | +**pnl** | **str** | | [optional] +**pnl_rate** | **str** | | [optional] +**invest_amount** | **str** | | [optional] +**created_at** | **str** | Created time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioRunningSuccessResponse.md b/docs/AIHubPortfolioRunningSuccessResponse.md new file mode 100644 index 00000000..fc443356 --- /dev/null +++ b/docs/AIHubPortfolioRunningSuccessResponse.md @@ -0,0 +1,14 @@ +# AIHubPortfolioRunningSuccessResponse + +The response body when querying the running policy list is successful. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**AIHubPortfolioRunningData**](AIHubPortfolioRunningData.md) | | +**trace_id** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioStopData.md b/docs/AIHubPortfolioStopData.md new file mode 100644 index 00000000..3e9285e0 --- /dev/null +++ b/docs/AIHubPortfolioStopData.md @@ -0,0 +1,14 @@ +# AIHubPortfolioStopData + +The result information returned after the termination strategy is successful. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_id** | **str** | | +**strategy_type** | [**StrategyType**](StrategyType.md) | | +**status** | **str** | The current implementation returns `stopping` | +**result_message** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioStopRequest.md b/docs/AIHubPortfolioStopRequest.md new file mode 100644 index 00000000..b90fd206 --- /dev/null +++ b/docs/AIHubPortfolioStopRequest.md @@ -0,0 +1,12 @@ +# AIHubPortfolioStopRequest + +The request body to terminate a running policy. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_id** | **str** | | +**strategy_type** | [**StrategyType**](StrategyType.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubPortfolioStopSuccessResponse.md b/docs/AIHubPortfolioStopSuccessResponse.md new file mode 100644 index 00000000..ae48a283 --- /dev/null +++ b/docs/AIHubPortfolioStopSuccessResponse.md @@ -0,0 +1,14 @@ +# AIHubPortfolioStopSuccessResponse + +The response body when the termination strategy is successful. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**AIHubPortfolioStopData**](AIHubPortfolioStopData.md) | | +**trace_id** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AIHubRecommendation.md b/docs/AIHubRecommendation.md new file mode 100644 index 00000000..32a5d78d --- /dev/null +++ b/docs/AIHubRecommendation.md @@ -0,0 +1,18 @@ +# AIHubRecommendation + +A single piece of strategy recommendation information. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**recommendation_id** | **str** | | +**market** | **str** | | +**strategy_type** | [**StrategyType**](StrategyType.md) | | +**strategy_name** | **str** | | +**backtest_apr** | **str** | | [optional] +**max_drawdown** | **str** | | [optional] +**summary** | **str** | | +**strategy_params_preview** | **str** | Recommended-parameter preview as JSON text (string-encoded so clients deserialize it consistently). The value is a serialized JSON object whose structure varies by strategy type; callers or upper-layer models must parse it. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 9ca5715d..b6704c17 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -147,6 +147,8 @@ This endpoint does not need any parameter. Get user transaction rate limit information +This interface is not yet open for use + ### Example * Api Key Authentication (apiv4): diff --git a/docs/AccountBookResponse.md b/docs/AccountBookResponse.md new file mode 100644 index 00000000..1beb78c3 --- /dev/null +++ b/docs/AccountBookResponse.md @@ -0,0 +1,15 @@ +# AccountBookResponse + +Query Asset Flow Return +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | [optional] +**time** | **int** | Operation timestamp | [optional] +**currency** | **str** | Currency name | [optional] +**change** | **str** | Change amount | [optional] +**balance** | **str** | Balance after change | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AccountKeyInfo.md b/docs/AccountKeyInfo.md index e5c7b4b5..5ca4ea59 100644 --- a/docs/AccountKeyInfo.md +++ b/docs/AccountKeyInfo.md @@ -4,8 +4,8 @@ Main Account API Key Information ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**state** | **int** | API Key Status: 1 - Normal, 2 - Locked, 3 - Frozen (can only be modified; default is 1 upon creation) | [optional] -**mode** | **int** | User Mode: 1 - Classic, 2 - Legacy Unified (can only be specified during creation, non-modifiable afterwards) | [optional] +**state** | **int** | API key status: 1 - Normal, 2 - Locked, 3 - Frozen (can only be modified, default is 1 when creating)API Key Status: 1 - Normal, 2 - Locked, 3 - Frozen (can only be modified; default is 1 upon creation) | [optional] +**mode** | **int** | User mode: 1 - Classic mode, 2 - Legacy unified mode (can only be specified when creating, cannot be modified) | [optional] **name** | **list[str]** | API Key Remark | [optional] **currency_pairs** | **list[str]** | Trading Pair Whitelist, Maximum 30 Pairs | [optional] **user_id** | **int** | User ID | [optional] diff --git a/docs/AccountTransferDetail.md b/docs/AccountTransferDetail.md new file mode 100644 index 00000000..1d64a7ba --- /dev/null +++ b/docs/AccountTransferDetail.md @@ -0,0 +1,18 @@ +# AccountTransferDetail + +Trading account transfer details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tx_id** | **str** | Transfer transaction ID | [readonly] +**status** | **str** | Transfer status: - `pending`: Processing - `success`: Successful - `fail`: Failed | [readonly] +**currency** | **str** | Transfer currency | [readonly] +**amount** | **str** | Transfer amount | [readonly] +**from_account** | **str** | Source account type: - `spot`: Spot account - `margin`: Margin account - `futures`: Perpetual futures account - `delivery`: Delivery futures account - `options`: Options account - `unknown`: Unrecognized account type | [readonly] +**to_account** | **str** | Destination account type: - `spot`: Spot account - `margin`: Margin account - `futures`: Perpetual futures account - `delivery`: Delivery futures account - `options`: Options account - `unknown`: Unrecognized account type | [readonly] +**settle** | **str** | Settlement currency for futures, delivery, and options transfers; otherwise, null | [readonly] +**currency_pair** | **str** | Currency pair for margin transfers; otherwise, null | [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AccountsResponse.md b/docs/AccountsResponse.md new file mode 100644 index 00000000..cae2be66 --- /dev/null +++ b/docs/AccountsResponse.md @@ -0,0 +1,15 @@ +# AccountsResponse + +Query Position Return +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | [optional] +**available** | **str** | Available Balance | [optional] +**locked** | **str** | Locked balance | [optional] +**token_address** | **str** | Token address | [optional] +**chain** | **str** | Blockchain name | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ActivityApi.md b/docs/ActivityApi.md new file mode 100644 index 00000000..269391be --- /dev/null +++ b/docs/ActivityApi.md @@ -0,0 +1,211 @@ +# gate_api.ActivityApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_my_activity_entry**](ActivityApi.md#get_my_activity_entry) | **GET** /rewards/activity/my-activity-entry | My activity entry +[**list_activities**](ActivityApi.md#list_activities) | **GET** /rewards/activity/activity-list | Recommended activity list +[**list_activity_types**](ActivityApi.md#list_activity_types) | **GET** /rewards/activity/activity-type | Activity type list + + +# **get_my_activity_entry** +> GetMyActivityEntryResponse get_my_activity_entry() + +My activity entry + +Query user's Activity Center entry information, including activity icon and redirect link + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.ActivityApi(api_client) + +try: + # My activity entry + api_response = api_instance.get_my_activity_entry() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling ActivityApi->get_my_activity_entry: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**GetMyActivityEntryResponse**](GetMyActivityEntryResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully returns activity entry information | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_activities** +> ListActivitiesResponse list_activities(recommend_type=recommend_type, type_ids=type_ids, keywords=keywords, page=page, page_size=page_size, sort_by=sort_by) + +Recommended activity list + +Query recommended activity list from Activity Center, supports pagination and sorting + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.ActivityApi(api_client) +recommend_type = 'recommend_type_example' # str | Recommendation type: hot for popular activities, type for filtering by activity type (type_ids), scenario for matching by activity name (optional) +type_ids = 'type_ids_example' # str | Activity type ID, multiple IDs separated by commas (supports filtering by activity type through this field) (optional) +keywords = 'keywords_example' # str | Activity name. When scenario type is used, keyword matching is applied (optional) +page = 1 # int | Page number, starting from 1 (optional) (default to 1) +page_size = 10 # int | Items per page (optional) (default to 10) +sort_by = 'sort_by_example' # str | Sort order, e.g., hot for sorting by popularity (optional) + +try: + # Recommended activity list + api_response = api_instance.list_activities(recommend_type=recommend_type, type_ids=type_ids, keywords=keywords, page=page, page_size=page_size, sort_by=sort_by) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling ActivityApi->list_activities: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **recommend_type** | **str**| Recommendation type: hot for popular activities, type for filtering by activity type (type_ids), scenario for matching by activity name | [optional] + **type_ids** | **str**| Activity type ID, multiple IDs separated by commas (supports filtering by activity type through this field) | [optional] + **keywords** | **str**| Activity name. When scenario type is used, keyword matching is applied | [optional] + **page** | **int**| Page number, starting from 1 | [optional] [default to 1] + **page_size** | **int**| Items per page | [optional] [default to 10] + **sort_by** | **str**| Sort order, e.g., hot for sorting by popularity | [optional] + +### Return type + +[**ListActivitiesResponse**](ListActivitiesResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully returns activity list | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_activity_types** +> ListActivityTypesResponse list_activity_types() + +Activity type list + +Query all activity types supported by Activity Center + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.ActivityApi(api_client) + +try: + # Activity type list + api_response = api_instance.list_activity_types() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling ActivityApi->list_activity_types: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ListActivityTypesResponse**](ListActivityTypesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully returns activity type list | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/FindCoin.md b/docs/AdsDetailRequest.md similarity index 67% rename from docs/FindCoin.md rename to docs/AdsDetailRequest.md index 784880ab..932bb29d 100644 --- a/docs/FindCoin.md +++ b/docs/AdsDetailRequest.md @@ -1,9 +1,10 @@ -# FindCoin +# AdsDetailRequest +Get ad details request ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**cointype** | **str** | Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. | [optional] +**adv_no** | **str** | Advertisement ID. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AdsListRequest.md b/docs/AdsListRequest.md new file mode 100644 index 00000000..4dda2d6e --- /dev/null +++ b/docs/AdsListRequest.md @@ -0,0 +1,13 @@ +# AdsListRequest + +Get market ads list request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | Cryptocurrency symbol. | +**fiat_unit** | **str** | Fiat currency | +**trade_type** | **str** | Ad side: `buy` buy-crypto ad; `sell` sell-crypto ad. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AdsUpdateStatus.md b/docs/AdsUpdateStatus.md new file mode 100644 index 00000000..d92f3f09 --- /dev/null +++ b/docs/AdsUpdateStatus.md @@ -0,0 +1,12 @@ +# AdsUpdateStatus + +Ad status update request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**adv_no** | **int** | Advertisement ID. | +**adv_status** | **int** | Ad status. `1`: listed; `3`: delisted; `4`: closed. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AgencyCommission.md b/docs/AgencyCommission.md index 11514234..64c978a6 100644 --- a/docs/AgencyCommission.md +++ b/docs/AgencyCommission.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **commission_time** | **int** | Commission time (Unix timestamp in seconds) | [optional] **user_id** | **int** | User ID | [optional] **group_name** | **str** | Group name | [optional] -**commission_amount** | **str** | Transaction amount | [optional] +**commission_amount** | **str** | Commission amount | [optional] **commission_asset** | **str** | Commission Asset | [optional] **source** | **str** | Commission source: SPOT - Spot commission, FUTURES - Futures commission | [optional] diff --git a/docs/AgencyTransaction.md b/docs/AgencyTransaction.md index 930d2b72..8afecc35 100644 --- a/docs/AgencyTransaction.md +++ b/docs/AgencyTransaction.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **fee_asset** | **str** | Fee currency | [optional] **currency_pair** | **str** | Currency pair | [optional] **amount** | **str** | Transaction amount | [optional] -**amount_asset** | **str** | Commission Asset | [optional] +**amount_asset** | **str** | Transaction amount currency | [optional] **source** | **str** | Commission source: SPOT - Spot commission, FUTURES - Futures commission | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CollateralLoanApi.md b/docs/AlphaApi.md similarity index 54% rename from docs/CollateralLoanApi.md rename to docs/AlphaApi.md index bfd5ed62..bfe18b22 100644 --- a/docs/CollateralLoanApi.md +++ b/docs/AlphaApi.md @@ -1,25 +1,26 @@ -# gate_api.CollateralLoanApi +# gate_api.AlphaApi All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**list_collateral_loan_orders**](CollateralLoanApi.md#list_collateral_loan_orders) | **GET** /loan/collateral/orders | Query collateral loan order list -[**create_collateral_loan**](CollateralLoanApi.md#create_collateral_loan) | **POST** /loan/collateral/orders | Place collateral loan order -[**get_collateral_loan_order_detail**](CollateralLoanApi.md#get_collateral_loan_order_detail) | **GET** /loan/collateral/orders/{order_id} | Query single order details -[**repay_collateral_loan**](CollateralLoanApi.md#repay_collateral_loan) | **POST** /loan/collateral/repay | Collateral loan repayment -[**list_repay_records**](CollateralLoanApi.md#list_repay_records) | **GET** /loan/collateral/repay_records | Query collateral loan repayment records -[**list_collateral_records**](CollateralLoanApi.md#list_collateral_records) | **GET** /loan/collateral/collaterals | Query collateral adjustment records -[**operate_collateral**](CollateralLoanApi.md#operate_collateral) | **POST** /loan/collateral/collaterals | Increase or redeem collateral -[**get_user_total_amount**](CollateralLoanApi.md#get_user_total_amount) | **GET** /loan/collateral/total_amount | Query user's total borrowing and collateral amount -[**get_user_ltv_info**](CollateralLoanApi.md#get_user_ltv_info) | **GET** /loan/collateral/ltv | Query user's collateralization ratio and remaining borrowable currencies -[**list_collateral_currencies**](CollateralLoanApi.md#list_collateral_currencies) | **GET** /loan/collateral/currencies | Query supported borrowing and collateral currencies +[**list_alpha_accounts**](AlphaApi.md#list_alpha_accounts) | **GET** /alpha/accounts | Alpha Account API +[**list_alpha_account_book**](AlphaApi.md#list_alpha_account_book) | **GET** /alpha/account_book | Alpha Account Transaction History API +[**quote_alpha_order**](AlphaApi.md#quote_alpha_order) | **POST** /alpha/quote | Alpha Quote API +[**list_alpha_order**](AlphaApi.md#list_alpha_order) | **GET** /alpha/orders | Alpha Order List API +[**place_alpha_order**](AlphaApi.md#place_alpha_order) | **POST** /alpha/orders | Alpha Order API +[**get_alpha_order**](AlphaApi.md#get_alpha_order) | **GET** /alpha/order | Alpha Single Order Query API +[**list_alpha_currencies**](AlphaApi.md#list_alpha_currencies) | **GET** /alpha/currencies | Query currency information +[**list_alpha_tickers**](AlphaApi.md#list_alpha_tickers) | **GET** /alpha/tickers | Query currency ticker +[**list_alpha_tokens**](AlphaApi.md#list_alpha_tokens) | **GET** /alpha/tokens | Query Token Information -# **list_collateral_loan_orders** -> list[CollateralOrder] list_collateral_loan_orders(page=page, limit=limit, collateral_currency=collateral_currency, borrow_currency=borrow_currency) +# **list_alpha_accounts** +> list[AccountsResponse] list_alpha_accounts() -Query collateral loan order list +Alpha Account API + +Query position assets ### Example @@ -44,34 +45,24 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.CollateralLoanApi(api_client) -page = 1 # int | Page number (optional) (default to 1) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) -collateral_currency = 'BTC' # str | Collateral currency (optional) -borrow_currency = 'USDT' # str | Borrowed currency (optional) +api_instance = gate_api.AlphaApi(api_client) try: - # Query collateral loan order list - api_response = api_instance.list_collateral_loan_orders(page=page, limit=limit, collateral_currency=collateral_currency, borrow_currency=borrow_currency) + # Alpha Account API + api_response = api_instance.list_alpha_accounts() print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling CollateralLoanApi->list_collateral_loan_orders: %s\n" % e) + print("Exception when calling AlphaApi->list_alpha_accounts: %s\n" % e) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] - **collateral_currency** | **str**| Collateral currency | [optional] - **borrow_currency** | **str**| Borrowed currency | [optional] +This endpoint does not need any parameter. ### Return type -[**list[CollateralOrder]**](CollateralOrder.md) +[**list[AccountsResponse]**](AccountsResponse.md) ### Authorization @@ -85,81 +76,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved successfully | - | +**200** | Positions queried successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **create_collateral_loan** -> OrderResp create_collateral_loan(create_collateral_order) - -Place collateral loan order - -### Example - -* Api Key Authentication (apiv4): -```python -from __future__ import print_function -import gate_api -from gate_api.exceptions import ApiException, GateApiException -# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 -# See configuration.py for a list of all supported configuration parameters. -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure APIv4 key authorization -configuration = gate_api.Configuration( - host = "https://api.gateio.ws/api/v4", - key = "YOU_API_KEY", - secret = "YOUR_API_SECRET" -) - -api_client = gate_api.ApiClient(configuration) -# Create an instance of the API class -api_instance = gate_api.CollateralLoanApi(api_client) -create_collateral_order = gate_api.CreateCollateralOrder() # CreateCollateralOrder | - -try: - # Place collateral loan order - api_response = api_instance.create_collateral_loan(create_collateral_order) - print(api_response) -except GateApiException as ex: - print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) -except ApiException as e: - print("Exception when calling CollateralLoanApi->create_collateral_loan: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_collateral_order** | [**CreateCollateralOrder**](CreateCollateralOrder.md)| | - -### Return type - -[**OrderResp**](OrderResp.md) - -### Authorization - -[apiv4](../README.md#apiv4) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Order placed successfully | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_alpha_account_book** +> list[AccountBookResponse] list_alpha_account_book(_from, to=to, page=page, limit=limit) -# **get_collateral_loan_order_detail** -> CollateralOrder get_collateral_loan_order_detail(order_id) +Alpha Account Transaction History API -Query single order details +Query asset transactions ### Example @@ -184,28 +110,34 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.CollateralLoanApi(api_client) -order_id = 100001 # int | Order ID returned when order is successfully created +api_instance = gate_api.AlphaApi(api_client) +_from = 56 # int | Start timestamp for the query +to = 56 # int | End timestamp for the query, defaults to current time if not specified (optional) +page = 56 # int | Page number (optional) +limit = 56 # int | Maximum 100 items per page (optional) try: - # Query single order details - api_response = api_instance.get_collateral_loan_order_detail(order_id) + # Alpha Account Transaction History API + api_response = api_instance.list_alpha_account_book(_from, to=to, page=page, limit=limit) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling CollateralLoanApi->get_collateral_loan_order_detail: %s\n" % e) + print("Exception when calling AlphaApi->list_alpha_account_book: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **int**| Order ID returned when order is successfully created | + **_from** | **int**| Start timestamp for the query | + **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] + **page** | **int**| Page number | [optional] + **limit** | **int**| Maximum 100 items per page | [optional] ### Return type -[**CollateralOrder**](CollateralOrder.md) +[**list[AccountBookResponse]**](AccountBookResponse.md) ### Authorization @@ -219,14 +151,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order details queried successfully | - | +**200** | Transaction history retrieved successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **repay_collateral_loan** -> RepayResp repay_collateral_loan(repay_loan) +# **quote_alpha_order** +> QuoteResponse quote_alpha_order(quote_request) + +Alpha Quote API -Collateral loan repayment +The quote_id returned by the price inquiry interface is valid for one minute; an order must be placed within this minute. If it times out, a new price inquiry is required. Rate-limited at 10 requests per second per user. ### Example @@ -251,28 +185,28 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.CollateralLoanApi(api_client) -repay_loan = gate_api.RepayLoan() # RepayLoan | +api_instance = gate_api.AlphaApi(api_client) +quote_request = gate_api.QuoteRequest() # QuoteRequest | try: - # Collateral loan repayment - api_response = api_instance.repay_collateral_loan(repay_loan) + # Alpha Quote API + api_response = api_instance.quote_alpha_order(quote_request) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling CollateralLoanApi->repay_collateral_loan: %s\n" % e) + print("Exception when calling AlphaApi->quote_alpha_order: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **repay_loan** | [**RepayLoan**](RepayLoan.md)| | + **quote_request** | [**QuoteRequest**](QuoteRequest.md)| | ### Return type -[**RepayResp**](RepayResp.md) +[**QuoteResponse**](QuoteResponse.md) ### Authorization @@ -286,14 +220,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Operation successful | - | +**200** | Quote retrieved successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_repay_records** -> list[RepayRecord] list_repay_records(source, borrow_currency=borrow_currency, collateral_currency=collateral_currency, page=page, limit=limit, _from=_from, to=to) +# **list_alpha_order** +> list[OrderResponse] list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page) -Query collateral loan repayment records +Alpha Order List API ### Example @@ -318,40 +252,40 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.CollateralLoanApi(api_client) -source = 'repay' # str | Operation type: repay - Regular repayment, liquidate - Liquidation -borrow_currency = 'USDT' # str | Borrowed currency (optional) -collateral_currency = 'BTC' # str | Collateral currency (optional) +api_instance = gate_api.AlphaApi(api_client) +currency = 'memeboxsst' # str | Trading symbol (optional) +side = 'buy' # str | Buy or sell orders - buy - sell (optional) +status = 2 # int | Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed (optional) +_from = 1627706330 # int | Start time for order query (optional) +to = 1635329650 # int | End time for order query, defaults to current time if not specified (optional) +limit = 100 # int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100) page = 1 # int | Page number (optional) (default to 1) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) -_from = 1609459200 # int | Start timestamp for the query (optional) -to = 1609459200 # int | End timestamp for the query, defaults to current time if not specified (optional) try: - # Query collateral loan repayment records - api_response = api_instance.list_repay_records(source, borrow_currency=borrow_currency, collateral_currency=collateral_currency, page=page, limit=limit, _from=_from, to=to) + # Alpha Order List API + api_response = api_instance.list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling CollateralLoanApi->list_repay_records: %s\n" % e) + print("Exception when calling AlphaApi->list_alpha_order: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **source** | **str**| Operation type: repay - Regular repayment, liquidate - Liquidation | - **borrow_currency** | **str**| Borrowed currency | [optional] - **collateral_currency** | **str**| Collateral currency | [optional] + **currency** | **str**| Trading symbol | [optional] + **side** | **str**| Buy or sell orders - buy - sell | [optional] + **status** | **int**| Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed | [optional] + **_from** | **int**| Start time for order query | [optional] + **to** | **int**| End time for order query, defaults to current time if not specified | [optional] + **limit** | **int**| Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] - **_from** | **int**| Start timestamp for the query | [optional] - **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] ### Return type -[**list[RepayRecord]**](RepayRecord.md) +[**list[OrderResponse]**](OrderResponse.md) ### Authorization @@ -365,14 +299,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Query successful | - | +**200** | List retrieved successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_collateral_records** -> list[CollateralRecord] list_collateral_records(page=page, limit=limit, _from=_from, to=to, borrow_currency=borrow_currency, collateral_currency=collateral_currency) +# **place_alpha_order** +> PlaceOrderResponse place_alpha_order(place_order_request) + +Alpha Order API -Query collateral adjustment records +Order placement interface, rate-limited at 5 requests per second per user. ### Example @@ -397,38 +333,28 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.CollateralLoanApi(api_client) -page = 1 # int | Page number (optional) (default to 1) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) -_from = 1609459200 # int | Start timestamp for the query (optional) -to = 1609459200 # int | End timestamp for the query, defaults to current time if not specified (optional) -borrow_currency = 'USDT' # str | Borrowed currency (optional) -collateral_currency = 'BTC' # str | Collateral currency (optional) +api_instance = gate_api.AlphaApi(api_client) +place_order_request = gate_api.PlaceOrderRequest() # PlaceOrderRequest | try: - # Query collateral adjustment records - api_response = api_instance.list_collateral_records(page=page, limit=limit, _from=_from, to=to, borrow_currency=borrow_currency, collateral_currency=collateral_currency) + # Alpha Order API + api_response = api_instance.place_alpha_order(place_order_request) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling CollateralLoanApi->list_collateral_records: %s\n" % e) + print("Exception when calling AlphaApi->place_alpha_order: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] - **_from** | **int**| Start timestamp for the query | [optional] - **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] - **borrow_currency** | **str**| Borrowed currency | [optional] - **collateral_currency** | **str**| Collateral currency | [optional] + **place_order_request** | [**PlaceOrderRequest**](PlaceOrderRequest.md)| | ### Return type -[**list[CollateralRecord]**](CollateralRecord.md) +[**PlaceOrderResponse**](PlaceOrderResponse.md) ### Authorization @@ -436,20 +362,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Query successful | - | +**200** | Order placed successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **operate_collateral** -> operate_collateral(collateral_align) +# **get_alpha_order** +> OrderResponse get_alpha_order(order_id) -Increase or redeem collateral +Alpha Single Order Query API ### Example @@ -474,27 +400,28 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.CollateralLoanApi(api_client) -collateral_align = gate_api.CollateralAlign() # CollateralAlign | +api_instance = gate_api.AlphaApi(api_client) +order_id = 'fdaf12321' # str | Order ID try: - # Increase or redeem collateral - api_instance.operate_collateral(collateral_align) + # Alpha Single Order Query API + api_response = api_instance.get_alpha_order(order_id) + print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling CollateralLoanApi->operate_collateral: %s\n" % e) + print("Exception when calling AlphaApi->get_alpha_order: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collateral_align** | [**CollateralAlign**](CollateralAlign.md)| | + **order_id** | **str**| Order ID | ### Return type -void (empty response body) +[**OrderResponse**](OrderResponse.md) ### Authorization @@ -502,66 +429,67 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | Operation successful | - | +**200** | Order queried successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_user_total_amount** -> UserTotalAmount get_user_total_amount() +# **list_alpha_currencies** +> list[AlphaCurrency] list_alpha_currencies(currency=currency, limit=limit, page=page) + +Query currency information -Query user's total borrowing and collateral amount +When currency is provided, query and return specified currency information; when currency is not provided, return paginated currency list ### Example -* Api Key Authentication (apiv4): ```python from __future__ import print_function import gate_api from gate_api.exceptions import ApiException, GateApiException # Defining the host is optional and defaults to https://api.gateio.ws/api/v4 # See configuration.py for a list of all supported configuration parameters. -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure APIv4 key authorization configuration = gate_api.Configuration( - host = "https://api.gateio.ws/api/v4", - key = "YOU_API_KEY", - secret = "YOUR_API_SECRET" + host = "https://api.gateio.ws/api/v4" ) api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.CollateralLoanApi(api_client) +api_instance = gate_api.AlphaApi(api_client) +currency = 'memeboxtrump' # str | Query currency information by currency symbol (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +page = 1 # int | Page number (optional) (default to 1) try: - # Query user's total borrowing and collateral amount - api_response = api_instance.get_user_total_amount() + # Query currency information + api_response = api_instance.list_alpha_currencies(currency=currency, limit=limit, page=page) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling CollateralLoanApi->get_user_total_amount: %s\n" % e) + print("Exception when calling AlphaApi->list_alpha_currencies: %s\n" % e) ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Query currency information by currency symbol | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **page** | **int**| Page number | [optional] [default to 1] ### Return type -[**UserTotalAmount**](UserTotalAmount.md) +[**list[AlphaCurrency]**](AlphaCurrency.md) ### Authorization -[apiv4](../README.md#apiv4) +No authorization required ### HTTP request headers @@ -575,62 +503,57 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_user_ltv_info** -> UserLtvInfo get_user_ltv_info(collateral_currency, borrow_currency) +# **list_alpha_tickers** +> list[AlphaTicker] list_alpha_tickers(currency=currency, limit=limit, page=page) + +Query currency ticker -Query user's collateralization ratio and remaining borrowable currencies +When currency is provided, returns ticker information for the specified currency. When currency is not provided, returns paginated ticker list ### Example -* Api Key Authentication (apiv4): ```python from __future__ import print_function import gate_api from gate_api.exceptions import ApiException, GateApiException # Defining the host is optional and defaults to https://api.gateio.ws/api/v4 # See configuration.py for a list of all supported configuration parameters. -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure APIv4 key authorization configuration = gate_api.Configuration( - host = "https://api.gateio.ws/api/v4", - key = "YOU_API_KEY", - secret = "YOUR_API_SECRET" + host = "https://api.gateio.ws/api/v4" ) api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.CollateralLoanApi(api_client) -collateral_currency = 'BTC' # str | Collateral currency -borrow_currency = 'USDT' # str | Borrowed currency +api_instance = gate_api.AlphaApi(api_client) +currency = 'memeboxtrump' # str | Query by specified currency name (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +page = 1 # int | Page number (optional) (default to 1) try: - # Query user's collateralization ratio and remaining borrowable currencies - api_response = api_instance.get_user_ltv_info(collateral_currency, borrow_currency) + # Query currency ticker + api_response = api_instance.list_alpha_tickers(currency=currency, limit=limit, page=page) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling CollateralLoanApi->get_user_ltv_info: %s\n" % e) + print("Exception when calling AlphaApi->list_alpha_tickers: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collateral_currency** | **str**| Collateral currency | - **borrow_currency** | **str**| Borrowed currency | + **currency** | **str**| Query by specified currency name | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **page** | **int**| Page number | [optional] [default to 1] ### Return type -[**UserLtvInfo**](UserLtvInfo.md) +[**list[AlphaTicker]**](AlphaTicker.md) ### Authorization -[apiv4](../README.md#apiv4) +No authorization required ### HTTP request headers @@ -644,10 +567,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_collateral_currencies** -> list[CollateralLoanCurrency] list_collateral_currencies(loan_currency=loan_currency) +# **list_alpha_tokens** +> list[Tokens] list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page) + +Query Token Information -Query supported borrowing and collateral currencies +Supports passing chain, platform, and address ### Example @@ -663,28 +588,34 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class -api_instance = gate_api.CollateralLoanApi(api_client) -loan_currency = 'BTC' # str | Parameter loan_currency. If omitted, returns all supported borrowing currencies; if provided, returns the array of collateral currencies supported for that borrowing currency (optional) +api_instance = gate_api.AlphaApi(api_client) +chain = 'solana' # str | Query Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer (optional) +launch_platform = 'pump' # str | Query Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals (optional) +address = '0x1234p' # str | Query Token List by Contract Address (optional) +page = 1 # int | Page number (optional) (default to 1) try: - # Query supported borrowing and collateral currencies - api_response = api_instance.list_collateral_currencies(loan_currency=loan_currency) + # Query Token Information + api_response = api_instance.list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling CollateralLoanApi->list_collateral_currencies: %s\n" % e) + print("Exception when calling AlphaApi->list_alpha_tokens: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loan_currency** | **str**| Parameter loan_currency. If omitted, returns all supported borrowing currencies; if provided, returns the array of collateral currencies supported for that borrowing currency | [optional] + **chain** | **str**| Query Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer | [optional] + **launch_platform** | **str**| Query Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals | [optional] + **address** | **str**| Query Token List by Contract Address | [optional] + **page** | **int**| Page number | [optional] [default to 1] ### Return type -[**list[CollateralLoanCurrency]**](CollateralLoanCurrency.md) +[**list[Tokens]**](Tokens.md) ### Authorization diff --git a/docs/AlphaCurrency.md b/docs/AlphaCurrency.md new file mode 100644 index 00000000..a27a78cf --- /dev/null +++ b/docs/AlphaCurrency.md @@ -0,0 +1,16 @@ +# AlphaCurrency + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency symbol | [optional] +**name** | **str** | Currency name | [optional] +**chain** | **str** | The main chain corresponding to the coin | [optional] +**address** | **str** | Contract Address | [optional] +**amount_precision** | **int** | Quantity precision | [optional] +**precision** | **int** | Price precision | [optional] +**status** | **int** | Currency Trading Status - `1` : Normal trading - `2` : Suspended trading - `3` : Delisted | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AlphaTicker.md b/docs/AlphaTicker.md new file mode 100644 index 00000000..3bbad98b --- /dev/null +++ b/docs/AlphaTicker.md @@ -0,0 +1,14 @@ +# AlphaTicker + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency symbol | [optional] +**last** | **str** | Last trading price | [optional] +**change** | **str** | 24h price change percentage (negative for decrease, e.g., -7.45) | [optional] +**volume** | **str** | 24h Trading Volume (USDT) | [optional] +**market_cap** | **str** | Current Token Market Cap | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AmendOptionsOrderRequest.md b/docs/AmendOptionsOrderRequest.md new file mode 100644 index 00000000..439090d8 --- /dev/null +++ b/docs/AmendOptionsOrderRequest.md @@ -0,0 +1,13 @@ +# AmendOptionsOrderRequest + +Order Modification Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract** | **str** | Options contract name | +**price** | **str** | Order Price | +**size** | **int** | Trade amount | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseAssetSwapConfig.md b/docs/ApiResponseAssetSwapConfig.md new file mode 100644 index 00000000..bd660224 --- /dev/null +++ b/docs/ApiResponseAssetSwapConfig.md @@ -0,0 +1,15 @@ +# ApiResponseAssetSwapConfig + +Asset allocation optimization - configure unified response +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code, 0 means success | +**label** | **str** | Error identification code, empty string on success | [optional] +**message** | **str** | Description information | +**data** | **object** | Front-end configuration on success, null on failure | +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseAssetSwapEvaluate.md b/docs/ApiResponseAssetSwapEvaluate.md new file mode 100644 index 00000000..07751aef --- /dev/null +++ b/docs/ApiResponseAssetSwapEvaluate.md @@ -0,0 +1,15 @@ +# ApiResponseAssetSwapEvaluate + +Asset allocation optimization-unified response to valuation +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code, 0 means success | +**label** | **str** | Error identification code, empty string on success | [optional] +**message** | **str** | Description information | +**data** | **object** | Estimated paginated data on success, null on failure | +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseAssetSwapListAssets.md b/docs/ApiResponseAssetSwapListAssets.md new file mode 100644 index 00000000..4055ea9f --- /dev/null +++ b/docs/ApiResponseAssetSwapListAssets.md @@ -0,0 +1,15 @@ +# ApiResponseAssetSwapListAssets + +Asset allocation optimization - unified response to currency list +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code, 0 means success | +**label** | **str** | Error identification code, empty string on success | [optional] +**message** | **str** | Description information | +**data** | **object** | Currency list data on success, null on failure | +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseAssetSwapOrderCreateV1.md b/docs/ApiResponseAssetSwapOrderCreateV1.md new file mode 100644 index 00000000..c5f49068 --- /dev/null +++ b/docs/ApiResponseAssetSwapOrderCreateV1.md @@ -0,0 +1,15 @@ +# ApiResponseAssetSwapOrderCreateV1 + +Asset allocation optimization - unified response to orders +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code, 0 means success | +**label** | **str** | Error identification code, empty string on success | [optional] +**message** | **str** | Description information | +**data** | **object** | It is the order result when successful, and null when it fails. | +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseAssetSwapOrderListV1.md b/docs/ApiResponseAssetSwapOrderListV1.md new file mode 100644 index 00000000..d3c79bf5 --- /dev/null +++ b/docs/ApiResponseAssetSwapOrderListV1.md @@ -0,0 +1,15 @@ +# ApiResponseAssetSwapOrderListV1 + +Asset allocation optimization - unified response to order list +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code, 0 means success | +**label** | **str** | Error identification code, empty string on success | [optional] +**message** | **str** | Description information | +**data** | **object** | Order list data on success, null on failure | +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseAssetSwapOrderPreviewV1.md b/docs/ApiResponseAssetSwapOrderPreviewV1.md new file mode 100644 index 00000000..94a72274 --- /dev/null +++ b/docs/ApiResponseAssetSwapOrderPreviewV1.md @@ -0,0 +1,15 @@ +# ApiResponseAssetSwapOrderPreviewV1 + +Asset allocation optimization-preview unified response +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code, 0 means success | +**label** | **str** | Error identification code, empty string on success | [optional] +**message** | **str** | Description information | +**data** | **object** | Preview result when successful, null when failed | +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseAssetSwapOrderQueryV1.md b/docs/ApiResponseAssetSwapOrderQueryV1.md new file mode 100644 index 00000000..ad9bed29 --- /dev/null +++ b/docs/ApiResponseAssetSwapOrderQueryV1.md @@ -0,0 +1,15 @@ +# ApiResponseAssetSwapOrderQueryV1 + +Asset allocation optimization - unified response to query orders +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code, 0 means success | +**label** | **str** | Error identification code, empty string on success | [optional] +**message** | **str** | Description information | +**data** | **object** | Order details on success, null on failure | +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseExSkillClaimRewardResp.md b/docs/ApiResponseExSkillClaimRewardResp.md new file mode 100644 index 00000000..ba9b9dd7 --- /dev/null +++ b/docs/ApiResponseExSkillClaimRewardResp.md @@ -0,0 +1,15 @@ +# ApiResponseExSkillClaimRewardResp + +Receive mission reward response +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code, 0 means success | [optional] +**label** | **str** | Error identifier code. Empty string on success, machine-readable error label on error | [optional] +**message** | **str** | Error description | [optional] +**data** | [**ApiResponseExSkillClaimRewardRespData**](ApiResponseExSkillClaimRewardRespData.md) | | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseExSkillClaimRewardRespData.md b/docs/ApiResponseExSkillClaimRewardRespData.md new file mode 100644 index 00000000..d3e0e126 --- /dev/null +++ b/docs/ApiResponseExSkillClaimRewardRespData.md @@ -0,0 +1,12 @@ +# ApiResponseExSkillClaimRewardRespData + +Get reward results +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_m_n_task** | **bool** | Whether to choose n prize pool tasks for m. When it is true, it only prompts a jump and does not actually issue prizes. | [optional] +**coupon_full_name** | **str** | The full name of the card reward. It is an empty string when it is not a coupon reward or cannot be parsed. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseExSkillClaimTaskResp.md b/docs/ApiResponseExSkillClaimTaskResp.md new file mode 100644 index 00000000..4b33e3da --- /dev/null +++ b/docs/ApiResponseExSkillClaimTaskResp.md @@ -0,0 +1,15 @@ +# ApiResponseExSkillClaimTaskResp + +Receive task response +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code, 0 means success | [optional] +**label** | **str** | Error identifier code. Empty string on success, machine-readable error label on error | [optional] +**message** | **str** | Error description | [optional] +**data** | [**object**](.md) | Empty object {} on success | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseExSkillGetBeginnerTaskListResp.md b/docs/ApiResponseExSkillGetBeginnerTaskListResp.md new file mode 100644 index 00000000..8b9c47e6 --- /dev/null +++ b/docs/ApiResponseExSkillGetBeginnerTaskListResp.md @@ -0,0 +1,15 @@ +# ApiResponseExSkillGetBeginnerTaskListResp + +Get beginner task list response +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code: 0 = success, 1007 = no task data, 1008 = not logged in | +**label** | **str** | Error identifier code. Empty string on success, machine-readable error label on error | [optional] +**message** | **str** | Error description | [optional] +**data** | [**ApiResponseExSkillGetBeginnerTaskListRespData**](ApiResponseExSkillGetBeginnerTaskListRespData.md) | | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseExSkillGetBeginnerTaskListRespData.md b/docs/ApiResponseExSkillGetBeginnerTaskListRespData.md new file mode 100644 index 00000000..2ace924a --- /dev/null +++ b/docs/ApiResponseExSkillGetBeginnerTaskListRespData.md @@ -0,0 +1,11 @@ +# ApiResponseExSkillGetBeginnerTaskListRespData + +Task list object on success, null on failure +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tasks** | [**list[ApiResponseExSkillGetBeginnerTaskListRespDataTasks]**](ApiResponseExSkillGetBeginnerTaskListRespDataTasks.md) | Getting started task list (registration tasks come first, guidance tasks follow; when conditions are met, an additional download task to be collected will be returned) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseExSkillGetBeginnerTaskListRespDataTasks.md b/docs/ApiResponseExSkillGetBeginnerTaskListRespDataTasks.md new file mode 100644 index 00000000..9d34c8db --- /dev/null +++ b/docs/ApiResponseExSkillGetBeginnerTaskListRespDataTasks.md @@ -0,0 +1,19 @@ +# ApiResponseExSkillGetBeginnerTaskListRespDataTasks + +Getting started mission information. `task_center_id` and `status` are included in required: both are allowed to be 0 (registration tasks, download tasks to be received), And avoid Go SDK using omitempty for integer zero values, which will cause fields to be lost during client serialization. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**welfare_task_id** | **int** | Rewards Center task ID | [optional] +**task_center_id** | **int** | Task center task ID (fixed at 0 for registration tasks) | +**task_type** | **int** | Task type: 1=KYC secondary certification 2=Spot 3=Contract 4=Invitation 5=Quantification 6=Yu Bibao 7=startup 8=First deposit 10=Registration task 11=Guide task 23=Download task | [optional] +**task_name** | **str** | Task name | [optional] +**task_desc** | **str** | Task description, may contain <span> highlight tags | [optional] +**reward_num** | **str** | Reward value | [optional] +**reward_unit** | **str** | Reward unit (e.g., USDT, BTC) | [optional] +**prize_type** | **int** | Reward type: 1 = points, 2 = regular coupon, 3 = VIP coupon | [optional] +**status** | **int** | Task status: 0=Not claimed (typically a download task waiting to be claimed) 1=Received/in progress 2=Completed and waiting to be claimed 3=Rewards in progress 4=Completed/settled 5=Expired | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ApiResponseExSkillGetUserIdentityResp.md b/docs/ApiResponseExSkillGetUserIdentityResp.md new file mode 100644 index 00000000..43c48ea7 --- /dev/null +++ b/docs/ApiResponseExSkillGetUserIdentityResp.md @@ -0,0 +1,15 @@ +# ApiResponseExSkillGetUserIdentityResp + +Get user identity response +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business error code: 0 = success, 1001 = existing user, 1002 = risk-controlled user, 1003 = sub-account, 1004 = agent, 1005 = market maker, 1006 = enterprise account, 1008 = not logged in | [optional] +**label** | **str** | Error identifier code. Empty string on success, machine-readable error label on error | [optional] +**message** | **str** | Error description | [optional] +**data** | [**object**](.md) | Empty object {} on success, null on failure | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RepayResp.md b/docs/AssetListResp.md similarity index 67% rename from docs/RepayResp.md rename to docs/AssetListResp.md index f7124e3f..3689bdef 100644 --- a/docs/RepayResp.md +++ b/docs/AssetListResp.md @@ -1,11 +1,9 @@ -# RepayResp +# AssetListResp -Repay ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**repaid_principal** | **str** | Principal | [optional] -**repaid_interest** | **str** | Interest | [optional] +**list** | **list[str]** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AssetSwapFrontend.md b/docs/AssetSwapFrontend.md new file mode 100644 index 00000000..f5cfe792 --- /dev/null +++ b/docs/AssetSwapFrontend.md @@ -0,0 +1,19 @@ +# AssetSwapFrontend + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset_evaluate_range** | **list[int]** | | +**banner_reappear_interval_hours** | **int** | | +**convert_currencies** | **list[str]** | | +**convert_currencies_v2** | [**list[ConvertCurrenciesV2Item]**](ConvertCurrenciesV2Item.md) | | +**default** | **dict(str, str)** | Mapping of string keys to string values, corresponding to Go's map[string]string. | +**max_select_currencies** | **int** | | +**min_evaluate_value** | **str** | | +**recommend** | [**Recommend**](Recommend.md) | | +**recommend_v2** | **dict(str, list[RecommendV2Strategy])** | Mapping of strategy grouping keys to RecommendV2Strategy lists. | +**title_tips** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AssetswapApi.md b/docs/AssetswapApi.md new file mode 100644 index 00000000..95924979 --- /dev/null +++ b/docs/AssetswapApi.md @@ -0,0 +1,506 @@ +# gate_api.AssetswapApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_asset_swap_assets**](AssetswapApi.md#list_asset_swap_assets) | **GET** /asset-swap/asset/list | Portfolio optimization — currency list +[**get_asset_swap_config**](AssetswapApi.md#get_asset_swap_config) | **GET** /asset-swap/config | Portfolio optimization — configuration +[**evaluate_asset_swap**](AssetswapApi.md#evaluate_asset_swap) | **GET** /asset-swap/evaluate | Portfolio optimization — valuation +[**create_asset_swap_order_v1**](AssetswapApi.md#create_asset_swap_order_v1) | **POST** /asset-swap/order/create | Portfolio optimization — place order +[**list_asset_swap_orders_v1**](AssetswapApi.md#list_asset_swap_orders_v1) | **GET** /asset-swap/order/list | Portfolio optimization — order list +[**preview_asset_swap_order_v1**](AssetswapApi.md#preview_asset_swap_order_v1) | **POST** /asset-swap/order/preview | Portfolio optimization — preview +[**get_asset_swap_order_v1**](AssetswapApi.md#get_asset_swap_order_v1) | **GET** /asset-swap/order/{order_id} | Portfolio optimization — query order + + +# **list_asset_swap_assets** +> ApiResponseAssetSwapListAssets list_asset_swap_assets() + +Portfolio optimization — currency list + +Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.AssetswapApi(api_client) + +try: + # Portfolio optimization — currency list + api_response = api_instance.list_asset_swap_assets() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling AssetswapApi->list_asset_swap_assets: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ApiResponseAssetSwapListAssets**](ApiResponseAssetSwapListAssets.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | HTTP 200, business results are distinguished by the code field | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_asset_swap_config** +> ApiResponseAssetSwapConfig get_asset_swap_config() + +Portfolio optimization — configuration + +Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.AssetswapApi(api_client) + +try: + # Portfolio optimization — configuration + api_response = api_instance.get_asset_swap_config() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling AssetswapApi->get_asset_swap_config: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ApiResponseAssetSwapConfig**](ApiResponseAssetSwapConfig.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | HTTP 200, business results are distinguished by the code field | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **evaluate_asset_swap** +> ApiResponseAssetSwapEvaluate evaluate_asset_swap(max_evaluate_value=max_evaluate_value, cursor=cursor, size=size) + +Portfolio optimization — valuation + +Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.AssetswapApi(api_client) +max_evaluate_value = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +cursor = 'cursor_example' # str | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +size = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) + +try: + # Portfolio optimization — valuation + api_response = api_instance.evaluate_asset_swap(max_evaluate_value=max_evaluate_value, cursor=cursor, size=size) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling AssetswapApi->evaluate_asset_swap: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **max_evaluate_value** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **cursor** | **str**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **size** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + +### Return type + +[**ApiResponseAssetSwapEvaluate**](ApiResponseAssetSwapEvaluate.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | HTTP 200, business results are distinguished by the code field | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_asset_swap_order_v1** +> ApiResponseAssetSwapOrderCreateV1 create_asset_swap_order_v1(order_create_v1_req) + +Portfolio optimization — place order + +Swap several source currencies in the account into the target currency side configuration according to the specified amount. **It is strongly recommended to call** `POST /asset-swap/order/preview` **and `code=0` before placing an official order, and then submit this interface with consistent semantics**. **The request body does not contain `ratio`** - This interface `OrderCreateV1Req` only contains `from` / `to`, and the array elements are all `CreateParam` (**only** `asset` + `amount`). **Do not** pass in `ratio` in the order JSON; the ratio field `ratio` only exists in the preview interface `OrderPreviewV1Req.to` (`PreviewToParam`). **Key differences from the preview interface (error-prone points)** - The `to` array element of this interface is `CreateParam`: **`asset` + `amount` (target side quantity, decimal string)**. - The preview interface `to` is **`asset` + `ratio` (ratio string)**, **the two cannot be mixed**: do not fill in the `ratio` in the preview to the `amount` of the order as it is, and do not use the `amount` of the order as the `ratio` of the preview. **Recommended calling order** 1. `GET /asset-swap/asset/list`: Confirm currency support. 2. `GET /asset-swap/config`: Read `recommend` / `recommend_v2` (such as `schemes` of a strategy under `recommend_v2.market`, use `scheme.name` as the target `asset`, `scheme.ratio` is only used for `to[].ratio` of **preview**). 3. `GET /asset-swap/evaluate` (optional): Refer to the sellable quantity. 4. `POST /asset-swap/order/preview`: `from` and `to` (ratio) construct inquiry. 5. After the preview is successful, map the preview results to the `from`/`to` (**both are amount**) of the order according to the product/server agreement and then call this interface. **Field Convention** - `from`: selling side, each item is `asset` + `amount` (string, decimal, indicating the selling amount of the currency). - `to`: Buy/target side, each item is `asset` + **`amount`** (string, decimal, indicating the amount of the target currency side; the semantics are different from the previewed `ratio`). - This interface only verifies the accuracy and range of the above `amount`; if not satisfied, it returns non-0 `code` and `message`. For the verification rules of `to[].ratio` on the preview side, see the `POST /asset-swap/order/preview` document. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.AssetswapApi(api_client) +order_create_v1_req = gate_api.OrderCreateV1Req() # OrderCreateV1Req | Order request body (`OrderCreateV1Req`). **No `ratio` field**; `from`/`to` items are only `asset` + `amount`. `to` uses the target side **amount** `amount`, which is different from the **ratio** (ratio) semantics of `to` in preview, do not mix them. + +try: + # Portfolio optimization — place order + api_response = api_instance.create_asset_swap_order_v1(order_create_v1_req) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling AssetswapApi->create_asset_swap_order_v1: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_create_v1_req** | [**OrderCreateV1Req**](OrderCreateV1Req.md)| Order request body (`OrderCreateV1Req`). **No `ratio` field**; `from`/`to` items are only `asset` + `amount`. `to` uses the target side **amount** `amount`, which is different from the **ratio** (ratio) semantics of `to` in preview, do not mix them. | + +### Return type + +[**ApiResponseAssetSwapOrderCreateV1**](ApiResponseAssetSwapOrderCreateV1.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | HTTP 200, business results are distinguished by the code field | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_asset_swap_orders_v1** +> ApiResponseAssetSwapOrderListV1 list_asset_swap_orders_v1(_from=_from, to=to, status=status, offset=offset, size=size, sort_mode=sort_mode, order_by=order_by) + +Portfolio optimization — order list + +Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.AssetswapApi(api_client) +_from = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +to = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +status = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +offset = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +size = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +sort_mode = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +order_by = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) + +try: + # Portfolio optimization — order list + api_response = api_instance.list_asset_swap_orders_v1(_from=_from, to=to, status=status, offset=offset, size=size, sort_mode=sort_mode, order_by=order_by) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling AssetswapApi->list_asset_swap_orders_v1: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_from** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **to** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **status** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **offset** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **size** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **sort_mode** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **order_by** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + +### Return type + +[**ApiResponseAssetSwapOrderListV1**](ApiResponseAssetSwapOrderListV1.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | HTTP 200, business results are distinguished by the code field | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **preview_asset_swap_order_v1** +> ApiResponseAssetSwapOrderPreviewV1 preview_asset_swap_order_v1(order_preview_v1_req) + +Portfolio optimization — preview + +The transaction and fees are estimated based on the quantity of coins sold and the **target allocation ratio**, and **no orders are written**. When `code=0`, `data` contains estimated `order` and `transaction_fee`. **Key differences from the order interface (error-prone points)** - The `to` array element of this interface is `PreviewToParam`: **`asset` + `ratio` (ratio, decimal string)**, which represents the weight/proportion of the target currency in the portfolio. - The `to` of the order interface `POST /asset-swap/order/create` is **`asset` + `amount` (absolute quantity)**, **not** `ratio`. Callers should never mix the two sets of fields. **How to construct `to`(ratio)** - Prioritize the value from `data.recommend_v2` of `GET /asset-swap/config`: find a certain `RecommendV2Strategy` in the strategy list (such as `name` is `top2`) by grouping key (such as `market`, `faith`, `conservative`), and map its `schemes` to a preview request: - `to[].asset` ← `scheme.name` (target currency symbol) - `to[].ratio` ← `scheme.ratio` (ratio string consistent with configuration) - You can also use the flat map (currency → ratio string) under `recommend` to expand it into a multi-element `to` (one `asset` + `ratio` for each item). - When there are multiple targets, it is recommended that each `ratio` be consistent with the front-end/operation configuration; whether it needs to be summed to 1 is subject to server-side verification. **`from` (sell side)** - Each item is `asset` + `amount` (string, decimal), indicating the amount of the currency participating in the exchange this time. The currency should be within the supported range of `GET /asset-swap/asset/list`; when the magnitude is too small or the market depth is insufficient, a non-0 `code` may be returned (if the price cannot be inquired). **Connection with order placement** - After the preview is successful, convert the preview results allowed by the business into the request body where **`from`/`to` is all amount** required for ordering and then call create (the specific mapping rules are subject to the product documentation or server agreement). + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.AssetswapApi(api_client) +order_preview_v1_req = gate_api.OrderPreviewV1Req() # OrderPreviewV1Req | Preview the request body. `to` must be **ratio**; unlike create's **amount** semantics. + +try: + # Portfolio optimization — preview + api_response = api_instance.preview_asset_swap_order_v1(order_preview_v1_req) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling AssetswapApi->preview_asset_swap_order_v1: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_preview_v1_req** | [**OrderPreviewV1Req**](OrderPreviewV1Req.md)| Preview the request body. `to` must be **ratio**; unlike create's **amount** semantics. | + +### Return type + +[**ApiResponseAssetSwapOrderPreviewV1**](ApiResponseAssetSwapOrderPreviewV1.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | HTTP 200, business results are distinguished by the code field | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_asset_swap_order_v1** +> ApiResponseAssetSwapOrderQueryV1 get_asset_swap_order_v1(order_id) + +Portfolio optimization — query order + +Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.AssetswapApi(api_client) +order_id = 'order_id_example' # str | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + +try: + # Portfolio optimization — query order + api_response = api_instance.get_asset_swap_order_v1(order_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling AssetswapApi->get_asset_swap_order_v1: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | + +### Return type + +[**ApiResponseAssetSwapOrderQueryV1**](ApiResponseAssetSwapOrderQueryV1.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | HTTP 200, business results are distinguished by the code field | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/AutoInvestCoinsItem.md b/docs/AutoInvestCoinsItem.md new file mode 100644 index 00000000..cafbca59 --- /dev/null +++ b/docs/AutoInvestCoinsItem.md @@ -0,0 +1,14 @@ +# AutoInvestCoinsItem + +Currency item supporting auto invest +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | Currency code | +**value** | **str** | Currency name | +**asset_icon_url** | **str** | Currency icon URL | +**sort** | **int** | Sort | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestConfigItem.md b/docs/AutoInvestConfigItem.md new file mode 100644 index 00000000..b63851c0 --- /dev/null +++ b/docs/AutoInvestConfigItem.md @@ -0,0 +1,12 @@ +# AutoInvestConfigItem + +Investment currency configuration item +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**coin** | **str** | Currency | +**max_limit** | **str** | InvestmentLimit | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestMinInvestAmount.md b/docs/AutoInvestMinInvestAmount.md new file mode 100644 index 00000000..da98ea78 --- /dev/null +++ b/docs/AutoInvestMinInvestAmount.md @@ -0,0 +1,12 @@ +# AutoInvestMinInvestAmount + +QueryAvailableInvestmentMinimumAmountRequest +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**money** | **str** | Currency, optional: USDT or BTC | +**items** | [**list[AutoInvestMinInvestAmountItems]**](AutoInvestMinInvestAmountItems.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StructuredBuy.md b/docs/AutoInvestMinInvestAmountItems.md similarity index 67% rename from docs/StructuredBuy.md rename to docs/AutoInvestMinInvestAmountItems.md index 2c5428f2..7d267d40 100644 --- a/docs/StructuredBuy.md +++ b/docs/AutoInvestMinInvestAmountItems.md @@ -1,11 +1,10 @@ -# StructuredBuy +# AutoInvestMinInvestAmountItems -Dual Investment Buy ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pid** | **str** | Product ID | [optional] -**amount** | **str** | Buy Quantity | [optional] +**asset** | **str** | Currency | +**ratio** | **str** | Ratio,e.g.100 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AutoInvestMinInvestAmountResp.md b/docs/AutoInvestMinInvestAmountResp.md new file mode 100644 index 00000000..beb6cb56 --- /dev/null +++ b/docs/AutoInvestMinInvestAmountResp.md @@ -0,0 +1,11 @@ +# AutoInvestMinInvestAmountResp + +AvailableInvestmentMinimumAmountResponse +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**min_amount** | **str** | MinimumAmount | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestOrderItem.md b/docs/AutoInvestOrderItem.md new file mode 100644 index 00000000..d991cb4e --- /dev/null +++ b/docs/AutoInvestOrderItem.md @@ -0,0 +1,26 @@ +# AutoInvestOrderItem + +Auto invest order item +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | +**type** | **str** | Type | +**amount** | **str** | Size | +**plan_id** | **int** | Plan ID | +**side** | **int** | direction | +**asset** | **str** | Currency | +**record_id** | **int** | Record ID | +**total_money** | **str** | TotalAmount | +**market** | **str** | Currency pair | +**price** | **str** | Price | +**create_time** | **int** | Creation time (Unix timestamp) | +**total** | **str** | Total | +**fund_flow** | **str** | Fund Flow Direction | +**error_code** | **int** | Error code | +**error_msg** | **str** | Error message | +**status** | **int** | Status | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPlanAddPosition.md b/docs/AutoInvestPlanAddPosition.md new file mode 100644 index 00000000..c6fe23c2 --- /dev/null +++ b/docs/AutoInvestPlanAddPosition.md @@ -0,0 +1,12 @@ +# AutoInvestPlanAddPosition + +Add position immediatelyRequest +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**plan_id** | **int** | Plan ID | +**amount** | **str** | Amount | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPlanCreate.md b/docs/AutoInvestPlanCreate.md new file mode 100644 index 00000000..9dfcd54d --- /dev/null +++ b/docs/AutoInvestPlanCreate.md @@ -0,0 +1,21 @@ +# AutoInvestPlanCreate + +Create auto invest planRequest +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**plan_name** | **str** | Plan name。Length: 0-50 characters | [optional] +**plan_des** | **str** | Plan description | [optional] +**plan_money** | **str** | Pricing currency,SupportUSDT,BTC | +**plan_amount** | **str** | Per PeriodAuto InvestAmount,Must > 0,and not exceedThePricing currencyConfigurationSingleMaximumAmount | +**plan_period_type** | **str** | Enum: daily, weekly, biweekly, monthly, hourly, 4-hourly | +**plan_period_day** | **int** | Cycle day. For monthly: day of month (1-30); For weekly/biweekly: day of week (1-7, 1=Monday); For daily/hourly/4-hourly: ignored | +**plan_period_hour** | **int** | Execution hourAuto Invest 0-23 | +**items** | [**list[AutoInvestPlanCreateItems]**](AutoInvestPlanCreateItems.md) | Investment portfolio, asset cannot be repeated; Sum of all items' ratios must be 100 | +**fund_source** | **str** | Fund source: spot or earn, default: spot | [optional] +**fund_flow** | **str** | Fund flow direction: auto_invest or earn, default: auto_invest | [optional] +**type** | **int** | 0 Normal creation, 1 QuickInvestment | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPlanCreateItems.md b/docs/AutoInvestPlanCreateItems.md new file mode 100644 index 00000000..7e127500 --- /dev/null +++ b/docs/AutoInvestPlanCreateItems.md @@ -0,0 +1,11 @@ +# AutoInvestPlanCreateItems + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | Investment currency, e.g., BTC; Must be enabled and market exists; Cannot be repeated within the same plan | +**ratio** | **str** | The proportion of this currency in the portfolio,The sum of all items' ratios must be 100 | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPlanCreateResp.md b/docs/AutoInvestPlanCreateResp.md new file mode 100644 index 00000000..fcc16e78 --- /dev/null +++ b/docs/AutoInvestPlanCreateResp.md @@ -0,0 +1,19 @@ +# AutoInvestPlanCreateResp + +Create auto invest planResponse +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Plan ID | +**amount** | **str** | Per PeriodAuto InvestAmount | [optional] +**money** | **str** | Quote currency | [optional] +**next_time** | **int** | Next execution time | [optional] +**period_type** | **str** | Cycle type | [optional] +**period_day** | **int** | Cycle day | [optional] +**period_hour** | **int** | CycleHours | [optional] +**fund_flow** | **str** | Fund Flow Direction | [optional] +**fund_source** | **str** | Fund source | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPlanDetail.md b/docs/AutoInvestPlanDetail.md new file mode 100644 index 00000000..6b0ecd0b --- /dev/null +++ b/docs/AutoInvestPlanDetail.md @@ -0,0 +1,26 @@ +# AutoInvestPlanDetail + +Auto invest planDetails +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Plan ID | +**version** | **int** | PlanVersion | [optional] +**name** | **str** | Plan name | +**create_time** | **int** | Creation time (Unix timestamp) | +**update_time** | **int** | Update time (Unix timestamp) | +**user_id** | **int** | User ID | +**money** | **str** | Quote Currency | +**amount** | **str** | Per PeriodInvestment amount | +**period_type** | **str** | Cycle type(e.g., monthly) | +**period_day** | **int** | Cycle day | +**period_hour** | **int** | CycleHours | +**portfolio** | [**list[AutoInvestPortfolioItem]**](AutoInvestPortfolioItem.md) | Portfolio | +**next_time** | **int** | Next execution time (Unix timestamp) | +**period** | **int** | Executed periods | +**fund_source** | **str** | Fund source(spot/earn) | +**fund_flow** | **str** | Fund flow direction (auto_invest/earn) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPlanListInfoResp.md b/docs/AutoInvestPlanListInfoResp.md new file mode 100644 index 00000000..81d3b0e0 --- /dev/null +++ b/docs/AutoInvestPlanListInfoResp.md @@ -0,0 +1,15 @@ +# AutoInvestPlanListInfoResp + +Auto invest planListPaginatedResponse +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | page number | +**page_size** | **int** | Items per page | +**page_count** | **int** | Total pages | +**total_count** | **int** | Total entries | +**list** | [**list[AutoInvestPlanDetail]**](AutoInvestPlanDetail.md) | PlanList | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPlanRecordItem.md b/docs/AutoInvestPlanRecordItem.md new file mode 100644 index 00000000..419f5b99 --- /dev/null +++ b/docs/AutoInvestPlanRecordItem.md @@ -0,0 +1,25 @@ +# AutoInvestPlanRecordItem + +Plan execution record item +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Record ID | +**type** | **str** | Type | +**money** | **str** | SourceCurrency | +**user_id** | **int** | User ID | +**plan_id** | **int** | Plan ID | +**plan_version** | **int** | PlanVersion | +**amount** | **str** | Investment amount | +**create_time** | **int** | Investment time | +**update_time** | **int** | Update time | +**status** | **str** | Status | +**status_type** | **int** | Status enum | +**side** | **int** | 2 = Buy, Other = Sell | +**status_message** | **str** | Status description | +**detail** | **str** | Details | [optional] +**asset** | **str** | Currency | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPlanRecordsResp.md b/docs/AutoInvestPlanRecordsResp.md new file mode 100644 index 00000000..2be4b64d --- /dev/null +++ b/docs/AutoInvestPlanRecordsResp.md @@ -0,0 +1,15 @@ +# AutoInvestPlanRecordsResp + +PlanExecutionRecordPaginatedResponse +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | page number | +**page_size** | **int** | Items per page | +**total_page** | **int** | TotalPage number | +**total** | **int** | Total entries | +**list** | [**list[AutoInvestPlanRecordItem]**](AutoInvestPlanRecordItem.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPlanStop.md b/docs/AutoInvestPlanStop.md new file mode 100644 index 00000000..283a566e --- /dev/null +++ b/docs/AutoInvestPlanStop.md @@ -0,0 +1,11 @@ +# AutoInvestPlanStop + +StopAuto invest planRequest +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**plan_id** | **int** | Plan ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPlanUpdate.md b/docs/AutoInvestPlanUpdate.md new file mode 100644 index 00000000..d4bbadb7 --- /dev/null +++ b/docs/AutoInvestPlanUpdate.md @@ -0,0 +1,13 @@ +# AutoInvestPlanUpdate + +Update auto invest plan request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**plan_id** | **int** | Plan ID | +**fund_source** | **str** | Fund source Spotspot or Flexible Savingsearn,Default spot | [optional] +**fund_flow** | **str** | Fund Flow Direction Spotauto_invest or Flexible Savingsearn,Default auto_invest | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AutoInvestPortfolioItem.md b/docs/AutoInvestPortfolioItem.md new file mode 100644 index 00000000..8ea3cacf --- /dev/null +++ b/docs/AutoInvestPortfolioItem.md @@ -0,0 +1,18 @@ +# AutoInvestPortfolioItem + +Auto invest plan portfolio item +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | Currency | +**ratio** | **str** | Ratio | +**cum_invest** | **str** | Accumulated investment | +**cum_hold** | **str** | AccumulatedPosition | +**cum_redeem** | **str** | Accumulated redemption | +**avg_price** | **str** | Average Cost Price | +**redeem_status** | **int** | Redemption status | +**lend_amount** | **str** | LendingQuantity | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AwardListStructList.md b/docs/AwardListStructList.md index 5c978adb..0faea434 100644 --- a/docs/AwardListStructList.md +++ b/docs/AwardListStructList.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **reward_coin** | **str** | Reward currency | **interest** | **str** | Interest amount | **fee** | **str** | fee | -**status** | **int** | Status | +**status** | **int** | Status. 4 - success | **bonus_date** | **str** | Date | **should_bonus_stamp** | **int** | Scheduled distribution timestamp | diff --git a/docs/BaseResponse.md b/docs/BaseResponse.md new file mode 100644 index 00000000..f21c03a2 --- /dev/null +++ b/docs/BaseResponse.md @@ -0,0 +1,13 @@ +# BaseResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Error Code, 0 Indicates Success | +**message** | **str** | Error message description | +**data** | [**object**](.md) | Response data | +**timestamp** | **int** | Unix timestamp | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchAmendItem.md b/docs/BatchAmendItem.md index 62bc971e..124bbfd8 100644 --- a/docs/BatchAmendItem.md +++ b/docs/BatchAmendItem.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **price** | **str** | Trading Price. Only one of `amount` or `price` can be specified | [optional] **amend_text** | **str** | Custom info during order amendment | [optional] **action_mode** | **str** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional] +**stop_profit** | [**SpotOrderStopProfit**](SpotOrderStopProfit.md) | | [optional] +**stop_loss** | [**SpotOrderStopLoss**](SpotOrderStopLoss.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BatchAmendOrderReq.md b/docs/BatchAmendOrderReq.md index 26c064e3..bda63a6a 100644 --- a/docs/BatchAmendOrderReq.md +++ b/docs/BatchAmendOrderReq.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **size** | **str** | New order size, including filled size. - If less than or equal to the filled quantity, the order will be cancelled. - The new order side must be identical to the original one. - Close order size cannot be modified. - For reduce-only orders, increasing the size may cancel other reduce-only orders. - If the price is not modified, decreasing the size will not affect the depth queue, while increasing the size will place it at the end of the current price level. | [optional] **price** | **str** | New order price | [optional] **amend_text** | **str** | Custom info during order amendment | [optional] +**action_mode** | **str** | Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BatchFundingRatesRequest.md b/docs/BatchFundingRatesRequest.md new file mode 100644 index 00000000..c24b109b --- /dev/null +++ b/docs/BatchFundingRatesRequest.md @@ -0,0 +1,10 @@ +# BatchFundingRatesRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contracts** | **list[str]** | Array of Contract Names | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchFundingRatesResponse.md b/docs/BatchFundingRatesResponse.md new file mode 100644 index 00000000..e0c97cb4 --- /dev/null +++ b/docs/BatchFundingRatesResponse.md @@ -0,0 +1,11 @@ +# BatchFundingRatesResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract** | **str** | Contract name | [optional] +**data** | [**list[FundingRateRecord]**](FundingRateRecord.md) | Array of Funding Rates | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchOrder.md b/docs/BatchOrder.md index 1b1880c3..7d0eb646 100644 --- a/docs/BatchOrder.md +++ b/docs/BatchOrder.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **update_time** | **str** | Last modification time of order | [optional] [readonly] **create_time_ms** | **int** | Creation time of order (in milliseconds) | [optional] [readonly] **update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly] -**status** | **str** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] +**status** | **str** | Order status - `open`: to be filled - `closed`: closed order - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **str** | Currency pair | [optional] **type** | **str** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] **account** | **str** | Account type, spot - spot account, margin - leveraged account, unified - unified account | [optional] [default to 'spot'] @@ -40,8 +40,10 @@ Name | Type | Description | Notes **rebated_fee_currency** | **str** | Rebated fee currency unit | [optional] [readonly] **stp_id** | **int** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly] **stp_act** | **str** | Self-Trading Prevention Action. Users can use this field to set self-trade prevetion strategies 1. After users join the `STP Group`, he can pass `stp_act` to limit the user's self-trade prevetion strategy. If `stp_act` is not passed, the default is `cn` strategy。 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter。 3. If the user did not use 'stp_act' when placing the order, 'stp_act' will return '-' - cn: Cancel newest, Cancel new orders and keep old ones - co: Cancel oldest, new ones - cb: Cancel both, Both old and new orders will be cancelled | [optional] -**finish_as** | **str** | How the order was finished. - open: processing - filled: filled totally - cancelled: manually cancelled - ioc: time in force is `IOC`, finish immediately - stp: cancelled because self trade prevention | [optional] [readonly] -**slippage** | **str** | Slippage, default limit range 0.0001-0.05, converted to percentage is 0.01%-5%, indicating the acceptable price difference for market order transactions | [optional] +**finish_as** | **str** | How the order finished: - open: Pending processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled by liquidation - small: Order size too small - depth_not_enough: Cancelled due to insufficient order book depth - trader_not_enough: Cancelled due to insufficient counterparty liquidity - ioc: Not filled immediately because time-in-force is IOC - poc: Post-only requirement not met because time-in-force is set to poc (maker-only); rejected after being detected as taker - fok: Not fully filled immediately because time-in-force is FOK - stp: Cancelled due to self-trade prevention - price_protect_cancelled: Cancelled due to price protection - unknown: Unknown | [optional] [readonly] +**slippage** | **str** | Maximum supported slippage ratio for Spot Market Order Placement, calculated based on the latest market price at the time of order placement as the benchmark (Example: 0.03 means 3%) | [optional] +**stop_profit** | [**SpotOrderStopProfit**](SpotOrderStopProfit.md) | | [optional] +**stop_loss** | [**SpotOrderStopLoss**](SpotOrderStopLoss.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BotApi.md b/docs/BotApi.md new file mode 100644 index 00000000..0516efbf --- /dev/null +++ b/docs/BotApi.md @@ -0,0 +1,812 @@ +# gate_api.BotApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_ai_hub_strategy_recommend**](BotApi.md#get_ai_hub_strategy_recommend) | **GET** /bot/strategy/recommend | Get AIHub strategy recommendations +[**post_ai_hub_spot_grid_create**](BotApi.md#post_ai_hub_spot_grid_create) | **POST** /bot/spot-grid/create | Create spot grid +[**post_ai_hub_margin_grid_create**](BotApi.md#post_ai_hub_margin_grid_create) | **POST** /bot/margin-grid/create | Create a lever grid +[**post_ai_hub_infinite_grid_create**](BotApi.md#post_ai_hub_infinite_grid_create) | **POST** /bot/infinite-grid/create | Create infinite grid +[**post_ai_hub_futures_grid_create**](BotApi.md#post_ai_hub_futures_grid_create) | **POST** /bot/futures-grid/create | Create a contract grid +[**post_ai_hub_spot_martingale_create**](BotApi.md#post_ai_hub_spot_martingale_create) | **POST** /bot/spot-martingale/create | Create Spot Martin +[**post_ai_hub_contract_martingale_create**](BotApi.md#post_ai_hub_contract_martingale_create) | **POST** /bot/contract-martingale/create | Create contract martin +[**get_ai_hub_portfolio_running**](BotApi.md#get_ai_hub_portfolio_running) | **GET** /bot/portfolio/running | Query the list of running policies +[**get_ai_hub_portfolio_detail**](BotApi.md#get_ai_hub_portfolio_detail) | **GET** /bot/portfolio/detail | Query order policy details +[**post_ai_hub_portfolio_stop**](BotApi.md#post_ai_hub_portfolio_stop) | **POST** /bot/portfolio/stop | Terminate a single running policy + + +# **get_ai_hub_strategy_recommend** +> AIHubDiscoverSuccessResponse get_ai_hub_strategy_recommend(market=market, strategy_type=strategy_type, direction=direction, invest_amount=invest_amount, scene=scene, refresh_recommendation_id=refresh_recommendation_id, limit=limit, max_drawdown_lte=max_drawdown_lte, backtest_apr_gte=backtest_apr_gte, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + +Get AIHub strategy recommendations + +The only formal interface for the discover domain. Support scenarios: - `top1` - `bundle` - `filter` - `refresh` Constraints: - The active recommendation pool only contains `spot_grid`, `futures_grid`, `spot_martingale` - Can return but do not actively recommend `infinite_grid`, `margin_grid` - `contract_martingale`, `smart-position`, `spot-future-arbitrage` must not be returned - When `scene=filter` is used, only filtering by `market`, `backtest_apr_gte`, `max_drawdown_lte` is allowed - `scene=refresh` inherits the refresh context through `refresh_recommendation_id`; the official minimum format only requires `strategy_type|market` - If the upstream directly transmits the previous recommendation `recommendation_id`, the third paragraph `backtest_id` will currently be ignored. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.BotApi(api_client) +market = 'market_example' # str | Trading pair, such as `BTC_USDT` (optional) +strategy_type = 'strategy_type_example' # str | Recommended target policy type; `contract_martingale` not allowed (optional) +direction = 'direction_example' # str | Market direction (optional) +invest_amount = 'invest_amount_example' # str | Investment amount, string transparent transmission (optional) +scene = 'scene_example' # str | Recommended scenario; when empty, bot-service can automatically infer according to the implementation logic. (optional) +refresh_recommendation_id = 'refresh_recommendation_id_example' # str | It is recommended to refresh the context. Used when `scene=refresh` is used; when `scene` is empty but the field exists, bot-service will also automatically determine as `refresh`. The official minimum format is `strategy_type|market`; if the `recommendation_id` of the previous recommendation is directly passed through, the third paragraph `backtest_id` will be ignored. (optional) +limit = 56 # int | Return quantity; when `scene=filter` is used, the actual results are up to 10 (optional) +max_drawdown_lte = 'max_drawdown_lte_example' # str | Maximum drawdown limit (optional) +backtest_apr_gte = 'backtest_apr_gte_example' # str | Backtest annualized lower limit (optional) +x_gate_service_id = 'x_gate_service_id_example' # str | Call source identifier; injected by APIv4 if necessary (optional) +x_gate_app_lang = 'x_gate_app_lang_example' # str | Language context, such as `zh-CN` / `en-US` (optional) +x_request_id = 'x_request_id_example' # str | Request link ID; caller can transmit transparently (optional) +x_trace_id = 'x_trace_id_example' # str | trace header; can be generated uniformly by APIv4 (optional) + +try: + # Get AIHub strategy recommendations + api_response = api_instance.get_ai_hub_strategy_recommend(market=market, strategy_type=strategy_type, direction=direction, invest_amount=invest_amount, scene=scene, refresh_recommendation_id=refresh_recommendation_id, limit=limit, max_drawdown_lte=max_drawdown_lte, backtest_apr_gte=backtest_apr_gte, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling BotApi->get_ai_hub_strategy_recommend: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **market** | **str**| Trading pair, such as `BTC_USDT` | [optional] + **strategy_type** | **str**| Recommended target policy type; `contract_martingale` not allowed | [optional] + **direction** | **str**| Market direction | [optional] + **invest_amount** | **str**| Investment amount, string transparent transmission | [optional] + **scene** | **str**| Recommended scenario; when empty, bot-service can automatically infer according to the implementation logic. | [optional] + **refresh_recommendation_id** | **str**| It is recommended to refresh the context. Used when `scene=refresh` is used; when `scene` is empty but the field exists, bot-service will also automatically determine as `refresh`. The official minimum format is `strategy_type|market`; if the `recommendation_id` of the previous recommendation is directly passed through, the third paragraph `backtest_id` will be ignored. | [optional] + **limit** | **int**| Return quantity; when `scene=filter` is used, the actual results are up to 10 | [optional] + **max_drawdown_lte** | **str**| Maximum drawdown limit | [optional] + **backtest_apr_gte** | **str**| Backtest annualized lower limit | [optional] + **x_gate_service_id** | **str**| Call source identifier; injected by APIv4 if necessary | [optional] + **x_gate_app_lang** | **str**| Language context, such as `zh-CN` / `en-US` | [optional] + **x_request_id** | **str**| Request link ID; caller can transmit transparently | [optional] + **x_trace_id** | **str**| trace header; can be generated uniformly by APIv4 | [optional] + +### Return type + +[**AIHubDiscoverSuccessResponse**](AIHubDiscoverSuccessResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unified business response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ai_hub_spot_grid_create** +> AIHubCreateSuccessResponse post_ai_hub_spot_grid_create(spot_grid_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + +Create spot grid + +Create a spot grid strategy based on the incoming parameters. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.BotApi(api_client) +spot_grid_create_request = gate_api.SpotGridCreateRequest() # SpotGridCreateRequest | +x_gate_service_id = 'x_gate_service_id_example' # str | Call source identifier; injected by APIv4 if necessary (optional) +x_gate_app_lang = 'x_gate_app_lang_example' # str | Language context, such as `zh-CN` / `en-US` (optional) +x_request_id = 'x_request_id_example' # str | Request link ID; caller can transmit transparently (optional) +x_trace_id = 'x_trace_id_example' # str | trace header; can be generated uniformly by APIv4 (optional) + +try: + # Create spot grid + api_response = api_instance.post_ai_hub_spot_grid_create(spot_grid_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling BotApi->post_ai_hub_spot_grid_create: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **spot_grid_create_request** | [**SpotGridCreateRequest**](SpotGridCreateRequest.md)| | + **x_gate_service_id** | **str**| Call source identifier; injected by APIv4 if necessary | [optional] + **x_gate_app_lang** | **str**| Language context, such as `zh-CN` / `en-US` | [optional] + **x_request_id** | **str**| Request link ID; caller can transmit transparently | [optional] + **x_trace_id** | **str**| trace header; can be generated uniformly by APIv4 | [optional] + +### Return type + +[**AIHubCreateSuccessResponse**](AIHubCreateSuccessResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unified business response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ai_hub_margin_grid_create** +> AIHubCreateSuccessResponse post_ai_hub_margin_grid_create(margin_grid_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + +Create a lever grid + +Create a leverage grid strategy based on the passed parameters. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.BotApi(api_client) +margin_grid_create_request = gate_api.MarginGridCreateRequest() # MarginGridCreateRequest | +x_gate_service_id = 'x_gate_service_id_example' # str | Call source identifier; injected by APIv4 if necessary (optional) +x_gate_app_lang = 'x_gate_app_lang_example' # str | Language context, such as `zh-CN` / `en-US` (optional) +x_request_id = 'x_request_id_example' # str | Request link ID; caller can transmit transparently (optional) +x_trace_id = 'x_trace_id_example' # str | trace header; can be generated uniformly by APIv4 (optional) + +try: + # Create a lever grid + api_response = api_instance.post_ai_hub_margin_grid_create(margin_grid_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling BotApi->post_ai_hub_margin_grid_create: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **margin_grid_create_request** | [**MarginGridCreateRequest**](MarginGridCreateRequest.md)| | + **x_gate_service_id** | **str**| Call source identifier; injected by APIv4 if necessary | [optional] + **x_gate_app_lang** | **str**| Language context, such as `zh-CN` / `en-US` | [optional] + **x_request_id** | **str**| Request link ID; caller can transmit transparently | [optional] + **x_trace_id** | **str**| trace header; can be generated uniformly by APIv4 | [optional] + +### Return type + +[**AIHubCreateSuccessResponse**](AIHubCreateSuccessResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unified business response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ai_hub_infinite_grid_create** +> AIHubCreateSuccessResponse post_ai_hub_infinite_grid_create(infinite_grid_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + +Create infinite grid + +Create an infinite grid strategy based on passed parameters. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.BotApi(api_client) +infinite_grid_create_request = gate_api.InfiniteGridCreateRequest() # InfiniteGridCreateRequest | +x_gate_service_id = 'x_gate_service_id_example' # str | Call source identifier; injected by APIv4 if necessary (optional) +x_gate_app_lang = 'x_gate_app_lang_example' # str | Language context, such as `zh-CN` / `en-US` (optional) +x_request_id = 'x_request_id_example' # str | Request link ID; caller can transmit transparently (optional) +x_trace_id = 'x_trace_id_example' # str | trace header; can be generated uniformly by APIv4 (optional) + +try: + # Create infinite grid + api_response = api_instance.post_ai_hub_infinite_grid_create(infinite_grid_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling BotApi->post_ai_hub_infinite_grid_create: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **infinite_grid_create_request** | [**InfiniteGridCreateRequest**](InfiniteGridCreateRequest.md)| | + **x_gate_service_id** | **str**| Call source identifier; injected by APIv4 if necessary | [optional] + **x_gate_app_lang** | **str**| Language context, such as `zh-CN` / `en-US` | [optional] + **x_request_id** | **str**| Request link ID; caller can transmit transparently | [optional] + **x_trace_id** | **str**| trace header; can be generated uniformly by APIv4 | [optional] + +### Return type + +[**AIHubCreateSuccessResponse**](AIHubCreateSuccessResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unified business response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ai_hub_futures_grid_create** +> AIHubCreateSuccessResponse post_ai_hub_futures_grid_create(futures_grid_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + +Create a contract grid + +Create a contract grid strategy based on the incoming parameters. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.BotApi(api_client) +futures_grid_create_request = gate_api.FuturesGridCreateRequest() # FuturesGridCreateRequest | +x_gate_service_id = 'x_gate_service_id_example' # str | Call source identifier; injected by APIv4 if necessary (optional) +x_gate_app_lang = 'x_gate_app_lang_example' # str | Language context, such as `zh-CN` / `en-US` (optional) +x_request_id = 'x_request_id_example' # str | Request link ID; caller can transmit transparently (optional) +x_trace_id = 'x_trace_id_example' # str | trace header; can be generated uniformly by APIv4 (optional) + +try: + # Create a contract grid + api_response = api_instance.post_ai_hub_futures_grid_create(futures_grid_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling BotApi->post_ai_hub_futures_grid_create: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **futures_grid_create_request** | [**FuturesGridCreateRequest**](FuturesGridCreateRequest.md)| | + **x_gate_service_id** | **str**| Call source identifier; injected by APIv4 if necessary | [optional] + **x_gate_app_lang** | **str**| Language context, such as `zh-CN` / `en-US` | [optional] + **x_request_id** | **str**| Request link ID; caller can transmit transparently | [optional] + **x_trace_id** | **str**| trace header; can be generated uniformly by APIv4 | [optional] + +### Return type + +[**AIHubCreateSuccessResponse**](AIHubCreateSuccessResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unified business response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ai_hub_spot_martingale_create** +> AIHubCreateSuccessResponse post_ai_hub_spot_martingale_create(spot_martingale_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + +Create Spot Martin + +Create a spot martingale strategy from the given parameters. Stop-loss semantics match the app / `MartingaleBot`: - Use **`create_params.stop_loss_per_cycle`** (ratio per round as a decimal string) for creation-side stop-loss; **do not** use `stop_loss_price` for creation logic. - Stop-loss prices shown on detail pages are computed per round by the engine; creation accepts optional **`create_params.trigger_price`** (trigger price). + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.BotApi(api_client) +spot_martingale_create_request = gate_api.SpotMartingaleCreateRequest() # SpotMartingaleCreateRequest | +x_gate_service_id = 'x_gate_service_id_example' # str | Call source identifier; injected by APIv4 if necessary (optional) +x_gate_app_lang = 'x_gate_app_lang_example' # str | Language context, such as `zh-CN` / `en-US` (optional) +x_request_id = 'x_request_id_example' # str | Request link ID; caller can transmit transparently (optional) +x_trace_id = 'x_trace_id_example' # str | trace header; can be generated uniformly by APIv4 (optional) + +try: + # Create Spot Martin + api_response = api_instance.post_ai_hub_spot_martingale_create(spot_martingale_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling BotApi->post_ai_hub_spot_martingale_create: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **spot_martingale_create_request** | [**SpotMartingaleCreateRequest**](SpotMartingaleCreateRequest.md)| | + **x_gate_service_id** | **str**| Call source identifier; injected by APIv4 if necessary | [optional] + **x_gate_app_lang** | **str**| Language context, such as `zh-CN` / `en-US` | [optional] + **x_request_id** | **str**| Request link ID; caller can transmit transparently | [optional] + **x_trace_id** | **str**| trace header; can be generated uniformly by APIv4 | [optional] + +### Return type + +[**AIHubCreateSuccessResponse**](AIHubCreateSuccessResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unified business response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ai_hub_contract_martingale_create** +> AIHubCreateSuccessResponse post_ai_hub_contract_martingale_create(contract_martingale_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + +Create contract martin + +Create a contract Martin strategy based on the input parameters. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.BotApi(api_client) +contract_martingale_create_request = gate_api.ContractMartingaleCreateRequest() # ContractMartingaleCreateRequest | +x_gate_service_id = 'x_gate_service_id_example' # str | Call source identifier; injected by APIv4 if necessary (optional) +x_gate_app_lang = 'x_gate_app_lang_example' # str | Language context, such as `zh-CN` / `en-US` (optional) +x_request_id = 'x_request_id_example' # str | Request link ID; caller can transmit transparently (optional) +x_trace_id = 'x_trace_id_example' # str | trace header; can be generated uniformly by APIv4 (optional) + +try: + # Create contract martin + api_response = api_instance.post_ai_hub_contract_martingale_create(contract_martingale_create_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling BotApi->post_ai_hub_contract_martingale_create: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contract_martingale_create_request** | [**ContractMartingaleCreateRequest**](ContractMartingaleCreateRequest.md)| | + **x_gate_service_id** | **str**| Call source identifier; injected by APIv4 if necessary | [optional] + **x_gate_app_lang** | **str**| Language context, such as `zh-CN` / `en-US` | [optional] + **x_request_id** | **str**| Request link ID; caller can transmit transparently | [optional] + **x_trace_id** | **str**| trace header; can be generated uniformly by APIv4 | [optional] + +### Return type + +[**AIHubCreateSuccessResponse**](AIHubCreateSuccessResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unified business response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_ai_hub_portfolio_running** +> AIHubPortfolioRunningSuccessResponse get_ai_hub_portfolio_running(strategy_type=strategy_type, market=market, page=page, page_size=page_size, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + +Query the list of running policies + +Query the list of AIHub strategies currently running by the user, and support filtering by strategy type, trading pair and paging conditions. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.BotApi(api_client) +strategy_type = 'strategy_type_example' # str | Filter by policy type (optional) +market = 'market_example' # str | Filter by trading pair (optional) +page = 1 # int | Page number, default 1 (optional) (default to 1) +page_size = 20 # int | Paging size, default 20, maximum 50 (optional) (default to 20) +x_gate_service_id = 'x_gate_service_id_example' # str | Call source identifier; injected by APIv4 if necessary (optional) +x_gate_app_lang = 'x_gate_app_lang_example' # str | Language context, such as `zh-CN` / `en-US` (optional) +x_request_id = 'x_request_id_example' # str | Request link ID; caller can transmit transparently (optional) +x_trace_id = 'x_trace_id_example' # str | trace header; can be generated uniformly by APIv4 (optional) + +try: + # Query the list of running policies + api_response = api_instance.get_ai_hub_portfolio_running(strategy_type=strategy_type, market=market, page=page, page_size=page_size, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling BotApi->get_ai_hub_portfolio_running: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **strategy_type** | **str**| Filter by policy type | [optional] + **market** | **str**| Filter by trading pair | [optional] + **page** | **int**| Page number, default 1 | [optional] [default to 1] + **page_size** | **int**| Paging size, default 20, maximum 50 | [optional] [default to 20] + **x_gate_service_id** | **str**| Call source identifier; injected by APIv4 if necessary | [optional] + **x_gate_app_lang** | **str**| Language context, such as `zh-CN` / `en-US` | [optional] + **x_request_id** | **str**| Request link ID; caller can transmit transparently | [optional] + **x_trace_id** | **str**| trace header; can be generated uniformly by APIv4 | [optional] + +### Return type + +[**AIHubPortfolioRunningSuccessResponse**](AIHubPortfolioRunningSuccessResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unified business response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_ai_hub_portfolio_detail** +> AIHubPortfolioDetailSuccessResponse get_ai_hub_portfolio_detail(strategy_id, strategy_type, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + +Query order policy details + +Both `strategy_id` and `strategy_type` must be passed in the request, where `strategy_type` is used to distribute to the underlying detailed implementation by strategy type. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.BotApi(api_client) +strategy_id = 'strategy_id_example' # str | Policy ID +strategy_type = 'strategy_type_example' # str | Policy type; used for underlying detail distribution +x_gate_service_id = 'x_gate_service_id_example' # str | Call source identifier; injected by APIv4 if necessary (optional) +x_gate_app_lang = 'x_gate_app_lang_example' # str | Language context, such as `zh-CN` / `en-US` (optional) +x_request_id = 'x_request_id_example' # str | Request link ID; caller can transmit transparently (optional) +x_trace_id = 'x_trace_id_example' # str | trace header; can be generated uniformly by APIv4 (optional) + +try: + # Query order policy details + api_response = api_instance.get_ai_hub_portfolio_detail(strategy_id, strategy_type, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling BotApi->get_ai_hub_portfolio_detail: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **strategy_id** | **str**| Policy ID | + **strategy_type** | **str**| Policy type; used for underlying detail distribution | + **x_gate_service_id** | **str**| Call source identifier; injected by APIv4 if necessary | [optional] + **x_gate_app_lang** | **str**| Language context, such as `zh-CN` / `en-US` | [optional] + **x_request_id** | **str**| Request link ID; caller can transmit transparently | [optional] + **x_trace_id** | **str**| trace header; can be generated uniformly by APIv4 | [optional] + +### Return type + +[**AIHubPortfolioDetailSuccessResponse**](AIHubPortfolioDetailSuccessResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unified business response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_ai_hub_portfolio_stop** +> AIHubPortfolioStopSuccessResponse post_ai_hub_portfolio_stop(ai_hub_portfolio_stop_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + +Terminate a single running policy + +Only one policy is allowed to be terminated per request. Risk warning and secondary confirmation are borne by the upper layer of OpenClaw; this interface is only responsible for executing stop. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.BotApi(api_client) +ai_hub_portfolio_stop_request = gate_api.AIHubPortfolioStopRequest() # AIHubPortfolioStopRequest | +x_gate_service_id = 'x_gate_service_id_example' # str | Call source identifier; injected by APIv4 if necessary (optional) +x_gate_app_lang = 'x_gate_app_lang_example' # str | Language context, such as `zh-CN` / `en-US` (optional) +x_request_id = 'x_request_id_example' # str | Request link ID; caller can transmit transparently (optional) +x_trace_id = 'x_trace_id_example' # str | trace header; can be generated uniformly by APIv4 (optional) + +try: + # Terminate a single running policy + api_response = api_instance.post_ai_hub_portfolio_stop(ai_hub_portfolio_stop_request, x_gate_service_id=x_gate_service_id, x_gate_app_lang=x_gate_app_lang, x_request_id=x_request_id, x_trace_id=x_trace_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling BotApi->post_ai_hub_portfolio_stop: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ai_hub_portfolio_stop_request** | [**AIHubPortfolioStopRequest**](AIHubPortfolioStopRequest.md)| | + **x_gate_service_id** | **str**| Call source identifier; injected by APIv4 if necessary | [optional] + **x_gate_app_lang** | **str**| Language context, such as `zh-CN` / `en-US` | [optional] + **x_request_id** | **str**| Request link ID; caller can transmit transparently | [optional] + **x_trace_id** | **str**| trace header; can be generated uniformly by APIv4 | [optional] + +### Return type + +[**AIHubPortfolioStopSuccessResponse**](AIHubPortfolioStopSuccessResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unified business response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/BrokerCommission.md b/docs/BrokerCommission.md index 0cbfd463..3002ac6c 100644 --- a/docs/BrokerCommission.md +++ b/docs/BrokerCommission.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total** | **int** | Total | [optional] -**list** | [**list[BrokerCommission1]**](BrokerCommission1.md) | List of commission history | [optional] +**list** | [**list[BrokerCommissionItem]**](BrokerCommissionItem.md) | List of commission history | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BrokerCommission1.md b/docs/BrokerCommissionItem.md similarity index 94% rename from docs/BrokerCommission1.md rename to docs/BrokerCommissionItem.md index 0382e9cc..d666b1d8 100644 --- a/docs/BrokerCommission1.md +++ b/docs/BrokerCommissionItem.md @@ -1,4 +1,4 @@ -# BrokerCommission1 +# BrokerCommissionItem ## Properties Name | Type | Description | Notes @@ -10,7 +10,7 @@ Name | Type | Description | Notes **fee** | **str** | Fee | [optional] **fee_asset** | **str** | Fee currency | [optional] **rebate_fee** | **str** | The income from rebates, converted to USDT | [optional] -**source** | **str** | Commission transaction type: Spot, Futures, Options, Alpha | [optional] +**source** | **str** | Commission transaction type: Spot, Futures, Options, Alpha、TradFi | [optional] **currency_pair** | **str** | Currency pair | [optional] **sub_broker_info** | [**BrokerCommissionSubBrokerInfo**](BrokerCommissionSubBrokerInfo.md) | | [optional] **alpha_contract_addr** | **str** | Alpha contract address | [optional] diff --git a/docs/BrokerTransaction.md b/docs/BrokerTransaction.md index c4508946..2e56b7b7 100644 --- a/docs/BrokerTransaction.md +++ b/docs/BrokerTransaction.md @@ -3,8 +3,16 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **int** | Total | [optional] -**list** | [**list[BrokerTransaction1]**](BrokerTransaction1.md) | List of transaction history | [optional] +**transaction_time** | **int** | Transaction Time. (unix timestamp) | [optional] +**user_id** | **int** | User ID | [optional] +**group_name** | **str** | Group name | [optional] +**fee** | **str** | Fee amount (USDT) | [optional] +**currency_pair** | **str** | Currency pair | [optional] +**amount** | **str** | Transaction amount | [optional] +**fee_asset** | **str** | Fee currency | [optional] +**source** | **str** | Commission transaction type: Spot, Futures, Options, Alpha、TradFi | [optional] +**sub_broker_info** | [**BrokerCommissionSubBrokerInfo**](BrokerCommissionSubBrokerInfo.md) | | [optional] +**alpha_contract_addr** | **str** | Alpha contract address | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BrokerTransaction1.md b/docs/BrokerTransaction1.md deleted file mode 100644 index 07833a85..00000000 --- a/docs/BrokerTransaction1.md +++ /dev/null @@ -1,19 +0,0 @@ -# BrokerTransaction1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**transaction_time** | **int** | Transaction Time. (unix timestamp) | [optional] -**user_id** | **int** | User ID | [optional] -**group_name** | **str** | Group name | [optional] -**fee** | **str** | Fee amount (USDT) | [optional] -**currency_pair** | **str** | Currency pair | [optional] -**amount** | **str** | Transaction amount | [optional] -**fee_asset** | **str** | Fee currency | [optional] -**source** | **str** | Commission transaction type: Spot, Futures, Options, Alpha | [optional] -**sub_broker_info** | [**BrokerCommissionSubBrokerInfo**](BrokerCommissionSubBrokerInfo.md) | | [optional] -**alpha_contract_addr** | **str** | Alpha contract address | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BrokerTransactionHistory.md b/docs/BrokerTransactionHistory.md new file mode 100644 index 00000000..1dab53f0 --- /dev/null +++ b/docs/BrokerTransactionHistory.md @@ -0,0 +1,11 @@ +# BrokerTransactionHistory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total | [optional] +**list** | [**list[BrokerTransaction]**](BrokerTransaction.md) | List of transaction history | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CFDApi.md b/docs/CFDApi.md new file mode 100644 index 00000000..226d96de --- /dev/null +++ b/docs/CFDApi.md @@ -0,0 +1,1417 @@ +# gate_api.CFDApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**query_mt5_account_info**](CFDApi.md#query_mt5_account_info) | **GET** /tradfi/users/mt5-account | Query MT5 account information +[**query_categories**](CFDApi.md#query_categories) | **GET** /tradfi/symbols/categories | Query trading symbol categories +[**query_symbol_commissions**](CFDApi.md#query_symbol_commissions) | **GET** /tradfi/symbols/commissions | Query symbol commission rates +[**query_symbols**](CFDApi.md#query_symbols) | **GET** /tradfi/symbols | Query trading symbol list +[**query_symbol_detail**](CFDApi.md#query_symbol_detail) | **GET** /tradfi/symbols/detail | Query trading symbol details +[**query_symbol_kline**](CFDApi.md#query_symbol_kline) | **GET** /tradfi/symbols/{symbol}/klines | Query trading symbol klines +[**query_symbol_ticker**](CFDApi.md#query_symbol_ticker) | **GET** /tradfi/symbols/{symbol}/tickers | Query trading symbol ticker +[**create_trad_fi_user**](CFDApi.md#create_trad_fi_user) | **POST** /tradfi/users | Create CFD user +[**query_user_assets**](CFDApi.md#query_user_assets) | **GET** /tradfi/users/assets | Query account assets +[**query_transaction**](CFDApi.md#query_transaction) | **GET** /tradfi/transactions | Query Fund Transfer In/Out Records +[**create_transaction**](CFDApi.md#create_transaction) | **POST** /tradfi/transactions | Fund transfer +[**query_order_list**](CFDApi.md#query_order_list) | **GET** /tradfi/orders | Query active order list +[**create_trad_fi_order**](CFDApi.md#create_trad_fi_order) | **POST** /tradfi/orders | Create order +[**update_order**](CFDApi.md#update_order) | **PUT** /tradfi/orders/{order_id} | Modify order +[**delete_order**](CFDApi.md#delete_order) | **DELETE** /tradfi/orders/{order_id} | Cancel order +[**query_order_history_list**](CFDApi.md#query_order_history_list) | **GET** /tradfi/orders/history | Query historical order list +[**query_order_log**](CFDApi.md#query_order_log) | **GET** /tradfi/orders/log/{log_id} | Get order details by log ID +[**query_position_list**](CFDApi.md#query_position_list) | **GET** /tradfi/positions | Query active position list +[**update_position**](CFDApi.md#update_position) | **PUT** /tradfi/positions/{position_id} | Modify position +[**close_position**](CFDApi.md#close_position) | **POST** /tradfi/positions/{position_id}/close | Close position +[**query_position_history_list**](CFDApi.md#query_position_history_list) | **GET** /tradfi/positions/history | Query historical position list + + +# **query_mt5_account_info** +> Mt5Account query_mt5_account_info() + +Query MT5 account information + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) + +try: + # Query MT5 account information + api_response = api_instance.query_mt5_account_info() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_mt5_account_info: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Mt5Account**](Mt5Account.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_categories** +> Categories query_categories() + +Query trading symbol categories + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) + +try: + # Query trading symbol categories + api_response = api_instance.query_categories() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_categories: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Categories**](Categories.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_symbol_commissions** +> SymbolCommissions query_symbol_commissions(symbols=symbols, category_code=category_code) + +Query symbol commission rates + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +symbols = 'AUDUSD,XAUUSD' # str | List of symbol codes (multiple codes separated by commas). At least one of symbol and category_code is required (optional) +category_code = 'forex-外汇,metal-金属,index-指数,commodity-大宗商品,stock-股票' # str | List of category codes (multiple codes separated by commas). When provided together with symbols, filters symbols by category. At least one of symbol and category_code is required (optional) + +try: + # Query symbol commission rates + api_response = api_instance.query_symbol_commissions(symbols=symbols, category_code=category_code) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_symbol_commissions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbols** | **str**| List of symbol codes (multiple codes separated by commas). At least one of symbol and category_code is required | [optional] + **category_code** | **str**| List of category codes (multiple codes separated by commas). When provided together with symbols, filters symbols by category. At least one of symbol and category_code is required | [optional] + +### Return type + +[**SymbolCommissions**](SymbolCommissions.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_symbols** +> Symbols query_symbols() + +Query trading symbol list + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) + +try: + # Query trading symbol list + api_response = api_instance.query_symbols() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_symbols: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Symbols**](Symbols.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_symbol_detail** +> ContractDetail query_symbol_detail(symbols) + +Query trading symbol details + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +symbols = 'EURUSD,XAGUSD' # str | Trading symbol code list (comma-separated, max 10 symbols) + +try: + # Query trading symbol details + api_response = api_instance.query_symbol_detail(symbols) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_symbol_detail: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbols** | **str**| Trading symbol code list (comma-separated, max 10 symbols) | + +### Return type + +[**ContractDetail**](ContractDetail.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_symbol_kline** +> Klines query_symbol_kline(symbol, kline_type, begin_time=begin_time, end_time=end_time, limit=limit) + +Query trading symbol klines + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +symbol = 'EURUSD' # str | Trading symbol code +kline_type = '1m' # str | Kline type (time period) +begin_time = 1769378400 # int | Start time (Unix timestamp in seconds) (optional) +end_time = 1769464800 # int | End time (Unix timestamp in seconds) (optional) +limit = 100 # int | Kline limit (max 500, error if exceeded) (optional) + +try: + # Query trading symbol klines + api_response = api_instance.query_symbol_kline(symbol, kline_type, begin_time=begin_time, end_time=end_time, limit=limit) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_symbol_kline: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Trading symbol code | + **kline_type** | **str**| Kline type (time period) | + **begin_time** | **int**| Start time (Unix timestamp in seconds) | [optional] + **end_time** | **int**| End time (Unix timestamp in seconds) | [optional] + **limit** | **int**| Kline limit (max 500, error if exceeded) | [optional] + +### Return type + +[**Klines**](Klines.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_symbol_ticker** +> TradFiTicker query_symbol_ticker(symbol) + +Query trading symbol ticker + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +symbol = 'EURUSD' # str | Trading symbol code + +try: + # Query trading symbol ticker + api_response = api_instance.query_symbol_ticker(symbol) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_symbol_ticker: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Trading symbol code | + +### Return type + +[**TradFiTicker**](TradFiTicker.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_trad_fi_user** +> CreateUserResp create_trad_fi_user() + +Create CFD user + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) + +try: + # Create CFD user + api_response = api_instance.create_trad_fi_user() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->create_trad_fi_user: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**CreateUserResp**](CreateUserResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Account opened successfully | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_user_assets** +> UserAssetResp query_user_assets() + +Query account assets + +Query account assets + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) + +try: + # Query account assets + api_response = api_instance.query_user_assets() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_user_assets: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UserAssetResp**](UserAssetResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_transaction** +> TransactionList query_transaction(begin_time=begin_time, end_time=end_time, type=type, page=page, page_size=page_size) + +Query Fund Transfer In/Out Records + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +begin_time = 1704067200 # int | Start Time (Second-level Timestamp) (optional) +end_time = 1706745599 # int | End Time (Second-level Timestamp) (optional) +type = 'withdraw' # str | Transaction Type (deposit - transfer in, withdraw - transfer out, dividend - dividend payment, fill_negative - cover negative balance) (optional) +page = 1 # int | page number (optional) +page_size = 20 # int | Number per page, default 10, maximum 50 (optional) + +try: + # Query Fund Transfer In/Out Records + api_response = api_instance.query_transaction(begin_time=begin_time, end_time=end_time, type=type, page=page, page_size=page_size) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_transaction: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **begin_time** | **int**| Start Time (Second-level Timestamp) | [optional] + **end_time** | **int**| End Time (Second-level Timestamp) | [optional] + **type** | **str**| Transaction Type (deposit - transfer in, withdraw - transfer out, dividend - dividend payment, fill_negative - cover negative balance) | [optional] + **page** | **int**| page number | [optional] + **page_size** | **int**| Number per page, default 10, maximum 50 | [optional] + +### Return type + +[**TransactionList**](TransactionList.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_transaction** +> CreateTransaction create_transaction(trad_fi_transaction_request) + +Fund transfer + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +trad_fi_transaction_request = gate_api.TradFiTransactionRequest() # TradFiTransactionRequest | + +try: + # Fund transfer + api_response = api_instance.create_transaction(trad_fi_transaction_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->create_transaction: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **trad_fi_transaction_request** | [**TradFiTransactionRequest**](TradFiTransactionRequest.md)| | + +### Return type + +[**CreateTransaction**](CreateTransaction.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_order_list** +> OrderList query_order_list() + +Query active order list + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) + +try: + # Query active order list + api_response = api_instance.query_order_list() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_order_list: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**OrderList**](OrderList.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_trad_fi_order** +> CreateOrder2 create_trad_fi_order(trad_fi_order_request) + +Create order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +trad_fi_order_request = gate_api.TradFiOrderRequest() # TradFiOrderRequest | + +try: + # Create order + api_response = api_instance.create_trad_fi_order(trad_fi_order_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->create_trad_fi_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **trad_fi_order_request** | [**TradFiOrderRequest**](TradFiOrderRequest.md)| | + +### Return type + +[**CreateOrder2**](CreateOrder2.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Order placed successfully | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_order** +> UpdateOrder update_order(order_id, trad_fi_order_update_request) + +Modify order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +order_id = 1223 # int | Order ID +trad_fi_order_update_request = gate_api.TradFiOrderUpdateRequest() # TradFiOrderUpdateRequest | + +try: + # Modify order + api_response = api_instance.update_order(order_id, trad_fi_order_update_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->update_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID | + **trad_fi_order_update_request** | [**TradFiOrderUpdateRequest**](TradFiOrderUpdateRequest.md)| | + +### Return type + +[**UpdateOrder**](UpdateOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_order** +> object delete_order(order_id) + +Cancel order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +order_id = 1223 # int | Order ID + +try: + # Cancel order + api_response = api_instance.delete_order(order_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->delete_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID | + +### Return type + +**object** + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Deleted successfully | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_order_history_list** +> OrderHistoryList query_order_history_list(begin_time=begin_time, end_time=end_time, symbol=symbol, side=side) + +Query historical order list + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +begin_time = 1769397000 # int | Start time (Unix timestamp in seconds), earliest query is one month ago (optional) +end_time = 1769398000 # int | End time (Unix timestamp in seconds) (optional) +symbol = 'USDCAD' # str | Currency pair (optional) +side = 2 # int | Side (1=sell, 2=buy) (optional) + +try: + # Query historical order list + api_response = api_instance.query_order_history_list(begin_time=begin_time, end_time=end_time, symbol=symbol, side=side) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_order_history_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **begin_time** | **int**| Start time (Unix timestamp in seconds), earliest query is one month ago | [optional] + **end_time** | **int**| End time (Unix timestamp in seconds) | [optional] + **symbol** | **str**| Currency pair | [optional] + **side** | **int**| Side (1=sell, 2=buy) | [optional] + +### Return type + +[**OrderHistoryList**](OrderHistoryList.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_order_log** +> OrderLog query_order_log(log_id) + +Get order details by log ID + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +log_id = 1223 # int | log_id returned from the order placement API + +try: + # Get order details by log ID + api_response = api_instance.query_order_log(log_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_order_log: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **log_id** | **int**| log_id returned from the order placement API | + +### Return type + +[**OrderLog**](OrderLog.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_position_list** +> PositionList query_position_list() + +Query active position list + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) + +try: + # Query active position list + api_response = api_instance.query_position_list() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_position_list: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PositionList**](PositionList.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_position** +> UpdatePosition update_position(position_id, trad_fi_position_update_request) + +Modify position + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +position_id = 1223 # int | Position ID +trad_fi_position_update_request = gate_api.TradFiPositionUpdateRequest() # TradFiPositionUpdateRequest | + +try: + # Modify position + api_response = api_instance.update_position(position_id, trad_fi_position_update_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->update_position: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **position_id** | **int**| Position ID | + **trad_fi_position_update_request** | [**TradFiPositionUpdateRequest**](TradFiPositionUpdateRequest.md)| | + +### Return type + +[**UpdatePosition**](UpdatePosition.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **close_position** +> DeletePosition close_position(position_id, trad_fi_close_position_request) + +Close position + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +position_id = 1223 # int | Position ID +trad_fi_close_position_request = gate_api.TradFiClosePositionRequest() # TradFiClosePositionRequest | + +try: + # Close position + api_response = api_instance.close_position(position_id, trad_fi_close_position_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->close_position: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **position_id** | **int**| Position ID | + **trad_fi_close_position_request** | [**TradFiClosePositionRequest**](TradFiClosePositionRequest.md)| | + +### Return type + +[**DeletePosition**](DeletePosition.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_position_history_list** +> PositionHistoryList query_position_history_list(page=page, page_size=page_size, begin_time=begin_time, end_time=end_time, symbol=symbol, position_dir=position_dir) + +Query historical position list + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CFDApi(api_client) +page = 1 # int | Page number; defaults to 1 if omitted. (optional) +page_size = 10 # int | Page size; defaults to 10 if omitted. Maximum 100. (optional) +begin_time = 56 # int | Start Time (Unix Timestamp, seconds). The earliest queryable time is one month ago (optional) +end_time = 56 # int | End time (timestamp in seconds) (optional) +symbol = 'symbol_example' # str | Trading symbol (e.g., EURUSD) (optional) +position_dir = 'position_dir_example' # str | Position direction (Long=long position, Short=short position) (optional) + +try: + # Query historical position list + api_response = api_instance.query_position_history_list(page=page, page_size=page_size, begin_time=begin_time, end_time=end_time, symbol=symbol, position_dir=position_dir) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CFDApi->query_position_history_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number; defaults to 1 if omitted. | [optional] + **page_size** | **int**| Page size; defaults to 10 if omitted. Maximum 100. | [optional] + **begin_time** | **int**| Start Time (Unix Timestamp, seconds). The earliest queryable time is one month ago | [optional] + **end_time** | **int**| End time (timestamp in seconds) | [optional] + **symbol** | **str**| Trading symbol (e.g., EURUSD) | [optional] + **position_dir** | **str**| Position direction (Long=long position, Short=short position) | [optional] + +### Return type + +[**PositionHistoryList**](PositionHistoryList.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/CancelOrder.md b/docs/CancelOrder.md new file mode 100644 index 00000000..b6d39cf7 --- /dev/null +++ b/docs/CancelOrder.md @@ -0,0 +1,13 @@ +# CancelOrder + +Cancel order request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**txid** | **str** | Order ID | +**reason_id** | **str** | Cancel reason ID. `1` no longer want to buy; `2` cannot reach seller; `3` will not pay; `4` seller account not real; `5` payout account issue; `6` price mismatch; `7` mutually agreed cancel; `8` poor communication; `9` other; `10` seller cannot release with refund; `11` terms not met; `12` seller payout risk-controlled. | [optional] +**reason_memo** | **str** | Extra cancel notes when `reason_id` is `9` or explanation is required. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Categories.md b/docs/Categories.md new file mode 100644 index 00000000..2b8b3790 --- /dev/null +++ b/docs/Categories.md @@ -0,0 +1,11 @@ +# Categories + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**CategoriesData**](CategoriesData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CategoriesData.md b/docs/CategoriesData.md new file mode 100644 index 00000000..2539b499 --- /dev/null +++ b/docs/CategoriesData.md @@ -0,0 +1,11 @@ +# CategoriesData + +Data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[CategoriesDataList]**](CategoriesDataList.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CategoriesDataList.md b/docs/CategoriesDataList.md new file mode 100644 index 00000000..6695d071 --- /dev/null +++ b/docs/CategoriesDataList.md @@ -0,0 +1,13 @@ +# CategoriesDataList + +Category information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category_id** | **int** | Category ID | [optional] +**is_favorite** | **bool** | Whether it is a custom category, generally no need to pay attention | [optional] +**category_name** | **str** | Category name | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ChaseOrder.md b/docs/ChaseOrder.md new file mode 100644 index 00000000..d52f2f20 --- /dev/null +++ b/docs/ChaseOrder.md @@ -0,0 +1,45 @@ +# ChaseOrder + +Chase order detail or list item +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**user** | **str** | | [optional] +**contract** | **str** | | [optional] +**settle** | **str** | | [optional] +**amount** | **str** | Total size in contracts; positive for buy, negative for sell | [optional] +**price_limit** | **str** | | [optional] +**reduce_only** | **bool** | | [optional] +**text** | **str** | | [optional] +**create_time** | **int** | | [optional] +**finish_time** | **int** | | [optional] +**original_status** | **int** | Raw status enum | [optional] +**status** | **str** | Simplified status, e.g. open / finished | [optional] +**reason** | **str** | | [optional] +**fill_amount** | **str** | | [optional] +**average_fill_price** | **str** | | [optional] +**suborder_id** | **str** | | [optional] +**is_dual_mode** | **bool** | | [optional] +**side_label** | **str** | | [optional] +**position_side_output** | **str** | | [optional] +**chase_price** | **str** | | [optional] +**interval_sec** | **int** | | [optional] +**updated_at** | **int** | | [optional] +**suborder_price** | **str** | | [optional] +**suborder_ongoing** | **bool** | | [optional] +**suborder_finish_as** | **str** | | [optional] +**price_type** | **int** | PriceType enum: 1 latest, 2 index, 3 mark | [optional] +**price_gap_type** | **str** | | [optional] +**price_gap_value** | **str** | | [optional] +**status_code** | **str** | | [optional] +**create_time_precise** | **str** | Creation time (seconds.microseconds) | [optional] +**finish_time_precise** | **str** | | [optional] +**pos_margin_mode** | **str** | | [optional] +**position_mode** | **str** | | [optional] +**leverage** | **str** | | [optional] +**error_label** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ClaimRewardError.md b/docs/ClaimRewardError.md new file mode 100644 index 00000000..06bc522a --- /dev/null +++ b/docs/ClaimRewardError.md @@ -0,0 +1,11 @@ +# ClaimRewardError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Error identifier code | [optional] +**message** | **str** | Error details | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ClaimTaskError.md b/docs/ClaimTaskError.md new file mode 100644 index 00000000..8fddd94c --- /dev/null +++ b/docs/ClaimTaskError.md @@ -0,0 +1,11 @@ +# ClaimTaskError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Error identifier code | [optional] +**message** | **str** | Error details | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ClosePosition.md b/docs/ClosePosition.md new file mode 100644 index 00000000..70c7c10a --- /dev/null +++ b/docs/ClosePosition.md @@ -0,0 +1,11 @@ +# ClosePosition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ClosePositionData**](ClosePositionData.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ClosePositionData.md b/docs/ClosePositionData.md new file mode 100644 index 00000000..9f196597 --- /dev/null +++ b/docs/ClosePositionData.md @@ -0,0 +1,10 @@ +# ClosePositionData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Close order ID | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CollateralOrder.md b/docs/CollateralOrder.md deleted file mode 100644 index b83a7fbc..00000000 --- a/docs/CollateralOrder.md +++ /dev/null @@ -1,26 +0,0 @@ -# CollateralOrder - -Collateral order -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**order_id** | **int** | Order ID | [optional] -**collateral_currency** | **str** | Collateral currency | [optional] -**collateral_amount** | **str** | Collateral amount | [optional] -**borrow_currency** | **str** | Borrowed currency | [optional] -**borrow_amount** | **str** | Borrowed amount | [optional] -**repaid_amount** | **str** | Repaid amount | [optional] -**repaid_principal** | **str** | Repaid principal | [optional] -**repaid_interest** | **str** | Repaid interest | [optional] -**init_ltv** | **str** | Initial collateralization rate | [optional] -**current_ltv** | **str** | Current collateralization rate | [optional] -**liquidate_ltv** | **str** | Liquidation collateralization rate | [optional] -**status** | **str** | Order status: - initial: Initial state after placing the order - collateral_deducted: Collateral deduction successful - collateral_returning: Loan failed - Collateral return pending - lent: Loan successful - repaying: Repayment in progress - liquidating: Liquidation in progress - finished: Order completed - closed_liquidated: Liquidation and repayment completed | [optional] -**borrow_time** | **int** | Borrowing time, timestamp in seconds | [optional] -**left_repay_total** | **str** | Outstanding principal and interest (outstanding principal + outstanding interest) | [optional] -**left_repay_principal** | **str** | Outstanding principal | [optional] -**left_repay_interest** | **str** | Outstanding interest | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CollateralRecord.md b/docs/CollateralRecord.md deleted file mode 100644 index f2fbfa71..00000000 --- a/docs/CollateralRecord.md +++ /dev/null @@ -1,20 +0,0 @@ -# CollateralRecord - -Collateral record -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**order_id** | **int** | Order ID | [optional] -**record_id** | **int** | Collateral record ID | [optional] -**borrow_currency** | **str** | Borrowed currency | [optional] -**borrow_amount** | **str** | Borrowed amount | [optional] -**collateral_currency** | **str** | Collateral currency | [optional] -**before_collateral** | **str** | Collateral amount before adjustment | [optional] -**after_collateral** | **str** | Collateral amount after adjustment | [optional] -**before_ltv** | **str** | Collateral ratio before adjustment | [optional] -**after_ltv** | **str** | Collateral ratio after adjustment | [optional] -**operate_time** | **int** | Operation time, timestamp in seconds | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ConfirmPayment.md b/docs/ConfirmPayment.md new file mode 100644 index 00000000..810549be --- /dev/null +++ b/docs/ConfirmPayment.md @@ -0,0 +1,12 @@ +# ConfirmPayment + +Confirm payment request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**txid** | **str** | Order ID | +**payment_method** | **str** | Payment type used for this payment; optional but must be among order-supported types. Use `supported_pay_types` on the order or `pay_type` list, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ConfirmReceipt.md b/docs/ConfirmReceipt.md new file mode 100644 index 00000000..ec60e5b8 --- /dev/null +++ b/docs/ConfirmReceipt.md @@ -0,0 +1,11 @@ +# ConfirmReceipt + +Confirm receipt request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**txid** | **str** | Order ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Contract.md b/docs/Contract.md index 89ff8e1a..1047abca 100644 --- a/docs/Contract.md +++ b/docs/Contract.md @@ -22,10 +22,12 @@ Name | Type | Description | Notes **funding_interval** | **int** | Funding application interval, unit in seconds | [optional] **funding_next_apply** | **float** | Next funding time | [optional] **risk_limit_base** | **str** | Base risk limit (deprecated) | [optional] +**interest_rate** | **str** | Interest rate parameter used in funding rate and premium-related calculations for perpetual contracts. Returned as a string decimal ratio (e.g. `0.0003`), same convention as `funding_rate` (ratio, not percent). | [optional] **risk_limit_step** | **str** | Risk limit adjustment step (deprecated) | [optional] **risk_limit_max** | **str** | Maximum risk limit allowed by the contract (deprecated). It is recommended to use /futures/{settle}/risk_limit_tiers to query risk limits | [optional] -**order_size_min** | **str** | Minimum order size allowed by the contract | [optional] -**order_size_max** | **str** | Maximum order size allowed by the contract | [optional] +**order_size_min** | **str** | Minimum order quantity | [optional] +**enable_decimal** | **bool** | Whether decimal string type is supported for contract lot size. When this field is set to `true`, it indicates that the contract supports decimal lot sizes (i.e., the `size` field can use a decimal string type); when set to `false`, it indicates that the contract does not support decimal lot sizes (i.e., the `size` field can only use an integer type). | [optional] +**order_size_max** | **str** | Maximum order quantity | [optional] **order_price_deviate** | **str** | Maximum allowed deviation between order price and current mark price. The order price `order_price` must satisfy the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate | [optional] **ref_discount_rate** | **str** | Trading fee discount for referred users | [optional] **ref_rebate_rate** | **str** | Commission rate for referrers | [optional] @@ -47,6 +49,9 @@ Name | Type | Description | Notes **market_order_slip_ratio** | **str** | The maximum slippage allowed for market orders, with the slippage rate calculated based on the latest market price | [optional] **market_order_size_max** | **str** | The maximum number of contracts supported for market orders, with a default value of 0. When the default value is used, the maximum number of contracts is limited by the `order_size_max` field | [optional] **funding_rate_limit** | **str** | Upper and lower limits of funding rate | [optional] +**contract_type** | **str** | Contract classification type, e.g. stocks, metals, indices, forex, commodities, etc. | [optional] +**funding_impact_value** | **str** | Funding rate depth impact value | [optional] +**enable_circuit_breaker** | **bool** | Whether the newly launched contract activates mark price circuit breaker (If the platform intends to activate this mechanism for a newly launched contract market to prevent significant price fluctuations and excessive liquidations after launch, an advance announcement will be made). | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ContractDetail.md b/docs/ContractDetail.md new file mode 100644 index 00000000..d5d70fe9 --- /dev/null +++ b/docs/ContractDetail.md @@ -0,0 +1,11 @@ +# ContractDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**ContractDetailData**](ContractDetailData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContractDetailData.md b/docs/ContractDetailData.md new file mode 100644 index 00000000..ff7efee9 --- /dev/null +++ b/docs/ContractDetailData.md @@ -0,0 +1,11 @@ +# ContractDetailData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[ContractDetailDataList]**](ContractDetailDataList.md) | Contract Details List | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContractDetailDataList.md b/docs/ContractDetailDataList.md new file mode 100644 index 00000000..855a431b --- /dev/null +++ b/docs/ContractDetailDataList.md @@ -0,0 +1,27 @@ +# ContractDetailDataList + +Futures contract details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Trading symbol code | [optional] +**symbol_desc** | **str** | Trading symbol description | [optional] +**category_name** | **str** | Category name | [optional] +**contract_volume** | **str** | Contract Volume | [optional] +**settlement_currency** | **str** | Settle currency | [optional] +**max_order_volume** | **str** | Maximum Order Volume | [optional] +**min_order_volume** | **str** | Minimum Order Volume | [optional] +**leverage** | **str** | Leverage multiplier | [optional] +**price_precision** | **int** | Price precision (decimal places) | [optional] +**price_sl_level** | **str** | Stop Loss Price Level | [optional] +**swap_cost_type** | **str** | Swap Cost Type | [optional] +**buy_swap_cost_rate** | **str** | Buy Swap Cost Rate | [optional] +**sell_swap_cost_rate** | **str** | Sell Swap Cost Rate | [optional] +**swap_cost_3day** | **str** | 3-Day Swap Cost | [optional] +**trade_timezone** | **str** | Trading Timezone | [optional] +**trade_mode** | **str** | Trading mode code (0=disabled, 1=long only, 2=short only, 3=close only, 4=full trading access) | [optional] +**icon_link** | **str** | Symbol icon URL | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContractMartingaleCreateParams.md b/docs/ContractMartingaleCreateParams.md new file mode 100644 index 00000000..60957272 --- /dev/null +++ b/docs/ContractMartingaleCreateParams.md @@ -0,0 +1,18 @@ +# ContractMartingaleCreateParams + +The creation parameters of the contract Martin strategy. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invest_amount** | **str** | Margin allocated; the server converts it to initial contract size using live contract price, contract multiplier, and minimum lot size. | +**price_deviation** | **str** | | +**max_orders** | **int** | | +**take_profit_ratio** | **str** | | +**direction** | [**ContractMartingaleDirection**](ContractMartingaleDirection.md) | | +**leverage** | **str** | | +**stop_loss_price** | **str** | Legacy field name. The AIHub `contract_martingale` creation path does not map this field today; follow contract martingale rules from the underlying API. MCP tooling must match bot-service behavior. | [optional] +**profit_sharing_ratio** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContractMartingaleCreateRequest.md b/docs/ContractMartingaleCreateRequest.md new file mode 100644 index 00000000..c1051e6f --- /dev/null +++ b/docs/ContractMartingaleCreateRequest.md @@ -0,0 +1,13 @@ +# ContractMartingaleCreateRequest + +Create the request body of the contract Martin strategy. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_type** | **str** | | +**market** | **str** | | +**create_params** | [**ContractMartingaleCreateParams**](ContractMartingaleCreateParams.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Eth2Swap.md b/docs/ContractMartingaleDirection.md similarity index 64% rename from docs/Eth2Swap.md rename to docs/ContractMartingaleDirection.md index 9ce975e6..385014d2 100644 --- a/docs/Eth2Swap.md +++ b/docs/ContractMartingaleDirection.md @@ -1,11 +1,9 @@ -# Eth2Swap +# ContractMartingaleDirection -ETH Mining +The direction enumeration supported by the contract Martin strategy is consistent with the original interface of the App. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**side** | **str** | 1-Forward Swap (ETH -> GTETH), 2-Reverse Swap (GTETH -> ETH) | -**amount** | **str** | Swap Amount | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ContractStat.md b/docs/ContractStat.md index 86c1de92..d1d09c82 100644 --- a/docs/ContractStat.md +++ b/docs/ContractStat.md @@ -9,14 +9,24 @@ Name | Type | Description | Notes **long_liq_size** | **str** | Long liquidation size (contracts) | [optional] **long_liq_amount** | **float** | Long liquidation amount (base currency) | [optional] **long_liq_usd** | **float** | Long liquidation volume (quote currency) | [optional] +**long_liq_usd_new** | **float** | Long liquidations in quote currency; USDT settlement: long_liq_size × multiplier × mark price | [optional] **short_liq_size** | **str** | Short liquidation size (contracts) | [optional] **short_liq_amount** | **float** | Short liquidation amount (base currency) | [optional] **short_liq_usd** | **float** | Short liquidation volume (quote currency) | [optional] +**short_liq_usd_new** | **float** | Short liquidations in quote currency; USDT settlement: short_liq_size × multiplier × mark price | [optional] **open_interest** | **str** | Total open interest size (contracts) | [optional] **open_interest_usd** | **float** | Total open interest volume (quote currency) | [optional] **top_lsr_account** | **float** | Top trader long/short account ratio | [optional] **top_lsr_size** | **str** | Top trader long/short position ratio | [optional] **mark_price** | **float** | Mark price | [optional] +**top_long_size** | **str** | Top long open interest (contracts) | [optional] +**top_short_size** | **str** | Top short open interest (contracts) | [optional] +**long_taker_size** | **str** | Long taker trade volume (contracts) | [optional] +**short_taker_size** | **str** | Short taker trade volume (contracts) | [optional] +**top_long_account** | **int** | Number of top long accounts (large holders) | [optional] +**top_short_account** | **int** | Number of top short accounts (large holders) | [optional] +**long_users** | **int** | Number of users holding long positions | [optional] +**short_users** | **int** | Number of users holding short positions | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ConvertCurrenciesV2Item.md b/docs/ConvertCurrenciesV2Item.md new file mode 100644 index 00000000..652276a2 --- /dev/null +++ b/docs/ConvertCurrenciesV2Item.md @@ -0,0 +1,12 @@ +# ConvertCurrenciesV2Item + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**icon_url** | **str** | | [optional] +**name** | **str** | | +**priority** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CouponApi.md b/docs/CouponApi.md new file mode 100644 index 00000000..0ad95f98 --- /dev/null +++ b/docs/CouponApi.md @@ -0,0 +1,164 @@ +# gate_api.CouponApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_user_coupons**](CouponApi.md#list_user_coupons) | **GET** /coupon/user-coupon-list | Coupon Center list +[**get_user_coupon_detail**](CouponApi.md#get_user_coupon_detail) | **GET** /coupon/user-coupon-detail | Coupon Center details + + +# **list_user_coupons** +> ListUserCouponsResponse list_user_coupons(expired=expired, limit=limit, last_id=last_id, expire_time=expire_time, order_by=order_by, type=type, is_task_coupon=is_task_coupon) + +Coupon Center list + +## Interface description The general list interface of the card and coupon center returns all the cards and coupons of the currently logged in user (supports paging, filtering type, and valid/invalid switching). --- ## Query Parameters | Parameter name | Type | Required | Default value | Constraints | Description | |--------|------|------|--------|------|------| | `expired` | integer | No | `0` | `0` or `1` | `0` = Query valid cards and coupons; `1` = Check expired/used cards | | `limit` | integer | No | `10` | 1 ~ 20 | The number of cards returned per page | | `last_id` | integer | No | `0` | 1 ~ 1000000000 | Cursor paging: the last record of the previous page `id`, the home page does not transmit | | `expire_time` | integer | no | `0` | 1 ~ 2147483647 | Cursor pagination: with `last_id` Union usage expiration time (Unix timestamp) | | `order_by` | string | no | `latest` | `latest` / `expired` | Sorting method: `latest` = sort by latest receipt; `expired` = sort by expiration time in ascending order | | `type` | string | No | Empty (return all) | See the card type table below | Only return cards of the specified type | | `is_task_coupon` | integer | No | Do not pass (return all) | `0` or `1` | `0` = Only ordinary cards and coupons are returned; `1` = Only mission cards and coupons are returned; both are returned without passing | ### Supported coupon types (`type` parameter enumeration value) The main site (gate.io default site) supports the following types, and different sub-sites (Türkiye, United States, Malta, Australia) have their own whitelist restrictions. | `type` value | Coupon name | Version limit (below this version will not be returned/cannot be transferred) | |-----------|---------|-------------------------------| | `position_voucher` | Position experience coupon | Unlimited | | `tradfi_position_voucher` | TradFi position experience coupon | Android < 7320000 / iOS < 202507320000 does not return | | `contract_bonus` | Contract trial bonus | Unlimited | | `contract_bonus_new` | Contract experience coupon | Unlimited | | `commission_rebate` | Fee rebate coupons | Unlimited | | `hold_bonus` | Financial management trial bonus | Unlimited | | `point` | Point card | Unlimited (main site/Türkiye site only) | | `financial_rate` | Interest rate coupons | Unlimited | | `robot_bonus` | Robot trial bonus | Unlimited | | `loss_protection_copier` | Worry-free money for copying orders | Unlimited | | `vip_card` | VIP experience card | Unlimited | | `interest_voucher` | Leveraged coupons | Unlimited | | `p2p` | P2P transaction coupons | Unlimited | | `cash` | Cash Vouchers | Unlimited | | `crypto_loan_interest` | Mortgage currency interest reduction coupons | Android < 7290000 / iOS < 202507290000 does not return | | `copy_trading` | Trading experience bonus | Android < 7320000 / iOS < 202507320000 No return | | `alpha_voucher` | Alpha Cash Voucher | Android < 7320000 / iOS < 202507320000 Do not return | | `etf_voucher` | ETF trial fund | Android < 7320000 / iOS < 202507320000 No return | --- ##Response ### Outer structure ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": true, \"list\": [ ...array of coupon objects... ] } } ``` | Field | Type | Description | |------|------|------| | `code` | integer | `0` = success | | `message` | string | response message | | `data.next_page` | boolean | Whether there is a next page. `true` = There is more data, the `id` of the last item on this page needs to be `last_id` is passed in for the next request | | `data.list` | array | Array of coupon objects, see below for details | --- ### Public fields of card and coupon objects (included in all types) | Field name | Type | Description | |--------|------|------| | `id` | integer | Card and coupon issuance record ID (`coupon_send_issuing_log.id`), used for paging cursor `last_id` | | `details_id` | integer | The primary key ID of the user card details table (independent tables for each type) | | `coupon_type` | string | Coupon type, see the enumeration table above | | `name` | string | Card display name (i18n translated) | | `amount` | string | Coupon denomination (formatted string, including thousandth sign). Different types have different meanings, see explanation below | | `currency` | string | The denomination unit. Different types have different values, see explanation below | | `rule_new` | string | Use rule text (this field in the list interface always returns the empty string `\"\"`, and only in the detail interface) | | `status` | string | Card status, see status enumeration below | | `jump_url` | object | jump link | | `jump_url.web` | string | Web jump link | | `jump_url.app` | string | App jump link | | `jump_url.mini_app` | string | Mini program jump link (most types are empty strings) | | `help_url` | object | Help center link | | `help_url.web` | string | Web help link | | `help_url.app` | string | App help link | | `expire_time` | integer | Expiration time (Unix timestamp). Note: Some types will be adjusted to the actual expiration time after they have been activated or used | | `expire_time_order_by` | integer | Expiration time for sorting (taken from the original expiration time of the issuance record, not affected by activation) | | `expire_second` | integer | The number of seconds remaining before expiration (expired or point card type returns `0`) | | `has_usage_history` | boolean | Whether there is a usage record (the point card type is fixed to `true`, and the rest are judged based on the type) | | `has_progress` | boolean | Whether to display the progress bar (only `commission_rebate`, `interest_voucher` and task coupons that meet the conditions are `true`) | | `progress_config` | object | Progress bar configuration, when `has_progress` is `false`, each field is an empty string | | `progress_config.total_balance` | string | The total amount to be completed | | `progress_config.current_used` | string | Amount used | | `progress_config.current_achived` | string | Amount achieved | | `progress_config.currency` | string | Progress unit | | `activation_info` | object | Activation information exclusive to each type, see each type description below (types without exclusive information return empty objects `{}`) | | `is_task_coupon` | integer | `0` = ordinary coupon; `1` = task coupon | | `upgrade_toast` | boolean | Whether the user needs to be prompted to upgrade the App (`true` when the version is too old and cannot support the coupon) | | `task_title` | string | Task title (only task coupons have value, ordinary coupons are `\"\"`) | | `task_desc` | string | Task description (only task coupons have value, ordinary coupons are `\"\"`) | | `task_start_at` | integer | Task start timestamp (only `TASK_EXPIRED` status task coupons have value, the rest are `0`) | | `task_expire_at` | integer | Task expiration timestamp (currently fixed to `0`, reserved field) | | `task_completed_at` | integer | Task completion timestamp (currently fixed at `0`, reserved field) | | `extra` | array | Extended field, fixed return empty array `[]` | --- ### `status` status enumeration | Value | Applicable objects | Description | |----|---------|------| | `NOT_ACTIVE` | Ordinary coupons | Pending activation (not yet activated) | | `ACTIVATED` | Ordinary coupons | Activated (activating or after activation) | | `TO_BE_USED` | Ordinary coupons | To be used (valid and not used) | | `EXPIRED` | Ordinary coupons | Expired (expired without being used) | | `RECYCLED` | Ordinary cards and coupons | Recycled (such as contract recharge experience coupons are recycled) | | `INVALID` | Ordinary coupons | Expired | | `USED` | Ordinary coupons | Used/consumed | | `UNKNOWN` | Ordinary coupons | Unknown status | | `LOCKED` | Ordinary cards and coupons (`p2p`) | Locked (P2P transaction in progress, waiting for write-off) | | `TASK_START` | Task coupons | The task has not started (the coupon has been issued and the task is to be started) | | `TASK_WAIT` | Task coupons | Task in progress (to be completed) | | `TASK_DONE` | Task coupons | The task has been completed (receiving is being processed) | | `TASK_EXPIRED` | Task coupon | The task is not completed and has expired | | `TASK_NOT_STARTED_EXPIRED` | Task coupon | The task has expired before it started | | `TASK_RECEIVE_SUCCESS` | Task coupons | Task rewards received successfully | | `TASK_RECEIVE_FAIL` | Task coupons | Failed to receive task rewards | --- ### `amount` / `currency` Description of each type | `coupon_type` | `amount` description | `currency` value | |---------------|--------------|---------------| | `point` | Point card balance (including thousandths) | `\"POINT\"` | | `position_voucher` | `Coupon face amount × leverage multiple` (including thousandths) | Such as `\"USDT\"` | | `tradfi_position_voucher` | `Coupon face amount × leverage multiple` (including thousandths) | `\"USDx\"` | | `financial_rate` | Interest rate increase value + `%`, such as `\"5%\"` | `\"APR\"` | | `vip_card` | VIP level number, such as `\"4\"` | `\"VIP\"` | | `interest_voucher` | Interest rate discount percentage + `%` | Discount logo (Chinese site is `\"discount\"`, other sites are empty) | | `crypto_loan_interest` | Interest rate discount percentage + `%` | `\"\"` | | `alpha_voucher` | Coupon face amount (including thousandths) | Alpha base currency (such as `\"USDT\"` or `\"ETH\"`) | | Other types | Coupon face amount (including thousandths) | Capital currency symbol, such as `\"USDT\"` / `\"GT\"` / `\"BTC\"` | > **Note**: The `point` type additionally returns the `origin_amount` field (the original balance string with the trailing zeros removed), other types do not have this field. --- ### `activation_info` Exclusive fields for each type #### `interest_voucher` (leverage coupon) ```json { \"supported_pairs\": \"BTC/USDT\", \"transaction_type\": \"borrow\" } ``` | Field | Type | Description | |------|------|------| | `supported_pairs` | string | Applicable trading pairs, separated by `/`, such as `\"BTC/USDT\"` | | `transaction_type` | string | Transaction type (such as `borrow`) | #### `contract_bonus_new` (contract experience coupon) ```json { \"received_expired_hour\": 48 } ``` | Field | Type | Description | |------|------|------| | `received_expired_hour` | integer | The number of hours valid after activation (automatic recycling after timeout) | #### `contract_bonus` (Contract experience bonus) ```json { \"check_unified_account_mode\": true, \"received_expired_days\": 7, \"abtest\": false } ``` | Field | Type | Description | |------|------|------| | `check_unified_account_mode` | boolean | Whether to check the unified account mode (fixed `true`) | | `received_expired_days` | integer | Number of days valid after activation | | `abtest` | boolean | AB test flag (currently fixed to `false`) | #### `commission_rebate` (handling fee cashback coupon) ```json { \"market\": \"futures\", \"market_name\": \"Futures\" } ``` | Field | Type | Description | |------|------|------| | `market` | string | Applicable market, enumeration value: `spot` / `margin` / `futures` / `alpha` / `etf` / `tradfi` | | `market_name` | string | Market display name (i18n translated) | #### `robot_bonus` (robot experience bonus) ```json { \"designated_bots\": \"DISABLED\" } ``` | Field | Type | Description | |------|------|------| | `designated_bots` | string | `\"ENABLED\"` = can only be used by specified policies; `\"DISABLED\"` = Unlimited strategy | #### `position_voucher` (position experience coupon) ```json { \"symbols\": \"BTC_USDT\", \"leverage\": \"10\", \"need_user_funds\": 0, \"user_funds_amount\": \"100\", \"position_bonus\": \"500\" } ``` | Field | Type | Description | |------|------|------| | `symbols` | string | Applicable trading pairs (such as `\"BTC_USDT\"`), empty means no limit | | `leverage` | string | Leverage multiple | | `need_user_funds` | integer | `0` = No user-owned funds are required; `1` = Fund allocation is required | | `user_funds_amount` | string | The amount of funds required by the user (meaningful when `need_user_funds=1`) | | `position_bonus` | string | The original amount of the coupon (remove the trailing zero) | #### `tradfi_position_voucher` (TradFi position experience coupon) ```json { \"symbols\": \"AAPL\", \"leverage\": \"5\", \"position_bonus\": \"200\" } ``` | Field | Type | Description | |------|------|------| | `symbols` | string | Applicable to TradFi varieties (such as `\"AAPL\"`), empty means no limit | | `leverage` | string | Leverage multiple | | `position_bonus` | string | The original amount of the coupon (remove the trailing zero) | #### `etf_voucher` (ETF trial bonus) ```json { \"currency_markets\": \"BTC3L_USDT,ETH3L_USDT\", \"amount\": \"50\" } ``` | Field | Type | Description | |------|------|------| | `currency_markets` | string | List of applicable ETF markets (comma separated) | | `amount` | string | The original amount of the coupon (remove the trailing zero) | #### Other types `point` (point card), `hold_bonus` (financial experience fund), `loss_protection_copier` (worry-free money for following orders), `vip_card` (VIP experience card), `p2p` (P2P transaction coupon), `cash` (cash coupon) , `crypto_loan_interest` (interest-reduced coupon for mortgage loan), `copy_trading` (trading experience fee), `alpha_voucher` (Alpha cash coupon), `financial_rate` (interest-increasing coupon) and other types return empty objects: ```json {} ``` --- ## Complete response example ### Ordinary cards and coupons (contract experience money) ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": false, \"list\": [ { \"id\": 1234567, \"details_id\": 890, \"coupon_type\": \"contract_bonus\", \"name\": \"Futures Bonus\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"\", \"status\": \"NOT_ACTIVE\", \"jump_url\": { \"web\": \"/futures/USDT\", \"app\": \"/futures/USDT\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 86400, \"has_usage_history\": false, \"has_progress\": false, \"progress_config\": { \"total_balance\": \"\", \"current_used\": \"\", \"current_achived\": \"\", \"currency\": \"\" }, \"activation_info\": { \"check_unified_account_mode\": true, \"received_expired_days\": 7, \"abtest\": false }, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [] } ] } } ``` ### Task coupons (handling fee cashback coupons) ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": false, \"list\": [ { \"id\": 9876543, \"details_id\": 0, \"coupon_type\": \"commission_rebate\", \"name\": \"10% Futures Commission Rebate\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"\", \"status\": \"TASK_WAIT\", \"jump_url\": { \"web\": \"https://www.gate.io/futures\", \"app\": \"gateio://futures\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 172800, \"has_usage_history\": false, \"has_progress\": true, \"progress_config\": { \"total_balance\": \"1000\", \"current_used\": \"350\", \"current_achived\": \"350\", \"currency\": \"USDT\" }, \"activation_info\": { \"market\": \"futures\", \"market_name\": \"Futures\" }, \"is_task_coupon\": 1, \"upgrade_toast\": false, \"task_title\": \"Trade 1000 USDT to earn commission rebate\", \"task_desc\": \"Complete futures trading volume task to get 100 USDT commission rebate\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [] } ] } } ``` ### Point card (point) ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": false, \"list\": [ { \"id\": 0, \"details_id\": 0, \"coupon_type\": \"point\", \"name\": \"Points\", \"amount\": \"1,234.56\", \"origin_amount\": \"1234.56\", \"currency\": \"POINT\", \"rule_new\": \"...\", \"status\": \"TO_BE_USED\", \"jump_url\": { \"web\": \"/trade/BTC_USDT\", \"app\": \"/trade/BTC_USDT\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 0, \"expire_time_order_by\": 0, \"expire_second\": 0, \"has_usage_history\": true, \"has_progress\": false, \"progress_config\": { \"total_balance\": \"\", \"current_used\": \"\", \"current_achived\": \"\", \"currency\": \"\" }, \"activation_info\": {}, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [] } ] } } ``` + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CouponApi(api_client) +expired = 0 # int | Coupon status filter. `0` = query valid coupons (default); `1` = query expired/used coupons (optional) (default to 0) +limit = 10 # int | Number of coupons returned per page, range 1-20, default 10 (optional) (default to 10) +last_id = 56 # int | Cursor-based pagination: the `id` value of the last record from the previous page, omit (or pass 0) for the first page (optional) +expire_time = 56 # int | Cursor-based pagination: used together with `last_id`, pass the `expire_time_order_by` value of the last record from the previous page (Unix timestamp), omit for the first page (optional) +order_by = 'latest' # str | Sort order. `latest` = by latest claim time descending (default); `expired` = by expiration time ascending (optional) (default to 'latest') +type = 'type_example' # str | Coupon type filter. If not specified, all supported types are returned. Available values: `position_voucher` (position voucher), `tradfi_position_voucher` (TradFi position voucher), `contract_bonus` (futures bonus), `contract_bonus_new` (futures trial coupon), `commission_rebate` (commission rebate coupon), `hold_bonus` (earn trial bonus), `point` (point card), `financial_rate` (interest rate boost coupon), `robot_bonus` (trading bot bonus), `loss_protection_copier` (copy trading loss protection), `vip_card` (VIP trial card), `interest_voucher` (margin interest discount coupon), `p2p` (P2P trading deduction coupon), `cash` (cash coupon), `crypto_loan_interest` (crypto loan interest discount coupon), `copy_trading` (copy trading bonus), `alpha_voucher` (Alpha cash coupon), `etf_voucher` (ETF trial bonus) (optional) +is_task_coupon = 56 # int | Task Coupon Filter. `0` = Return only regular coupons; `1` = Return only task coupons; Omit to return both (optional) + +try: + # Coupon Center list + api_response = api_instance.list_user_coupons(expired=expired, limit=limit, last_id=last_id, expire_time=expire_time, order_by=order_by, type=type, is_task_coupon=is_task_coupon) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CouponApi->list_user_coupons: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **expired** | **int**| Coupon status filter. `0` = query valid coupons (default); `1` = query expired/used coupons | [optional] [default to 0] + **limit** | **int**| Number of coupons returned per page, range 1-20, default 10 | [optional] [default to 10] + **last_id** | **int**| Cursor-based pagination: the `id` value of the last record from the previous page, omit (or pass 0) for the first page | [optional] + **expire_time** | **int**| Cursor-based pagination: used together with `last_id`, pass the `expire_time_order_by` value of the last record from the previous page (Unix timestamp), omit for the first page | [optional] + **order_by** | **str**| Sort order. `latest` = by latest claim time descending (default); `expired` = by expiration time ascending | [optional] [default to 'latest'] + **type** | **str**| Coupon type filter. If not specified, all supported types are returned. Available values: `position_voucher` (position voucher), `tradfi_position_voucher` (TradFi position voucher), `contract_bonus` (futures bonus), `contract_bonus_new` (futures trial coupon), `commission_rebate` (commission rebate coupon), `hold_bonus` (earn trial bonus), `point` (point card), `financial_rate` (interest rate boost coupon), `robot_bonus` (trading bot bonus), `loss_protection_copier` (copy trading loss protection), `vip_card` (VIP trial card), `interest_voucher` (margin interest discount coupon), `p2p` (P2P trading deduction coupon), `cash` (cash coupon), `crypto_loan_interest` (crypto loan interest discount coupon), `copy_trading` (copy trading bonus), `alpha_voucher` (Alpha cash coupon), `etf_voucher` (ETF trial bonus) | [optional] + **is_task_coupon** | **int**| Task Coupon Filter. `0` = Return only regular coupons; `1` = Return only task coupons; Omit to return both | [optional] + +### Return type + +[**ListUserCouponsResponse**](ListUserCouponsResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The endpoint always returns HTTP 200. Business results are distinguished by the code field | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_user_coupon_detail** +> GetUserCouponDetailResponse get_user_coupon_detail(coupon_type, detail_id, is_task_coupon=is_task_coupon) + +Coupon Center details + +## Interface description The general details interface of the card and coupon center returns the complete detailed information of a single card and coupon. Compared with the list interface, it additionally includes: usage rule text, block-based card and coupon detailed attributes (`extra`), and source completion task information (`from_task`). ## Query Parameters | Parameter name | Type | Required | Constraints | Description | | ---------------- | ------- | --- | --------------------- | ------------------------------------------------- | | `coupon_type` | string | Yes | See coupon type enumeration | Coupon type, the value is the same as `coupon-list` has the same interface | | `detail_id` | integer | Yes | min:1, max:2147483647 | Ordinary card and coupon transfer `details_id`; the `id` of the task card and coupon transfer record (i.e. the `id` field in the list) | | `is_task_coupon` | integer | no | `0` or `1`, default `0` | `0` = Ordinary coupons; `1` = mission coupons | > **Note**: The `detail_id` semantics of ordinary coupons and mission coupons are different. > > - Ordinary cards and coupons: `detail_id` = the primary key of each type of user card and coupon table (`details_id` in the list) > - Task coupon: `detail_id` = primary key of issuance record table (`id` in the list) --- ##Response ### Outer structure ```json { \"code\": 0, \"message\": \"\", \"data\": { ...card details object... } } ``` ### Details object fields The details interface returns the same basic fields as the list interface, with differences in the following fields: rule_new | Field name | Type | Difference from list | Description | | ------------------- | ------- | ----------------- | -------------------------------------------- | | `rule_new` | string | **Value** (the list returns an empty string) | Card and coupon usage rule text (i18n translation) | | `extra` | array | **Value** (list returns `[]`) | For the detailed attributes of the cards and coupons in the partitions, please see the description below | | `from_task` | boolean | **New field** | Ordinary coupons redeemed by completing tasks (sub-coupons automatically issued after the task is completed) | | `task_start_at` | integer | **May have value** | Task coupon: task start timestamp; ordinary coupon (`from_task=true`): start time of the source task | | `task_expire_at` | integer | **May have value** | Task coupons: receive the validity expiration timestamp (`0` means no limit); ordinary cards and coupons are fixed `0` | | `task_completed_at` | integer | **May have value** | Task coupon: task completion timestamp; ordinary coupon (`from_task=true`): completion time of the source task | The remaining basic fields (`id`, `details_id`, `coupon_type`, `name`, `amount`, `currency`, `status`, `jump_url`, `help_url`, `expire_time`, `expire_second`, `has_ progress`, `progress_config`, `activation_info`, `is_task_coupon`, `upgrade_toast`, `task_title`, `task_desc`) are exactly the same as the list interface (`listUserCoupons`). --- ## `extra` field description `extra` is a **two-dimensional array**, composed of several \"blocks\", and the front end displays them separately by blocks. ``` extra = [ [block1_item1, block1_item2, ...], // Block 1: Card name/source/status [block2_item1, block2_item2, ...], // Block 2: Core attributes of cards and coupons [block3_item1, block3_item2, ...], // Block 3: time information ] ``` ### The structure of each item in `extra` | Field | Type | Description | | ------- | ---------------- | --------------- | | `type` | string | Display type, enumeration values ​​are shown in the table below | | `key` | string | Label text (i18n translated) | | `value` | string / integer | Value, type changes with `type` | ### `type` enumeration | `type` value | `value` type | description | | ----------- | ---------- | ------------------------ | | `string` | string | Normal text display | | `timestamp` | integer | Unix timestamp, the front end is responsible for formatting into date and time | | `day` | integer | Number of days (integer) | | `hour` | integer | Number of hours (integer) | | `status` | string | Status enum value (same meaning as `status` field) | | `btn` | string | With jump button, `value` is the button copy | --- ## Block 1 (fixed): Coupon name/source/status All types (except `point`) contain this block, the fixed fields are as follows: | Serial number | `type` | `key` (translation key) | `value` | Remarks | | --- | -------- | ----------------------------- | ------- | --------- | | 1 | `string` | `COUPON_VOUCHER_NAME` (coupon name) | Coupon name text | Required | | 2 | `string` | `COUPON_VOUCHER_SOURCE` (coupon source) | Source activity name | Return this item only if there is a source | | 3 | `status` | `COUPON_STATUS` (coupon status) | Status enumeration value | Required | > `extra` of type `point` (point card) is fixed to an empty array `[]`. --- ## Block 2 + Block 3: Exclusive fields for each type ### `contract_bonus` (contract experience bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | -------------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | --------------------------------- | ---------- | ----- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Required | | `day` | `COUPON_USAGE_DURATION` (duration of use) | Number of days valid after activation | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | activation timestamp | only if activated | --- ### `contract_bonus_new` (contract experience coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------ | ------------------ | ------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | Required | | `string` | `COUPON_MAXIMUM_LEVERAGE` (maximum leverage) | `NX` or `Unlimited` | Required | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair list | When there are limited trading pairs | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | --------------------------------- | ---------- | ---- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Required | | `hour` | `COUPON_USAGE_DURATION` (duration of use) | Number of hours valid after activation | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | Activation timestamp | When activated | --- ### `commission_rebate` (handling fee cashback coupon) **Block 2: Core Attributes** | `type` | `key` | `value` description | condition | | -------- | -------------------------------- | -------------- | --- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | Required | | `string` | `COUPON_REBATE_PERCENTAGE` (cashback ratio) | `N%` | Required | | `string` | `COUPON_BALANCE` (remaining balance) | `amount + space + currency` | Required | | `string` | `COUPON_USED_AMOUNT` (used amount) | `Amount + space + currency` | Required | | `string` | `COUPON_APPLICABLE_MARKET` (applicable market) | Market name | Required | **Block 3: Time Information** | `type` | `key` | `value` Description | Conditions | | ----------- | --------------------------------- | ---------- | --------------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Vouchers that require activation are displayed | | `day` | `COUPON_USAGE_DURATION` (duration of use) | Number of days valid after activation | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | Activation timestamp | When the status is activated/used/expired | --- ### `hold_bonus` (Financial Management Experience Bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | -------------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `financial_rate` (interest rate coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------------ | ----------------------- | --- | | `string` | `COUPON_RATE_UP_CAP` (rate increase cap) | `amount + currency` or `Unlimited` | Required | | `string` | `COUPON_RATE_UP_APR` (rate increase ratio) | `N%APR` | Required | | `string` | `COUPON_RATE_UP_TERM_DAYS` (number of days to increase interest rate) | `N days` or `Unlimited` | Required | | `string` | `COUPON_AVAILABLE_INVESTMENT_TYPE` (available financial management type) | Such as `Lend & Earn` | required | | `string` | `COUPON_AVAILABLE_PRODUCTS` (available products) | List of product names (comma separated) | Required | | `string` | `COUPON_MINIMUM_INVESTMENT_UP` (minimum purchase amount) | `≥ Amount Currency` or interval | required | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `robot_bonus` (robot experience bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------ | ------------------------ | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (coupon amount) | `amount + space + Currency` | Required | | `string` | `COUPON_APPLICABLE_BOTS` (for robots) | such as `Future Grids` | Unlimited robot time | | `string` | `COUPON_MAXIMUM_LEVERAGE` (maximum leverage multiple) | Multiples | Unlimited and with leverage restrictions | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair or `All` | When not limited to robots | | `string` | `COUPON_STOP_LOSS_AMOUNT` (stop loss amount) | `Amount + Currency` | When there is a stop loss amount | | `btn` | `COUPON_DESIGNATED_BOTS` (limited to bots) | `ViewMyaccountLeft` Button copy | When limited to robots | | `day` | `COUPON_RUNTIME_DURATION` (running duration) | Number of days | required | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `loss_protection_copier` (worry-free money for following orders) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ----------------------------------- | ------------------- | ------------ | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | Required | | `string` | `COUPON_APPLICABLE_MARKET` (where applicable) | `Contract` or `Spot` | Required | | `string` | `COUPON_MINIMUM_INVESTMENT` (minimum order amount) | `amount + currency` | When there is a minimum amount limit | | `string` | `COUPON_AVAILABLE_TRADERS` (available traders) | Nickname list | When Partially Available (Designated Trader) | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | use timestamp | when there is use time | --- ### `position_voucher` (position experience coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------ | ----------------- | ------- | | `string` | `COUPON_VOUCHER_AMOUNT` (coupon amount) | `Amount × Leverage + Space + Currency` | Required | | `string` | `COUPON_APPLICABLE_MARKET` (applicable market) | `USDT Perpetual Contract` | Required | | `hour` | `COUPON_POSITION_DURATION` (position duration) | Number of hours | Required | | `string` | `COUPON_LEVERAGE` (leverage multiple) | `NX` | Required | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair, empty means no limit | Required | | `string` | `COUPON_USER_INVESTMENT_QUOTA` (capital quota) | `amount + currency` | When user allocation is required | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `tradfi_position_voucher` (TradFi position experience coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------------ | ----------------- | | `string` | `COUPON_VOUCHER_AMOUNT` (coupon amount) | `Amount × Leverage + Space + Currency` | | `string` | `COUPON_POSITION_DURATION` (position duration) | `N trading days` | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | TradFi varieties | | `string` | `COUPON_LEVERAGE` (leverage multiple) | `Nx` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `vip_card` (VIP experience card) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------- | ---------- | | `string` | `COUPON_VIP_TIER` (VIP level) | `VIPN` | | `day` | `COUPON_BENEFIT_DURATION` (benefits duration) | Number of days | **Block 3: Time information** | `type` | `key` | `value` Description | Conditions | | ----------- | --------------------------------- | ---------- | ----------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Create timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | Activation timestamp | When the status is used or expired | | `timestamp` | `COUPON_EXPIRY_TIME` (expiration time) | Expiration timestamp | When the status is used or expired | --- ### `p2p` (P2P transaction discount coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------- | -------------- | | `string` | `COUPON_DEDUCTION_LIMIT` (deduction limit) | `amount + currency` | | `string` | `COUPON_DEDUCTION_RATIO` (discount ratio) | `N%` | | `string` | `COUPON_USAGE_CONDITIONS` (conditions of use) | `No less than N currencies per transaction` | | `string` | `COUPON_SUPPORTED_FIAT` (for fiat currencies) | Fiat currency list or `all` | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `interest_voucher` (leverage coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | --------------------------------------- | ----------------- | -------- | | `string` | `max_discount_amount` (maximum discount amount) | `amount + currency` | Required | | `string` | `COUPON_APPLICABLE_TRADES` (applicable transactions) | `Isolated Margin` | Required | | `string` | `COUPON_INTEREST_DISCOUNT` (reduction ratio) | `N%` | Required | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair, empty means no limit | Required | | `string` | `COUPON_BALANCE` (remaining balance) | `amount + currency` | Required | | `string` | `COUPON_BORROWING_AMOUNT_LIMIT` (borrowing amount limit) | Borrowing amount range | When there is a limit on the borrowing amount | | `hour` | `COUPON_VALIDITY_PERIOD` (reduction time) | Number of hours | When set | **Block 3: Time Information** | `type` | `key` | `value` Description | Conditions | | ----------- | ------------------------------------- | ---------- | -------------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | When the status is pending or expired | | `timestamp` | `COUPON_EFFECTIVE_TIME` (reduction start time) | Start using timestamp | When the status is invalid/in use/used | | `timestamp` | `COUPON_DISCOUNT_EXPIRY_TIME` (reduction expiry time) | Reduction expiration timestamp | When the status is invalid/in use/used | --- ### `cash` (cash coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + currency` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When there is a redemption time | --- ### `crypto_loan_interest` (Mortgage loan interest coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ---------------------------------------------- | ---------- | -------- | | `string` | `coupon_center_discount_max_amount` (maximum discount amount) | `amount + currency` | Required | | `string` | `COUPON_INTEREST_DISCOUNT` (reduction ratio) | `N%` | Required | | `string` | `coupon_center_loan_min_amount` (minimum loan amount) | `amount + currency` | When there is a minimum amount requirement | | `hour` | `coupon_center_interest_discount_period` (discount duration) | Number of hours | Required | | `string` | `coupon_center_trade_applicable` (applicable transactions) | `demand deposit` | Required | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `copy_trading` (Following experience bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ---------------------------------- | ------------------- | ---- | | `string` | `COUPON_VOUCHER_AMOUNT` (face value) | `amount + currency` | Required | | `string` | `coupon_applicable_traders` (applicable traders) | `all` or `specified traders` | Required | | `string` | `coupon_trade_category` (applicable transaction type) | `Spot` or `Contract` | Required | | `day` | `coupon_usage_days` (the number of days the experience is valid) | Number of days | Required | | `string` | `COUPON_STOP_LOSS_AMOUNT` (stop loss amount) | `amount + currency` | Required | | `string` | `coupon_ineligible_mkts` (cannot experience the market) | Market list | When there are restrictions | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `alpha_voucher` (Alpha cash coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + currency` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When there is a collection time | --- ### `etf_voucher` (ETF trial bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------------ | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + currency` | | `hour` | `coupon_trial_duration` (trial duration) | Number of hours | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | ETF market list | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | use timestamp | when there is use time | --- ### `point` (point card) `extra` always returns `[]` without any blocks. --- ## Complete response example ### Ordinary cards and coupons (handling fee cashback coupons) ```json { \"code\": 0, \"message\": \"\", \"data\": { \"id\": 1234567, \"details_id\": 890, \"coupon_type\": \"commission_rebate\", \"name\": \"10% Futures Commission Rebate\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"Rebate up to 100% of futures trading fee within 30 days.\", \"status\": \"TO_BE_USED\", \"jump_url\": { \"web\": \"/futures/USDT\", \"app\": \"/futures/USDT\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 86400, \"has_usage_history\": false, \"has_progress\": true, \"progress_config\": { \"total_balance\": \"100\", \"current_used\": \"30\", \"current_achived\": \"30\", \"currency\": \"USDT\" }, \"activation_info\": { \"market\": \"futures\", \"market_name\": \"Futures\" }, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"from_task\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [ [ { \"type\": \"string\", \"key\": \"Coupon name\", \"value\": \"10% Futures Commission Rebate\" }, { \"type\": \"string\", \"key\": \"Card and coupon source\", \"value\": \"New user registration activity\" }, { \"type\": \"status\", \"key\": \"Card and coupon status\", \"value\": \"TO_BE_USED\" } ], [ { \"type\": \"string\", \"key\": \"Card coupon amount\", \"value\": \"100 USDT\" }, { \"type\": \"string\", \"key\": \"Cashback ratio\", \"value\": \"10%\" }, { \"type\": \"string\", \"key\": \"Remaining Amount\", \"value\": \"100 USDT\" }, { \"type\": \"string\", \"key\": \"Used quota\", \"value\": \"0 USDT\" }, { \"type\": \"string\", \"key\": \"Applicable markets\", \"value\": \"Futures\" } ], [ { \"type\": \"timestamp\", \"key\": \"Get time\", \"value\": 1757000000 }, { \"type\": \"day\", \"key\": \"duration\", \"value\": 30 } ] ] } } ``` ### Task coupons (position experience coupons) ```json { \"code\": 0, \"message\": \"\", \"data\": { \"id\": 9876543, \"details_id\": 0, \"coupon_type\": \"position_voucher\", \"name\": \"position experience coupon\", \"amount\": \"5,000\", \"currency\": \"USDT\", \"rule_new\": \"Experience the position coupon rules...\", \"status\": \"TASK_WAIT\", \"jump_url\": { \"web\": \"https://www.gate.io/futures\", \"app\": \"gateio://futures\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 172800, \"has_usage_history\": false, \"has_progress\": true, \"progress_config\": { \"total_balance\": \"10000\", \"current_used\": \"3000\", \"current_achived\": \"3000\", \"currency\": \"USDT\" }, \"activation_info\": { \"symbols\": \"BTC_USDT\", \"leverage\": \"10\", \"need_user_funds\": 0, \"user_funds_amount\": \"\", \"position_bonus\": \"500\" }, \"is_task_coupon\": 1, \"upgrade_toast\": false, \"from_task\": false, \"task_title\": \"Complete 10,000 USDT contract trading volume and obtain position experience coupon\", \"task_desc\": \"Complete the specified trading volume task in the perpetual contract\", \"task_start_at\": 1757000000, \"task_expire_at\": 1760000000, \"task_completed_at\": 0, \"extra\": [ [ { \"type\": \"string\", \"key\": \"Card name\", \"value\": \"position experience coupon\" }, { \"type\": \"status\", \"key\": \"Card and coupon status\", \"value\": \"TASK_WAIT\" } ], [ { \"type\": \"string\", \"key\": \"Coupon amount\", \"value\": \"5,000 USDT\" }, { \"type\": \"string\", \"key\": \"Applicable market\", \"value\": \"USDT perpetual contract\" }, { \"type\": \"hour\", \"key\": \"position duration\", \"value\": 24 }, { \"type\": \"string\", \"key\": \"Leverage multiple\", \"value\": \"10X\" }, { \"type\": \"string\", \"key\": \"Limited trading pairs\", \"value\": \"BTCUSDT\" } ], [ { \"type\": \"timestamp\", \"key\": \"Get time\", \"value\": 1757000000 } ] ] } } ``` ### P2P transaction coupon (p2p) ```json { \"code\": 0, \"message\": \"\", \"data\": { \"id\": 5678901, \"details_id\": 234, \"coupon_type\": \"p2p\", \"name\": \"5.5% P2P transaction discount coupon\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"Each P2P transaction can deduct up to 100 USDT in handling fees, with a discount rate of 5.5%, and each transaction is not less than 200 USDT.\", \"status\": \"TO_BE_USED\", \"jump_url\": { \"web\": \"/p2p\", \"app\": \"gateio://p2p\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 2592000, \"has_usage_history\": false, \"has_progress\": false, \"progress_config\": { \"total_balance\": \"\", \"current_used\": \"\", \"current_achived\": \"\", \"currency\": \"\" }, \"activation_info\": {}, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"from_task\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [ [ { \"type\": \"string\", \"key\": \"Coupon name\", \"value\": \"5.5% P2P transaction discount coupon\" }, { \"type\": \"string\", \"key\": \"Card and coupon source\", \"value\": \"New user registration activity\" }, { \"type\": \"status\", \"key\": \"Card and coupon status\", \"value\": \"TO_BE_USED\" } ], [ { \"type\": \"string\", \"key\": \"deduction limit\", \"value\": \"100 USDT\" }, { \"type\": \"string\", \"key\": \"Discount ratio\", \"value\": \"5.5%\" }, { \"type\": \"string\", \"key\": \"Usage conditions\", \"value\": \"Each transaction must not be less than 200 USDT\" }, { \"type\": \"string\", \"key\": \"Applicable legal currency\", \"value\": \"CNY, USD\" } ], [ { \"type\": \"timestamp\", \"key\": \"Get time\", \"value\": 1757000000 }, { \"type\": \"timestamp\", \"key\": \"expiration time\", \"value\": 1760000000 } ] ] } } ``` --- ## Error code | `code` | Description | | -------------------------------------------- | ------------------------- | | `0` | Success | | `10001`(`COUPON_SEND_ISSUING_LOG_NOT_FOUND`) | The card and coupon record does not exist or does not belong to the current user | | `10000` (`PARAMS_INVALID`) | The parameter is invalid (such as the task card is missing coupon_info) | | `50105` (`INVALID_PARAMETERS`) | Input parameter verification failed (such as coupon_type illegal) | + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CouponApi(api_client) +coupon_type = 'coupon_type_example' # str | Coupon type enum. If not specified, all supported types are returned. Available values: `position_voucher` (position voucher), `tradfi_position_voucher` (TradFi position voucher), `contract_bonus` (futures bonus), `contract_bonus_new` (futures trial coupon), `commission_rebate` (commission rebate coupon), `hold_bonus` (earn trial bonus), `point` (point card), `financial_rate` (interest rate boost coupon), `robot_bonus` (trading bot bonus), `loss_protection_copier` (copy trading loss protection), `vip_card` (VIP trial card), `interest_voucher` (margin interest discount coupon), `p2p` (P2P trading deduction coupon), `cash` (cash coupon), `crypto_loan_interest` (crypto loan interest discount coupon), `copy_trading` (copy trading bonus), `alpha_voucher` (Alpha cash coupon), `etf_voucher` (ETF trial bonus) +detail_id = 56 # int | Coupon ID. **Regular coupon**: pass `details_id` from the list (primary key of each type's user coupon table); **Task coupon**: pass `id` from the list (primary key of the distribution record table) +is_task_coupon = 0 # int | Coupon source type. `0` = regular coupon (default); `1` = task coupon. This parameter determines the query logic for `detail_id` (optional) (default to 0) + +try: + # Coupon Center details + api_response = api_instance.get_user_coupon_detail(coupon_type, detail_id, is_task_coupon=is_task_coupon) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CouponApi->get_user_coupon_detail: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **coupon_type** | **str**| Coupon type enum. If not specified, all supported types are returned. Available values: `position_voucher` (position voucher), `tradfi_position_voucher` (TradFi position voucher), `contract_bonus` (futures bonus), `contract_bonus_new` (futures trial coupon), `commission_rebate` (commission rebate coupon), `hold_bonus` (earn trial bonus), `point` (point card), `financial_rate` (interest rate boost coupon), `robot_bonus` (trading bot bonus), `loss_protection_copier` (copy trading loss protection), `vip_card` (VIP trial card), `interest_voucher` (margin interest discount coupon), `p2p` (P2P trading deduction coupon), `cash` (cash coupon), `crypto_loan_interest` (crypto loan interest discount coupon), `copy_trading` (copy trading bonus), `alpha_voucher` (Alpha cash coupon), `etf_voucher` (ETF trial bonus) | + **detail_id** | **int**| Coupon ID. **Regular coupon**: pass `details_id` from the list (primary key of each type's user coupon table); **Task coupon**: pass `id` from the list (primary key of the distribution record table) | + **is_task_coupon** | **int**| Coupon source type. `0` = regular coupon (default); `1` = task coupon. This parameter determines the query logic for `detail_id` | [optional] [default to 0] + +### Return type + +[**GetUserCouponDetailResponse**](GetUserCouponDetailResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The endpoint always returns HTTP 200. Business results are distinguished by the code field | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/CreateChaseOrderReq.md b/docs/CreateChaseOrderReq.md new file mode 100644 index 00000000..ff6e44ec --- /dev/null +++ b/docs/CreateChaseOrderReq.md @@ -0,0 +1,23 @@ +# CreateChaseOrderReq + +Request body for creating a chase order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract** | **str** | Contract name; server-side converted to uppercase | +**settle** | **str** | Settle currency, overridden by the path parameter and converted to lowercase | [optional] +**amount** | **str** | Total order size in contracts, decimal string. Positive for buy, negative for sell. Cannot be 0 | +**price_limit** | **str** | 最高追逐价,合法十进制字符串;未设置限价时请传 \"0\" | +**offset_limit** | **str** | Maximum chasing distance from the best price, mutually exclusive with price_limit | [optional] +**reduce_only** | **bool** | Whether reduce only | [optional] +**text** | **str** | Optional custom tag | [optional] +**is_dual_mode** | **bool** | Whether dual-position mode is enabled | [optional] +**price_type** | **int** | Price type: 1 best bid/ask, 2 distance from best bid/ask | [optional] +**price_gap_type** | **int** | Used when price_type == 2: 1 absolute price gap, 2 percentage | [optional] +**price_gap_value** | **str** | Price gap value paired with price_gap_type | [optional] +**pos_margin_mode** | **str** | Position margin mode, e.g. isolated or cross | [optional] +**position_mode** | **str** | Position mode (e.g. single, dual, dual_plus) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateChaseOrderResp.md b/docs/CreateChaseOrderResp.md new file mode 100644 index 00000000..fde72249 --- /dev/null +++ b/docs/CreateChaseOrderResp.md @@ -0,0 +1,10 @@ +# CreateChaseOrderResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | ID of the newly created order | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateEarnFixedTermLendResponse.md b/docs/CreateEarnFixedTermLendResponse.md new file mode 100644 index 00000000..b7219f8e --- /dev/null +++ b/docs/CreateEarnFixedTermLendResponse.md @@ -0,0 +1,13 @@ +# CreateEarnFixedTermLendResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Return code, 0 means success | [optional] +**message** | **str** | Response message | [optional] +**data** | [**CreateEarnFixedTermLendResponseData**](CreateEarnFixedTermLendResponseData.md) | | [optional] +**timestamp** | **int** | Response timestamp (in seconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateEarnFixedTermLendResponseData.md b/docs/CreateEarnFixedTermLendResponseData.md new file mode 100644 index 00000000..2d7f3d8c --- /dev/null +++ b/docs/CreateEarnFixedTermLendResponseData.md @@ -0,0 +1,11 @@ +# CreateEarnFixedTermLendResponseData + +Subscription result +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Subscription order ID | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateEarnFixedTermPreRedeemResponse.md b/docs/CreateEarnFixedTermPreRedeemResponse.md new file mode 100644 index 00000000..84a50ab1 --- /dev/null +++ b/docs/CreateEarnFixedTermPreRedeemResponse.md @@ -0,0 +1,13 @@ +# CreateEarnFixedTermPreRedeemResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Return code, 0 means success | [optional] +**message** | **str** | Response message | [optional] +**data** | [**object**](.md) | Redemption result (empty object on success) | [optional] +**timestamp** | **int** | Response timestamp (in seconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateOrder.md b/docs/CreateOrder.md new file mode 100644 index 00000000..07c6462f --- /dev/null +++ b/docs/CreateOrder.md @@ -0,0 +1,18 @@ +# CreateOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**user_id** | **int** | | +**_from** | [**list[CreateOrderDetail]**](CreateOrderDetail.md) | | +**to** | [**list[CreateOrderDetail]**](CreateOrderDetail.md) | | +**source** | **str** | | +**app_id** | **str** | | +**client_req_id** | **str** | | +**status** | **int** | | +**create_time** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateOrder2.md b/docs/CreateOrder2.md new file mode 100644 index 00000000..d426809c --- /dev/null +++ b/docs/CreateOrder2.md @@ -0,0 +1,11 @@ +# CreateOrder2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**CreateOrder2Data**](CreateOrder2Data.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateOrder2Data.md b/docs/CreateOrder2Data.md new file mode 100644 index 00000000..c1e3b73b --- /dev/null +++ b/docs/CreateOrder2Data.md @@ -0,0 +1,11 @@ +# CreateOrder2Data + +Order result +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Queue Task ID (not task ID) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateOrderDetail.md b/docs/CreateOrderDetail.md new file mode 100644 index 00000000..801df970 --- /dev/null +++ b/docs/CreateOrderDetail.md @@ -0,0 +1,13 @@ +# CreateOrderDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | | +**icon_url** | **str** | | +**amount** | **str** | | +**amount_show** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateParam.md b/docs/CreateParam.md new file mode 100644 index 00000000..15397fe2 --- /dev/null +++ b/docs/CreateParam.md @@ -0,0 +1,12 @@ +# CreateParam + +**For order only**. Represents a currency and its **amount** on a certain side (`from` or `to`). Used with `OrderCreateV1Req`; **Don't** be used with `to` of the preview interface (preview `to` uses `PreviewToParam.ratio`). +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | Currency symbol, consistent with `GET /asset-swap/asset/list` and business support scope. | +**amount** | **str** | The quantity of this currency on this side, **decimal string** (non-scientific notation). `from` represents the selling quantity, and `to` represents the target side quantity. Different from preview interface `to[].ratio`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateTrailOrder.md b/docs/CreateTrailOrder.md new file mode 100644 index 00000000..953229ff --- /dev/null +++ b/docs/CreateTrailOrder.md @@ -0,0 +1,20 @@ +# CreateTrailOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract** | **str** | Contract name | +**amount** | **str** | Trading quantity in contracts, positive for buy, negative for sell | +**activation_price** | **str** | Activation price, 0 means trigger immediately | [optional] [default to '0'] +**is_gte** | **bool** | true: activate when market price >= activation price, false: <= activation price | [optional] +**price_type** | **int** | Activation price type: 1-latest price, 2-index price, 3-mark price | [optional] +**price_offset** | **str** | Callback ratio or price distance, e.g., `0.1` or `0.1%` | [optional] +**reduce_only** | **bool** | Whether reduce only | [optional] [default to False] +**position_related** | **bool** | Whether bound to a position (if position_related = true (position-related), then reduce_only must also be true) | [optional] [default to False] +**text** | **str** | Order custom information, optional field. Used to identify the order source or set a user-defined ID. If non-empty, it must meet one of the following rules: 1. Internal Reserved Fields (identifying order source): - `apiv4`: API call 2. User-defined Fields (setting custom ID): - Must start with `t-` - The content after `t-` must not exceed 28 bytes in length - Can only contain: numbers, letters, underscores (_), hyphens (-), or dots (.) - Examples: `t-my-order-001`, `t-trail_2024.01` Note: User-defined fields must not conflict with internal reserved fields. | [optional] [default to 'apiv4'] +**pos_margin_mode** | **str** | Position margin mode: isolated/cross | [optional] +**position_mode** | **str** | Position mode: single, dual, and dual_plus | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateTrailOrderResponse.md b/docs/CreateTrailOrderResponse.md new file mode 100644 index 00000000..6b5aff3c --- /dev/null +++ b/docs/CreateTrailOrderResponse.md @@ -0,0 +1,13 @@ +# CreateTrailOrderResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Status code, 0 means success | [optional] +**message** | **str** | Response message | [optional] +**data** | [**CreateTrailOrderResult**](CreateTrailOrderResult.md) | | [optional] +**timestamp** | **int** | Response timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateTrailOrderResult.md b/docs/CreateTrailOrderResult.md new file mode 100644 index 00000000..d8d811da --- /dev/null +++ b/docs/CreateTrailOrderResult.md @@ -0,0 +1,10 @@ +# CreateTrailOrderResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Order ID | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateTransaction.md b/docs/CreateTransaction.md new file mode 100644 index 00000000..c13c1904 --- /dev/null +++ b/docs/CreateTransaction.md @@ -0,0 +1,11 @@ +# CreateTransaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**object**](.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateTransaction2.md b/docs/CreateTransaction2.md new file mode 100644 index 00000000..de68fe56 --- /dev/null +++ b/docs/CreateTransaction2.md @@ -0,0 +1,11 @@ +# CreateTransaction2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**object**](.md) | Returns empty object on success | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateUserResp.md b/docs/CreateUserResp.md new file mode 100644 index 00000000..9c45cf2e --- /dev/null +++ b/docs/CreateUserResp.md @@ -0,0 +1,11 @@ +# CreateUserResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**CreateUserRespData**](CreateUserRespData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateUserRespData.md b/docs/CreateUserRespData.md new file mode 100644 index 00000000..bd3784a4 --- /dev/null +++ b/docs/CreateUserRespData.md @@ -0,0 +1,12 @@ +# CreateUserRespData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **int** | Status (1=not opened, 2=pending review, 3=opened) | [optional] +**leverage** | **int** | Leverage | [optional] +**mt5_uid** | **str** | mt5uid | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossExApi.md b/docs/CrossExApi.md new file mode 100644 index 00000000..ab1a0026 --- /dev/null +++ b/docs/CrossExApi.md @@ -0,0 +1,2645 @@ +# gate_api.CrossExApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_crossex_rule_symbols**](CrossExApi.md#list_crossex_rule_symbols) | **GET** /crossex/rule/symbols | Query symbol information +[**list_crossex_rule_risk_limits**](CrossExApi.md#list_crossex_rule_risk_limits) | **GET** /crossex/rule/risk_limits | Query risk limit information +[**list_crossex_transfer_coins**](CrossExApi.md#list_crossex_transfer_coins) | **GET** /crossex/transfers/coin | Query supported transfer currencies +[**list_crossex_transfers**](CrossExApi.md#list_crossex_transfers) | **GET** /crossex/transfers | Query Fund Transfer History +[**create_crossex_transfer**](CrossExApi.md#create_crossex_transfer) | **POST** /crossex/transfers | Fund Transfer +[**create_crossex_order**](CrossExApi.md#create_crossex_order) | **POST** /crossex/orders | Create order +[**cancel_batch_crossex_orders**](CrossExApi.md#cancel_batch_crossex_orders) | **POST** /crossex/batch_cancel_orders | Batch cancel orders +[**get_crossex_order**](CrossExApi.md#get_crossex_order) | **GET** /crossex/orders/{order_id} | Query order details +[**update_crossex_order**](CrossExApi.md#update_crossex_order) | **PUT** /crossex/orders/{order_id} | Modify Order +[**cancel_crossex_order**](CrossExApi.md#cancel_crossex_order) | **DELETE** /crossex/orders/{order_id} | Cancel Order +[**create_crossex_convert_quote**](CrossExApi.md#create_crossex_convert_quote) | **POST** /crossex/convert/quote | Flash Swap Inquiry +[**create_crossex_convert_order**](CrossExApi.md#create_crossex_convert_order) | **POST** /crossex/convert/orders | Flash Swap Transaction +[**get_crossex_account**](CrossExApi.md#get_crossex_account) | **GET** /crossex/accounts | Query Account Assets +[**update_crossex_account**](CrossExApi.md#update_crossex_account) | **PUT** /crossex/accounts | Modify Account Contract Position Mode and Account Mode +[**get_crossex_positions_leverage**](CrossExApi.md#get_crossex_positions_leverage) | **GET** /crossex/positions/leverage | Query Contract Trading Pair Leverage Multiplier +[**update_crossex_positions_leverage**](CrossExApi.md#update_crossex_positions_leverage) | **POST** /crossex/positions/leverage | Modify Contract Trading Pair Leverage Multiplier +[**get_crossex_margin_positions_leverage**](CrossExApi.md#get_crossex_margin_positions_leverage) | **GET** /crossex/margin_positions/leverage | Query Leveraged Trading Pair Leverage Multiplier +[**update_crossex_margin_positions_leverage**](CrossExApi.md#update_crossex_margin_positions_leverage) | **POST** /crossex/margin_positions/leverage | Modify Leveraged Trading Pair Leverage Multiplier +[**close_crossex_position**](CrossExApi.md#close_crossex_position) | **POST** /crossex/position | Full Close Position +[**get_crossex_positions_margin_mode**](CrossExApi.md#get_crossex_positions_margin_mode) | **GET** /crossex/positions/margin_mode | Get futures position margin mode +[**update_crossex_positions_margin_mode**](CrossExApi.md#update_crossex_positions_margin_mode) | **POST** /crossex/positions/margin_mode | Update futures position margin mode +[**update_crossex_positions_margin**](CrossExApi.md#update_crossex_positions_margin) | **POST** /crossex/positions/margin | Increase or decrease isolated margin +[**get_crossex_interest_rate**](CrossExApi.md#get_crossex_interest_rate) | **GET** /crossex/interest_rate | Query margin asset interest rates +[**get_crossex_fee**](CrossExApi.md#get_crossex_fee) | **GET** /crossex/fee | Query User Fee Rates +[**list_crossex_positions**](CrossExApi.md#list_crossex_positions) | **GET** /crossex/positions | Query Contract Positions +[**list_crossex_margin_positions**](CrossExApi.md#list_crossex_margin_positions) | **GET** /crossex/margin_positions | Query Leveraged Positions +[**list_crossex_adl_rank**](CrossExApi.md#list_crossex_adl_rank) | **GET** /crossex/adl_rank | Query ADL Position Reduction Ranking +[**list_crossex_open_orders**](CrossExApi.md#list_crossex_open_orders) | **GET** /crossex/open_orders | Query All Current Open Orders +[**list_crossex_history_orders**](CrossExApi.md#list_crossex_history_orders) | **GET** /crossex/history_orders | Query order history +[**list_crossex_history_positions**](CrossExApi.md#list_crossex_history_positions) | **GET** /crossex/history_positions | Query Contract Position History +[**list_crossex_history_margin_positions**](CrossExApi.md#list_crossex_history_margin_positions) | **GET** /crossex/history_margin_positions | Query Leveraged Position History +[**list_crossex_history_margin_interests**](CrossExApi.md#list_crossex_history_margin_interests) | **GET** /crossex/history_margin_interests | Query Leveraged Interest Deduction History +[**list_crossex_history_trades**](CrossExApi.md#list_crossex_history_trades) | **GET** /crossex/history_trades | Query filled history +[**list_crossex_account_book**](CrossExApi.md#list_crossex_account_book) | **GET** /crossex/account_book | Query Account Asset Change History +[**list_crossex_coin_discount_rate**](CrossExApi.md#list_crossex_coin_discount_rate) | **GET** /crossex/coin_discount_rate | Query Currency Discount Rate +[**list_crossex_market_tickers**](CrossExApi.md#list_crossex_market_tickers) | **GET** /crossex/market/tickers | Get exchange tickers +[**list_crossex_market_funding_info**](CrossExApi.md#list_crossex_market_funding_info) | **GET** /crossex/market/funding_info | Get exchange futures funding rate information + + +# **list_crossex_rule_symbols** +> list[Symbol] list_crossex_rule_symbols(symbols=symbols) + +Query symbol information + +Query Trading Pair Information + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbols = 'symbols_example' # str | List of trading pairs, comma-separated. Example: BINANCE_FUTURE_ADA_USDT,OKX_FUTURE_ADA_USDT (optional) + +try: + # Query symbol information + api_response = api_instance.list_crossex_rule_symbols(symbols=symbols) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_rule_symbols: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbols** | **str**| List of trading pairs, comma-separated. Example: BINANCE_FUTURE_ADA_USDT,OKX_FUTURE_ADA_USDT | [optional] + +### Return type + +[**list[Symbol]**](Symbol.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_rule_risk_limits** +> list[CrossexRiskLimit] list_crossex_rule_risk_limits(symbols) + +Query risk limit information + +Query risk limit information for futures/margin trading pairs + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbols = 'BINANCE_FUTURE_AAVE_USDT' # str | Trading Pair List, multiple separated by commas Example values: BINANCE_FUTURE_ADA_USDT,GATE_MARGIN_ADA_USDT + +try: + # Query risk limit information + api_response = api_instance.list_crossex_rule_risk_limits(symbols) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_rule_risk_limits: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbols** | **str**| Trading Pair List, multiple separated by commas Example values: BINANCE_FUTURE_ADA_USDT,GATE_MARGIN_ADA_USDT | + +### Return type + +[**list[CrossexRiskLimit]**](CrossexRiskLimit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_transfer_coins** +> list[CrossexTransferCoin] list_crossex_transfer_coins(coin=coin) + +Query supported transfer currencies + +`est_fee`: On-chain withdrawal fee. When a fund transfer involves an on-chain withdrawal, the exchange charges this fee. This value is for reference only; the actual fee charged by the exchange applies + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +coin = 'BTC' # str | Query by specified currency name (optional) + +try: + # Query supported transfer currencies + api_response = api_instance.list_crossex_transfer_coins(coin=coin) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_transfer_coins: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **coin** | **str**| Query by specified currency name | [optional] + +### Return type + +[**list[CrossexTransferCoin]**](CrossexTransferCoin.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_transfers** +> list[CrossexTransferRecord] list_crossex_transfers(coin=coin, order_id=order_id, _from=_from, to=to, page=page, limit=limit) + +Query Fund Transfer History + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +coin = 'USDT, BTC, ETH' # str | Query by specified currency name (optional) +order_id = '38083797492939266' # str | Supports querying by the order ID returned when creating an order (tx_id), as well as a user-defined custom ID specified at creation (text) (optional) +_from = 1750681141933 # int | Start timestamp for the query (optional) +to = 1750681141933 # int | End timestamp for the query, defaults to current time if not specified (optional) +page = 1 # int | Page number (optional) +limit = 100 # int | Maximum number returned by list, max 1000 (optional) + +try: + # Query Fund Transfer History + api_response = api_instance.list_crossex_transfers(coin=coin, order_id=order_id, _from=_from, to=to, page=page, limit=limit) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_transfers: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **coin** | **str**| Query by specified currency name | [optional] + **order_id** | **str**| Supports querying by the order ID returned when creating an order (tx_id), as well as a user-defined custom ID specified at creation (text) | [optional] + **_from** | **int**| Start timestamp for the query | [optional] + **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] + **page** | **int**| Page number | [optional] + **limit** | **int**| Maximum number returned by list, max 1000 | [optional] + +### Return type + +[**list[CrossexTransferRecord]**](CrossexTransferRecord.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_crossex_transfer** +> CrossexTransferResponse create_crossex_transfer(crossex_transfer_request=crossex_transfer_request) + +Fund Transfer + +Rate limit: 10 requests per 10 seconds - In cross-exchange mode, when transferring USDT, either `from` or `to` must be `SPOT`, and the other side must be `CROSSEX`. If `CROSSEX_${exchange_type}` (e.g. `CROSSEX_GATE`) is provided, it will be automatically treated as `CROSSEX`. - In isolated exchange mode, when transferring USDT, either `from` or `to` must be `CROSSEX_${exchange_type}`, and the other side must be `SPOT` or `CROSSEX_${exchange_type}`. If `CROSSEX` is provided, it will be automatically treated as `CROSSEX_GATE`. - When transferring non-USDT assets to or from CrossEx, neither `from` nor `to` can be `CROSSEX`; `CROSSEX_${exchange_type}` must be explicitly specified. - When transferring non-USDT assets, transfers between `CROSSEX_{exchange_type}` accounts are supported, for example: from = `CROSSEX_BINANCE`, to = `CROSSEX_GATE` - When either side of the transfer is `CROSSEX_KRAKEN`, only USDT is supported for now. - When either side of the transfer is `CROSSEX_HYPERLIQUID`, the other side must be `SPOT`, and only USDC is supported. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_transfer_request = gate_api.CrossexTransferRequest() # CrossexTransferRequest | (optional) + +try: + # Fund Transfer + api_response = api_instance.create_crossex_transfer(crossex_transfer_request=crossex_transfer_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->create_crossex_transfer: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_transfer_request** | [**CrossexTransferRequest**](CrossexTransferRequest.md)| | [optional] + +### Return type + +[**CrossexTransferResponse**](CrossexTransferResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_crossex_order** +> CrossexOrderActionResponse create_crossex_order(crossex_order_request=crossex_order_request) + +Create order + +Rate Limit: 100 requests per 10 seconds, maximum 1,000 open orders per user + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_order_request = gate_api.CrossexOrderRequest() # CrossexOrderRequest | (optional) + +try: + # Create order + api_response = api_instance.create_crossex_order(crossex_order_request=crossex_order_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->create_crossex_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_order_request** | [**CrossexOrderRequest**](CrossexOrderRequest.md)| | [optional] + +### Return type + +[**CrossexOrderActionResponse**](CrossexOrderActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **cancel_batch_crossex_orders** +> list[CrossexBatchCancelOrderResponse] cancel_batch_crossex_orders(crossex_batch_cancel_order_request) + +Batch cancel orders + +Cancel multiple specified orders. Either order_id or text is required; if both are provided, order_id takes precedence. Rate limit: 100 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_batch_cancel_order_request = [gate_api.CrossexBatchCancelOrderRequest()] # list[CrossexBatchCancelOrderRequest] | + +try: + # Batch cancel orders + api_response = api_instance.cancel_batch_crossex_orders(crossex_batch_cancel_order_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->cancel_batch_crossex_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_batch_cancel_order_request** | [**list[CrossexBatchCancelOrderRequest]**](CrossexBatchCancelOrderRequest.md)| | + +### Return type + +[**list[CrossexBatchCancelOrderResponse]**](CrossexBatchCancelOrderResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Batch order cancellation request results | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_crossex_order** +> CrossexOrder get_crossex_order(order_id) + +Query order details + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +order_id = '2048522992198912' # str | 1. Supports querying order IDs returned when creating orders 2. Supports custom IDs specified by users when creating orders (i.e., the text field) + +try: + # Query order details + api_response = api_instance.get_crossex_order(order_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->get_crossex_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| 1. Supports querying order IDs returned when creating orders 2. Supports custom IDs specified by users when creating orders (i.e., the text field) | + +### Return type + +[**CrossexOrder**](CrossexOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_crossex_order** +> CrossexOrderActionResponse update_crossex_order(order_id, crossex_order_update_request=crossex_order_update_request) + +Modify Order + +Rate Limit: 100 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +order_id = 'order_id_example' # str | Support Order ID or Text for Modify Order +crossex_order_update_request = gate_api.CrossexOrderUpdateRequest() # CrossexOrderUpdateRequest | (optional) + +try: + # Modify Order + api_response = api_instance.update_crossex_order(order_id, crossex_order_update_request=crossex_order_update_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->update_crossex_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| Support Order ID or Text for Modify Order | + **crossex_order_update_request** | [**CrossexOrderUpdateRequest**](CrossexOrderUpdateRequest.md)| | [optional] + +### Return type + +[**CrossexOrderActionResponse**](CrossexOrderActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **cancel_crossex_order** +> CrossexOrderActionResponse cancel_crossex_order(order_id) + +Cancel Order + +Rate Limit: 100 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +order_id = 'order_id_example' # str | Support Order ID or Text for Cancel Order + +try: + # Cancel Order + api_response = api_instance.cancel_crossex_order(order_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->cancel_crossex_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| Support Order ID or Text for Cancel Order | + +### Return type + +[**CrossexOrderActionResponse**](CrossexOrderActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_crossex_convert_quote** +> CrossexConvertQuoteResponse create_crossex_convert_quote(crossex_convert_quote_request=crossex_convert_quote_request) + +Flash Swap Inquiry + +Rate limit: 100 requests per day For HYPERLIQUID, swaps between `HYPERLIQUID_USDC` and `CROSSEX_USDT` are supported. Flash Swap in isolated exchange mode is not currently supported for HYPERLIQUID + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_convert_quote_request = gate_api.CrossexConvertQuoteRequest() # CrossexConvertQuoteRequest | (optional) + +try: + # Flash Swap Inquiry + api_response = api_instance.create_crossex_convert_quote(crossex_convert_quote_request=crossex_convert_quote_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->create_crossex_convert_quote: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_convert_quote_request** | [**CrossexConvertQuoteRequest**](CrossexConvertQuoteRequest.md)| | [optional] + +### Return type + +[**CrossexConvertQuoteResponse**](CrossexConvertQuoteResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_crossex_convert_order** +> CrossexConvertOrderResponse create_crossex_convert_order(crossex_convert_order_request=crossex_convert_order_request) + +Flash Swap Transaction + +Rate limit: 10 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_convert_order_request = gate_api.CrossexConvertOrderRequest() # CrossexConvertOrderRequest | (optional) + +try: + # Flash Swap Transaction + api_response = api_instance.create_crossex_convert_order(crossex_convert_order_request=crossex_convert_order_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->create_crossex_convert_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_convert_order_request** | [**CrossexConvertOrderRequest**](CrossexConvertOrderRequest.md)| | [optional] + +### Return type + +[**CrossexConvertOrderResponse**](CrossexConvertOrderResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_crossex_account** +> CrossexAccount get_crossex_account(exchange_type=exchange_type) + +Query Account Assets + +Rate Limit: 200 requests per 10 seconds If 100% ≤ initial_margin_rate < 110%, transferring out the margin currency is prohibited. If initial_margin_rate < 100%, the system will automatically cancel orders; only closing positions is allowed, not opening new ones. If maintenance_margin_rate ≤ 100%, the system will force liquidation. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +exchange_type = 'BINANCE,OKX,GATE,BYBIT,KRAKEN,HYPERLIQUID,DERIBIT' # str | Trading venue identifier. Omit in cross-exchange mode; required in isolated-per-venue mode (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT`). (optional) + +try: + # Query Account Assets + api_response = api_instance.get_crossex_account(exchange_type=exchange_type) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->get_crossex_account: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **exchange_type** | **str**| Trading venue identifier. Omit in cross-exchange mode; required in isolated-per-venue mode (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT`). | [optional] + +### Return type + +[**CrossexAccount**](CrossexAccount.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_crossex_account** +> CrossexAccountUpdateResponse update_crossex_account(crossex_account_update_request=crossex_account_update_request) + +Modify Account Contract Position Mode and Account Mode + +Rate Limit: 100 requests per 60 seconds. position_mode+exchange_type modifies contract position mode (exchange_type is required when the user's account mode is split exchange); account_mode modifies the user's account mode. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_account_update_request = gate_api.CrossexAccountUpdateRequest() # CrossexAccountUpdateRequest | (optional) + +try: + # Modify Account Contract Position Mode and Account Mode + api_response = api_instance.update_crossex_account(crossex_account_update_request=crossex_account_update_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->update_crossex_account: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_account_update_request** | [**CrossexAccountUpdateRequest**](CrossexAccountUpdateRequest.md)| | [optional] + +### Return type + +[**CrossexAccountUpdateResponse**](CrossexAccountUpdateResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_crossex_positions_leverage** +> dict(str, str) get_crossex_positions_leverage(symbols=symbols) + +Query Contract Trading Pair Leverage Multiplier + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbols = 'BINANCE_FUTURE_BTC_USDT,OKX_FUTURE_BTC_USDT,GATE_FUTURE_BTC_USDT' # str | Trading Pair List, multiple separated by commas (optional) + +try: + # Query Contract Trading Pair Leverage Multiplier + api_response = api_instance.get_crossex_positions_leverage(symbols=symbols) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->get_crossex_positions_leverage: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbols** | **str**| Trading Pair List, multiple separated by commas | [optional] + +### Return type + +**dict(str, str)** + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_crossex_positions_leverage** +> CrossexLeverageResponse update_crossex_positions_leverage(crossex_leverage_request=crossex_leverage_request) + +Modify Contract Trading Pair Leverage Multiplier + +Rate Limit: 100 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_leverage_request = gate_api.CrossexLeverageRequest() # CrossexLeverageRequest | (optional) + +try: + # Modify Contract Trading Pair Leverage Multiplier + api_response = api_instance.update_crossex_positions_leverage(crossex_leverage_request=crossex_leverage_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->update_crossex_positions_leverage: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_leverage_request** | [**CrossexLeverageRequest**](CrossexLeverageRequest.md)| | [optional] + +### Return type + +[**CrossexLeverageResponse**](CrossexLeverageResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_crossex_margin_positions_leverage** +> dict(str, str) get_crossex_margin_positions_leverage(symbols=symbols) + +Query Leveraged Trading Pair Leverage Multiplier + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbols = 'BINANCE_MARGIN_BTC_USDT,OKX_MARGIN_BTC_USDT,GATE_MARGIN_BTC_USDT' # str | Trading Pair List, multiple separated by commas (optional) + +try: + # Query Leveraged Trading Pair Leverage Multiplier + api_response = api_instance.get_crossex_margin_positions_leverage(symbols=symbols) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->get_crossex_margin_positions_leverage: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbols** | **str**| Trading Pair List, multiple separated by commas | [optional] + +### Return type + +**dict(str, str)** + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_crossex_margin_positions_leverage** +> CrossexLeverageResponse update_crossex_margin_positions_leverage(crossex_leverage_request=crossex_leverage_request) + +Modify Leveraged Trading Pair Leverage Multiplier + +Rate Limit: 100 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_leverage_request = gate_api.CrossexLeverageRequest() # CrossexLeverageRequest | (optional) + +try: + # Modify Leveraged Trading Pair Leverage Multiplier + api_response = api_instance.update_crossex_margin_positions_leverage(crossex_leverage_request=crossex_leverage_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->update_crossex_margin_positions_leverage: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_leverage_request** | [**CrossexLeverageRequest**](CrossexLeverageRequest.md)| | [optional] + +### Return type + +[**CrossexLeverageResponse**](CrossexLeverageResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **close_crossex_position** +> CrossexOrderActionResponse close_crossex_position(crossex_close_position_request=crossex_close_position_request) + +Full Close Position + +Rate limit: 100 requests per day. Automatic position-closing rules. FUTURE and MARGIN positions are supported. Before using this endpoint, ensure that the following prerequisite is met: - There are no open orders for the symbol in the current account. - Once the prerequisite is met, the system checks whether the position meets either of the following conditions: - Less than the minimum notional amount (minNotional) - Less than the minimum order size (minSize) When either condition is met, the system automatically creates a closing order and immediately closes the entire position. This endpoint prevents positions that are too small to be submitted to an exchange from becoming stranded and ensures that small positions can be closed when they fall below the threshold. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_close_position_request = gate_api.CrossexClosePositionRequest() # CrossexClosePositionRequest | (optional) + +try: + # Full Close Position + api_response = api_instance.close_crossex_position(crossex_close_position_request=crossex_close_position_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->close_crossex_position: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_close_position_request** | [**CrossexClosePositionRequest**](CrossexClosePositionRequest.md)| | [optional] + +### Return type + +[**CrossexOrderActionResponse**](CrossexOrderActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_crossex_positions_margin_mode** +> CrossexMarginModeResponse get_crossex_positions_margin_mode(symbol) + +Get futures position margin mode + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbol = 'HYPERLIQUID_FUTURE_CXMT_USDC' # str | Futures trading pair + +try: + # Get futures position margin mode + api_response = api_instance.get_crossex_positions_margin_mode(symbol) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->get_crossex_positions_margin_mode: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Futures trading pair | + +### Return type + +[**CrossexMarginModeResponse**](CrossexMarginModeResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_crossex_positions_margin_mode** +> CrossexMarginModeResponse update_crossex_positions_margin_mode(crossex_margin_mode_request=crossex_margin_mode_request) + +Update futures position margin mode + +Rate limit: 100 requests per 10 seconds. Only Hyperliquid futures trading pairs are supported. The margin mode cannot be changed while open orders or positions exist + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_margin_mode_request = gate_api.CrossexMarginModeRequest() # CrossexMarginModeRequest | (optional) + +try: + # Update futures position margin mode + api_response = api_instance.update_crossex_positions_margin_mode(crossex_margin_mode_request=crossex_margin_mode_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->update_crossex_positions_margin_mode: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_margin_mode_request** | [**CrossexMarginModeRequest**](CrossexMarginModeRequest.md)| | [optional] + +### Return type + +[**CrossexMarginModeResponse**](CrossexMarginModeResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_crossex_positions_margin** +> CrossexIsolatedMarginResponse update_crossex_positions_margin(crossex_isolated_margin_request=crossex_isolated_margin_request) + +Increase or decrease isolated margin + +Rate limit: 100 requests per 10 seconds. Only Hyperliquid isolated futures positions are supported. Positive values increase margin, while negative values decrease margin + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +crossex_isolated_margin_request = gate_api.CrossexIsolatedMarginRequest() # CrossexIsolatedMarginRequest | (optional) + +try: + # Increase or decrease isolated margin + api_response = api_instance.update_crossex_positions_margin(crossex_isolated_margin_request=crossex_isolated_margin_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->update_crossex_positions_margin: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **crossex_isolated_margin_request** | [**CrossexIsolatedMarginRequest**](CrossexIsolatedMarginRequest.md)| | [optional] + +### Return type + +[**CrossexIsolatedMarginResponse**](CrossexIsolatedMarginResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_crossex_interest_rate** +> list[CrossexInterestRate] get_crossex_interest_rate(coin=coin, exchange_type=exchange_type) + +Query margin asset interest rates + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +coin = 'SOL' # str | Query by specified currency name (optional) +exchange_type = 'BINANCE,OKX,GATE,BYBIT,KRAKEN,HYPERLIQUID,DERIBIT' # str | Exchange (optional) + +try: + # Query margin asset interest rates + api_response = api_instance.get_crossex_interest_rate(coin=coin, exchange_type=exchange_type) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->get_crossex_interest_rate: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **coin** | **str**| Query by specified currency name | [optional] + **exchange_type** | **str**| Exchange | [optional] + +### Return type + +[**list[CrossexInterestRate]**](CrossexInterestRate.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_crossex_fee** +> list[InlineResponse200] get_crossex_fee() + +Query User Fee Rates + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) + +try: + # Query User Fee Rates + api_response = api_instance.get_crossex_fee() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->get_crossex_fee: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[InlineResponse200]**](InlineResponse200.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_positions** +> list[CrossexPosition] list_crossex_positions(symbol=symbol, exchange_type=exchange_type) + +Query Contract Positions + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbol = 'BINANCE_FUTURE_ADA_USDT' # str | Trading Pair (optional) +exchange_type = 'BINANCE,OKX,GATE,BYBIT,KRAKEN,HYPERLIQUID,DERIBIT' # str | Exchange (optional) + +try: + # Query Contract Positions + api_response = api_instance.list_crossex_positions(symbol=symbol, exchange_type=exchange_type) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_positions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Trading Pair | [optional] + **exchange_type** | **str**| Exchange | [optional] + +### Return type + +[**list[CrossexPosition]**](CrossexPosition.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_margin_positions** +> list[CrossexMarginPosition] list_crossex_margin_positions(symbol=symbol, exchange_type=exchange_type) + +Query Leveraged Positions + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbol = 'BINANCE_MARGIN_ADA_USDT' # str | Currency pair (optional) +exchange_type = 'BINANCE' # str | Exchange (optional) + +try: + # Query Leveraged Positions + api_response = api_instance.list_crossex_margin_positions(symbol=symbol, exchange_type=exchange_type) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_margin_positions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Currency pair | [optional] + **exchange_type** | **str**| Exchange | [optional] + +### Return type + +[**list[CrossexMarginPosition]**](CrossexMarginPosition.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_adl_rank** +> CrossexAdlRank list_crossex_adl_rank(symbol) + +Query ADL Position Reduction Ranking + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbol = 'BINANCE_FUTURE_ADA_USDT' # str | Trading Pair + +try: + # Query ADL Position Reduction Ranking + api_response = api_instance.list_crossex_adl_rank(symbol) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_adl_rank: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Trading Pair | + +### Return type + +[**CrossexAdlRank**](CrossexAdlRank.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_open_orders** +> list[CrossexOrder] list_crossex_open_orders(symbol=symbol, exchange_type=exchange_type, business_type=business_type) + +Query All Current Open Orders + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbol = 'BINANCE_FUTURE_ADA_USDT' # str | Trading Pair (optional) +exchange_type = 'BINANCE' # str | Exchange (optional) +business_type = 'FUTURE' # str | Business Type (optional) + +try: + # Query All Current Open Orders + api_response = api_instance.list_crossex_open_orders(symbol=symbol, exchange_type=exchange_type, business_type=business_type) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_open_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Trading Pair | [optional] + **exchange_type** | **str**| Exchange | [optional] + **business_type** | **str**| Business Type | [optional] + +### Return type + +[**list[CrossexOrder]**](CrossexOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_history_orders** +> list[CrossexOrder] list_crossex_history_orders(page=page, limit=limit, symbol=symbol, _from=_from, to=to, attributes=attributes) + +Query order history + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +page = 56 # int | Page number (optional) +limit = 56 # int | Maximum number of records returned in a single list (optional) +symbol = 'symbol_example' # str | Currency pair (optional) +_from = 56 # int | Start Millisecond Timestamp (optional) +to = 56 # int | End Millisecond Timestamp (optional) +attributes = 'attributes_example' # str | Order attributes (`COMMON` normal / `LIQ` liquidation takeover / `REDUCE` liquidation reduction / `ADL` auto-deleverage / `SETTLEMENT` delisting settlement). Multiple values, comma-separated. (optional) + +try: + # Query order history + api_response = api_instance.list_crossex_history_orders(page=page, limit=limit, symbol=symbol, _from=_from, to=to, attributes=attributes) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_history_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] + **symbol** | **str**| Currency pair | [optional] + **_from** | **int**| Start Millisecond Timestamp | [optional] + **to** | **int**| End Millisecond Timestamp | [optional] + **attributes** | **str**| Order attributes (`COMMON` normal / `LIQ` liquidation takeover / `REDUCE` liquidation reduction / `ADL` auto-deleverage / `SETTLEMENT` delisting settlement). Multiple values, comma-separated. | [optional] + +### Return type + +[**list[CrossexOrder]**](CrossexOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_history_positions** +> list[CrossexHistoricalPosition] list_crossex_history_positions(page=page, limit=limit, symbol=symbol, _from=_from, to=to) + +Query Contract Position History + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +page = 56 # int | Page number (optional) +limit = 56 # int | Maximum number returned by list, max 1000 (optional) +symbol = 'symbol_example' # str | Currency pair (optional) +_from = 56 # int | Start Millisecond Timestamp (optional) +to = 56 # int | End Millisecond Timestamp (optional) + +try: + # Query Contract Position History + api_response = api_instance.list_crossex_history_positions(page=page, limit=limit, symbol=symbol, _from=_from, to=to) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_history_positions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number | [optional] + **limit** | **int**| Maximum number returned by list, max 1000 | [optional] + **symbol** | **str**| Currency pair | [optional] + **_from** | **int**| Start Millisecond Timestamp | [optional] + **to** | **int**| End Millisecond Timestamp | [optional] + +### Return type + +[**list[CrossexHistoricalPosition]**](CrossexHistoricalPosition.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_history_margin_positions** +> list[CrossexHistoricalMarginPosition] list_crossex_history_margin_positions(page=page, limit=limit, symbol=symbol, _from=_from, to=to) + +Query Leveraged Position History + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +page = 56 # int | Page number (optional) +limit = 56 # int | Maximum number returned by list, max 1000 (optional) +symbol = 'symbol_example' # str | Currency pair (optional) +_from = 56 # int | Start Millisecond Timestamp (optional) +to = 56 # int | End Millisecond Timestamp (optional) + +try: + # Query Leveraged Position History + api_response = api_instance.list_crossex_history_margin_positions(page=page, limit=limit, symbol=symbol, _from=_from, to=to) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_history_margin_positions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number | [optional] + **limit** | **int**| Maximum number returned by list, max 1000 | [optional] + **symbol** | **str**| Currency pair | [optional] + **_from** | **int**| Start Millisecond Timestamp | [optional] + **to** | **int**| End Millisecond Timestamp | [optional] + +### Return type + +[**list[CrossexHistoricalMarginPosition]**](CrossexHistoricalMarginPosition.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_history_margin_interests** +> list[CrossexMarginInterestRecord] list_crossex_history_margin_interests(symbol=symbol, _from=_from, to=to, page=page, limit=limit, exchange_type=exchange_type) + +Query Leveraged Interest Deduction History + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbol = 'symbol_example' # str | Currency pair (optional) +_from = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +to = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +page = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +limit = 56 # int | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) +exchange_type = 'exchange_type_example' # str | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (optional) + +try: + # Query Leveraged Interest Deduction History + api_response = api_instance.list_crossex_history_margin_interests(symbol=symbol, _from=_from, to=to, page=page, limit=limit, exchange_type=exchange_type) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_history_margin_interests: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Currency pair | [optional] + **_from** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **to** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **page** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **limit** | **int**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + **exchange_type** | **str**| Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | [optional] + +### Return type + +[**list[CrossexMarginInterestRecord]**](CrossexMarginInterestRecord.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_history_trades** +> list[CrossexTrade] list_crossex_history_trades(page=page, limit=limit, symbol=symbol, _from=_from, to=to) + +Query filled history + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +page = 56 # int | Page number (optional) +limit = 56 # int | Maximum number returned by list, max 1000 (optional) +symbol = 'symbol_example' # str | Currency pair (optional) +_from = 56 # int | Start Millisecond Timestamp (optional) +to = 56 # int | End Millisecond Timestamp (optional) + +try: + # Query filled history + api_response = api_instance.list_crossex_history_trades(page=page, limit=limit, symbol=symbol, _from=_from, to=to) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_history_trades: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number | [optional] + **limit** | **int**| Maximum number returned by list, max 1000 | [optional] + **symbol** | **str**| Currency pair | [optional] + **_from** | **int**| Start Millisecond Timestamp | [optional] + **to** | **int**| End Millisecond Timestamp | [optional] + +### Return type + +[**list[CrossexTrade]**](CrossexTrade.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_account_book** +> list[CrossexAccountBookRecord] list_crossex_account_book(page=page, limit=limit, coin=coin, statement_type=statement_type, _from=_from, to=to) + +Query Account Asset Change History + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +page = 56 # int | Page number (optional) +limit = 56 # int | Maximum number returned by list, max 1000 (optional) +coin = 'coin_example' # str | Query by specified currency name (optional) +statement_type = 'statement_type_example' # str | Bill entry type. The filter accepts the same values returned in the response. (optional) +_from = 56 # int | Start Millisecond Timestamp (optional) +to = 56 # int | End Millisecond Timestamp (optional) + +try: + # Query Account Asset Change History + api_response = api_instance.list_crossex_account_book(page=page, limit=limit, coin=coin, statement_type=statement_type, _from=_from, to=to) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_account_book: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number | [optional] + **limit** | **int**| Maximum number returned by list, max 1000 | [optional] + **coin** | **str**| Query by specified currency name | [optional] + **statement_type** | **str**| Bill entry type. The filter accepts the same values returned in the response. | [optional] + **_from** | **int**| Start Millisecond Timestamp | [optional] + **to** | **int**| End Millisecond Timestamp | [optional] + +### Return type + +[**list[CrossexAccountBookRecord]**](CrossexAccountBookRecord.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_coin_discount_rate** +> list[CrossexCoinDiscountRate] list_crossex_coin_discount_rate(coin=coin, exchange_type=exchange_type) + +Query Currency Discount Rate + +Rate Limit: 200 requests per 10 seconds + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +coin = 'SOL' # str | Query by specified currency name (optional) +exchange_type = 'OKX' # str | OKX/GATE/BINANCE/BYBIT/KRAKEN/HYPERLIQUID/DERIBIT (optional) + +try: + # Query Currency Discount Rate + api_response = api_instance.list_crossex_coin_discount_rate(coin=coin, exchange_type=exchange_type) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_coin_discount_rate: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **coin** | **str**| Query by specified currency name | [optional] + **exchange_type** | **str**| OKX/GATE/BINANCE/BYBIT/KRAKEN/HYPERLIQUID/DERIBIT | [optional] + +### Return type + +[**list[CrossexCoinDiscountRate]**](CrossexCoinDiscountRate.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_market_tickers** +> list[InlineResponse2001] list_crossex_market_tickers(symbols=symbols) + +Get exchange tickers + +Rate limit: 1 request per second - Margin trading pairs cannot be passed directly as parameters. For example, `GATE_MARGIN_BTC_USDT` is invalid. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbols = 'GATE_SPOT_BTC_USDT,GATE_FUTURE_BTC_USDT' # str | Trading Pair List, multiple separated by commas (optional) + +try: + # Get exchange tickers + api_response = api_instance.list_crossex_market_tickers(symbols=symbols) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_market_tickers: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbols** | **str**| Trading Pair List, multiple separated by commas | [optional] + +### Return type + +[**list[InlineResponse2001]**](InlineResponse2001.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_crossex_market_funding_info** +> list[InlineResponse2002] list_crossex_market_funding_info(symbols=symbols) + +Get exchange futures funding rate information + +Rate limit: 1 request per second - For `Deribit`, `funding_rate` is the current real-time rate calculated over an 8-hour period. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.CrossExApi(api_client) +symbols = 'BINANCE_MARGIN_BTC_USDT,OKX_MARGIN_BTC_USDT,GATE_MARGIN_BTC_USDT' # str | Trading Pair List, multiple separated by commas (optional) + +try: + # Get exchange futures funding rate information + api_response = api_instance.list_crossex_market_funding_info(symbols=symbols) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling CrossExApi->list_crossex_market_funding_info: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbols** | **str**| Trading Pair List, multiple separated by commas | [optional] + +### Return type + +[**list[InlineResponse2002]**](InlineResponse2002.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/CrossexAccount.md b/docs/CrossexAccount.md new file mode 100644 index 00000000..8ca4618a --- /dev/null +++ b/docs/CrossexAccount.md @@ -0,0 +1,23 @@ +# CrossexAccount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **str** | User ID | +**available_margin** | **str** | Available Margin | +**margin_balance** | **str** | marginbalance | +**initial_margin** | **str** | Initial Margin | +**maintenance_margin** | **str** | Maintenance margin | +**initial_margin_rate** | **str** | Initial margin rate | +**maintenance_margin_rate** | **str** | Maintenance margin rate | +**position_mode** | **str** | Contract Position Mode | +**account_limit** | **str** | Account limit | [optional] +**create_time** | **str** | Created time | +**update_time** | **str** | Update time | +**account_mode** | **str** | Account Mode. CROSS_EXCHANGE: Cross-Exchange Mode; ISOLATED_EXCHANGE: Split-Exchange Mode | [optional] +**exchange_type** | **str** | Exchange Type. When account_mode is CROSS_EXCHANGE, it must be CROSSEX; otherwise, it is another exchange. | [optional] +**assets** | [**list[CrossexAccountAsset]**](CrossexAccountAsset.md) | Asset list: grouped by exchange and currency, returning per-account balances, margin, and PnL details | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexAccountAsset.md b/docs/CrossexAccountAsset.md new file mode 100644 index 00000000..24bdba5e --- /dev/null +++ b/docs/CrossexAccountAsset.md @@ -0,0 +1,21 @@ +# CrossexAccountAsset + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **str** | User ID | [optional] +**coin** | **str** | Currency | [optional] +**exchange_type** | **str** | Exchange | [optional] +**balance** | **str** | Balance | [optional] +**upnl** | **str** | Unrealized P&L | [optional] +**equity** | **str** | Equity (only USDT has a value; other assets are 0) | [optional] +**futures_initial_margin** | **str** | Futures initial margin (only USDT has a value; other assets are 0) | [optional] +**futures_maintenance_margin** | **str** | Futures maintenance margin (only USDT has a value; other assets are 0) | [optional] +**borrowing_initial_margin** | **str** | Margin trading initial margin (only USDT has a value; other assets are 0) | +**borrowing_maintenance_margin** | **str** | Margin trading maintenance margin (only USDT has a value; other assets are 0) | +**available_balance** | **str** | Available Balance | [optional] +**liability** | **str** | Liabilities (only meaningful in isolated exchange mode; always 0 in cross-exchange mode) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexAccountBookRecord.md b/docs/CrossexAccountBookRecord.md new file mode 100644 index 00000000..ebbde5f7 --- /dev/null +++ b/docs/CrossexAccountBookRecord.md @@ -0,0 +1,19 @@ +# CrossexAccountBookRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Account Change Record ID | +**user_id** | **str** | User ID | +**business_id** | **str** | Business ID. Its meaning varies by `statement_type`. `TRANSACTION`: order ID. `TRADING_FEE`: order ID. `LIQUIDATION_FEE`: liquidation order ID. `FUNDING_FEE`: position ID and funding fee settlement time. For other types, it is a system-generated processing ID with no business meaning. | +**statement_type** | **str** | Bill entry type. `TRANSACTION` trade `TRADING_FEE` fee `FUNDING_FEE` funding `LIQUIDATION_FEE` liquidation `TRANSFER_IN` deposit `TRANSFER_OUT` withdrawal `BANKRUPT_COMPENSATION` bankruptcy subsidy `AUTO_REPAY` margin auto-repay `INTEREST_ISOLATED` isolated-venue interest entry `ACCOUNT_MODE_CHANGE` account mode switch entry `KRAKEN_CONVERSION` conversion of other margin coins to cover a negative KRAKEN_USD balance `OTHER` other | +**exchange_type** | **str** | Exchange | +**coin** | **str** | Currency | +**symbol** | **str** | Trading Pair | [optional] +**change** | **str** | Change amount (positive indicates transfer in; negative indicates transfer out) | +**balance** | **str** | Balance after change | +**create_time** | **str** | Created time | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexAccountUpdateRequest.md b/docs/CrossexAccountUpdateRequest.md new file mode 100644 index 00000000..113c29c2 --- /dev/null +++ b/docs/CrossexAccountUpdateRequest.md @@ -0,0 +1,13 @@ +# CrossexAccountUpdateRequest + +Change Account Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**position_mode** | **str** | Futures position mode (SINGLE/DUAL) | [optional] +**account_mode** | **str** | Account mode (CROSS_EXCHANGE/ISOLATED_EXCHANGE, default: CROSS_EXCHANGE) | [optional] +**exchange_type** | **str** | Exchange (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT` / `CROSSEX`). When account mode is `ISOLATED_EXCHANGE`, the exchange must be specified to adjust futures position mode. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexAccountUpdateResponse.md b/docs/CrossexAccountUpdateResponse.md new file mode 100644 index 00000000..74fe88db --- /dev/null +++ b/docs/CrossexAccountUpdateResponse.md @@ -0,0 +1,12 @@ +# CrossexAccountUpdateResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**position_mode** | **str** | Requested futures position mode to modify (SINGLE/DUAL) | [optional] +**account_mode** | **str** | Requested account mode to modify (CROSS_EXCHANGE/ISOLATED_EXCHANGE, default: CROSS_EXCHANGE) | [optional] +**exchange_type** | **str** | Exchange targeted by the requested change (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT` / `CROSSEX`). When account mode is `ISOLATED_EXCHANGE`, the exchange must be specified to change futures position mode. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexAdlRank.md b/docs/CrossexAdlRank.md new file mode 100644 index 00000000..371750e0 --- /dev/null +++ b/docs/CrossexAdlRank.md @@ -0,0 +1,13 @@ +# CrossexAdlRank + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **str** | User ID | +**symbol** | **str** | Currency pair | +**crossex_adl_rank** | **str** | CROSSEX position-reduction indicator ranking (1–5, higher value ranks higher) | +**exchange_adl_rank** | **str** | Exchange raw information (BINANCE: 0-4, larger numbers rank higher; OKX: 0-5, larger numbers rank higher; GATE: 1-5, smaller numbers rank higher; Kraken: 20, 40, 80, 100, smaller numbers rank higher; BYBIT: 0-5, larger numbers rank higher) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexBatchCancelOrderRequest.md b/docs/CrossexBatchCancelOrderRequest.md new file mode 100644 index 00000000..46d044ad --- /dev/null +++ b/docs/CrossexBatchCancelOrderRequest.md @@ -0,0 +1,12 @@ +# CrossexBatchCancelOrderRequest + +Batch cancel orders +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID; either this field or text is required | [optional] +**text** | **str** | Custom ID specified by the user when creating the order; either this field or order_id is required | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexBatchCancelOrderResponse.md b/docs/CrossexBatchCancelOrderResponse.md new file mode 100644 index 00000000..2d127659 --- /dev/null +++ b/docs/CrossexBatchCancelOrderResponse.md @@ -0,0 +1,15 @@ +# CrossexBatchCancelOrderResponse + +Batch order cancellation request results +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | +**text** | **str** | Custom ID specified by the user when creating the order | +**accepted** | **str** | Whether the request was accepted, as the string true or false | +**label** | **str** | Error label when the request is not accepted; empty on success | +**message** | **str** | Error message when the request is not accepted; empty on success | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexClosePositionRequest.md b/docs/CrossexClosePositionRequest.md new file mode 100644 index 00000000..5b966e32 --- /dev/null +++ b/docs/CrossexClosePositionRequest.md @@ -0,0 +1,12 @@ +# CrossexClosePositionRequest + +Full Close Position Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Trading Pair 1. Supports leveraged trading pairs, e.g., BINANCE_MARGIN_SOL_USDT 2. Supports contract trading pairs, e.g., OKX_FUTURE_ETH_USDT | +**position_side** | **str** | Position Direction 1. For leveraged positions, this parameter must be passed 2. For contract positions, pass selectively based on your contract holding method | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CollateralAlign.md b/docs/CrossexCoinDiscountRate.md similarity index 51% rename from docs/CollateralAlign.md rename to docs/CrossexCoinDiscountRate.md index 4b148409..32d368b3 100644 --- a/docs/CollateralAlign.md +++ b/docs/CrossexCoinDiscountRate.md @@ -1,12 +1,14 @@ -# CollateralAlign +# CrossexCoinDiscountRate ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**order_id** | **int** | Order ID | -**collateral_currency** | **str** | Collateral currency | -**collateral_amount** | **str** | Collateral amount | -**type** | **str** | Operation type: append - add collateral, redeem - withdraw collateral | +**coin** | **str** | Currency | +**exchange_type** | **str** | Exchange | +**tier** | **str** | Tier | +**min_value** | **str** | Minimum value | +**max_value** | **str** | Maximum value | +**discount_rate** | **str** | Discount rate | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CrossexConvertOrderRequest.md b/docs/CrossexConvertOrderRequest.md new file mode 100644 index 00000000..9ac9fea2 --- /dev/null +++ b/docs/CrossexConvertOrderRequest.md @@ -0,0 +1,11 @@ +# CrossexConvertOrderRequest + +Flash Swap Transaction Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quote_id** | **str** | Inquiry ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexConvertOrderResponse.md b/docs/CrossexConvertOrderResponse.md new file mode 100644 index 00000000..3644b414 --- /dev/null +++ b/docs/CrossexConvertOrderResponse.md @@ -0,0 +1,11 @@ +# CrossexConvertOrderResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | +**text** | **str** | Order ID (cannot be customized) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexConvertQuoteRequest.md b/docs/CrossexConvertQuoteRequest.md new file mode 100644 index 00000000..14cf4f71 --- /dev/null +++ b/docs/CrossexConvertQuoteRequest.md @@ -0,0 +1,14 @@ +# CrossexConvertQuoteRequest + +Flash Swap Quote Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exchange_type** | **str** | Exchange Type | +**from_coin** | **str** | Asset Sold | +**to_coin** | **str** | Asset name to buy (OKX and GATE only allow BTC, ETH, USDT; BN only allows USDT) | +**from_amount** | **str** | Amount to sell | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexConvertQuoteResponse.md b/docs/CrossexConvertQuoteResponse.md new file mode 100644 index 00000000..19969af4 --- /dev/null +++ b/docs/CrossexConvertQuoteResponse.md @@ -0,0 +1,16 @@ +# CrossexConvertQuoteResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quote_id** | **str** | Quote ID | +**valid_ms** | **str** | Valid time (milliseconds timestamp) | +**from_coin** | **str** | Asset Sold | +**to_coin** | **str** | Asset Bought | +**from_amount** | **str** | Amount to sell | +**to_amount** | **str** | Amount to buy | +**price** | **str** | Price | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexHistoricalMarginPosition.md b/docs/CrossexHistoricalMarginPosition.md new file mode 100644 index 00000000..e0d82ea1 --- /dev/null +++ b/docs/CrossexHistoricalMarginPosition.md @@ -0,0 +1,27 @@ +# CrossexHistoricalMarginPosition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**position_id** | **str** | Position ID | [optional] +**user_id** | **str** | User ID | [optional] +**symbol** | **str** | Currency pair | [optional] +**closed_type** | **str** | Position close type (PARTIAL_CLOSED: partially closed; COMPLETE_CLOSED: fully closed) | [optional] +**closed_pnl** | **str** | Close Position P&L | [optional] +**closed_pnl_rate** | **str** | Close Position P&L Ratio | [optional] +**open_avg_price** | **str** | Average Opening Price | [optional] +**closed_avg_price** | **str** | Average Close Price | [optional] +**max_position_qty** | **str** | Max Trade Size | [optional] +**closed_qty** | **str** | Close Position Quantity | [optional] +**closed_value** | **str** | Close Position Value | [optional] +**liq_fee** | **str** | Liquidation Fee | [optional] +**position_side** | **str** | Position Direction Before Close | [optional] +**leverage** | **str** | Leverage at Close | [optional] +**interest** | **str** | Total Deducted Interest | +**business_type** | **str** | Position Business Type | +**create_time** | **str** | Created time | [optional] +**update_time** | **str** | Update time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexHistoricalPosition.md b/docs/CrossexHistoricalPosition.md new file mode 100644 index 00000000..ff4b1f9b --- /dev/null +++ b/docs/CrossexHistoricalPosition.md @@ -0,0 +1,29 @@ +# CrossexHistoricalPosition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**position_id** | **str** | Position ID | [optional] +**user_id** | **str** | User ID | [optional] +**symbol** | **str** | Currency pair | [optional] +**closed_type** | **str** | Position close type (PARTIAL_CLOSED: partially closed; COMPLETE_CLOSED: fully closed) | [optional] +**closed_pnl** | **str** | Close Position P&L | [optional] +**closed_pnl_rate** | **str** | Close Position P&L Ratio | [optional] +**open_avg_price** | **str** | Average Opening Price | [optional] +**closed_avg_price** | **str** | Average Close Price | [optional] +**max_position_qty** | **str** | Max Trade Size | [optional] +**closed_qty** | **str** | Close Position Quantity | [optional] +**closed_value** | **str** | Close Position Value | [optional] +**fee** | **str** | Position Accumulated Fees | [optional] +**liq_fee** | **str** | Liquidation Fee | [optional] +**funding_fee** | **str** | Funding Fee | [optional] +**position_side** | **str** | Position Direction Before Close | [optional] +**position_mode** | **str** | Position Mode at Close | [optional] +**leverage** | **str** | Leverage at Close | [optional] +**business_type** | **str** | Business Type | +**create_time** | **str** | Created time | [optional] +**update_time** | **str** | Update time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexInterestRate.md b/docs/CrossexInterestRate.md new file mode 100644 index 00000000..76145ae4 --- /dev/null +++ b/docs/CrossexInterestRate.md @@ -0,0 +1,13 @@ +# CrossexInterestRate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**coin** | **str** | Currency | +**exchange_type** | **str** | Exchange | +**hour_interest_rate** | **str** | Hourly Interest Rate | +**time** | **str** | Millisecond Timestamp | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexIsolatedMarginRequest.md b/docs/CrossexIsolatedMarginRequest.md new file mode 100644 index 00000000..6fab815b --- /dev/null +++ b/docs/CrossexIsolatedMarginRequest.md @@ -0,0 +1,13 @@ +# CrossexIsolatedMarginRequest + +Request body for increasing or decreasing isolated margin +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Hyperliquid futures trading pair | +**margin** | **str** | Margin adjustment amount. Positive values increase margin, while negative values decrease margin. Values with more than two decimal places are truncated to two decimal places | +**position_side** | **str** | Position side (NONE/LONG/SHORT). Defaults to NONE for one-way positions if omitted | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexIsolatedMarginResponse.md b/docs/CrossexIsolatedMarginResponse.md new file mode 100644 index 00000000..bca3f9c4 --- /dev/null +++ b/docs/CrossexIsolatedMarginResponse.md @@ -0,0 +1,11 @@ +# CrossexIsolatedMarginResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Futures trading pair | +**margin** | **str** | Amount of isolated margin increased or decreased in this request | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexLeverageRequest.md b/docs/CrossexLeverageRequest.md new file mode 100644 index 00000000..05d81d17 --- /dev/null +++ b/docs/CrossexLeverageRequest.md @@ -0,0 +1,12 @@ +# CrossexLeverageRequest + +Change Leverage Request Body (for futures/margin) +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Currency pair | +**leverage** | **str** | Leverage | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexLeverageResponse.md b/docs/CrossexLeverageResponse.md new file mode 100644 index 00000000..677989ff --- /dev/null +++ b/docs/CrossexLeverageResponse.md @@ -0,0 +1,11 @@ +# CrossexLeverageResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Currency pair | +**leverage** | **str** | Requested Modified Leverage | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexMarginInterestRecord.md b/docs/CrossexMarginInterestRecord.md new file mode 100644 index 00000000..0210dcd0 --- /dev/null +++ b/docs/CrossexMarginInterestRecord.md @@ -0,0 +1,20 @@ +# CrossexMarginInterestRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **str** | User ID | +**symbol** | **str** | Trading Pair | +**interest_id** | **str** | Interest Deduction ID | +**liability_id** | **str** | Debt Source ID, can be Order ID or Position ID | +**liability** | **str** | Debt Quantity | +**liability_coin** | **str** | Debt Currency | +**interest** | **str** | Interest | +**interest_rate** | **str** | interest rate | +**interest_type** | **str** | Interest deduction type (`PERIODIC_POSITION` hourly interest on position, `PERIODIC_OPEN_ORDER` hourly interest on open orders, `IMMEDIATE_OPEN_ORDER` interest charged on order placement, `PERIODIC_ISOLATED` hourly interest on debt) | +**create_time** | **str** | Created time | +**exchange_type** | **str** | Exchange | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexMarginModeRequest.md b/docs/CrossexMarginModeRequest.md new file mode 100644 index 00000000..6b1658db --- /dev/null +++ b/docs/CrossexMarginModeRequest.md @@ -0,0 +1,12 @@ +# CrossexMarginModeRequest + +Request body for updating the futures position margin mode +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Hyperliquid futures trading pair | +**margin_mode** | **str** | Margin mode (CROSS/ISOLATED) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexMarginModeResponse.md b/docs/CrossexMarginModeResponse.md new file mode 100644 index 00000000..fac0fa8d --- /dev/null +++ b/docs/CrossexMarginModeResponse.md @@ -0,0 +1,11 @@ +# CrossexMarginModeResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Futures trading pair | +**margin_mode** | **str** | Margin mode (CROSS/ISOLATED) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexMarginPosition.md b/docs/CrossexMarginPosition.md new file mode 100644 index 00000000..9d103c87 --- /dev/null +++ b/docs/CrossexMarginPosition.md @@ -0,0 +1,30 @@ +# CrossexMarginPosition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **str** | User ID | +**position_id** | **str** | Leveraged Position ID | +**symbol** | **str** | Trading Pair | +**position_side** | **str** | Position Direction | +**initial_margin** | **str** | Initial position margin | +**maintenance_margin** | **str** | Position maintenance margin | +**asset_qty** | **str** | Position Asset Quantity | +**asset_coin** | **str** | Position Asset Currency | +**position_value** | **str** | Position Value | +**liability** | **str** | Debt Quantity | +**liability_coin** | **str** | Debt Currency | +**interest** | **str** | Deducted Interest | +**max_position_qty** | **str** | Max Trade Size | +**entry_price** | **str** | Position Cost Price (Average Opening Price) | +**index_price** | **str** | Index price | +**upnl** | **str** | Unrealized P&L | +**upnl_rate** | **str** | Unrealized P&L Ratio | +**leverage** | **str** | Opening Leverage | +**max_leverage** | **str** | Maximum leverage | +**create_time** | **str** | Created time | +**update_time** | **str** | Update time | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexOrder.md b/docs/CrossexOrder.md new file mode 100644 index 00000000..753865b4 --- /dev/null +++ b/docs/CrossexOrder.md @@ -0,0 +1,37 @@ +# CrossexOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **str** | User ID | +**order_id** | **str** | Order ID | +**text** | **str** | Client-defined order ID. | +**state** | **str** | Order status: NEW: Validated and queued to be sent to the exchange. OPEN: Resting on the exchange order book. PARTIALLY_FILLED: Partially filled. FILLED: Fully filled. FAIL: CrossEx internal validation failed; see the `reason` field for details. REJECT: Rejected by the exchange; see the `reason` field for details. | +**symbol** | **str** | Unique trading pair identifiers, e.g. `BINANCE_SPOT_BTC_USDT`, `BINANCE_FUTURE_BTC_USDT`. | +**side** | **str** | Side (`BUY` buy / `SELL` sell). | +**type** | **str** | Order type (`LIMIT` limit / `MARKET` market). | +**attribute** | **str** | Order attributes (`COMMON` normal / `LIQ` liquidation takeover / `REDUCE` liquidation reduction / `ADL` auto-deleverage / `SETTLEMENT` delisting settlement). | +**exchange_type** | **str** | Venue bucket (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT`). | +**business_type** | **str** | Business type (`SPOT` Spot / `FUTURE` Futures / `MARGIN` Margin). | +**qty** | **str** | Order quantity in the base currency. | +**quote_qty** | **str** | Order quantity in the quote currency. | +**price** | **str** | Order price. | +**time_in_force** | **str** | Time-in-force policy (default: GTC; allowed values: GTC, IOC, FOK, POC, and RPI) | +**executed_qty** | **str** | Filled base amount. | +**executed_amount** | **str** | Filled quote amount. | +**executed_avg_price** | **str** | Average Filled Price | +**fee_coin** | **str** | Fee currency | +**fee** | **str** | Fee amount. | +**reduce_only** | **str** | Reduce-only order (`\"true\"` or `\"false\"`). | +**leverage** | **str** | Order leverage multiplier. | +**reason** | **str** | Failure reason description. | +**last_executed_qty** | **str** | Base quantity of the latest fill. | +**last_executed_price** | **str** | Price of the latest fill. | +**last_executed_amount** | **str** | Quote amount of the latest fill. | +**position_side** | **str** | Position side (`NONE` flat / `LONG` long / `SHORT` short). | +**create_time** | **str** | Created time | +**update_time** | **str** | Update time | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexOrderActionResponse.md b/docs/CrossexOrderActionResponse.md new file mode 100644 index 00000000..f558a3df --- /dev/null +++ b/docs/CrossexOrderActionResponse.md @@ -0,0 +1,11 @@ +# CrossexOrderActionResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | +**text** | **str** | User-defined Order ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexOrderRequest.md b/docs/CrossexOrderRequest.md new file mode 100644 index 00000000..d7130705 --- /dev/null +++ b/docs/CrossexOrderRequest.md @@ -0,0 +1,20 @@ +# CrossexOrderRequest + +Place Order Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text** | **str** | Client-defined Order ID, supports letters (a-z), numbers (0-9), symbols (-, _) only | [optional] +**symbol** | **str** | Unique identifier `{Exchange}_{Business}_{Base}_{Counter}` Examples: To send a Binance spot order on `ADA/USDT`, use `BINANCE_SPOT_ADA_USDT`; For an ADA/USDT-margined USDT perpetual futures order on OKX, use `OKX_FUTURE_ADA_USDT`; For ADA/USDT margin trading on Gate, use `GATE_MARGIN_ADA_USDT`; For ADA/USDT spot trading on Bybit, use `BYBIT_SPOT_ADA_USDT`; For an ADA/USD futures order on Kraken, use `KRAKEN_FUTURE_ADA_USD`; For an ADA/USDC futures order on Hyperliquid, use `HYPERLIQUID_FUTURE_ADA_USDC`; For an ADA/USDC futures order on Deribit, use `DERIBIT_FUTURE_ADA_USDC`; Supports spot trades, USDT-margined perpetual futures, and spot margin templates. BYBIT and DERIBIT omit spot margin for now; Kraken and Hyperliquid omit dedicated spot/margin legs inside CrossEx. | +**side** | **str** | BUY, SELL | +**type** | **str** | Order type (default: `LIMIT`; supported types: `LIMIT`, `MARKET`) | [optional] [default to 'LIMIT'] +**time_in_force** | **str** | Defaults to GTC. Supported values: `GTC`, `IOC`, `FOK`, `POC`, and `RPI` `GTC`: GoodTillCancelled `IOC`: ImmediateOrCancelled `FOK`: FillOrKill `POC`: PendingOrCancelled or PostOnly `RPI`: Retail Price Improvement | [optional] [default to 'GTC'] +**qty** | **str** | Order quantity (required unless spot market buy) | [optional] +**price** | **str** | Limit Order Price (Required for Limit Orders) | [optional] +**quote_qty** | **str** | Order quote quantity; required for spot and margin market buy orders | [optional] +**reduce_only** | **str** | Reduce-only: `true` or `false` | [optional] +**position_side** | **str** | Position side: `NONE`, `LONG`, `SHORT` Defaults to `NONE` (single position mode) if not specified | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexOrderUpdateRequest.md b/docs/CrossexOrderUpdateRequest.md new file mode 100644 index 00000000..bdf21f0d --- /dev/null +++ b/docs/CrossexOrderUpdateRequest.md @@ -0,0 +1,12 @@ +# CrossexOrderUpdateRequest + +Order Modification Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**qty** | **str** | modify amount | [optional] +**price** | **str** | modify price | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexPosition.md b/docs/CrossexPosition.md new file mode 100644 index 00000000..a3826243 --- /dev/null +++ b/docs/CrossexPosition.md @@ -0,0 +1,33 @@ +# CrossexPosition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **str** | User ID | [optional] +**position_id** | **str** | Position ID | [optional] +**symbol** | **str** | Currency pair | [optional] +**position_side** | **str** | Position Direction | [optional] +**initial_margin** | **str** | Initial Margin | [optional] +**isolated_margin** | **str** | Isolated margin. It is 0 in cross margin mode and applies only to isolated margin positions | [optional] +**margin_mode** | **str** | Margin mode (CROSS/ISOLATED) | [optional] +**maintenance_margin** | **str** | Maintenance margin | [optional] +**position_qty** | **str** | Position Quantity | [optional] +**position_value** | **str** | Position Value | [optional] +**upnl** | **str** | Unrealized P&L | [optional] +**upnl_rate** | **str** | Unrealized P&L Ratio | [optional] +**entry_price** | **str** | Position Average Entry Price | [optional] +**liq_price** | **str** | Liquidation price. It is 0 in cross margin mode and applies only to isolated margin positions; 0 in isolated margin mode means the position will not be liquidated | [optional] +**mark_price** | **str** | Mark price | [optional] +**leverage** | **str** | Position Leverage | [optional] +**max_leverage** | **str** | Maximum leverage | [optional] +**risk_limit** | **str** | Position risk limit | [optional] +**fee** | **str** | Position Fee | [optional] +**funding_fee** | **str** | Accumulated position funding fee. A positive value indicates a gain, while a negative value indicates a loss. | [optional] +**funding_time** | **str** | Position funding fee collection time (0 indicates it has not been collected yet) | [optional] +**create_time** | **str** | Position Creation Time | [optional] +**update_time** | **str** | Position Update Time | [optional] +**closed_pnl** | **str** | Realized PnL | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexRiskLimit.md b/docs/CrossexRiskLimit.md new file mode 100644 index 00000000..2804ab26 --- /dev/null +++ b/docs/CrossexRiskLimit.md @@ -0,0 +1,11 @@ +# CrossexRiskLimit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | | [optional] +**tiers** | [**list[CrossexRiskLimitTier]**](CrossexRiskLimitTier.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexRiskLimitTier.md b/docs/CrossexRiskLimitTier.md new file mode 100644 index 00000000..584bbd9a --- /dev/null +++ b/docs/CrossexRiskLimitTier.md @@ -0,0 +1,15 @@ +# CrossexRiskLimitTier + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**min_risk_limit_value** | **str** | Minimum risk limit value | +**max_risk_limit_value** | **str** | Maximum risk limit value | +**quick_cal_amount** | **str** | Quick-calculation amount | +**leverage_max** | **str** | Maximum leverage | +**maintenance_rate** | **str** | Maintenance margin rate | +**tier** | **str** | Tier | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexSpecialFee.md b/docs/CrossexSpecialFee.md new file mode 100644 index 00000000..16bffa8c --- /dev/null +++ b/docs/CrossexSpecialFee.md @@ -0,0 +1,13 @@ +# CrossexSpecialFee + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Currency pair | +**taker_fee_rate** | **str** | Taker fee rate | +**maker_fee_rate** | **str** | Maker fee rate | +**rpi_fee_rate** | **str** | RPI order maker fee rate | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexTrade.md b/docs/CrossexTrade.md new file mode 100644 index 00000000..bfcc5159 --- /dev/null +++ b/docs/CrossexTrade.md @@ -0,0 +1,27 @@ +# CrossexTrade + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **str** | User ID | [optional] +**transaction_id** | **str** | filledrecordsID | [optional] +**order_id** | **str** | Order ID | [optional] +**text** | **str** | User Order ID | [optional] +**symbol** | **str** | Currency pair | [optional] +**exchange_type** | **str** | Exchange | [optional] +**business_type** | **str** | Business Type | [optional] +**side** | **str** | Buy/Sell Direction | [optional] +**qty** | **str** | Trading size | [optional] +**price** | **str** | Fill Price | [optional] +**fee** | **str** | fee | [optional] +**fee_coin** | **str** | Fee currency | [optional] +**fee_rate** | **str** | Fee Rate | [optional] +**match_role** | **str** | Filled Role | [optional] +**rpnl** | **str** | Realized P&L | [optional] +**position_mode** | **str** | Position Mode | [optional] +**position_side** | **str** | Position Direction | [optional] +**create_time** | **str** | Created time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexTransferCoin.md b/docs/CrossexTransferCoin.md new file mode 100644 index 00000000..a7b10ca8 --- /dev/null +++ b/docs/CrossexTransferCoin.md @@ -0,0 +1,14 @@ +# CrossexTransferCoin + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**coin** | **str** | Currency | +**min_trans_amount** | **float** | Minimum Transfer Quantity (including estimated fees) | +**est_fee** | **float** | Estimated Fee | +**precision** | **int** | Precision | +**is_disabled** | **int** | If it is disabled. 0 means NOT being disabled | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexTransferRecord.md b/docs/CrossexTransferRecord.md new file mode 100644 index 00000000..5c6800ee --- /dev/null +++ b/docs/CrossexTransferRecord.md @@ -0,0 +1,20 @@ +# CrossexTransferRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Order ID | +**text** | **str** | Client Custom ID | +**from_account_type** | **str** | `from` credit account touched by this operation (`CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT`). | +**to_account_type** | **str** | `to` debit account handled by this operation (`CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT`). | +**coin** | **str** | Currency | +**amount** | **str** | Transfer amount, the amount requested for the transfer | +**actual_receive** | **str** | Actual credited amount (has a value when status = SUCCESS; empty for other statuses) | [optional] +**status** | **str** | Transfer Status - `FAIL`: Failed - `SUCCESS`: Successful - `PENDING`: Transfer in Progress | +**fail_reason** | **str** | Failure reason (has a value when status = FAIL; empty for other statuses) | [optional] +**create_time** | **int** | Creation time of order | +**update_time** | **int** | OrderUpdateTime | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexTransferRequest.md b/docs/CrossexTransferRequest.md new file mode 100644 index 00000000..122b9cb3 --- /dev/null +++ b/docs/CrossexTransferRequest.md @@ -0,0 +1,15 @@ +# CrossexTransferRequest + +Fund Transfer Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**coin** | **str** | Currency | +**amount** | **str** | Transfer amount | +**_from** | **str** | `from` receiving account (`CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT`). | +**to** | **str** | `to` debit account (funds withdrawn from): `CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT` | +**text** | **str** | User-defined ID | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CrossexTransferResponse.md b/docs/CrossexTransferResponse.md new file mode 100644 index 00000000..79d76036 --- /dev/null +++ b/docs/CrossexTransferResponse.md @@ -0,0 +1,11 @@ +# CrossexTransferResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tx_id** | **str** | Order ID | +**text** | **str** | User-defined Order ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Currency.md b/docs/Currency.md index 27e0400b..2a1d26fe 100644 --- a/docs/Currency.md +++ b/docs/Currency.md @@ -13,6 +13,9 @@ Name | Type | Description | Notes **fixed_rate** | **str** | Fixed fee rate. Only for fixed rate currencies, not valid for normal currencies | [optional] **chain** | **str** | The main chain corresponding to the coin | [optional] **chains** | [**list[SpotCurrencyChain]**](SpotCurrencyChain.md) | All links corresponding to coins | [optional] +**total_supply** | **str** | Total supply | [optional] +**market_cap** | **str** | Market cap | [optional] +**category** | **list[str]** | Currency categories - stocks: Stocks - metals: Metals - indices: Indices - forex: Forex - commodities: Commodities | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CurrencyPair.md b/docs/CurrencyPair.md index f424b7c9..b7110b61 100644 --- a/docs/CurrencyPair.md +++ b/docs/CurrencyPair.md @@ -14,8 +14,8 @@ Name | Type | Description | Notes **min_quote_amount** | **str** | Minimum amount of quote currency to trade, `null` means no limit | [optional] **max_base_amount** | **str** | Maximum amount of base currency to trade, `null` means no limit | [optional] **max_quote_amount** | **str** | Maximum amount of quote currency to trade, `null` means no limit | [optional] -**amount_precision** | **int** | Amount scale | [optional] -**precision** | **int** | Price scale | [optional] +**amount_precision** | **int** | Quantity precision | [optional] +**precision** | **int** | Price precision | [optional] **trade_status** | **str** | Trading status - untradable: cannot be traded - buyable: can be bought - sellable: can be sold - tradable: can be bought and sold | [optional] **sell_start** | **int** | Sell start unix timestamp in seconds | [optional] **buy_start** | **int** | Buy start unix timestamp in seconds | [optional] @@ -25,9 +25,9 @@ Name | Type | Description | Notes **st_tag** | **bool** | Whether the trading pair is in ST risk assessment, false - No, true - Yes | [optional] **up_rate** | **str** | Maximum Quote Rise Percentage | [optional] **down_rate** | **str** | Maximum Quote Decline Percentage | [optional] -**slippage** | **str** | Currency Slippage | [optional] -**market_order_max_stock** | **str** | Maximum Market Order Quantity | [optional] -**market_order_max_money** | **str** | Maximum Market Order Amount | [optional] +**slippage** | **str** | Maximum supported slippage ratio for Spot Market Order Placement, calculated based on the latest market price at the time of order placement as the benchmark (Example: 0.03 means 3%) | [optional] +**market_order_max_stock** | **str** | Maximum market order quantity. `null` or `0` means no limit | [optional] +**market_order_max_money** | **str** | Maximum market order amount. `null` or `0` means no limit | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CurrencyQuota.md b/docs/CurrencyQuota.md index 656a6a8b..3deb82f3 100644 --- a/docs/CurrencyQuota.md +++ b/docs/CurrencyQuota.md @@ -7,8 +7,10 @@ Name | Type | Description | Notes **currency** | **str** | Currency | [optional] **index_price** | **str** | Currency Index Price | [optional] **min_quota** | **str** | Minimum borrowing/collateral limit for the currency | [optional] -**left_quota** | **str** | Remaining borrowing/collateral quota for the currency | [optional] -**left_quote_usdt** | **str** | Remaining currency limit converted to USDT | [optional] +**left_quota** | **str** | Remaining currency limit for `borrow/collateral` (when input parameter `type` is `borrow`, represents current currency) | [optional] +**left_quote_usdt** | **str** | Remaining currency limit converted to USDT (when input parameter `type` is `borrow`, represents current currency) | [optional] +**left_quota_fixed** | **str** | Remaining `borrow/collateral` limit for fixed-term currency | [optional] +**left_quote_usdt_fixed** | **str** | Remaining currency limit for fixed-term currency converted to USDT | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DeleteOrder.md b/docs/DeleteOrder.md new file mode 100644 index 00000000..fd4da96d --- /dev/null +++ b/docs/DeleteOrder.md @@ -0,0 +1,11 @@ +# DeleteOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**object**](.md) | Returns empty object on success | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeletePosition.md b/docs/DeletePosition.md new file mode 100644 index 00000000..09cce38c --- /dev/null +++ b/docs/DeletePosition.md @@ -0,0 +1,11 @@ +# DeletePosition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**object**](.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeliveryAccount.md b/docs/DeliveryAccount.md index 55550d10..590fe550 100644 --- a/docs/DeliveryAccount.md +++ b/docs/DeliveryAccount.md @@ -28,7 +28,7 @@ Name | Type | Description | Notes **enable_new_dual_mode** | **bool** | Deprecated | [optional] **margin_mode** | **int** | Margin mode of the account 0: classic future account or Classic Spot Margin Mode of unified account; 1: Multi-Currency Margin Mode; 2: Portoforlio Margin Mode; 3: Single-Currency Margin Mode | [optional] **enable_tiered_mm** | **bool** | Whether to enable tiered maintenance margin calculation | [optional] -**history** | [**FuturesAccountHistory**](FuturesAccountHistory.md) | | [optional] +**history** | [**DeliveryAccountHistory**](DeliveryAccountHistory.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DeliveryAccountHistory.md b/docs/DeliveryAccountHistory.md new file mode 100644 index 00000000..98e83bd7 --- /dev/null +++ b/docs/DeliveryAccountHistory.md @@ -0,0 +1,20 @@ +# DeliveryAccountHistory + +Statistical data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dnw** | **str** | total amount of deposit and withdraw | [optional] +**pnl** | **str** | total amount of trading profit and loss | [optional] +**fee** | **str** | total amount of fee | [optional] +**refr** | **str** | total amount of referrer rebates | [optional] +**fund** | **str** | total amount of funding costs | [optional] +**point_dnw** | **str** | total amount of point deposit and withdraw | [optional] +**point_fee** | **str** | total amount of point fee | [optional] +**point_refr** | **str** | total amount of referrer rebates of point fee | [optional] +**bonus_dnw** | **str** | total amount of perpetual contract bonus transfer | [optional] +**bonus_offset** | **str** | total amount of perpetual contract bonus deduction | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeliveryApi.md b/docs/DeliveryApi.md index e09e1fc1..b65029ff 100644 --- a/docs/DeliveryApi.md +++ b/docs/DeliveryApi.md @@ -177,7 +177,7 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.DeliveryApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT_20200814' # str | Futures contract -interval = '0' # str | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (optional) (default to '0') +interval = '0' # str | Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 (optional) (default to '0') limit = 10 # int | Number of depth levels (optional) (default to 10) with_id = False # bool | Whether to return depth update ID. This ID increments by 1 each time the depth changes (optional) (default to False) @@ -197,7 +197,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **interval** | **str**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [optional] [default to '0'] + **interval** | **str**| Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 | [optional] [default to '0'] **limit** | **int**| Number of depth levels | [optional] [default to 10] **with_id** | **bool**| Whether to return depth update ID. This ID increments by 1 each time the depth changes | [optional] [default to False] @@ -1906,7 +1906,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Batch cancellation request accepted and processed, success determined by order list | - | +**200** | Batch cancel request is received and processed. Success is determined based on the order list | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/DeliveryContract.md b/docs/DeliveryContract.md index 00dc2add..b1e7ccfa 100644 --- a/docs/DeliveryContract.md +++ b/docs/DeliveryContract.md @@ -30,8 +30,8 @@ Name | Type | Description | Notes **risk_limit_base** | **str** | Risk limit base | [optional] **risk_limit_step** | **str** | Step of adjusting risk limit | [optional] **risk_limit_max** | **str** | Maximum risk limit the contract allowed | [optional] -**order_size_min** | **int** | Minimum order size allowed by the contract | [optional] -**order_size_max** | **int** | Maximum order size allowed by the contract | [optional] +**order_size_min** | **int** | Minimum order quantity | [optional] +**order_size_max** | **int** | Maximum order quantity | [optional] **order_price_deviate** | **str** | Maximum allowed deviation between order price and current mark price. The order price `order_price` must satisfy the following condition: abs(order_price - mark_price) <= mark_price * order_price_deviate | [optional] **ref_discount_rate** | **str** | Trading fee discount for referred users | [optional] **ref_rebate_rate** | **str** | Commission rate for referrers | [optional] diff --git a/docs/DeliveryOrder.md b/docs/DeliveryOrder.md index cb343422..4e8a7b7f 100644 --- a/docs/DeliveryOrder.md +++ b/docs/DeliveryOrder.md @@ -22,7 +22,7 @@ Name | Type | Description | Notes **tif** | **str** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [optional] [default to 'gtc'] **left** | **int** | Unfilled quantity | [optional] [readonly] **fill_price** | **str** | Fill price | [optional] [readonly] -**text** | **str** | 订单自定义信息,用户可以用该字段设置自定义 ID,用户自定义字段必须满足以下条件: 1. 必须以 `t-` 开头 2. 不计算 `t-` ,长度不能超过 28 字节 3. 输入内容只能包含数字、字母、下划线(_)、中划线(-) 或者点(.) 除用户自定义信息以外,以下为内部保留字段,标识订单来源: - web: 网页 - api: API 调用 - app: 移动端 - auto_deleveraging: 自动减仓 - liquidation: ⽼经典模式仓位强制平仓 - liq-xxx: a. 新经典模式仓位强制平仓,包含逐仓、单向全仓、双向全仓⾮对冲仓位强平。 b. 统⼀账户单币种保证金模式逐仓强制平仓 - hedge-liq-xxx: 新经典模式双向全仓对冲部分强制平仓,即同时平多空仓位 - pm_liquidate: 统⼀账户跨币种保证金模式强制平仓 - comb_margin_liquidate: 统⼀账户组合保证金模式强制平仓 - scm_liquidate: 统⼀账户单币种保证金模式仓位强制平仓 - insurance: 保险 | [optional] +**text** | **str** | Order Custom Information: Users can set custom IDs via this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Content can only contain numbers, letters, underscores (_), hyphens (-), or dots (.) In addition to user custom information, the following are internal reserved fields identifying order sources: - web: Web - api: API Call - app: Mobile App - auto_deleveraging: Auto-Deleveraging - liquidation: Forced Liquidation of Legacy Classic Mode Positions - liq-xxx: a. Forced liquidation of New Classic Mode positions, including isolated margin, single-direction cross margin, and non-hedged dual-direction cross margin positions. b. Forced liquidation of isolated margin positions in Unified Account Single-Currency Margin Mode - hedge-liq-xxx: Forced liquidation of hedged portions in New Classic Mode dual-direction cross margin (simultaneous closing of long and short positions) - pm_liquidate: Forced liquidation in Unified Account Cross-Currency Margin Mode - comb_margin_liquidate: Forced liquidation in Unified Account Portfolio Margin Mode - scm_liquidate: Forced liquidation of positions in Unified Account Single-Currency Margin Mode - insurance: Insurance | [optional] **tkfr** | **str** | Taker fee | [optional] [readonly] **mkfr** | **str** | Maker fee | [optional] [readonly] **refu** | **int** | Referrer user ID | [optional] [readonly] diff --git a/docs/DeliveryOrderBook.md b/docs/DeliveryOrderBook.md index cf95b7d7..4d858c78 100644 --- a/docs/DeliveryOrderBook.md +++ b/docs/DeliveryOrderBook.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes **id** | **int** | Order Book ID. Increases by 1 on every order book change. Set `with_id=true` to include this field in response | [optional] **current** | **float** | Response data generation timestamp | [optional] **update** | **float** | Order book changed timestamp | [optional] -**asks** | [**list[FuturesOrderBookItem1]**](FuturesOrderBookItem1.md) | Ask Depth | -**bids** | [**list[FuturesOrderBookItem1]**](FuturesOrderBookItem1.md) | Bid Depth | +**asks** | [**list[DeliveryOrderBookItem]**](DeliveryOrderBookItem.md) | Ask Depth | +**bids** | [**list[DeliveryOrderBookItem]**](DeliveryOrderBookItem.md) | Bid Depth | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesOrderBookItem1.md b/docs/DeliveryOrderBookItem.md similarity index 93% rename from docs/FuturesOrderBookItem1.md rename to docs/DeliveryOrderBookItem.md index d0210bc6..f3eea174 100644 --- a/docs/FuturesOrderBookItem1.md +++ b/docs/DeliveryOrderBookItem.md @@ -1,4 +1,4 @@ -# FuturesOrderBookItem1 +# DeliveryOrderBookItem ## Properties Name | Type | Description | Notes diff --git a/docs/DeliveryPosition.md b/docs/DeliveryPosition.md index 60daea57..f44e2835 100644 --- a/docs/DeliveryPosition.md +++ b/docs/DeliveryPosition.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **leverage_max** | **str** | Maximum leverage under current risk limit | [optional] [readonly] **maintenance_rate** | **str** | The maintenance margin rate of the first tier of risk limit sheet | [optional] [readonly] **value** | **str** | Position value calculated in settlement currency | [optional] [readonly] -**margin** | **str** | Position margin | [optional] +**margin** | **str** | Margin | [optional] **entry_price** | **str** | Entry price | [optional] [readonly] **liq_price** | **str** | Liquidation price | [optional] [readonly] **mark_price** | **str** | Current mark price | [optional] [readonly] diff --git a/docs/DeliverySettlement.md b/docs/DeliverySettlement.md index 06a479a7..71708fd4 100644 --- a/docs/DeliverySettlement.md +++ b/docs/DeliverySettlement.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **int** | Liquidation time | [optional] [readonly] **contract** | **str** | Futures contract | [optional] [readonly] -**leverage** | **str** | Position leverage | [optional] [readonly] +**leverage** | **str** | Leverage multiplier | [optional] [readonly] **size** | **int** | Position size | [optional] [readonly] -**margin** | **str** | Position margin | [optional] [readonly] +**margin** | **str** | Margin | [optional] [readonly] **entry_price** | **str** | Average entry price | [optional] [readonly] **settle_price** | **str** | Settled price | [optional] [readonly] **profit** | **str** | Profit | [optional] [readonly] diff --git a/docs/DeltaNeutralEnabled.md b/docs/DeltaNeutralEnabled.md new file mode 100644 index 00000000..35385069 --- /dev/null +++ b/docs/DeltaNeutralEnabled.md @@ -0,0 +1,10 @@ +# DeltaNeutralEnabled + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | Whether to enable the account Delta-neutral strategy mode | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DepositRecord.md b/docs/DepositRecord.md index ead8fa65..4ef4a5af 100644 --- a/docs/DepositRecord.md +++ b/docs/DepositRecord.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **address** | **str** | Withdrawal address. Required for withdrawals | [optional] **memo** | **str** | Additional remarks with regards to the withdrawal | [optional] **status** | **str** | Transaction Status - BLOCKED: Deposit Blocked - DEP_CREDITED: Deposit Credited, Withdrawal Pending Unlock - DONE: Funds Credited to Spot Account - INVALID: Invalid Transaction - MANUAL: Manual Review Required - PEND: Processing - REVIEW: Under Compliance Review - TRACK: Tracking Block Confirmations, Pending Spot Account Credit | [optional] [readonly] +**refund_status** | **str** | Blocked deposit refund status. This field is returned only when the deposit record has a blocked deposit refund record with a non-empty refund status. Not returned when there is no refund record or the refund status is empty - REFUNDING: Refund in progress - REFUNDED: Refund completed - REFUND_FAILED: Refund failed - REJECTED: Refund rejected | [optional] [readonly] **chain** | **str** | Name of the chain used in withdrawals | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DiscoverScene.md b/docs/DiscoverScene.md new file mode 100644 index 00000000..a2fc4c8a --- /dev/null +++ b/docs/DiscoverScene.md @@ -0,0 +1,10 @@ +# DiscoverScene + +Enumeration of scenarios supported by the policy recommendation interface. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DualGetBalance.md b/docs/DualGetBalance.md new file mode 100644 index 00000000..b6e72245 --- /dev/null +++ b/docs/DualGetBalance.md @@ -0,0 +1,13 @@ +# DualGetBalance + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_asset_usdt** | **str** | User Assets in USDT Equivalent | [optional] +**user_asset_btc** | **str** | User Assets in BTC Equivalent | [optional] +**user_total_interest_usdt** | **str** | Total User Interest in USDT Equivalent | [optional] +**user_total_interest_btc** | **str** | Total User Interest in BTC Equivalent | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DualGetOrders.md b/docs/DualGetOrders.md index 91f79deb..c85cde03 100644 --- a/docs/DualGetOrders.md +++ b/docs/DualGetOrders.md @@ -5,7 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Order ID | [optional] **plan_id** | **int** | Product ID | [optional] -**copies** | **str** | Units | [optional] **invest_amount** | **str** | Investment Quantity | [optional] **settlement_amount** | **str** | Settlement Quantity | [optional] **create_time** | **int** | Created time | [optional] diff --git a/docs/DualGetPlans.md b/docs/DualGetPlans.md index 53b3a58d..bb6545f1 100644 --- a/docs/DualGetPlans.md +++ b/docs/DualGetPlans.md @@ -9,13 +9,11 @@ Name | Type | Description | Notes **exercise_currency** | **str** | Strike Token | [optional] **exercise_price** | **float** | Strike price | [optional] **delivery_time** | **int** | Settlement time | [optional] -**min_copies** | **int** | Minimum Units | [optional] -**max_copies** | **int** | Maximum Units | [optional] -**per_value** | **str** | Value Per Unit | [optional] **apy_display** | **str** | Annual Yield | [optional] +**min_amount** | **str** | Minimum investment amount | [optional] **start_time** | **int** | Start Time | [optional] **end_time** | **int** | End time | [optional] -**status** | **str** | Status: `NOTSTARTED`-Not Started `ONGOING`-In Progress `ENDED`-Ended | [optional] +**status** | **str** | Status: `NOTSTARTED` - Not started `ONGOING` - In progress `ENDED` - Ended | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DualModifyOrderReinvestParams.md b/docs/DualModifyOrderReinvestParams.md new file mode 100644 index 00000000..998279a7 --- /dev/null +++ b/docs/DualModifyOrderReinvestParams.md @@ -0,0 +1,13 @@ +# DualModifyOrderReinvestParams + +Dual-currency order reinvest modification request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | [optional] +**status** | **int** | `0` — off; `1` — on | [optional] +**effective_time_duration** | **int** | Effective duration in seconds; default 1 day (86400) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DualOrderRefundParams.md b/docs/DualOrderRefundParams.md new file mode 100644 index 00000000..c6521616 --- /dev/null +++ b/docs/DualOrderRefundParams.md @@ -0,0 +1,12 @@ +# DualOrderRefundParams + +Dual-currency order early redemption request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | +**req_id** | **str** | Request ID returned by order-refund-preview | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DualOrderRefundPreview.md b/docs/DualOrderRefundPreview.md new file mode 100644 index 00000000..80e795a2 --- /dev/null +++ b/docs/DualOrderRefundPreview.md @@ -0,0 +1,25 @@ +# DualOrderRefundPreview + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**create_timest** | **int** | Order creation timestamp | [optional] +**delivery_timest** | **int** | Order delivery timestamp | [optional] +**exercise_price** | **str** | Strike price | [optional] +**invest_amount** | **str** | Investment amount | [optional] +**invest_currency** | **str** | Investment Token | [optional] +**name** | **str** | Order name identifier | [optional] +**order_id** | **int** | Order ID | [optional] +**req_id** | **str** | Request ID used for actual redemption | [optional] +**refund_service_charge** | **int** | Refund fee | [optional] +**settle_price** | **str** | Settlement price | [optional] +**settlement_amount** | **str** | Settlement amount | [optional] +**settlement_currency** | **str** | Settlement currency | [optional] +**settlement_interest** | **str** | Settlement interest | [optional] +**settlement_principle** | **str** | Settlement principal | [optional] +**type** | **str** | `call`: sell high; `put`: buy low | [optional] +**money_back_timest** | **int** | Redemption time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DualProjectRecommend.md b/docs/DualProjectRecommend.md new file mode 100644 index 00000000..55a83247 --- /dev/null +++ b/docs/DualProjectRecommend.md @@ -0,0 +1,23 @@ +# DualProjectRecommend + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Product ID | [optional] +**category** | **int** | Strategy category | [optional] +**type** | **str** | `call`: sell high; `put`: buy low | [optional] +**invest_currency** | **str** | Investment Token | [optional] +**exercise_currency** | **str** | Strike Token | [optional] +**apy_display** | **str** | Annual Yield | [optional] +**exercise_price** | **str** | Strike price | [optional] +**delivery_timest** | **int** | Settlement time | [optional] +**min_amount** | **str** | Minimum investment amount | [optional] +**max_amount** | **str** | Maximum investment amount | [optional] +**min_copies** | **int** | Minimum Units | [optional] +**max_copies** | **int** | Maximum Units | [optional] +**invest_days** | **int** | Lock-up days | [optional] +**invest_hours** | **str** | Lock-up hours | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EarnApi.md b/docs/EarnApi.md index 07392bae..d2ea17fc 100644 --- a/docs/EarnApi.md +++ b/docs/EarnApi.md @@ -4,93 +4,112 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- -[**swap_eth2**](EarnApi.md#swap_eth2) | **POST** /earn/staking/eth2/swap | ETH swap -[**rate_list_eth2**](EarnApi.md#rate_list_eth2) | **GET** /earn/staking/eth2/rate_records | GTETH historical return rate query [**list_dual_investment_plans**](EarnApi.md#list_dual_investment_plans) | **GET** /earn/dual/investment_plan | Dual Investment product list [**list_dual_orders**](EarnApi.md#list_dual_orders) | **GET** /earn/dual/orders | Dual Investment order list [**place_dual_order**](EarnApi.md#place_dual_order) | **POST** /earn/dual/orders | Place Dual Investment order -[**list_structured_products**](EarnApi.md#list_structured_products) | **GET** /earn/structured/products | Structured Product List -[**list_structured_orders**](EarnApi.md#list_structured_orders) | **GET** /earn/structured/orders | Structured Product Order List -[**place_structured_order**](EarnApi.md#place_structured_order) | **POST** /earn/structured/orders | Place Structured Product Order +[**list_dual_balance**](EarnApi.md#list_dual_balance) | **GET** /earn/dual/balance | Dual-Currency Earning Assets +[**get_dual_order_refund_preview**](EarnApi.md#get_dual_order_refund_preview) | **GET** /earn/dual/order-refund-preview | Dual-currency early redemption preview +[**place_dual_order_refund**](EarnApi.md#place_dual_order_refund) | **POST** /earn/dual/order-refund | Dual-currency order early redemption +[**modify_dual_order_reinvest**](EarnApi.md#modify_dual_order_reinvest) | **POST** /earn/dual/modify-order-reinvest | Modify dual-currency order reinvest +[**get_dual_project_recommend**](EarnApi.md#get_dual_project_recommend) | **GET** /earn/dual/project-recommend | Dual-currency recommended projects [**find_coin**](EarnApi.md#find_coin) | **GET** /earn/staking/coins | Staking coins [**swap_staking_coin**](EarnApi.md#swap_staking_coin) | **POST** /earn/staking/swap | On-chain token swap for earned coins [**order_list**](EarnApi.md#order_list) | **GET** /earn/staking/order_list | List of on-chain coin-earning orders [**award_list**](EarnApi.md#award_list) | **GET** /earn/staking/award_list | On-chain coin-earning dividend records [**asset_list**](EarnApi.md#asset_list) | **GET** /earn/staking/assets | On-chain coin-earning assets +[**create_auto_invest_plan**](EarnApi.md#create_auto_invest_plan) | **POST** /earn/autoinvest/plans/create | Create auto invest plan +[**update_auto_invest_plan**](EarnApi.md#update_auto_invest_plan) | **POST** /earn/autoinvest/plans/update | UpdateAuto invest plan +[**stop_auto_invest_plan**](EarnApi.md#stop_auto_invest_plan) | **POST** /earn/autoinvest/plans/stop | StopAuto invest plan +[**add_position_auto_invest_plan**](EarnApi.md#add_position_auto_invest_plan) | **POST** /earn/autoinvest/plans/add_position | Add position immediately +[**list_auto_invest_coins**](EarnApi.md#list_auto_invest_coins) | **GET** /earn/autoinvest/coins | QueryCurrencies supporting auto invest +[**get_auto_invest_min_amount**](EarnApi.md#get_auto_invest_min_amount) | **POST** /earn/autoinvest/min_invest_amount | Get minimum investment amount +[**list_auto_invest_plan_records**](EarnApi.md#list_auto_invest_plan_records) | **GET** /earn/autoinvest/plans/records | List plan execution records +[**list_auto_invest_orders**](EarnApi.md#list_auto_invest_orders) | **GET** /earn/autoinvest/orders | List plan execution recordsDetails(OrderDetails) +[**list_auto_invest_config**](EarnApi.md#list_auto_invest_config) | **GET** /earn/autoinvest/config | List investment currency configuration +[**get_auto_invest_plan_detail**](EarnApi.md#get_auto_invest_plan_detail) | **GET** /earn/autoinvest/plans/detail | QueryAuto invest planDetails +[**list_auto_invest_plans**](EarnApi.md#list_auto_invest_plans) | **GET** /earn/autoinvest/plans/list_info | QueryAuto invest planList +[**list_earn_fixed_term_products**](EarnApi.md#list_earn_fixed_term_products) | **GET** /earn/fixed-term/product | Get product list +[**list_earn_fixed_term_products_by_asset**](EarnApi.md#list_earn_fixed_term_products_by_asset) | **GET** /earn/fixed-term/product/{asset}/list | Get product list by single currency +[**list_earn_fixed_term_lends**](EarnApi.md#list_earn_fixed_term_lends) | **GET** /earn/fixed-term/user/lend | Subscription list +[**create_earn_fixed_term_lend**](EarnApi.md#create_earn_fixed_term_lend) | **POST** /earn/fixed-term/user/lend | Subscription +[**create_earn_fixed_term_pre_redeem**](EarnApi.md#create_earn_fixed_term_pre_redeem) | **POST** /earn/fixed-term/user/pre-redeem | Redeem +[**list_earn_fixed_term_history**](EarnApi.md#list_earn_fixed_term_history) | **GET** /earn/fixed-term/user/history | Subscription history -# **swap_eth2** -> swap_eth2(eth2_swap) +# **list_dual_investment_plans** +> list[DualGetPlans] list_dual_investment_plans(plan_id=plan_id, coin=coin, type=type, quote_currency=quote_currency, sort=sort, page=page, page_size=page_size) -ETH swap +Dual Investment product list ### Example -* Api Key Authentication (apiv4): ```python from __future__ import print_function import gate_api from gate_api.exceptions import ApiException, GateApiException # Defining the host is optional and defaults to https://api.gateio.ws/api/v4 # See configuration.py for a list of all supported configuration parameters. -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure APIv4 key authorization configuration = gate_api.Configuration( - host = "https://api.gateio.ws/api/v4", - key = "YOU_API_KEY", - secret = "YOUR_API_SECRET" + host = "https://api.gateio.ws/api/v4" ) api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.EarnApi(api_client) -eth2_swap = gate_api.Eth2Swap() # Eth2Swap | +plan_id = 1 # int | Financial project ID (optional) +coin = 'BTC' # str | Investment Token (optional) +type = 'call' # str | Type enum: `put` — buy low; `call` — sell high (optional) +quote_currency = 'quote_currency_example' # str | Settlement currency enum: defaults to USDT; GUSD optional (optional) +sort = 'sort_example' # str | Sort field enum: `apy` — highest APY first `short-period` — shortest tenor first `multiple` — highest premium first (optional) +page = 1 # int | page number (optional) +page_size = 3 # int | Items per page (optional) try: - # ETH swap - api_instance.swap_eth2(eth2_swap) + # Dual Investment product list + api_response = api_instance.list_dual_investment_plans(plan_id=plan_id, coin=coin, type=type, quote_currency=quote_currency, sort=sort, page=page, page_size=page_size) + print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling EarnApi->swap_eth2: %s\n" % e) + print("Exception when calling EarnApi->list_dual_investment_plans: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **eth2_swap** | [**Eth2Swap**](Eth2Swap.md)| | + **plan_id** | **int**| Financial project ID | [optional] + **coin** | **str**| Investment Token | [optional] + **type** | **str**| Type enum: `put` — buy low; `call` — sell high | [optional] + **quote_currency** | **str**| Settlement currency enum: defaults to USDT; GUSD optional | [optional] + **sort** | **str**| Sort field enum: `apy` — highest APY first `short-period` — shortest tenor first `multiple` — highest premium first | [optional] + **page** | **int**| page number | [optional] + **page_size** | **int**| Items per page | [optional] ### Return type -void (empty response body) +[**list[DualGetPlans]**](DualGetPlans.md) ### Authorization -[apiv4](../README.md#apiv4) +No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Swap successful | - | +**200** | Successfully retrieved | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **rate_list_eth2** -> list[Eth2RateList] rate_list_eth2() - -GTETH historical return rate query +# **list_dual_orders** +> list[DualGetOrders] list_dual_orders(_from=_from, to=to, type=type, status=status, coin=coin, page=page, limit=limit) -Query ETH earnings rate records for the last 31 days +Dual Investment order list ### Example @@ -116,23 +135,39 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.EarnApi(api_client) +_from = 1740727000 # int | Start settlement time (optional) +to = 1740729000 # int | End settlement time (optional) +type = 'put' # str | Type enum: `put` — buy low; `call` — sell high (optional) +status = 'HOLD' # str | Order status enum: `HOLD` — open position `REPAY` — historical position `PROCESSING` — position active `SETTLEMENT_PROCESSING` — settlement in progress `ALL` — all (optional) +coin = 'BTC' # str | Investment Token (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) try: - # GTETH historical return rate query - api_response = api_instance.rate_list_eth2() + # Dual Investment order list + api_response = api_instance.list_dual_orders(_from=_from, to=to, type=type, status=status, coin=coin, page=page, limit=limit) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling EarnApi->rate_list_eth2: %s\n" % e) + print("Exception when calling EarnApi->list_dual_orders: %s\n" % e) ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **_from** | **int**| Start settlement time | [optional] + **to** | **int**| End settlement time | [optional] + **type** | **str**| Type enum: `put` — buy low; `call` — sell high | [optional] + **status** | **str**| Order status enum: `HOLD` — open position `REPAY` — historical position `PROCESSING` — position active `SETTLEMENT_PROCESSING` — settlement in progress `ALL` — all | [optional] + **coin** | **str**| Investment Token | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] ### Return type -[**list[Eth2RateList]**](Eth2RateList.md) +[**list[DualGetOrders]**](DualGetOrders.md) ### Authorization @@ -150,68 +185,77 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_dual_investment_plans** -> list[DualGetPlans] list_dual_investment_plans(plan_id=plan_id) +# **place_dual_order** +> PlaceDualInvestmentOrder place_dual_order(place_dual_investment_order_params) -Dual Investment product list +Place Dual Investment order ### Example +* Api Key Authentication (apiv4): ```python from __future__ import print_function import gate_api from gate_api.exceptions import ApiException, GateApiException # Defining the host is optional and defaults to https://api.gateio.ws/api/v4 # See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization configuration = gate_api.Configuration( - host = "https://api.gateio.ws/api/v4" + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" ) api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.EarnApi(api_client) -plan_id = 1 # int | Financial project ID (optional) +place_dual_investment_order_params = gate_api.PlaceDualInvestmentOrderParams() # PlaceDualInvestmentOrderParams | try: - # Dual Investment product list - api_response = api_instance.list_dual_investment_plans(plan_id=plan_id) + # Place Dual Investment order + api_response = api_instance.place_dual_order(place_dual_investment_order_params) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling EarnApi->list_dual_investment_plans: %s\n" % e) + print("Exception when calling EarnApi->place_dual_order: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **plan_id** | **int**| Financial project ID | [optional] + **place_dual_investment_order_params** | [**PlaceDualInvestmentOrderParams**](PlaceDualInvestmentOrderParams.md)| | ### Return type -[**list[DualGetPlans]**](DualGetPlans.md) +[**PlaceDualInvestmentOrder**](PlaceDualInvestmentOrder.md) ### Authorization -No authorization required +[apiv4](../README.md#apiv4) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Order placed successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_dual_orders** -> list[DualGetOrders] list_dual_orders(_from=_from, to=to, page=page, limit=limit) +# **list_dual_balance** +> DualGetBalance list_dual_balance() -Dual Investment order list +Dual-Currency Earning Assets ### Example @@ -237,33 +281,23 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.EarnApi(api_client) -_from = 1740727000 # int | Start settlement time (optional) -to = 1740729000 # int | End settlement time (optional) -page = 1 # int | Page number (optional) (default to 1) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) try: - # Dual Investment order list - api_response = api_instance.list_dual_orders(_from=_from, to=to, page=page, limit=limit) + # Dual-Currency Earning Assets + api_response = api_instance.list_dual_balance() print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling EarnApi->list_dual_orders: %s\n" % e) + print("Exception when calling EarnApi->list_dual_balance: %s\n" % e) ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **_from** | **int**| Start settlement time | [optional] - **to** | **int**| End settlement time | [optional] - **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] +This endpoint does not need any parameter. ### Return type -[**list[DualGetOrders]**](DualGetOrders.md) +[**DualGetBalance**](DualGetBalance.md) ### Authorization @@ -281,10 +315,10 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **place_dual_order** -> place_dual_order(place_dual_investment_order) +# **get_dual_order_refund_preview** +> DualOrderRefundPreview get_dual_order_refund_preview(order_id) -Place Dual Investment order +Dual-currency early redemption preview ### Example @@ -310,26 +344,27 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.EarnApi(api_client) -place_dual_investment_order = gate_api.PlaceDualInvestmentOrder() # PlaceDualInvestmentOrder | +order_id = '9497' # str | Order ID try: - # Place Dual Investment order - api_instance.place_dual_order(place_dual_investment_order) + # Dual-currency early redemption preview + api_response = api_instance.get_dual_order_refund_preview(order_id) + print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling EarnApi->place_dual_order: %s\n" % e) + print("Exception when calling EarnApi->get_dual_order_refund_preview: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **place_dual_investment_order** | [**PlaceDualInvestmentOrder**](PlaceDualInvestmentOrder.md)| | + **order_id** | **str**| Order ID | ### Return type -void (empty response body) +[**DualOrderRefundPreview**](DualOrderRefundPreview.md) ### Authorization @@ -337,84 +372,86 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order placed successfully | - | +**200** | Successfully retrieved | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_structured_products** -> list[StructuredGetProjectList] list_structured_products(status, type=type, page=page, limit=limit) +# **place_dual_order_refund** +> place_dual_order_refund(dual_order_refund_params) -Structured Product List +Dual-currency order early redemption ### Example +* Api Key Authentication (apiv4): ```python from __future__ import print_function import gate_api from gate_api.exceptions import ApiException, GateApiException # Defining the host is optional and defaults to https://api.gateio.ws/api/v4 # See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization configuration = gate_api.Configuration( - host = "https://api.gateio.ws/api/v4" + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" ) api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.EarnApi(api_client) -status = 'in_process' # str | Status (Default empty to query all) `in_process`-In progress `will_begin`-Not started `wait_settlement`-Pending settlement `done`-Completed -type = 'BullishSharkFin' # str | Product Type (Default empty to query all) `SharkFin2.0`-Shark Fin `BullishSharkFin`-Bullish Treasure `BearishSharkFin`-Bearish Treasure `DoubleNoTouch`-Volatility Treasure `RangeAccrual`-Range Smart Yield `SnowBall`-Snowball (optional) -page = 1 # int | Page number (optional) (default to 1) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +dual_order_refund_params = gate_api.DualOrderRefundParams() # DualOrderRefundParams | try: - # Structured Product List - api_response = api_instance.list_structured_products(status, type=type, page=page, limit=limit) - print(api_response) + # Dual-currency order early redemption + api_instance.place_dual_order_refund(dual_order_refund_params) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling EarnApi->list_structured_products: %s\n" % e) + print("Exception when calling EarnApi->place_dual_order_refund: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | **str**| Status (Default empty to query all) `in_process`-In progress `will_begin`-Not started `wait_settlement`-Pending settlement `done`-Completed | - **type** | **str**| Product Type (Default empty to query all) `SharkFin2.0`-Shark Fin `BullishSharkFin`-Bullish Treasure `BearishSharkFin`-Bearish Treasure `DoubleNoTouch`-Volatility Treasure `RangeAccrual`-Range Smart Yield `SnowBall`-Snowball | [optional] - **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **dual_order_refund_params** | [**DualOrderRefundParams**](DualOrderRefundParams.md)| | ### Return type -[**list[StructuredGetProjectList]**](StructuredGetProjectList.md) +void (empty response body) ### Authorization -No authorization required +[apiv4](../README.md#apiv4) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json + - **Content-Type**: application/json + - **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Redemption successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_structured_orders** -> list[StructuredOrderList] list_structured_orders(_from=_from, to=to, page=page, limit=limit) +# **modify_dual_order_reinvest** +> modify_dual_order_reinvest(dual_modify_order_reinvest_params) -Structured Product Order List +Modify dual-currency order reinvest ### Example @@ -440,33 +477,26 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.EarnApi(api_client) -_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) -to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) -page = 1 # int | Page number (optional) (default to 1) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +dual_modify_order_reinvest_params = gate_api.DualModifyOrderReinvestParams() # DualModifyOrderReinvestParams | try: - # Structured Product Order List - api_response = api_instance.list_structured_orders(_from=_from, to=to, page=page, limit=limit) - print(api_response) + # Modify dual-currency order reinvest + api_instance.modify_dual_order_reinvest(dual_modify_order_reinvest_params) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling EarnApi->list_structured_orders: %s\n" % e) + print("Exception when calling EarnApi->modify_dual_order_reinvest: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] - **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] - **page** | **int**| Page number | [optional] [default to 1] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **dual_modify_order_reinvest_params** | [**DualModifyOrderReinvestParams**](DualModifyOrderReinvestParams.md)| | ### Return type -[**list[StructuredOrderList]**](StructuredOrderList.md) +void (empty response body) ### Authorization @@ -474,20 +504,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json + - **Content-Type**: application/json + - **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Successfully retrieved | - | +**200** | Updated successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **place_structured_order** -> place_structured_order(structured_buy) +# **get_dual_project_recommend** +> list[DualProjectRecommend] get_dual_project_recommend(mode=mode, coin=coin, type=type, history_pids=history_pids) -Place Structured Product Order +Dual-currency recommended projects ### Example @@ -513,26 +543,33 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.EarnApi(api_client) -structured_buy = gate_api.StructuredBuy() # StructuredBuy | +mode = 'normal' # str | Sort mode; default `normal`: `senior` — curated picks (APR/tenor) `apy_up` — APY ascending `ep_down` — target price descending `ep_up` — target price ascending `dt_down` — maturity time descending `dt_up` — maturity time ascending (optional) +coin = 'ETH' # str | Investment Token (optional) +type = 'call' # str | `call`: sell high; `put`: buy low (optional) +history_pids = '110656,110652' # str | Comma-separated project IDs to exclude already recommended items (optional) try: - # Place Structured Product Order - api_instance.place_structured_order(structured_buy) + # Dual-currency recommended projects + api_response = api_instance.get_dual_project_recommend(mode=mode, coin=coin, type=type, history_pids=history_pids) + print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling EarnApi->place_structured_order: %s\n" % e) + print("Exception when calling EarnApi->get_dual_project_recommend: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **structured_buy** | [**StructuredBuy**](StructuredBuy.md)| | + **mode** | **str**| Sort mode; default `normal`: `senior` — curated picks (APR/tenor) `apy_up` — APY ascending `ep_down` — target price descending `ep_up` — target price ascending `dt_down` — maturity time descending `dt_up` — maturity time ascending | [optional] + **coin** | **str**| Investment Token | [optional] + **type** | **str**| `call`: sell high; `put`: buy low | [optional] + **history_pids** | **str**| Comma-separated project IDs to exclude already recommended items | [optional] ### Return type -void (empty response body) +[**list[DualProjectRecommend]**](DualProjectRecommend.md) ### Authorization @@ -540,18 +577,18 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order placed successfully | - | +**200** | Successfully retrieved | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **find_coin** -> list[object] find_coin(find_coin) +> list[object] find_coin(cointype=cointype) Staking coins @@ -579,11 +616,11 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.EarnApi(api_client) -find_coin = gate_api.FindCoin() # FindCoin | +cointype = 'cointype_example' # str | Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. (optional) try: # Staking coins - api_response = api_instance.find_coin(find_coin) + api_response = api_instance.find_coin(cointype=cointype) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -595,7 +632,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **find_coin** | [**FindCoin**](FindCoin.md)| | + **cointype** | **str**| Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. | [optional] ### Return type @@ -607,7 +644,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details @@ -895,3 +932,1179 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_auto_invest_plan** +> AutoInvestPlanCreateResp create_auto_invest_plan(auto_invest_plan_create) + +Create auto invest plan + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +auto_invest_plan_create = gate_api.AutoInvestPlanCreate() # AutoInvestPlanCreate | + +try: + # Create auto invest plan + api_response = api_instance.create_auto_invest_plan(auto_invest_plan_create) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->create_auto_invest_plan: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **auto_invest_plan_create** | [**AutoInvestPlanCreate**](AutoInvestPlanCreate.md)| | + +### Return type + +[**AutoInvestPlanCreateResp**](AutoInvestPlanCreateResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Created successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_auto_invest_plan** +> update_auto_invest_plan(auto_invest_plan_update) + +UpdateAuto invest plan + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +auto_invest_plan_update = gate_api.AutoInvestPlanUpdate() # AutoInvestPlanUpdate | + +try: + # UpdateAuto invest plan + api_instance.update_auto_invest_plan(auto_invest_plan_update) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->update_auto_invest_plan: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **auto_invest_plan_update** | [**AutoInvestPlanUpdate**](AutoInvestPlanUpdate.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Updated successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **stop_auto_invest_plan** +> stop_auto_invest_plan(auto_invest_plan_stop) + +StopAuto invest plan + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +auto_invest_plan_stop = gate_api.AutoInvestPlanStop() # AutoInvestPlanStop | + +try: + # StopAuto invest plan + api_instance.stop_auto_invest_plan(auto_invest_plan_stop) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->stop_auto_invest_plan: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **auto_invest_plan_stop** | [**AutoInvestPlanStop**](AutoInvestPlanStop.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Stopped successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **add_position_auto_invest_plan** +> add_position_auto_invest_plan(auto_invest_plan_add_position) + +Add position immediately + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +auto_invest_plan_add_position = gate_api.AutoInvestPlanAddPosition() # AutoInvestPlanAddPosition | + +try: + # Add position immediately + api_instance.add_position_auto_invest_plan(auto_invest_plan_add_position) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->add_position_auto_invest_plan: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **auto_invest_plan_add_position** | [**AutoInvestPlanAddPosition**](AutoInvestPlanAddPosition.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Add PositionSuccess | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_auto_invest_coins** +> list[AutoInvestCoinsItem] list_auto_invest_coins(plan_money=plan_money) + +QueryCurrencies supporting auto invest + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +plan_money = 'USDT' # str | Pricing currency,Optional: USDT or BTC,Default: USDT (optional) + +try: + # QueryCurrencies supporting auto invest + api_response = api_instance.list_auto_invest_coins(plan_money=plan_money) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_auto_invest_coins: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_money** | **str**| Pricing currency,Optional: USDT or BTC,Default: USDT | [optional] + +### Return type + +[**list[AutoInvestCoinsItem]**](AutoInvestCoinsItem.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_auto_invest_min_amount** +> AutoInvestMinInvestAmountResp get_auto_invest_min_amount(auto_invest_min_invest_amount) + +Get minimum investment amount + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +auto_invest_min_invest_amount = gate_api.AutoInvestMinInvestAmount() # AutoInvestMinInvestAmount | + +try: + # Get minimum investment amount + api_response = api_instance.get_auto_invest_min_amount(auto_invest_min_invest_amount) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->get_auto_invest_min_amount: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **auto_invest_min_invest_amount** | [**AutoInvestMinInvestAmount**](AutoInvestMinInvestAmount.md)| | + +### Return type + +[**AutoInvestMinInvestAmountResp**](AutoInvestMinInvestAmountResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_auto_invest_plan_records** +> AutoInvestPlanRecordsResp list_auto_invest_plan_records(plan_id, page=page, page_size=page_size) + +List plan execution records + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +plan_id = 141378 # int | Plan ID +page = 1 # int | page number (optional) +page_size = 10 # int | Items per page,Maximum 100 (optional) + +try: + # List plan execution records + api_response = api_instance.list_auto_invest_plan_records(plan_id, page=page, page_size=page_size) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_auto_invest_plan_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **int**| Plan ID | + **page** | **int**| page number | [optional] + **page_size** | **int**| Items per page,Maximum 100 | [optional] + +### Return type + +[**AutoInvestPlanRecordsResp**](AutoInvestPlanRecordsResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_auto_invest_orders** +> list[AutoInvestOrderItem] list_auto_invest_orders(plan_id, record_id) + +List plan execution recordsDetails(OrderDetails) + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +plan_id = 142583 # int | Plan ID +record_id = 1770805384904919 # int | Record ID + +try: + # List plan execution recordsDetails(OrderDetails) + api_response = api_instance.list_auto_invest_orders(plan_id, record_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_auto_invest_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **int**| Plan ID | + **record_id** | **int**| Record ID | + +### Return type + +[**list[AutoInvestOrderItem]**](AutoInvestOrderItem.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_auto_invest_config** +> list[AutoInvestConfigItem] list_auto_invest_config() + +List investment currency configuration + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) + +try: + # List investment currency configuration + api_response = api_instance.list_auto_invest_config() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_auto_invest_config: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[AutoInvestConfigItem]**](AutoInvestConfigItem.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_auto_invest_plan_detail** +> AutoInvestPlanDetail get_auto_invest_plan_detail(plan_id) + +QueryAuto invest planDetails + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +plan_id = 142609 # int | Plan ID + +try: + # QueryAuto invest planDetails + api_response = api_instance.get_auto_invest_plan_detail(plan_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->get_auto_invest_plan_detail: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **plan_id** | **int**| Plan ID | + +### Return type + +[**AutoInvestPlanDetail**](AutoInvestPlanDetail.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_auto_invest_plans** +> AutoInvestPlanListInfoResp list_auto_invest_plans(status, page=page, page_size=page_size) + +QueryAuto invest planList + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +status = 'active' # str | Plan status,History history,Active active +page = 56 # int | page number (optional) +page_size = 56 # int | Items per page,Maximum 100 (optional) + +try: + # QueryAuto invest planList + api_response = api_instance.list_auto_invest_plans(status, page=page, page_size=page_size) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_auto_invest_plans: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **str**| Plan status,History history,Active active | + **page** | **int**| page number | [optional] + **page_size** | **int**| Items per page,Maximum 100 | [optional] + +### Return type + +[**AutoInvestPlanListInfoResp**](AutoInvestPlanListInfoResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_earn_fixed_term_products** +> ListEarnFixedTermProductsResponse list_earn_fixed_term_products(page, limit, asset=asset, type=type) + +Get product list + +Query fixed-term earn product list. Supports filtering by currency, product type, status, etc. Returns product interest rate, lock-up period, quota, and reward campaign information + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +page = 1 # int | Page number +limit = 100 # int | Page size +asset = 'USDT' # str | Currency (optional) +type = 1 # int | Product type: 1 for regular, 2 for VIP (optional) + +try: + # Get product list + api_response = api_instance.list_earn_fixed_term_products(page, limit, asset=asset, type=type) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_earn_fixed_term_products: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number | + **limit** | **int**| Page size | + **asset** | **str**| Currency | [optional] + **type** | **int**| Product type: 1 for regular, 2 for VIP | [optional] + +### Return type + +[**ListEarnFixedTermProductsResponse**](ListEarnFixedTermProductsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Product list retrieved successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_earn_fixed_term_products_by_asset** +> ListEarnFixedTermProductsByAssetResponse list_earn_fixed_term_products_by_asset(asset, type=type) + +Get product list by single currency + +Sort by product term in ascending order + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +asset = 'USDT' # str | Currency name, e.g., USDT, BTC +type = '1' # str | Product type: \"\" or 1 for regular product list, 2 for VIP product list, 0 for all products (optional) + +try: + # Get product list by single currency + api_response = api_instance.list_earn_fixed_term_products_by_asset(asset, type=type) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_earn_fixed_term_products_by_asset: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **asset** | **str**| Currency name, e.g., USDT, BTC | + **type** | **str**| Product type: \"\" or 1 for regular product list, 2 for VIP product list, 0 for all products | [optional] + +### Return type + +[**ListEarnFixedTermProductsByAssetResponse**](ListEarnFixedTermProductsByAssetResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Single currency product list retrieved successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_earn_fixed_term_lends** +> ListEarnFixedTermLendsResponse list_earn_fixed_term_lends(order_type, page, limit, product_id=product_id, order_id=order_id, asset=asset, sub_business=sub_business, business_filter=business_filter) + +Subscription list + +Query the user's fixed-term earn subscription order list. Supports filtering by product, currency, order type, etc. Returns order details, earnings, rewards, and interest rate boost coupon information + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +order_type = '1' # str | Order type: 1 for current orders, 2 for historical orders +page = 1 # int | Page number +limit = 10 # int | Page size +product_id = 56 # int | Product ID (optional) +order_id = 56 # int | Order ID (optional) +asset = 'asset_example' # str | Currency (optional) +sub_business = 56 # int | Sub-business (optional) +business_filter = '[{\"business\":1, \"sub_business\": 0},{\"business\":2, \"sub_business\": 0}]' # str | Business filter conditions, JSON array format, e.g., [{\"business\":1, \"sub_business\": 0}]. business: 1 for regular, 2 for VIP (optional) + +try: + # Subscription list + api_response = api_instance.list_earn_fixed_term_lends(order_type, page, limit, product_id=product_id, order_id=order_id, asset=asset, sub_business=sub_business, business_filter=business_filter) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_earn_fixed_term_lends: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_type** | **str**| Order type: 1 for current orders, 2 for historical orders | + **page** | **int**| Page number | + **limit** | **int**| Page size | + **product_id** | **int**| Product ID | [optional] + **order_id** | **int**| Order ID | [optional] + **asset** | **str**| Currency | [optional] + **sub_business** | **int**| Sub-business | [optional] + **business_filter** | **str**| Business filter conditions, JSON array format, e.g., [{\"business\":1, \"sub_business\": 0}]. business: 1 for regular, 2 for VIP | [optional] + +### Return type + +[**ListEarnFixedTermLendsResponse**](ListEarnFixedTermLendsResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Subscription order list retrieved successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_earn_fixed_term_lend** +> CreateEarnFixedTermLendResponse create_earn_fixed_term_lend(fixed_term_lend_request=fixed_term_lend_request) + +Subscription + +Subscribe to a fixed-term earn product by specifying the product ID and subscription amount. Optionally enable auto-renewal and apply an interest rate boost coupon + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +fixed_term_lend_request = gate_api.FixedTermLendRequest() # FixedTermLendRequest | (optional) + +try: + # Subscription + api_response = api_instance.create_earn_fixed_term_lend(fixed_term_lend_request=fixed_term_lend_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->create_earn_fixed_term_lend: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fixed_term_lend_request** | [**FixedTermLendRequest**](FixedTermLendRequest.md)| | [optional] + +### Return type + +[**CreateEarnFixedTermLendResponse**](CreateEarnFixedTermLendResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Subscription successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_earn_fixed_term_pre_redeem** +> CreateEarnFixedTermPreRedeemResponse create_earn_fixed_term_pre_redeem(earn_fixed_term_pre_redeem_request=earn_fixed_term_pre_redeem_request) + +Redeem + +Early redemption of a fixed-term earn order, order ID is required + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +earn_fixed_term_pre_redeem_request = gate_api.EarnFixedTermPreRedeemRequest() # EarnFixedTermPreRedeemRequest | (optional) + +try: + # Redeem + api_response = api_instance.create_earn_fixed_term_pre_redeem(earn_fixed_term_pre_redeem_request=earn_fixed_term_pre_redeem_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->create_earn_fixed_term_pre_redeem: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **earn_fixed_term_pre_redeem_request** | [**EarnFixedTermPreRedeemRequest**](EarnFixedTermPreRedeemRequest.md)| | [optional] + +### Return type + +[**CreateEarnFixedTermPreRedeemResponse**](CreateEarnFixedTermPreRedeemResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Redemption successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_earn_fixed_term_history** +> ListEarnFixedTermHistoryResponse list_earn_fixed_term_history(type, page, limit, product_id=product_id, order_id=order_id, asset=asset, start_at=start_at, end_at=end_at, sub_business=sub_business, business_filter=business_filter) + +Subscription history + +Query the user's fixed-term earn history records. Supports filtering by type (subscription, redemption, interest, bonus rewards) and time range + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +type = '1' # str | 1 for subscription, 2 for redemption, 3 for interest, 4 for bonus reward +page = 1 # int | Page number +limit = 10 # int | Page size +product_id = 56 # int | Product ID (optional) +order_id = 'order_id_example' # str | Order ID (optional) +asset = 'asset_example' # str | Currency (optional) +start_at = 56 # int | Start timestamp (optional) +end_at = 56 # int | End Timestamp (optional) +sub_business = 56 # int | Sub-business (optional) +business_filter = '[{\"business\":1, \"sub_business\": 0},{\"business\":2, \"sub_business\": 0}]' # str | Business filter conditions, JSON array format, e.g., [{\"business\":1, \"sub_business\": 0}]. business: 1 for regular, 2 for VIP (optional) + +try: + # Subscription history + api_response = api_instance.list_earn_fixed_term_history(type, page, limit, product_id=product_id, order_id=order_id, asset=asset, start_at=start_at, end_at=end_at, sub_business=sub_business, business_filter=business_filter) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_earn_fixed_term_history: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | **str**| 1 for subscription, 2 for redemption, 3 for interest, 4 for bonus reward | + **page** | **int**| Page number | + **limit** | **int**| Page size | + **product_id** | **int**| Product ID | [optional] + **order_id** | **str**| Order ID | [optional] + **asset** | **str**| Currency | [optional] + **start_at** | **int**| Start timestamp | [optional] + **end_at** | **int**| End Timestamp | [optional] + **sub_business** | **int**| Sub-business | [optional] + **business_filter** | **str**| Business filter conditions, JSON array format, e.g., [{\"business\":1, \"sub_business\": 0}]. business: 1 for regular, 2 for VIP | [optional] + +### Return type + +[**ListEarnFixedTermHistoryResponse**](ListEarnFixedTermHistoryResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | History records retrieved successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/EarnFixedTermPreRedeemRequest.md b/docs/EarnFixedTermPreRedeemRequest.md new file mode 100644 index 00000000..785811c3 --- /dev/null +++ b/docs/EarnFixedTermPreRedeemRequest.md @@ -0,0 +1,10 @@ +# EarnFixedTermPreRedeemRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EarnUniApi.md b/docs/EarnUniApi.md index a15da34a..0ff17ef5 100644 --- a/docs/EarnUniApi.md +++ b/docs/EarnUniApi.md @@ -623,7 +623,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_uni_chart** -> list[InlineResponse200] list_uni_chart(_from, to, asset) +> list[UniChartPoint] list_uni_chart(_from, to, asset) UniLoan currency annualized trend chart @@ -675,7 +675,7 @@ Name | Type | Description | Notes ### Return type -[**list[InlineResponse200]**](InlineResponse200.md) +[**list[UniChartPoint]**](UniChartPoint.md) ### Authorization @@ -694,7 +694,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_uni_rate** -> list[InlineResponse2001] list_uni_rate() +> list[UniEstimatedRate] list_uni_rate() Currency estimated annualized interest rate @@ -738,7 +738,7 @@ This endpoint does not need any parameter. ### Return type -[**list[InlineResponse2001]**](InlineResponse2001.md) +[**list[UniEstimatedRate]**](UniEstimatedRate.md) ### Authorization diff --git a/docs/Eligibility.md b/docs/Eligibility.md new file mode 100644 index 00000000..ce63d165 --- /dev/null +++ b/docs/Eligibility.md @@ -0,0 +1,12 @@ +# Eligibility + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**eligible** | **bool** | Whether eligible for application | +**block_reasons** | **list[str]** | List of ineligibility reason descriptions | +**block_reason_codes** | **list[str]** | List of ineligibility reason codes | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EligibilityResponse.md b/docs/EligibilityResponse.md new file mode 100644 index 00000000..03ff7c99 --- /dev/null +++ b/docs/EligibilityResponse.md @@ -0,0 +1,13 @@ +# EligibilityResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Error Code, 0 Indicates Success | +**message** | **str** | Error message description | +**data** | [**Eligibility**](Eligibility.md) | | +**timestamp** | **int** | Unix timestamp | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EligibilityResponseAllOf.md b/docs/EligibilityResponseAllOf.md new file mode 100644 index 00000000..94946659 --- /dev/null +++ b/docs/EligibilityResponseAllOf.md @@ -0,0 +1,10 @@ +# EligibilityResponseAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Eligibility**](Eligibility.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ErrCodeMsg.md b/docs/ErrCodeMsg.md new file mode 100644 index 00000000..6b5f2ffc --- /dev/null +++ b/docs/ErrCodeMsg.md @@ -0,0 +1,12 @@ +# ErrCodeMsg + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Error code | +**message** | **str** | Error message | +**extra** | [**object**](.md) | Additional information | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md new file mode 100644 index 00000000..50df3d0b --- /dev/null +++ b/docs/ErrorResponse.md @@ -0,0 +1,13 @@ +# ErrorResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Error code | +**message** | **str** | Error message | +**data** | [**object**](.md) | Empty object | +**timestamp** | **int** | Unix timestamp | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EvaluateItem.md b/docs/EvaluateItem.md new file mode 100644 index 00000000..f89ff081 --- /dev/null +++ b/docs/EvaluateItem.md @@ -0,0 +1,16 @@ +# EvaluateItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | | +**asset_full_name** | **str** | | +**asset_icon_url** | **str** | | +**available** | **str** | | +**available_show** | **str** | | +**evaluate_usdt** | **str** | | +**evaluate_usdt_show** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EvaluateResp.md b/docs/EvaluateResp.md new file mode 100644 index 00000000..9164b642 --- /dev/null +++ b/docs/EvaluateResp.md @@ -0,0 +1,14 @@ +# EvaluateResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[EvaluateItem]**](EvaluateItem.md) | | +**total** | **int** | | +**cursor** | **str** | | +**total_available** | **str** | | +**total_available_show** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ExSkillClaimRewardReq.md b/docs/ExSkillClaimRewardReq.md new file mode 100644 index 00000000..3a8be4b1 --- /dev/null +++ b/docs/ExSkillClaimRewardReq.md @@ -0,0 +1,10 @@ +# ExSkillClaimRewardReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**welfare_task_id** | **int** | Rewards Center task ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ExSkillClaimTaskReq.md b/docs/ExSkillClaimTaskReq.md new file mode 100644 index 00000000..b7db0c82 --- /dev/null +++ b/docs/ExSkillClaimTaskReq.md @@ -0,0 +1,10 @@ +# ExSkillClaimTaskReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**welfare_task_id** | **int** | Rewards Center task ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Exchanges.md b/docs/Exchanges.md new file mode 100644 index 00000000..056845a3 --- /dev/null +++ b/docs/Exchanges.md @@ -0,0 +1,11 @@ +# Exchanges + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ExchangesData**](ExchangesData.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ExchangesData.md b/docs/ExchangesData.md new file mode 100644 index 00000000..e4ed59ef --- /dev/null +++ b/docs/ExchangesData.md @@ -0,0 +1,10 @@ +# ExchangesData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[ExchangesDataList]**](ExchangesDataList.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ExchangesDataList.md b/docs/ExchangesDataList.md new file mode 100644 index 00000000..9b014209 --- /dev/null +++ b/docs/ExchangesDataList.md @@ -0,0 +1,13 @@ +# ExchangesDataList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exchange** | **str** | Trading market, supports us, hk, and kr | [optional] +**exchange_desc** | **str** | Market display name | [optional] +**icon_link** | **str** | Market icon | [optional] +**support_transfer** | **bool** | Whether stock transfer is supported | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FeeRate.md b/docs/FeeRate.md new file mode 100644 index 00000000..e06b05a7 --- /dev/null +++ b/docs/FeeRate.md @@ -0,0 +1,11 @@ +# FeeRate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**FeeRateData**](FeeRateData.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FeeRateData.md b/docs/FeeRateData.md new file mode 100644 index 00000000..2ac6311c --- /dev/null +++ b/docs/FeeRateData.md @@ -0,0 +1,10 @@ +# FeeRateData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[FeeRateDataList]**](FeeRateDataList.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateCollateralOrder.md b/docs/FeeRateDataList.md similarity index 53% rename from docs/CreateCollateralOrder.md rename to docs/FeeRateDataList.md index 41db4cca..354ec155 100644 --- a/docs/CreateCollateralOrder.md +++ b/docs/FeeRateDataList.md @@ -1,12 +1,11 @@ -# CreateCollateralOrder +# FeeRateDataList ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**collateral_amount** | **str** | Collateral amount | -**collateral_currency** | **str** | Collateral currency | -**borrow_amount** | **str** | Borrowed amount | -**borrow_currency** | **str** | Borrowed currency | +**vip_level** | **int** | VIP level | [optional] +**maker_fee** | **str** | Maker fee rate for Japanese and Korean stocks | [optional] +**taker_fee** | **str** | Taker fee rate for Japanese and Korean stocks | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FixedTermBonusInfo.md b/docs/FixedTermBonusInfo.md new file mode 100644 index 00000000..dd32dea8 --- /dev/null +++ b/docs/FixedTermBonusInfo.md @@ -0,0 +1,29 @@ +# FixedTermBonusInfo + +Bonus reward campaign information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Activity ID | [optional] +**product_id** | **int** | Associated product ID | [optional] +**asset** | **str** | Product currency | [optional] +**bonus_asset** | **str** | Reward currency | [optional] +**kyc_limit** | **str** | KYC level restrictions, comma-separated | [optional] +**ladder_apr** | [**list[LadderApr]**](LadderApr.md) | Tiered annual interest rate | [optional] +**total_bonus_amount** | **str** | Total reward amount | [optional] +**user_total_bonus_amount** | **str** | Maximum reward per user | [optional] +**status** | **int** | Activity status: 1 for unlisted, 2 for listed, 3 for delisted | [optional] +**start_time** | **str** | Activity start time | [optional] +**end_time** | **str** | Activity end time | [optional] +**create_time** | **str** | Created time | [optional] +**start_at** | **int** | Activity start timestamp (in seconds) | [optional] +**end_at** | **int** | Activity end timestamp (in seconds) | [optional] +**total_issued_amount** | **str** | Total rewards distributed | [optional] +**user_total_issued_amount** | **str** | Total rewards distributed to the user | [optional] +**bonus_asset_price** | **str** | Reward currency price (denominated in USDT) | [optional] +**product_asset_price** | **str** | Product currency price (denominated in USDT) | [optional] +**product_year_rate** | **str** | Product base annual interest rate | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FixedTermCouponInfo.md b/docs/FixedTermCouponInfo.md new file mode 100644 index 00000000..5948afcd --- /dev/null +++ b/docs/FixedTermCouponInfo.md @@ -0,0 +1,27 @@ +# FixedTermCouponInfo + +Interest rate boost coupon information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Interest rate boost coupon record ID | +**business** | **int** | Business Type | +**user_id** | **int** | User ID | +**asset** | **str** | Currency | +**order_id** | **int** | Associated order ID | +**financial_rate_id** | **int** | Interest rate boost coupon ID | +**buy_limit_low** | **str** | Minimum subscription amount for interest rate boost coupon | +**buy_limit_high** | **str** | Maximum subscription amount for interest rate boost coupon | +**rate_day** | **int** | Interest rate boost days | +**rate_ratio** | **str** | Interest rate boost percentage | +**coupon_days** | **int** | Actual interest rate boost days | +**coupon_principal** | **str** | Principal for interest rate boost calculation | +**coupon_year_rate** | **str** | Interest rate boost APR | +**coupon_interest** | **str** | Interest generated from rate boost | +**status** | **int** | Status: 1 for active, 2 for settled | +**finish_time** | **str** | Settlement time | +**create_time** | **str** | Created time | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FixedTermHistoryRecord.md b/docs/FixedTermHistoryRecord.md new file mode 100644 index 00000000..abc08e82 --- /dev/null +++ b/docs/FixedTermHistoryRecord.md @@ -0,0 +1,26 @@ +# FixedTermHistoryRecord + +Fixed-term earn history records +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Record ID | +**order_id** | **int** | Order ID | [optional] +**user_id** | **int** | User ID | +**asset** | **str** | Currency | +**uniq_time** | **str** | Unique time identifier (date) | [optional] +**bonus_id** | **int** | Reward campaign ID | [optional] +**product_id** | **int** | Product ID | +**bonus_asset** | **str** | Reward currency | [optional] +**total_principal** | **str** | Total principal | [optional] +**amount** | **str** | Amount | [optional] +**asset_price** | **str** | Currency price | [optional] +**status** | **int** | Status | +**detail** | **str** | Detail description | [optional] +**create_time** | **str** | Created time | +**create_at** | **int** | Creation timestamp (in seconds) | +**lock_up_period** | **int** | Term | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FixedTermLendOrder.md b/docs/FixedTermLendOrder.md new file mode 100644 index 00000000..a45a012d --- /dev/null +++ b/docs/FixedTermLendOrder.md @@ -0,0 +1,39 @@ +# FixedTermLendOrder + +Fixed-term earn subscription order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Subscription record ID | [optional] +**business** | **int** | Business type: 1 for regular, 2 for VIP | [optional] +**order_id** | **int** | Order ID | [optional] +**user_id** | **int** | User ID | [optional] +**asset** | **str** | Currency | [optional] +**product_id** | **int** | Product ID | [optional] +**lock_up_period** | **int** | Lock-up period (in days) | [optional] +**principal** | **str** | Subscription principal | [optional] +**year_rate** | **str** | Annual interest rate | [optional] +**product_type** | **int** | Product type: 1 for regular, 2 for VIP | [optional] +**interest** | **str** | Accrued interest | [optional] +**status** | **int** | Order status: 1 for holding, 2 for redeemed, 3 for matured, 4 for settled | [optional] +**reinvest_status** | **int** | Auto-renewal status: 0 for disabled, 1 for enabled | [optional] +**redeem_account_type** | **int** | Redemption payout account type: 1 for spot account | [optional] +**origin_order** | **str** | Original order ID, linked to previous order IDs in auto-renewal scenarios | [optional] +**redeem_type** | **int** | Redemption type: 1 for early redemption, 2 for maturity redemption | [optional] +**redeem_time** | **str** | Redemption time | [optional] +**finish_time** | **str** | Expiration time | [optional] +**create_time** | **str** | Created time | [optional] +**year_rate_perent** | **str** | Annual interest rate percentage display value | [optional] +**total_year_rate_percent** | **str** | Comprehensive annualized yield percentage (including interest rate boost, rewards, etc.) | [optional] +**total_interest** | **str** | Total earnings (including interest and bonus rewards) | [optional] +**product_info** | [**FixedTermProductInfo**](FixedTermProductInfo.md) | | [optional] +**bonus_info** | [**FixedTermBonusInfo**](FixedTermBonusInfo.md) | | [optional] +**coupon_info** | [**FixedTermCouponInfo**](FixedTermCouponInfo.md) | | [optional] +**redeem_at** | **int** | Redemption timestamp (in seconds) | [optional] +**finish_at** | **int** | Expiration timestamp (in seconds) | [optional] +**create_at** | **int** | Creation timestamp (in seconds) | [optional] +**icon** | **str** | Currency icon URL | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FixedTermLendRequest.md b/docs/FixedTermLendRequest.md new file mode 100644 index 00000000..e1f11c65 --- /dev/null +++ b/docs/FixedTermLendRequest.md @@ -0,0 +1,17 @@ +# FixedTermLendRequest + +Subscription request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | Product ID | +**amount** | **str** | Subscription amount | +**year_rate** | **str** | Annual interest rate | [optional] +**reinvest_status** | **int** | Auto-renewal status: 0 for disabled, 1 for enabled | [optional] +**redeem_account_type** | **int** | Redemption payout account type: 1 for spot account | [optional] +**financial_rate_id** | **int** | Interest rate boost coupon ID, 0 means not used | [optional] +**sub_business** | **int** | Sub-business type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FixedTermProduct.md b/docs/FixedTermProduct.md new file mode 100644 index 00000000..c0e9446c --- /dev/null +++ b/docs/FixedTermProduct.md @@ -0,0 +1,29 @@ +# FixedTermProduct + +Fixed-term earn product +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Product ID | [optional] +**name** | **str** | Product name | [optional] +**asset** | **str** | Currency | [optional] +**lock_up_period** | **int** | Lock-up period (in days) | [optional] +**min_lend_amount** | **str** | Minimum earn amount | [optional] +**user_max_lend_amount** | **str** | User maximum earn limit | [optional] +**total_lend_amount** | **str** | Platform earn limit | [optional] +**year_rate** | **str** | Annual interest rate | [optional] +**type** | **int** | Product type: 1 for regular, 2 for VIP | [optional] +**pre_redeem** | **int** | Whether early redemption is supported: 0 for not supported, 1 for supported | [optional] +**reinvest** | **int** | Whether auto-renewal is supported: 0 for not supported, 1 for supported | [optional] +**redeem_account** | **int** | Whether fixed-to-flexible conversion is supported: 0 for not supported, 1 for supported | [optional] +**min_vip** | **int** | Minimum VIP level requirement, 0-16, 0 means no restriction | [optional] +**max_vip** | **int** | Maximum VIP level requirement (0-16), 0 means no restriction | [optional] +**status** | **int** | Product status: 1 for unlisted, 2 for listed, 3 for delisted | [optional] +**create_time** | **str** | Created time | [optional] +**user_max_lend_volume** | **str** | User maximum earn amount | [optional] +**user_total_amount** | **str** | Total amount the user has invested in earn products | [optional] +**sale_status** | **int** | Sale status: 1 for on sale, 2 for sold out | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FixedTermProductInfo.md b/docs/FixedTermProductInfo.md new file mode 100644 index 00000000..1f27b8c1 --- /dev/null +++ b/docs/FixedTermProductInfo.md @@ -0,0 +1,15 @@ +# FixedTermProductInfo + +Product configuration +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pre_redeem** | **int** | Whether early redemption is supported: 0 for not supported, 1 for supported | +**reinvest** | **int** | Whether auto-renewal is supported: 0 for not supported, 1 for supported | +**redeem_account** | **int** | Redemption payout account type | +**min_vip** | **int** | Minimum VIP level requirement, 0 means no restriction | +**max_vip** | **int** | Maximum VIP level requirement, 0 means no restriction | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FixedTermProductSimple.md b/docs/FixedTermProductSimple.md new file mode 100644 index 00000000..48152d00 --- /dev/null +++ b/docs/FixedTermProductSimple.md @@ -0,0 +1,21 @@ +# FixedTermProductSimple + +Fixed-term earn product (compact) +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Product ID | [optional] +**asset** | **str** | Currency | [optional] +**lock_up_period** | **int** | Lock-up period (in days) | [optional] +**year_rate** | **str** | Annual interest rate | [optional] +**type** | **int** | Product type: 1 for regular, 2 for VIP | [optional] +**pre_redeem** | **int** | Whether early redemption is supported: 0 for not supported, 1 for supported | [optional] +**reinvest** | **int** | Whether auto-renewal is supported: 0 for not supported, 1 for supported | [optional] +**simple_earn** | **int** | Whether fixed-to-flexible conversion is supported: 0 for not supported, 1 for supported | [optional] +**min_vip** | **int** | Minimum VIP level requirement, 0 means no restriction | [optional] +**max_vip** | **int** | Maximum VIP level requirement, 0 means no restriction | [optional] +**sale_status** | **int** | Sale status: 1 for on sale, 2 for sold out | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapApi.md b/docs/FlashSwapApi.md index 39fd84a9..d95159f6 100644 --- a/docs/FlashSwapApi.md +++ b/docs/FlashSwapApi.md @@ -9,6 +9,12 @@ Method | HTTP request | Description [**create_flash_swap_order**](FlashSwapApi.md#create_flash_swap_order) | **POST** /flash_swap/orders | Create a flash swap order [**get_flash_swap_order**](FlashSwapApi.md#get_flash_swap_order) | **GET** /flash_swap/orders/{order_id} | Query single flash swap order [**preview_flash_swap_order**](FlashSwapApi.md#preview_flash_swap_order) | **POST** /flash_swap/orders/preview | Flash swap order preview +[**create_flash_swap_multi_currency_many_to_one_order**](FlashSwapApi.md#create_flash_swap_multi_currency_many_to_one_order) | **POST** /flash_swap/multi-currency/many-to-one/order/create | Flash Swap - Multi-currency exchange - Place order (many-to-one) +[**preview_flash_swap_multi_currency_many_to_one_order**](FlashSwapApi.md#preview_flash_swap_multi_currency_many_to_one_order) | **POST** /flash_swap/multi-currency/many-to-one/order/preview | Flash Swap - Multi-currency exchange - Preview (many-to-one) +[**create_flash_swap_order_v1**](FlashSwapApi.md#create_flash_swap_order_v1) | **POST** /flash_swap/order/create | Flash Swap - Place order (one-to-one) +[**create_flash_swap_multi_currency_one_to_many_order**](FlashSwapApi.md#create_flash_swap_multi_currency_one_to_many_order) | **POST** /flash_swap/multi-currency/one-to-many/order/create | Flash Swap - Multi-currency exchange - Place order (one-to-many) +[**preview_flash_swap_multi_currency_one_to_many_order**](FlashSwapApi.md#preview_flash_swap_multi_currency_one_to_many_order) | **POST** /flash_swap/multi-currency/one-to-many/order/preview | Flash Swap - Multi-currency exchange - Preview (one-to-many) +[**preview_flash_swap_order_v1**](FlashSwapApi.md#preview_flash_swap_order_v1) | **GET** /flash_swap/order/preview | Flash Swap - Preview (one-to-one) # **list_flash_swap_currency_pair** @@ -355,3 +361,435 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_flash_swap_multi_currency_many_to_one_order** +> FlashSwapMultiCurrencyManyToOneOrderCreateResp create_flash_swap_multi_currency_many_to_one_order(flash_swap_multi_currency_many_to_one_order_create_req) + +Flash Swap - Multi-currency exchange - Place order (many-to-one) + +Create a multi-currency to single target currency exchange order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FlashSwapApi(api_client) +flash_swap_multi_currency_many_to_one_order_create_req = gate_api.FlashSwapMultiCurrencyManyToOneOrderCreateReq() # FlashSwapMultiCurrencyManyToOneOrderCreateReq | + +try: + # Flash Swap - Multi-currency exchange - Place order (many-to-one) + api_response = api_instance.create_flash_swap_multi_currency_many_to_one_order(flash_swap_multi_currency_many_to_one_order_create_req) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FlashSwapApi->create_flash_swap_multi_currency_many_to_one_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flash_swap_multi_currency_many_to_one_order_create_req** | [**FlashSwapMultiCurrencyManyToOneOrderCreateReq**](FlashSwapMultiCurrencyManyToOneOrderCreateReq.md)| | + +### Return type + +[**FlashSwapMultiCurrencyManyToOneOrderCreateResp**](FlashSwapMultiCurrencyManyToOneOrderCreateResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | +**400** | Invalid parameters | - | +**404** | Record does not exist | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **preview_flash_swap_multi_currency_many_to_one_order** +> FlashSwapMultiCurrencyManyToOneOrderPreviewResp preview_flash_swap_multi_currency_many_to_one_order(flash_swap_multi_currency_many_to_one_order_preview_req) + +Flash Swap - Multi-currency exchange - Preview (many-to-one) + +Preview quote for multi-currency to single target currency exchange + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FlashSwapApi(api_client) +flash_swap_multi_currency_many_to_one_order_preview_req = gate_api.FlashSwapMultiCurrencyManyToOneOrderPreviewReq() # FlashSwapMultiCurrencyManyToOneOrderPreviewReq | + +try: + # Flash Swap - Multi-currency exchange - Preview (many-to-one) + api_response = api_instance.preview_flash_swap_multi_currency_many_to_one_order(flash_swap_multi_currency_many_to_one_order_preview_req) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FlashSwapApi->preview_flash_swap_multi_currency_many_to_one_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flash_swap_multi_currency_many_to_one_order_preview_req** | [**FlashSwapMultiCurrencyManyToOneOrderPreviewReq**](FlashSwapMultiCurrencyManyToOneOrderPreviewReq.md)| | + +### Return type + +[**FlashSwapMultiCurrencyManyToOneOrderPreviewResp**](FlashSwapMultiCurrencyManyToOneOrderPreviewResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | +**400** | Invalid parameters | - | +**404** | Record does not exist | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_flash_swap_order_v1** +> FlashSwapOrderCreateResp create_flash_swap_order_v1(flash_swap_order_create_req) + +Flash Swap - Place order (one-to-one) + +Submit a one-to-one flash swap order. A quote_id must be obtained from the preview endpoint first + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FlashSwapApi(api_client) +flash_swap_order_create_req = gate_api.FlashSwapOrderCreateReq() # FlashSwapOrderCreateReq | + +try: + # Flash Swap - Place order (one-to-one) + api_response = api_instance.create_flash_swap_order_v1(flash_swap_order_create_req) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FlashSwapApi->create_flash_swap_order_v1: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flash_swap_order_create_req** | [**FlashSwapOrderCreateReq**](FlashSwapOrderCreateReq.md)| | + +### Return type + +[**FlashSwapOrderCreateResp**](FlashSwapOrderCreateResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | +**400** | Invalid parameters | - | +**404** | Record does not exist | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_flash_swap_multi_currency_one_to_many_order** +> FlashSwapMultiCurrencyOneToManyOrderCreateResp create_flash_swap_multi_currency_one_to_many_order(flash_swap_multi_currency_one_to_many_order_create_req) + +Flash Swap - Multi-currency exchange - Place order (one-to-many) + +Create a single currency to multiple target currencies exchange order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FlashSwapApi(api_client) +flash_swap_multi_currency_one_to_many_order_create_req = gate_api.FlashSwapMultiCurrencyOneToManyOrderCreateReq() # FlashSwapMultiCurrencyOneToManyOrderCreateReq | + +try: + # Flash Swap - Multi-currency exchange - Place order (one-to-many) + api_response = api_instance.create_flash_swap_multi_currency_one_to_many_order(flash_swap_multi_currency_one_to_many_order_create_req) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FlashSwapApi->create_flash_swap_multi_currency_one_to_many_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flash_swap_multi_currency_one_to_many_order_create_req** | [**FlashSwapMultiCurrencyOneToManyOrderCreateReq**](FlashSwapMultiCurrencyOneToManyOrderCreateReq.md)| | + +### Return type + +[**FlashSwapMultiCurrencyOneToManyOrderCreateResp**](FlashSwapMultiCurrencyOneToManyOrderCreateResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | +**400** | Invalid parameters | - | +**404** | Record does not exist | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **preview_flash_swap_multi_currency_one_to_many_order** +> FlashSwapMultiCurrencyOneToManyOrderPreviewResp preview_flash_swap_multi_currency_one_to_many_order(flash_swap_multi_currency_one_to_many_order_preview_req) + +Flash Swap - Multi-currency exchange - Preview (one-to-many) + +Preview quote for single currency to multiple target currencies exchange + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FlashSwapApi(api_client) +flash_swap_multi_currency_one_to_many_order_preview_req = gate_api.FlashSwapMultiCurrencyOneToManyOrderPreviewReq() # FlashSwapMultiCurrencyOneToManyOrderPreviewReq | + +try: + # Flash Swap - Multi-currency exchange - Preview (one-to-many) + api_response = api_instance.preview_flash_swap_multi_currency_one_to_many_order(flash_swap_multi_currency_one_to_many_order_preview_req) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FlashSwapApi->preview_flash_swap_multi_currency_one_to_many_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **flash_swap_multi_currency_one_to_many_order_preview_req** | [**FlashSwapMultiCurrencyOneToManyOrderPreviewReq**](FlashSwapMultiCurrencyOneToManyOrderPreviewReq.md)| | + +### Return type + +[**FlashSwapMultiCurrencyOneToManyOrderPreviewResp**](FlashSwapMultiCurrencyOneToManyOrderPreviewResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | +**400** | Invalid parameters | - | +**404** | Record does not exist | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **preview_flash_swap_order_v1** +> FlashSwapOrderPreviewResp preview_flash_swap_order_v1(sell_asset, buy_asset, sell_amount=sell_amount, buy_amount=buy_amount) + +Flash Swap - Preview (one-to-one) + +Get one-to-one flash swap quote. Either sell_amount or buy_amount must be specified + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FlashSwapApi(api_client) +sell_asset = 'sell_asset_example' # str | Currency to sell +buy_asset = 'buy_asset_example' # str | Currency to buy +sell_amount = 'sell_amount_example' # str | Sell amount, either this or buy_amount must be specified (optional) +buy_amount = 'buy_amount_example' # str | Buy amount, either this or sell_amount must be specified (optional) + +try: + # Flash Swap - Preview (one-to-one) + api_response = api_instance.preview_flash_swap_order_v1(sell_asset, buy_asset, sell_amount=sell_amount, buy_amount=buy_amount) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FlashSwapApi->preview_flash_swap_order_v1: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sell_asset** | **str**| Currency to sell | + **buy_asset** | **str**| Currency to buy | + **sell_amount** | **str**| Sell amount, either this or buy_amount must be specified | [optional] + **buy_amount** | **str**| Buy amount, either this or sell_amount must be specified | [optional] + +### Return type + +[**FlashSwapOrderPreviewResp**](FlashSwapOrderPreviewResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | +**400** | Invalid parameters | - | +**404** | Record does not exist | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/FlashSwapErrorResponse.md b/docs/FlashSwapErrorResponse.md new file mode 100644 index 00000000..9e1f09bd --- /dev/null +++ b/docs/FlashSwapErrorResponse.md @@ -0,0 +1,11 @@ +# FlashSwapErrorResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Error code | +**message** | **str** | Error message | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyCreateParam.md b/docs/FlashSwapMultiCurrencyCreateParam.md new file mode 100644 index 00000000..03caf24a --- /dev/null +++ b/docs/FlashSwapMultiCurrencyCreateParam.md @@ -0,0 +1,13 @@ +# FlashSwapMultiCurrencyCreateParam + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sell_asset** | **str** | Currency to sell | +**sell_amount** | **str** | Sell amount | +**buy_asset** | **str** | Currency to buy | +**buy_amount** | **str** | Buy amount | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyManyToOneOrderCreateReq.md b/docs/FlashSwapMultiCurrencyManyToOneOrderCreateReq.md new file mode 100644 index 00000000..b4dc2c68 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyManyToOneOrderCreateReq.md @@ -0,0 +1,10 @@ +# FlashSwapMultiCurrencyManyToOneOrderCreateReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**params** | [**list[FlashSwapMultiCurrencyCreateParam]**](FlashSwapMultiCurrencyCreateParam.md) | Multi-currency exchange parameter list | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyManyToOneOrderCreateResp.md b/docs/FlashSwapMultiCurrencyManyToOneOrderCreateResp.md new file mode 100644 index 00000000..3dda1c80 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyManyToOneOrderCreateResp.md @@ -0,0 +1,13 @@ +# FlashSwapMultiCurrencyManyToOneOrderCreateResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response code, 0 means success | +**message** | **str** | Response message | +**data** | [**FlashSwapMultiCurrencyManyToOneOrderCreateRespData**](FlashSwapMultiCurrencyManyToOneOrderCreateRespData.md) | | +**timestamp** | **int** | Response timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyManyToOneOrderCreateRespData.md b/docs/FlashSwapMultiCurrencyManyToOneOrderCreateRespData.md new file mode 100644 index 00000000..fc599553 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyManyToOneOrderCreateRespData.md @@ -0,0 +1,14 @@ +# FlashSwapMultiCurrencyManyToOneOrderCreateRespData + +Business data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orders** | [**list[FlashSwapMultiCurrencyOrder]**](FlashSwapMultiCurrencyOrder.md) | Order list | +**account_mode** | **int** | Account Mode | +**exchange_time_ms** | **int** | Exchange timestamp (in milliseconds) | +**total_acquire_amount** | **str** | Total amount received | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyManyToOneOrderPreviewReq.md b/docs/FlashSwapMultiCurrencyManyToOneOrderPreviewReq.md new file mode 100644 index 00000000..4b4776ba --- /dev/null +++ b/docs/FlashSwapMultiCurrencyManyToOneOrderPreviewReq.md @@ -0,0 +1,10 @@ +# FlashSwapMultiCurrencyManyToOneOrderPreviewReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**params** | [**list[FlashSwapMultiCurrencyPreviewParam]**](FlashSwapMultiCurrencyPreviewParam.md) | Multi-currency exchange preview parameter list | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyManyToOneOrderPreviewResp.md b/docs/FlashSwapMultiCurrencyManyToOneOrderPreviewResp.md new file mode 100644 index 00000000..89ecd055 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyManyToOneOrderPreviewResp.md @@ -0,0 +1,13 @@ +# FlashSwapMultiCurrencyManyToOneOrderPreviewResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response code, 0 means success | +**message** | **str** | Response message | +**data** | [**FlashSwapMultiCurrencyManyToOneOrderPreviewRespData**](FlashSwapMultiCurrencyManyToOneOrderPreviewRespData.md) | | +**timestamp** | **int** | Response timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyManyToOneOrderPreviewRespData.md b/docs/FlashSwapMultiCurrencyManyToOneOrderPreviewRespData.md new file mode 100644 index 00000000..b0c43522 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyManyToOneOrderPreviewRespData.md @@ -0,0 +1,12 @@ +# FlashSwapMultiCurrencyManyToOneOrderPreviewRespData + +Business data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orders** | [**list[FlashSwapMultiCurrencyPreviewOrder]**](FlashSwapMultiCurrencyPreviewOrder.md) | Preview order list | +**total_acquire_amount** | **str** | Total amount received | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyOneToManyOrderCreateReq.md b/docs/FlashSwapMultiCurrencyOneToManyOrderCreateReq.md new file mode 100644 index 00000000..24299779 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyOneToManyOrderCreateReq.md @@ -0,0 +1,10 @@ +# FlashSwapMultiCurrencyOneToManyOrderCreateReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**params** | [**list[FlashSwapMultiCurrencyCreateParam]**](FlashSwapMultiCurrencyCreateParam.md) | Multi-currency exchange parameter list | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyOneToManyOrderCreateResp.md b/docs/FlashSwapMultiCurrencyOneToManyOrderCreateResp.md new file mode 100644 index 00000000..3f50ddf5 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyOneToManyOrderCreateResp.md @@ -0,0 +1,13 @@ +# FlashSwapMultiCurrencyOneToManyOrderCreateResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response code, 0 means success | +**message** | **str** | Response message | +**data** | [**FlashSwapMultiCurrencyOneToManyOrderCreateRespData**](FlashSwapMultiCurrencyOneToManyOrderCreateRespData.md) | | +**timestamp** | **int** | Response timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyOneToManyOrderCreateRespData.md b/docs/FlashSwapMultiCurrencyOneToManyOrderCreateRespData.md new file mode 100644 index 00000000..a6f1d44c --- /dev/null +++ b/docs/FlashSwapMultiCurrencyOneToManyOrderCreateRespData.md @@ -0,0 +1,15 @@ +# FlashSwapMultiCurrencyOneToManyOrderCreateRespData + +Business data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orders** | [**list[FlashSwapMultiCurrencyOrder]**](FlashSwapMultiCurrencyOrder.md) | Order list | +**account_mode** | **int** | Account Mode | +**exchange_time_ms** | **int** | Exchange timestamp (in milliseconds) | +**total_consume_amount** | **str** | Total consumed amount | +**total_acquire_amount** | **str** | Total amount received | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyOneToManyOrderPreviewReq.md b/docs/FlashSwapMultiCurrencyOneToManyOrderPreviewReq.md new file mode 100644 index 00000000..c277582d --- /dev/null +++ b/docs/FlashSwapMultiCurrencyOneToManyOrderPreviewReq.md @@ -0,0 +1,10 @@ +# FlashSwapMultiCurrencyOneToManyOrderPreviewReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**params** | [**list[FlashSwapMultiCurrencyPreviewParam]**](FlashSwapMultiCurrencyPreviewParam.md) | Multi-currency exchange preview parameter list | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyOneToManyOrderPreviewResp.md b/docs/FlashSwapMultiCurrencyOneToManyOrderPreviewResp.md new file mode 100644 index 00000000..80f6f7a6 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyOneToManyOrderPreviewResp.md @@ -0,0 +1,13 @@ +# FlashSwapMultiCurrencyOneToManyOrderPreviewResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response code, 0 means success | +**message** | **str** | Response message | +**data** | [**FlashSwapMultiCurrencyOneToManyOrderPreviewRespData**](FlashSwapMultiCurrencyOneToManyOrderPreviewRespData.md) | | +**timestamp** | **int** | Response timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyOneToManyOrderPreviewRespData.md b/docs/FlashSwapMultiCurrencyOneToManyOrderPreviewRespData.md new file mode 100644 index 00000000..c08a0eb8 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyOneToManyOrderPreviewRespData.md @@ -0,0 +1,13 @@ +# FlashSwapMultiCurrencyOneToManyOrderPreviewRespData + +Business data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orders** | [**list[FlashSwapMultiCurrencyPreviewOrder]**](FlashSwapMultiCurrencyPreviewOrder.md) | Preview order list | +**total_consume_amount** | **str** | Total consumed amount | +**total_acquire_amount** | **str** | Total amount received | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyOrder.md b/docs/FlashSwapMultiCurrencyOrder.md new file mode 100644 index 00000000..c77c44d6 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyOrder.md @@ -0,0 +1,28 @@ +# FlashSwapMultiCurrencyOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | [optional] +**user_id** | **int** | User ID | [optional] +**source** | **str** | Request source | [optional] +**app_id** | **str** | Application ID | [optional] +**client_req_id** | **str** | Client request ID | [optional] +**sell_asset** | **str** | Currency to sell | [optional] +**sell_amount** | **str** | Sell amount | [optional] +**sell_amount_show** | **str** | Sell amount display value | [optional] +**buy_asset** | **str** | Currency to buy | [optional] +**buy_amount** | **str** | Buy amount | [optional] +**buy_amount_show** | **str** | Buy amount display value | [optional] +**price** | **str** | Exchange price | [optional] +**status** | **int** | Order status | [optional] +**quote_id** | **str** | Quote ID | [optional] +**failed_code** | **int** | Failure error code, 0 means success | [optional] +**failed_reason** | **str** | Failure Reason | [optional] +**create_time** | **str** | Created time | [optional] +**create_time_ms** | **int** | Creation timestamp (in milliseconds) | [optional] +**error** | [**ErrCodeMsg**](ErrCodeMsg.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyPreviewOrder.md b/docs/FlashSwapMultiCurrencyPreviewOrder.md new file mode 100644 index 00000000..9e06b8c4 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyPreviewOrder.md @@ -0,0 +1,22 @@ +# FlashSwapMultiCurrencyPreviewOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quote_id** | **str** | Quote ID | [optional] +**hedge_type** | **int** | Hedge type | [optional] +**sell_asset** | **str** | Currency to sell | [optional] +**sell_amount** | **str** | Sell amount | [optional] +**sell_amount_show** | **str** | Sell amount display value | [optional] +**buy_asset** | **str** | Currency to buy | [optional] +**buy_amount** | **str** | Buy amount | [optional] +**buy_amount_show** | **str** | Buy amount display value | [optional] +**price** | **str** | Exchange price | [optional] +**price_diff** | **str** | Spread percentage | [optional] +**reverse_price** | **str** | Reverse price | [optional] +**valid_timestamp** | **int** | Quote expiration timestamp (in seconds) | [optional] +**error** | [**ErrCodeMsg**](ErrCodeMsg.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapMultiCurrencyPreviewParam.md b/docs/FlashSwapMultiCurrencyPreviewParam.md new file mode 100644 index 00000000..a167d712 --- /dev/null +++ b/docs/FlashSwapMultiCurrencyPreviewParam.md @@ -0,0 +1,13 @@ +# FlashSwapMultiCurrencyPreviewParam + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sell_asset** | **str** | Currency to sell | +**sell_amount** | **str** | Sell amount | [optional] +**buy_asset** | **str** | Currency to buy | +**buy_amount** | **str** | Buy amount | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapOrderCreateReq.md b/docs/FlashSwapOrderCreateReq.md new file mode 100644 index 00000000..355779d0 --- /dev/null +++ b/docs/FlashSwapOrderCreateReq.md @@ -0,0 +1,17 @@ +# FlashSwapOrderCreateReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quote_id** | **str** | Quote ID returned by the preview endpoint | [optional] +**hedge_type** | **int** | Hedge type | [optional] +**sell_asset** | **str** | Currency to sell | +**sell_amount** | **str** | Sell amount | +**buy_asset** | **str** | Currency to buy | +**buy_amount** | **str** | Buy amount | +**client_req_id** | **str** | Client request ID for idempotency check | [optional] +**request_time_ms** | **int** | Request timestamp (in milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapOrderCreateResp.md b/docs/FlashSwapOrderCreateResp.md new file mode 100644 index 00000000..ebfa40d5 --- /dev/null +++ b/docs/FlashSwapOrderCreateResp.md @@ -0,0 +1,13 @@ +# FlashSwapOrderCreateResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response code, 0 means success | +**message** | **str** | Response message | +**data** | [**FlashSwapOrderCreateRespData**](FlashSwapOrderCreateRespData.md) | | +**timestamp** | **int** | Response timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapOrderCreateRespData.md b/docs/FlashSwapOrderCreateRespData.md new file mode 100644 index 00000000..de13c6a1 --- /dev/null +++ b/docs/FlashSwapOrderCreateRespData.md @@ -0,0 +1,29 @@ +# FlashSwapOrderCreateRespData + +Business data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | [optional] +**user_id** | **int** | User ID | [optional] +**source** | **str** | Request source | [optional] +**app_id** | **str** | Application ID | [optional] +**client_req_id** | **str** | Client request ID | [optional] +**sell_asset** | **str** | Currency to sell | [optional] +**sell_amount** | **str** | Sell amount | [optional] +**sell_amount_show** | **str** | Sell amount display value | [optional] +**buy_asset** | **str** | Currency to buy | [optional] +**buy_amount** | **str** | Buy amount | [optional] +**buy_amount_show** | **str** | Buy amount display value | [optional] +**price** | **str** | Exchange price | [optional] +**status** | **int** | Order status | [optional] +**quote_id** | **str** | Quote ID | [optional] +**failed_code** | **int** | Failure error code, 0 means success | [optional] +**failed_reason** | **str** | Failure Reason | [optional] +**create_time** | **str** | Created time | [optional] +**create_time_ms** | **int** | Creation timestamp (in milliseconds) | [optional] +**account_mode** | **int** | Account Mode | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapOrderPreviewResp.md b/docs/FlashSwapOrderPreviewResp.md new file mode 100644 index 00000000..07e9e798 --- /dev/null +++ b/docs/FlashSwapOrderPreviewResp.md @@ -0,0 +1,13 @@ +# FlashSwapOrderPreviewResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response code, 0 means success | +**message** | **str** | Response message | +**data** | [**FlashSwapOrderPreviewRespData**](FlashSwapOrderPreviewRespData.md) | | +**timestamp** | **int** | Response timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FlashSwapOrderPreviewRespData.md b/docs/FlashSwapOrderPreviewRespData.md new file mode 100644 index 00000000..e248780b --- /dev/null +++ b/docs/FlashSwapOrderPreviewRespData.md @@ -0,0 +1,22 @@ +# FlashSwapOrderPreviewRespData + +Business data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quote_id** | **str** | Quote ID, valid for one minute | [optional] +**hedge_type** | **int** | Hedge type | [optional] +**sell_asset** | **str** | Currency to sell | [optional] +**sell_amount** | **str** | Sell amount | [optional] +**sell_amount_show** | **str** | Sell amount display value | [optional] +**buy_asset** | **str** | Currency to buy | [optional] +**buy_amount** | **str** | Buy amount | [optional] +**buy_amount_show** | **str** | Buy amount display value | [optional] +**price** | **str** | Exchange price | [optional] +**price_diff** | **str** | Spread percentage | [optional] +**reverse_price** | **str** | Reverse price | [optional] +**valid_timestamp** | **int** | Quote expiration timestamp (in seconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FuturesAccount.md b/docs/FuturesAccount.md index 5cb60293..e89931cb 100644 --- a/docs/FuturesAccount.md +++ b/docs/FuturesAccount.md @@ -11,7 +11,6 @@ Name | Type | Description | Notes **point** | **str** | Point card amount | [optional] **currency** | **str** | Settlement currency | [optional] **in_dual_mode** | **bool** | Whether Hedge Mode is enabled | [optional] -**position_mode** | **str** | Position mode: single - one-way, dual - dual-side, split - sub-positions (in_dual_mode is deprecated) | [optional] **enable_credit** | **bool** | Whether portfolio margin account mode is enabled | [optional] **position_initial_margin** | **str** | Initial margin occupied by positions, applicable to unified account mode | [optional] **maintenance_margin** | **str** | Maintenance margin occupied by positions, applicable to new classic account margin mode and unified account mode | [optional] @@ -29,6 +28,8 @@ Name | Type | Description | Notes **enable_new_dual_mode** | **bool** | Deprecated | [optional] **margin_mode** | **int** | Margin mode of the account 0: classic future account or Classic Spot Margin Mode of unified account; 1: Multi-Currency Margin Mode; 2: Portoforlio Margin Mode; 3: Single-Currency Margin Mode | [optional] **enable_tiered_mm** | **bool** | Whether to enable tiered maintenance margin calculation | [optional] +**enable_dual_plus** | **bool** | Whether to Support Split Position Mode | [optional] +**position_mode** | **str** | Position Holding Mode single - Single Direction Position, dual - Dual Direction Position, dual_plus - Split Position | [optional] **history** | [**FuturesAccountHistory**](FuturesAccountHistory.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesAccountHistory.md b/docs/FuturesAccountHistory.md index 202fdc69..a139880a 100644 --- a/docs/FuturesAccountHistory.md +++ b/docs/FuturesAccountHistory.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **point_refr** | **str** | total amount of referrer rebates of point fee | [optional] **bonus_dnw** | **str** | total amount of perpetual contract bonus transfer | [optional] **bonus_offset** | **str** | total amount of perpetual contract bonus deduction | [optional] +**cross_settle** | **str** | Represents the value of profit settlement from the futures account to the spot account under Unified Account Mode. Negative values indicate settlement from futures to spot, while positive values indicate settlement from spot to futures. This value is cumulative. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesApi.md b/docs/FuturesApi.md index fbb80e09..a1624735 100644 --- a/docs/FuturesApi.md +++ b/docs/FuturesApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- [**list_futures_contracts**](FuturesApi.md#list_futures_contracts) | **GET** /futures/{settle}/contracts | Query all futures contracts +[**list_futures_contracts_all**](FuturesApi.md#list_futures_contracts_all) | **GET** /futures/{settle}/contracts_all | Query all contract information (including delisted) [**get_futures_contract**](FuturesApi.md#get_futures_contract) | **GET** /futures/{settle}/contracts/{contract} | Query single contract information [**list_futures_order_book**](FuturesApi.md#list_futures_order_book) | **GET** /futures/{settle}/order_book | Query futures market depth information [**list_futures_trades**](FuturesApi.md#list_futures_trades) | **GET** /futures/{settle}/trades | Futures market transaction records @@ -12,6 +13,7 @@ Method | HTTP request | Description [**list_futures_premium_index**](FuturesApi.md#list_futures_premium_index) | **GET** /futures/{settle}/premium_index | Premium Index K-line chart [**list_futures_tickers**](FuturesApi.md#list_futures_tickers) | **GET** /futures/{settle}/tickers | Get all futures trading statistics [**list_futures_funding_rate_history**](FuturesApi.md#list_futures_funding_rate_history) | **GET** /futures/{settle}/funding_rate | Futures market historical funding rate +[**list_batch_futures_funding_rates**](FuturesApi.md#list_batch_futures_funding_rates) | **POST** /futures/{settle}/funding_rates | Batch Query Historical Funding Rate Data for Perpetual Contracts [**list_futures_insurance_ledger**](FuturesApi.md#list_futures_insurance_ledger) | **GET** /futures/{settle}/insurance | Futures market insurance fund history [**list_contract_stats**](FuturesApi.md#list_contract_stats) | **GET** /futures/{settle}/contract_stats | Futures statistics [**get_index_constituents**](FuturesApi.md#get_index_constituents) | **GET** /futures/{settle}/index_constituents/{index} | Query index constituents @@ -20,13 +22,17 @@ Method | HTTP request | Description [**list_futures_accounts**](FuturesApi.md#list_futures_accounts) | **GET** /futures/{settle}/accounts | Get futures account [**list_futures_account_book**](FuturesApi.md#list_futures_account_book) | **GET** /futures/{settle}/account_book | Query futures account change history [**list_positions**](FuturesApi.md#list_positions) | **GET** /futures/{settle}/positions | Get user position list +[**list_positions_timerange**](FuturesApi.md#list_positions_timerange) | **GET** /futures/{settle}/positions_timerange | Get user's historical position information list by time [**get_position**](FuturesApi.md#get_position) | **GET** /futures/{settle}/positions/{contract} | Get single position information +[**get_leverage**](FuturesApi.md#get_leverage) | **GET** /futures/{settle}/get_leverage/{contract} | Get Leverage Information for Specified Mode [**update_position_margin**](FuturesApi.md#update_position_margin) | **POST** /futures/{settle}/positions/{contract}/margin | Update position margin [**update_position_leverage**](FuturesApi.md#update_position_leverage) | **POST** /futures/{settle}/positions/{contract}/leverage | Update position leverage +[**update_contract_position_leverage**](FuturesApi.md#update_contract_position_leverage) | **POST** /futures/{settle}/positions/{contract}/set_leverage | Update Leverage for Specified Mode [**update_position_cross_mode**](FuturesApi.md#update_position_cross_mode) | **POST** /futures/{settle}/positions/cross_mode | Switch Position Margin Mode [**update_dual_comp_position_cross_mode**](FuturesApi.md#update_dual_comp_position_cross_mode) | **POST** /futures/{settle}/dual_comp/positions/cross_mode | Switch Between Cross and Isolated Margin Modes Under Hedge Mode [**update_position_risk_limit**](FuturesApi.md#update_position_risk_limit) | **POST** /futures/{settle}/positions/{contract}/risk_limit | Update position risk limit [**set_dual_mode**](FuturesApi.md#set_dual_mode) | **POST** /futures/{settle}/dual_mode | Set position mode +[**set_position_mode**](FuturesApi.md#set_position_mode) | **POST** /futures/{settle}/set_position_mode | Set Position Holding Mode, replacing the dual_mode interface [**get_dual_mode_position**](FuturesApi.md#get_dual_mode_position) | **GET** /futures/{settle}/dual_comp/positions/{contract} | Get position information in Hedge Mode [**update_dual_mode_position_margin**](FuturesApi.md#update_dual_mode_position_margin) | **POST** /futures/{settle}/dual_comp/positions/{contract}/margin | Update position margin in Hedge Mode [**update_dual_mode_position_leverage**](FuturesApi.md#update_dual_mode_position_leverage) | **POST** /futures/{settle}/dual_comp/positions/{contract}/leverage | Update position leverage in Hedge Mode @@ -50,12 +56,24 @@ Method | HTTP request | Description [**amend_batch_future_orders**](FuturesApi.md#amend_batch_future_orders) | **POST** /futures/{settle}/batch_amend_orders | Batch modify orders by specified IDs [**get_futures_risk_limit_table**](FuturesApi.md#get_futures_risk_limit_table) | **GET** /futures/{settle}/risk_limit_table | Query risk limit table by table_id [**create_futures_bbo_order**](FuturesApi.md#create_futures_bbo_order) | **POST** /futures/{settle}/bbo_orders | Level-based BBO Contract Order Placement +[**create_trail_order**](FuturesApi.md#create_trail_order) | **POST** /futures/{settle}/autoorder/v1/trail/create | Create trail order +[**stop_trail_order**](FuturesApi.md#stop_trail_order) | **POST** /futures/{settle}/autoorder/v1/trail/stop | Terminate trail order +[**stop_all_trail_orders**](FuturesApi.md#stop_all_trail_orders) | **POST** /futures/{settle}/autoorder/v1/trail/stop_all | Batch terminate trail orders +[**get_trail_orders**](FuturesApi.md#get_trail_orders) | **GET** /futures/{settle}/autoorder/v1/trail/list | Get trail order list +[**get_trail_order_detail**](FuturesApi.md#get_trail_order_detail) | **GET** /futures/{settle}/autoorder/v1/trail/detail | Get trail order details +[**update_trail_order**](FuturesApi.md#update_trail_order) | **POST** /futures/{settle}/autoorder/v1/trail/update | Update trail order +[**get_trail_order_change_log**](FuturesApi.md#get_trail_order_change_log) | **GET** /futures/{settle}/autoorder/v1/trail/change_log | Get trail order user modification records +[**create_chase_order**](FuturesApi.md#create_chase_order) | **POST** /futures/{settle}/autoorder/v1/chase/create | Create a chase order +[**stop_chase_order**](FuturesApi.md#stop_chase_order) | **POST** /futures/{settle}/autoorder/v1/chase/stop | Stop a chase order +[**stop_all_chase_orders**](FuturesApi.md#stop_all_chase_orders) | **POST** /futures/{settle}/autoorder/v1/chase/stop_all | Stop chase orders in batch +[**get_chase_orders**](FuturesApi.md#get_chase_orders) | **GET** /futures/{settle}/autoorder/v1/chase/list | List chase orders +[**get_chase_order_detail**](FuturesApi.md#get_chase_order_detail) | **GET** /futures/{settle}/autoorder/v1/chase/detail | Get chase order detail [**list_price_triggered_orders**](FuturesApi.md#list_price_triggered_orders) | **GET** /futures/{settle}/price_orders | Query auto order list [**create_price_triggered_order**](FuturesApi.md#create_price_triggered_order) | **POST** /futures/{settle}/price_orders | Create price-triggered order [**cancel_price_triggered_order_list**](FuturesApi.md#cancel_price_triggered_order_list) | **DELETE** /futures/{settle}/price_orders | Cancel all auto orders [**get_price_triggered_order**](FuturesApi.md#get_price_triggered_order) | **GET** /futures/{settle}/price_orders/{order_id} | Query single auto order details -[**update_price_triggered_order**](FuturesApi.md#update_price_triggered_order) | **PUT** /futures/{settle}/price_orders/{order_id} | Modify a Single Auto Order [**cancel_price_triggered_order**](FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel single auto order +[**update_price_triggered_order**](FuturesApi.md#update_price_triggered_order) | **PUT** /futures/{settle}/price_orders/amend | Modify a Single Auto Order # **list_futures_contracts** @@ -120,6 +138,68 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_futures_contracts_all** +> list[Contract] list_futures_contracts_all(settle, limit=limit, offset=offset) + +Query all contract information (including delisted) + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) + +try: + # Query all contract information (including delisted) + api_response = api_instance.list_futures_contracts_all(settle, limit=limit, offset=offset) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->list_futures_contracts_all: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + +### Return type + +[**list[Contract]**](Contract.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List retrieved successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_futures_contract** > Contract get_futures_contract(settle, contract) @@ -204,7 +284,7 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract -interval = '0' # str | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (optional) (default to '0') +interval = '0' # str | Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 (optional) (default to '0') limit = 10 # int | Number of depth levels (optional) (default to 10) with_id = False # bool | Whether to return depth update ID. This ID increments by 1 each time the depth changes (optional) (default to False) @@ -224,7 +304,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **interval** | **str**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [optional] [default to '0'] + **interval** | **str**| Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 | [optional] [default to '0'] **limit** | **int**| Number of depth levels | [optional] [default to 10] **with_id** | **bool**| Whether to return depth update ID. This ID increments by 1 each time the depth changes | [optional] [default to False] @@ -345,7 +425,7 @@ contract = 'BTC_USDT' # str | Futures contract _from = 1546905600 # int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional) to = 1546935600 # int | Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision (optional) limit = 100 # int | Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected. (optional) (default to 100) -interval = '5m' # str | Interval time between data points. Note that `1w` means natural week(Mon-Sun), while `7d` means every 7d since unix 0. 30d represents a natural month, not 30 days (optional) (default to '5m') +interval = '5m' # str | Time interval for data points. Note: 1w represents a natural week, 7d is aligned with Unix epoch time, 30d represents a natural month (optional) (default to '5m') timezone = 'utc0' # str | Time zone: all/utc0/utc8, default utc0 (optional) (default to 'utc0') try: @@ -367,7 +447,7 @@ Name | Type | Description | Notes **_from** | **int**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] **to** | **int**| Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision | [optional] **limit** | **int**| Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] - **interval** | **str**| Interval time between data points. Note that `1w` means natural week(Mon-Sun), while `7d` means every 7d since unix 0. 30d represents a natural month, not 30 days | [optional] [default to '5m'] + **interval** | **str**| Time interval for data points. Note: 1w represents a natural week, 7d is aligned with Unix epoch time, 30d represents a natural month | [optional] [default to '5m'] **timezone** | **str**| Time zone: all/utc0/utc8, default utc0 | [optional] [default to 'utc0'] ### Return type @@ -395,7 +475,7 @@ No authorization required Premium Index K-line chart -Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval +K-line chart data returns a maximum of 1000 points per request. When specifying from, to, and interval, ensure the number of points is not excessive ### Example @@ -586,6 +666,66 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_batch_futures_funding_rates** +> list[BatchFundingRatesResponse] list_batch_futures_funding_rates(settle, batch_funding_rates_request) + +Batch Query Historical Funding Rate Data for Perpetual Contracts + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +batch_funding_rates_request = gate_api.BatchFundingRatesRequest() # BatchFundingRatesRequest | + +try: + # Batch Query Historical Funding Rate Data for Perpetual Contracts + api_response = api_instance.list_batch_futures_funding_rates(settle, batch_funding_rates_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->list_batch_futures_funding_rates: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **batch_funding_rates_request** | [**BatchFundingRatesRequest**](BatchFundingRatesRequest.md)| | + +### Return type + +[**list[BatchFundingRatesResponse]**](BatchFundingRatesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Batch Query Successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **list_futures_insurance_ledger** > list[InsuranceRecord] list_futures_insurance_ledger(settle, limit=limit) @@ -1087,7 +1227,7 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency holding = true # bool | Return only real positions - true, return all - false (optional) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +limit = 100 # int | Maximum number of positions returned. If omitted, all current positions are returned by default; if provided, the value must be within [1,100]. (optional) offset = 0 # int | List offset, starting from 0 (optional) (default to 0) try: @@ -1106,7 +1246,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **holding** | **bool**| Return only real positions - true, return all - false | [optional] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **limit** | **int**| Maximum number of positions returned. If omitted, all current positions are returned by default; if provided, the value must be within [1,100]. | [optional] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] ### Return type @@ -1129,12 +1269,10 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_position** -> Position get_position(settle, contract) - -Get single position information +# **list_positions_timerange** +> list[PositionTimerange] list_positions_timerange(settle, contract, _from=_from, to=to, limit=limit, offset=offset) -Get single position information from a contract. If you hold two postions in one contract market, please use this API: /futures/{settle}/dual_comp/positions/{contract} +Get user's historical position information list by time ### Example @@ -1162,15 +1300,19 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract +_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) +to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) try: - # Get single position information - api_response = api_instance.get_position(settle, contract) + # Get user's historical position information list by time + api_response = api_instance.list_positions_timerange(settle, contract, _from=_from, to=to, limit=limit, offset=offset) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->get_position: %s\n" % e) + print("Exception when calling FuturesApi->list_positions_timerange: %s\n" % e) ``` ### Parameters @@ -1179,10 +1321,14 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | + **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] + **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] ### Return type -[**Position**](Position.md) +[**list[PositionTimerange]**](PositionTimerange.md) ### Authorization @@ -1196,16 +1342,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Position information | - | +**200** | List retrieved successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_position_margin** -> Position update_position_margin(settle, contract, change) +# **get_position** +> Position get_position(settle, contract) -Update position margin +Get single position information -Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. +Get single position information from a contract. If you hold two postions in one contract market, please use this API: /futures/{settle}/dual_comp/positions/{contract} ### Example @@ -1233,16 +1379,15 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract -change = '0.01' # str | Margin change amount, positive number increases, negative number decreases try: - # Update position margin - api_response = api_instance.update_position_margin(settle, contract, change) + # Get single position information + api_response = api_instance.get_position(settle, contract) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->update_position_margin: %s\n" % e) + print("Exception when calling FuturesApi->get_position: %s\n" % e) ``` ### Parameters @@ -1251,7 +1396,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **change** | **str**| Margin change amount, positive number increases, negative number decreases | ### Return type @@ -1273,12 +1417,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_position_leverage** -> Position update_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit, pid=pid) +# **get_leverage** +> FuturesLeverage get_leverage(settle, contract, pos_margin_mode, dual_side) -Update position leverage +Get Leverage Information for Specified Mode -⚠️ Position Mode Switching Rules: - leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored) - leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple) Examples: - Set isolated margin with 10x leverage: leverage=10 - Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10 - leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored) ⚠️ Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management. +Get Leverage Information for Specified Mode ### Example @@ -1306,18 +1450,17 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract -leverage = '10' # str | Set the leverage for isolated margin. When setting isolated margin leverage, the `cross_leverage_limit` must be empty. -cross_leverage_limit = '10' # str | Set the leverage for cross margin. When setting cross margin leverage, the `leverage` must be set to 0. (optional) -pid = 1 # int | Product ID (optional) +pos_margin_mode = 'isolated' # str | Position Margin Mode, required for split position mode, values: isolated/cross. +dual_side = 'dual_long' # str | dual_long - Long, dual_short - Short try: - # Update position leverage - api_response = api_instance.update_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit, pid=pid) + # Get Leverage Information for Specified Mode + api_response = api_instance.get_leverage(settle, contract, pos_margin_mode, dual_side) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->update_position_leverage: %s\n" % e) + print("Exception when calling FuturesApi->get_leverage: %s\n" % e) ``` ### Parameters @@ -1326,13 +1469,12 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **leverage** | **str**| Set the leverage for isolated margin. When setting isolated margin leverage, the `cross_leverage_limit` must be empty. | - **cross_leverage_limit** | **str**| Set the leverage for cross margin. When setting cross margin leverage, the `leverage` must be set to 0. | [optional] - **pid** | **int**| Product ID | [optional] + **pos_margin_mode** | **str**| Position Margin Mode, required for split position mode, values: isolated/cross. | + **dual_side** | **str**| dual_long - Long, dual_short - Short | ### Return type -[**Position**](Position.md) +[**FuturesLeverage**](FuturesLeverage.md) ### Authorization @@ -1346,14 +1488,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Position information | - | +**200** | query leverage success | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_position_cross_mode** -> Position update_position_cross_mode(settle, futures_position_cross_mode) +# **update_position_margin** +> Position update_position_margin(settle, contract, change) -Switch Position Margin Mode +Update position margin + +Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. ### Example @@ -1380,16 +1524,17 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -futures_position_cross_mode = gate_api.FuturesPositionCrossMode() # FuturesPositionCrossMode | +contract = 'BTC_USDT' # str | Futures contract +change = '0.01' # str | Margin change amount, positive number increases, negative number decreases try: - # Switch Position Margin Mode - api_response = api_instance.update_position_cross_mode(settle, futures_position_cross_mode) + # Update position margin + api_response = api_instance.update_position_margin(settle, contract, change) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->update_position_cross_mode: %s\n" % e) + print("Exception when calling FuturesApi->update_position_margin: %s\n" % e) ``` ### Parameters @@ -1397,7 +1542,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **futures_position_cross_mode** | [**FuturesPositionCrossMode**](FuturesPositionCrossMode.md)| | + **contract** | **str**| Futures contract | + **change** | **str**| Margin change amount, positive number increases, negative number decreases | ### Return type @@ -1409,7 +1555,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details @@ -1419,10 +1565,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_dual_comp_position_cross_mode** -> list[Position] update_dual_comp_position_cross_mode(settle, inline_object) +# **update_position_leverage** +> Position update_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit, pid=pid) -Switch Between Cross and Isolated Margin Modes Under Hedge Mode +Update position leverage + +⚠️ Position Mode Switching Rules: - leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored) - leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple) Examples: - Set isolated margin with 10x leverage: leverage=10 - Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10 - leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored) ⚠️ Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management. ### Example @@ -1449,16 +1597,19 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -inline_object = gate_api.InlineObject() # InlineObject | +contract = 'BTC_USDT' # str | Futures contract +leverage = '10' # str | Set the leverage for isolated margin. When setting isolated margin leverage, the `cross_leverage_limit` must be empty. +cross_leverage_limit = '10' # str | Set the leverage for cross margin. When setting cross margin leverage, the `leverage` must be set to 0. (optional) +pid = 1 # int | Product ID (optional) try: - # Switch Between Cross and Isolated Margin Modes Under Hedge Mode - api_response = api_instance.update_dual_comp_position_cross_mode(settle, inline_object) + # Update position leverage + api_response = api_instance.update_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit, pid=pid) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->update_dual_comp_position_cross_mode: %s\n" % e) + print("Exception when calling FuturesApi->update_position_leverage: %s\n" % e) ``` ### Parameters @@ -1466,11 +1617,14 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **inline_object** | [**InlineObject**](InlineObject.md)| | + **contract** | **str**| Futures contract | + **leverage** | **str**| Set the leverage for isolated margin. When setting isolated margin leverage, the `cross_leverage_limit` must be empty. | + **cross_leverage_limit** | **str**| Set the leverage for cross margin. When setting cross margin leverage, the `leverage` must be set to 0. | [optional] + **pid** | **int**| Product ID | [optional] ### Return type -[**list[Position]**](Position.md) +[**Position**](Position.md) ### Authorization @@ -1478,22 +1632,22 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Query successful | - | +**200** | Position information | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_position_risk_limit** -> Position update_position_risk_limit(settle, contract, risk_limit) +# **update_contract_position_leverage** +> Position update_contract_position_leverage(settle, contract, leverage, margin_mode, dual_side=dual_side) -Update position risk limit +Update Leverage for Specified Mode -Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. +To simplify the complex logic of the leverage interface, added a new interface for modifying leverage ### Example @@ -1521,16 +1675,18 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract -risk_limit = '1000000' # str | New risk limit value +leverage = '10' # str | Position Leverage Multiple +margin_mode = 'cross' # str | Margin Mode isolated/cross +dual_side = 'dual_long' # str | dual_long - Long, dual_short - Short (optional) try: - # Update position risk limit - api_response = api_instance.update_position_risk_limit(settle, contract, risk_limit) + # Update Leverage for Specified Mode + api_response = api_instance.update_contract_position_leverage(settle, contract, leverage, margin_mode, dual_side=dual_side) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->update_position_risk_limit: %s\n" % e) + print("Exception when calling FuturesApi->update_contract_position_leverage: %s\n" % e) ``` ### Parameters @@ -1539,7 +1695,9 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **risk_limit** | **str**| New risk limit value | + **leverage** | **str**| Position Leverage Multiple | + **margin_mode** | **str**| Margin Mode isolated/cross | + **dual_side** | **str**| dual_long - Long, dual_short - Short | [optional] ### Return type @@ -1561,12 +1719,10 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **set_dual_mode** -> FuturesAccount set_dual_mode(settle, dual_mode) - -Set position mode +# **update_position_cross_mode** +> Position update_position_cross_mode(settle, futures_position_cross_mode) -The prerequisite for changing mode is that all positions have no holdings and no pending orders +Switch Position Margin Mode ### Example @@ -1593,16 +1749,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -dual_mode = true # bool | Whether to enable Hedge Mode +futures_position_cross_mode = gate_api.FuturesPositionCrossMode() # FuturesPositionCrossMode | try: - # Set position mode - api_response = api_instance.set_dual_mode(settle, dual_mode) + # Switch Position Margin Mode + api_response = api_instance.update_position_cross_mode(settle, futures_position_cross_mode) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->set_dual_mode: %s\n" % e) + print("Exception when calling FuturesApi->update_position_cross_mode: %s\n" % e) ``` ### Parameters @@ -1610,11 +1766,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **dual_mode** | **bool**| Whether to enable Hedge Mode | + **futures_position_cross_mode** | [**FuturesPositionCrossMode**](FuturesPositionCrossMode.md)| | ### Return type -[**FuturesAccount**](FuturesAccount.md) +[**Position**](Position.md) ### Authorization @@ -1622,20 +1778,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Updated successfully | - | +**200** | Position information | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_dual_mode_position** -> list[Position] get_dual_mode_position(settle, contract) +# **update_dual_comp_position_cross_mode** +> list[Position] update_dual_comp_position_cross_mode(settle, update_dual_comp_position_cross_mode_request) -Get position information in Hedge Mode +Switch Between Cross and Isolated Margin Modes Under Hedge Mode ### Example @@ -1662,16 +1818,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -contract = 'BTC_USDT' # str | Futures contract +update_dual_comp_position_cross_mode_request = gate_api.UpdateDualCompPositionCrossModeRequest() # UpdateDualCompPositionCrossModeRequest | try: - # Get position information in Hedge Mode - api_response = api_instance.get_dual_mode_position(settle, contract) + # Switch Between Cross and Isolated Margin Modes Under Hedge Mode + api_response = api_instance.update_dual_comp_position_cross_mode(settle, update_dual_comp_position_cross_mode_request) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->get_dual_mode_position: %s\n" % e) + print("Exception when calling FuturesApi->update_dual_comp_position_cross_mode: %s\n" % e) ``` ### Parameters @@ -1679,7 +1835,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract | + **update_dual_comp_position_cross_mode_request** | [**UpdateDualCompPositionCrossModeRequest**](UpdateDualCompPositionCrossModeRequest.md)| | ### Return type @@ -1691,7 +1847,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -1701,10 +1857,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_dual_mode_position_margin** -> list[Position] update_dual_mode_position_margin(settle, contract, change, dual_side) - -Update position margin in Hedge Mode +# **update_position_risk_limit** +> Position update_position_risk_limit(settle, contract, risk_limit) + +Update position risk limit + +Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. ### Example @@ -1732,17 +1890,16 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency contract = 'BTC_USDT' # str | Futures contract -change = '0.01' # str | Margin change amount, positive number increases, negative number decreases -dual_side = 'dual_long' # str | Long or short position +risk_limit = '1000000' # str | New risk limit value try: - # Update position margin in Hedge Mode - api_response = api_instance.update_dual_mode_position_margin(settle, contract, change, dual_side) + # Update position risk limit + api_response = api_instance.update_position_risk_limit(settle, contract, risk_limit) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->update_dual_mode_position_margin: %s\n" % e) + print("Exception when calling FuturesApi->update_position_risk_limit: %s\n" % e) ``` ### Parameters @@ -1751,12 +1908,11 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | **contract** | **str**| Futures contract | - **change** | **str**| Margin change amount, positive number increases, negative number decreases | - **dual_side** | **str**| Long or short position | + **risk_limit** | **str**| New risk limit value | ### Return type -[**list[Position]**](Position.md) +[**Position**](Position.md) ### Authorization @@ -1770,14 +1926,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Query successful | - | +**200** | Position information | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_dual_mode_position_leverage** -> list[Position] update_dual_mode_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit) +# **set_dual_mode** +> FuturesAccount set_dual_mode(settle, dual_mode) -Update position leverage in Hedge Mode +Set position mode + +The prerequisite for changing mode is that all positions have no holdings and no pending orders ### Example @@ -1804,18 +1962,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -contract = 'BTC_USDT' # str | Futures contract -leverage = '10' # str | New position leverage -cross_leverage_limit = '10' # str | Cross margin leverage (valid only when `leverage` is 0) (optional) +dual_mode = true # bool | Whether to enable Hedge Mode try: - # Update position leverage in Hedge Mode - api_response = api_instance.update_dual_mode_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit) + # Set position mode + api_response = api_instance.set_dual_mode(settle, dual_mode) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->update_dual_mode_position_leverage: %s\n" % e) + print("Exception when calling FuturesApi->set_dual_mode: %s\n" % e) ``` ### Parameters @@ -1823,13 +1979,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract | - **leverage** | **str**| New position leverage | - **cross_leverage_limit** | **str**| Cross margin leverage (valid only when `leverage` is 0) | [optional] + **dual_mode** | **bool**| Whether to enable Hedge Mode | ### Return type -[**list[Position]**](Position.md) +[**FuturesAccount**](FuturesAccount.md) ### Authorization @@ -1843,16 +1997,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Query successful | - | +**200** | Updated successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_dual_mode_position_risk_limit** -> list[Position] update_dual_mode_position_risk_limit(settle, contract, risk_limit) +# **set_position_mode** +> FuturesAccount set_position_mode(settle, position_mode) -Update position risk limit in Hedge Mode +Set Position Holding Mode, replacing the dual_mode interface -Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. +The prerequisite for changing mode is that all positions have no holdings and no pending orders ### Example @@ -1879,17 +2033,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -contract = 'BTC_USDT' # str | Futures contract -risk_limit = '1000000' # str | New risk limit value +position_mode = 'dual_plus' # str | Optional Values: single, dual, dual_plus, representing Single Direction, Dual Direction, Split Position respectively try: - # Update position risk limit in Hedge Mode - api_response = api_instance.update_dual_mode_position_risk_limit(settle, contract, risk_limit) + # Set Position Holding Mode, replacing the dual_mode interface + api_response = api_instance.set_position_mode(settle, position_mode) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->update_dual_mode_position_risk_limit: %s\n" % e) + print("Exception when calling FuturesApi->set_position_mode: %s\n" % e) ``` ### Parameters @@ -1897,12 +2050,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract | - **risk_limit** | **str**| New risk limit value | + **position_mode** | **str**| Optional Values: single, dual, dual_plus, representing Single Direction, Dual Direction, Split Position respectively | ### Return type -[**list[Position]**](Position.md) +[**FuturesAccount**](FuturesAccount.md) ### Authorization @@ -1916,16 +2068,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Query successful | - | +**200** | Updated successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_futures_orders** -> list[FuturesOrder] list_futures_orders(settle, status, contract=contract, limit=limit, offset=offset, last_id=last_id) - -Query futures order list +# **get_dual_mode_position** +> list[Position] get_dual_mode_position(settle, contract) -- Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`. +Get position information in Hedge Mode ### Example @@ -1952,20 +2102,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -status = 'open' # str | Query order list based on status -contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) -offset = 0 # int | List offset, starting from 0 (optional) (default to 0) -last_id = '12345' # str | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used (optional) +contract = 'BTC_USDT' # str | Futures contract try: - # Query futures order list - api_response = api_instance.list_futures_orders(settle, status, contract=contract, limit=limit, offset=offset, last_id=last_id) + # Get position information in Hedge Mode + api_response = api_instance.get_dual_mode_position(settle, contract) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->list_futures_orders: %s\n" % e) + print("Exception when calling FuturesApi->get_dual_mode_position: %s\n" % e) ``` ### Parameters @@ -1973,15 +2119,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **status** | **str**| Query order list based on status | - **contract** | **str**| Futures contract, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] - **last_id** | **str**| Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used | [optional] + **contract** | **str**| Futures contract | ### Return type -[**list[FuturesOrder]**](FuturesOrder.md) +[**list[Position]**](Position.md) ### Authorization @@ -1995,16 +2137,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| +**200** | Query successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **create_futures_order** -> FuturesOrder create_futures_order(settle, futures_order, x_gate_exptime=x_gate_exptime) - -Place futures order +# **update_dual_mode_position_margin** +> list[Position] update_dual_mode_position_margin(settle, contract, change, dual_side) -- When placing an order, the number of contracts is specified `size`, not the number of coins. The number of coins corresponding to each contract is returned in the contract details interface `quanto_multiplier` - 0 The order that was completed cannot be obtained after 10 minutes of withdrawal, and the order will be mentioned that the order does not exist - Setting `reduce_only` to `true` can prevent the position from being penetrated when reducing the position - In single-position mode, if you need to close the position, you need to set `size` to 0 and `close` to `true` - In dual warehouse mode, - Reduce position: reduce_only=true, size is a positive number that indicates short position, negative number that indicates long position - Add number that indicates adding long positions, and negative numbers indicate adding short positions - Close position: size=0, set the direction of closing position according to auto_size, and set `reduce_only` to true at the same time - reduce_only: Make sure to only perform position reduction operations to prevent increased positions - Set `stp_act` to determine the use of a strategy that restricts user transactions. For detailed usage, refer to the body parameter `stp_act` +Update position margin in Hedge Mode ### Example @@ -2031,17 +2171,18 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -futures_order = gate_api.FuturesOrder() # FuturesOrder | -x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) +contract = 'BTC_USDT' # str | Futures contract +change = '0.01' # str | Margin change amount, positive number increases, negative number decreases +dual_side = 'dual_long' # str | Long or short position try: - # Place futures order - api_response = api_instance.create_futures_order(settle, futures_order, x_gate_exptime=x_gate_exptime) + # Update position margin in Hedge Mode + api_response = api_instance.update_dual_mode_position_margin(settle, contract, change, dual_side) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->create_futures_order: %s\n" % e) + print("Exception when calling FuturesApi->update_dual_mode_position_margin: %s\n" % e) ``` ### Parameters @@ -2049,12 +2190,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **futures_order** | [**FuturesOrder**](FuturesOrder.md)| | - **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + **contract** | **str**| Futures contract | + **change** | **str**| Margin change amount, positive number increases, negative number decreases | + **dual_side** | **str**| Long or short position | ### Return type -[**FuturesOrder**](FuturesOrder.md) +[**list[Position]**](Position.md) ### Authorization @@ -2062,22 +2204,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Order details | - | +**200** | Query successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **cancel_futures_orders** -> list[FuturesOrder] cancel_futures_orders(settle, x_gate_exptime=x_gate_exptime, contract=contract, side=side, exclude_reduce_only=exclude_reduce_only, text=text) - -Cancel all orders with 'open' status +# **update_dual_mode_position_leverage** +> list[Position] update_dual_mode_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit) -Zero-fill orders cannot be retrieved 10 minutes after order cancellation +Update position leverage in Hedge Mode ### Example @@ -2104,20 +2244,18 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) -contract = 'BTC_USDT' # str | Contract Identifier; if specified, only cancel pending orders related to this contract (optional) -side = 'ask' # str | Specify all buy orders or all sell orders, both are included if not specified. Set to bid to cancel all buy orders, set to ask to cancel all sell orders (optional) -exclude_reduce_only = False # bool | Whether to exclude reduce-only orders (optional) (default to False) -text = 'cancel by user' # str | Remark for order cancellation (optional) +contract = 'BTC_USDT' # str | Futures contract +leverage = '10' # str | New position leverage +cross_leverage_limit = '10' # str | Cross margin leverage (valid only when `leverage` is 0) (optional) try: - # Cancel all orders with 'open' status - api_response = api_instance.cancel_futures_orders(settle, x_gate_exptime=x_gate_exptime, contract=contract, side=side, exclude_reduce_only=exclude_reduce_only, text=text) + # Update position leverage in Hedge Mode + api_response = api_instance.update_dual_mode_position_leverage(settle, contract, leverage, cross_leverage_limit=cross_leverage_limit) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->cancel_futures_orders: %s\n" % e) + print("Exception when calling FuturesApi->update_dual_mode_position_leverage: %s\n" % e) ``` ### Parameters @@ -2125,15 +2263,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] - **contract** | **str**| Contract Identifier; if specified, only cancel pending orders related to this contract | [optional] - **side** | **str**| Specify all buy orders or all sell orders, both are included if not specified. Set to bid to cancel all buy orders, set to ask to cancel all sell orders | [optional] - **exclude_reduce_only** | **bool**| Whether to exclude reduce-only orders | [optional] [default to False] - **text** | **str**| Remark for order cancellation | [optional] + **contract** | **str**| Futures contract | + **leverage** | **str**| New position leverage | + **cross_leverage_limit** | **str**| Cross margin leverage (valid only when `leverage` is 0) | [optional] ### Return type -[**list[FuturesOrder]**](FuturesOrder.md) +[**list[Position]**](Position.md) ### Authorization @@ -2147,14 +2283,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Batch cancellation successful | - | +**200** | Query successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_orders_with_time_range** -> list[FuturesOrder] get_orders_with_time_range(settle, contract=contract, _from=_from, to=to, limit=limit, offset=offset) +# **update_dual_mode_position_risk_limit** +> list[Position] update_dual_mode_position_risk_limit(settle, contract, risk_limit) -Query futures order list by time range +Update position risk limit in Hedge Mode + +Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. ### Example @@ -2181,20 +2319,17 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) -_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) -to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) -offset = 0 # int | List offset, starting from 0 (optional) (default to 0) +contract = 'BTC_USDT' # str | Futures contract +risk_limit = '1000000' # str | New risk limit value try: - # Query futures order list by time range - api_response = api_instance.get_orders_with_time_range(settle, contract=contract, _from=_from, to=to, limit=limit, offset=offset) + # Update position risk limit in Hedge Mode + api_response = api_instance.update_dual_mode_position_risk_limit(settle, contract, risk_limit) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->get_orders_with_time_range: %s\n" % e) + print("Exception when calling FuturesApi->update_dual_mode_position_risk_limit: %s\n" % e) ``` ### Parameters @@ -2202,15 +2337,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract, return related data only if specified | [optional] - **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] - **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **contract** | **str**| Futures contract | + **risk_limit** | **str**| New risk limit value | ### Return type -[**list[FuturesOrder]**](FuturesOrder.md) +[**list[Position]**](Position.md) ### Authorization @@ -2224,16 +2356,16 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| +**200** | Query successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **create_batch_futures_order** -> list[BatchFuturesOrder] create_batch_futures_order(settle, futures_order, x_gate_exptime=x_gate_exptime) +# **list_futures_orders** +> list[FuturesOrder] list_futures_orders(settle, status, contract=contract, limit=limit, offset=offset, last_id=last_id) -Place batch futures orders +Query futures order list -- Up to 10 orders per request - If any of the order's parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly - If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders - The returned result is in array format, and the order corresponds to the orders in the request body - In the returned result, the `succeeded` field of type bool indicates whether the execution was successful or not - If the execution is successful, the normal order content is included; if the execution fails, the `label` field is included to indicate the cause of the error - In the rate limiting, each order is counted individually +- Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`. ### Example @@ -2260,17 +2392,20 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -futures_order = [gate_api.FuturesOrder()] # list[FuturesOrder] | -x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) +status = 'open' # str | Query order list based on status +contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) +last_id = '12345' # str | Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used (optional) try: - # Place batch futures orders - api_response = api_instance.create_batch_futures_order(settle, futures_order, x_gate_exptime=x_gate_exptime) + # Query futures order list + api_response = api_instance.list_futures_orders(settle, status, contract=contract, limit=limit, offset=offset, last_id=last_id) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->create_batch_futures_order: %s\n" % e) + print("Exception when calling FuturesApi->list_futures_orders: %s\n" % e) ``` ### Parameters @@ -2278,12 +2413,15 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **futures_order** | [**list[FuturesOrder]**](FuturesOrder.md)| | - **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + **status** | **str**| Query order list based on status | + **contract** | **str**| Futures contract, return related data only if specified | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **last_id** | **str**| Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used | [optional] ### Return type -[**list[BatchFuturesOrder]**](BatchFuturesOrder.md) +[**list[FuturesOrder]**](FuturesOrder.md) ### Authorization @@ -2291,22 +2429,22 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Request execution completed | - | +**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_futures_order** -> FuturesOrder get_futures_order(settle, order_id) +# **create_futures_order** +> FuturesOrder create_futures_order(settle, futures_order, x_gate_exptime=x_gate_exptime) -Query single order details +Place futures order -- Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. +- When placing an order, the number of contracts is specified `size`, not the number of coins. The number of coins corresponding to each contract is returned in the contract details interface `quanto_multiplier` - 0 The order that was completed cannot be obtained after 10 minutes of withdrawal, and the order will be mentioned that the order does not exist - Setting `reduce_only` to `true` can prevent the position from being penetrated when reducing the position - In single-position mode, if you need to close the position, you need to set `size` to 0 and `close` to `true` - In dual warehouse mode, - Reduce position: reduce_only=true, size is a positive number that indicates short position, negative number that indicates long position - Add number that indicates adding long positions, and negative numbers indicate adding short positions - Close position: size=0, set the direction of closing position according to auto_size, and set `reduce_only` to true at the same time - reduce_only: Make sure to only perform position reduction operations to prevent increased positions - Set `stp_act` to determine the use of a strategy that restricts user transactions. For detailed usage, refer to the body parameter `stp_act` ### Example @@ -2333,16 +2471,17 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -order_id = '12345' # str | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. +futures_order = gate_api.FuturesOrder() # FuturesOrder | +x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) try: - # Query single order details - api_response = api_instance.get_futures_order(settle, order_id) + # Place futures order + api_response = api_instance.create_futures_order(settle, futures_order, x_gate_exptime=x_gate_exptime) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->get_futures_order: %s\n" % e) + print("Exception when calling FuturesApi->create_futures_order: %s\n" % e) ``` ### Parameters @@ -2350,7 +2489,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | + **futures_order** | [**FuturesOrder**](FuturesOrder.md)| | + **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] ### Return type @@ -2362,20 +2502,22 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order details | - | +**201** | Order details | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **amend_futures_order** -> FuturesOrder amend_futures_order(settle, order_id, futures_order_amendment, x_gate_exptime=x_gate_exptime) +# **cancel_futures_orders** +> list[FuturesOrder] cancel_futures_orders(settle, x_gate_exptime=x_gate_exptime, contract=contract, action_mode=action_mode, side=side, exclude_reduce_only=exclude_reduce_only, text=text) -Amend single order +Cancel all orders with 'open' status + +Zero-fill orders cannot be retrieved 10 minutes after order cancellation ### Example @@ -2402,8 +2544,308 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -order_id = '12345' # str | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. -futures_order_amendment = gate_api.FuturesOrderAmendment() # FuturesOrderAmendment | +x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) +contract = 'BTC_USDT' # str | Contract Identifier; if specified, only cancel pending orders related to this contract (optional) +action_mode = 'ACK' # str | Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) (optional) +side = 'ask' # str | Specify all buy orders or all sell orders, both are included if not specified. Set to bid to cancel all buy orders, set to ask to cancel all sell orders (optional) +exclude_reduce_only = False # bool | Whether to exclude reduce-only orders (optional) (default to False) +text = 'cancel by user' # str | Remark for order cancellation (optional) + +try: + # Cancel all orders with 'open' status + api_response = api_instance.cancel_futures_orders(settle, x_gate_exptime=x_gate_exptime, contract=contract, action_mode=action_mode, side=side, exclude_reduce_only=exclude_reduce_only, text=text) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->cancel_futures_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + **contract** | **str**| Contract Identifier; if specified, only cancel pending orders related to this contract | [optional] + **action_mode** | **str**| Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) | [optional] + **side** | **str**| Specify all buy orders or all sell orders, both are included if not specified. Set to bid to cancel all buy orders, set to ask to cancel all sell orders | [optional] + **exclude_reduce_only** | **bool**| Whether to exclude reduce-only orders | [optional] [default to False] + **text** | **str**| Remark for order cancellation | [optional] + +### Return type + +[**list[FuturesOrder]**](FuturesOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Batch cancellation successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_orders_with_time_range** +> list[FuturesOrderTimerange] get_orders_with_time_range(settle, contract=contract, _from=_from, to=to, limit=limit, offset=offset) + +Query futures order list by time range + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) +_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) +to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) + +try: + # Query futures order list by time range + api_response = api_instance.get_orders_with_time_range(settle, contract=contract, _from=_from, to=to, limit=limit, offset=offset) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->get_orders_with_time_range: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract, return related data only if specified | [optional] + **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] + **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + +### Return type + +[**list[FuturesOrderTimerange]**](FuturesOrderTimerange.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_batch_futures_order** +> list[BatchFuturesOrder] create_batch_futures_order(settle, futures_order, x_gate_exptime=x_gate_exptime) + +Place batch futures orders + +- Up to 10 orders per request - If any of the order's parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly - If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders - The returned result is in array format, and the order corresponds to the orders in the request body - In the returned result, the `succeeded` field of type bool indicates whether the execution was successful or not - If the execution is successful, the normal order content is included; if the execution fails, the `label` field is included to indicate the cause of the error - In the rate limiting, each order is counted individually + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +futures_order = [gate_api.FuturesOrder()] # list[FuturesOrder] | +x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + +try: + # Place batch futures orders + api_response = api_instance.create_batch_futures_order(settle, futures_order, x_gate_exptime=x_gate_exptime) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->create_batch_futures_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **futures_order** | [**list[FuturesOrder]**](FuturesOrder.md)| | + **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + +### Return type + +[**list[BatchFuturesOrder]**](BatchFuturesOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request execution completed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_futures_order** +> FuturesOrder get_futures_order(settle, order_id) + +Query single order details + +- Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +order_id = '12345' # str | The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. + +try: + # Query single order details + api_response = api_instance.get_futures_order(settle, order_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->get_futures_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **order_id** | **str**| The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. | + +### Return type + +[**FuturesOrder**](FuturesOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Order details | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **amend_futures_order** +> FuturesOrder amend_futures_order(settle, order_id, futures_order_amendment, x_gate_exptime=x_gate_exptime) + +Amend single order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +order_id = '12345' # str | The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. +futures_order_amendment = gate_api.FuturesOrderAmendment() # FuturesOrderAmendment | x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) try: @@ -2413,7 +2855,899 @@ try: except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->amend_futures_order: %s\n" % e) + print("Exception when calling FuturesApi->amend_futures_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **order_id** | **str**| The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. | + **futures_order_amendment** | [**FuturesOrderAmendment**](FuturesOrderAmendment.md)| | + **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + +### Return type + +[**FuturesOrder**](FuturesOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Order details | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **cancel_futures_order** +> FuturesOrder cancel_futures_order(settle, order_id, x_gate_exptime=x_gate_exptime, action_mode=action_mode) + +Cancel single order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +order_id = '12345' # str | The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. +x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) +action_mode = 'ACK' # str | Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) (optional) + +try: + # Cancel single order + api_response = api_instance.cancel_futures_order(settle, order_id, x_gate_exptime=x_gate_exptime, action_mode=action_mode) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->cancel_futures_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **order_id** | **str**| The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. | + **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + **action_mode** | **str**| Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) | [optional] + +### Return type + +[**FuturesOrder**](FuturesOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Order details | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_my_trades** +> list[MyFuturesTrade] get_my_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id) + +Query personal trading records + +By default, only supports querying data within 6 months. For older data, use `GET /futures/{settle}/my_trades_timerange` + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) +order = 12345 # int | Futures order ID, return related data only if specified (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) +last_id = '12345' # str | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'. (optional) + +try: + # Query personal trading records + api_response = api_instance.get_my_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->get_my_trades: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract, return related data only if specified | [optional] + **order** | **int**| Futures order ID, return related data only if specified | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **last_id** | **str**| Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'. | [optional] + +### Return type + +[**list[MyFuturesTrade]**](MyFuturesTrade.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_my_trades_with_time_range** +> list[MyFuturesTradeTimeRange] get_my_trades_with_time_range(settle, contract=contract, _from=_from, to=to, limit=limit, offset=offset, role=role) + +Query personal trading records by time range + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) +_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) +to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) +role = 'maker' # str | Query role, maker or taker (optional) + +try: + # Query personal trading records by time range + api_response = api_instance.get_my_trades_with_time_range(settle, contract=contract, _from=_from, to=to, limit=limit, offset=offset, role=role) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->get_my_trades_with_time_range: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract, return related data only if specified | [optional] + **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] + **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **role** | **str**| Query role, maker or taker | [optional] + +### Return type + +[**list[MyFuturesTradeTimeRange]**](MyFuturesTradeTimeRange.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_position_close** +> list[PositionClose] list_position_close(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, side=side, pnl=pnl) + +Query position close history + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) +_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) +to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) +side = 'short' # str | Query side. long or shot (optional) +pnl = 'profit' # str | Query profit or loss (optional) + +try: + # Query position close history + api_response = api_instance.list_position_close(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, side=side, pnl=pnl) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->list_position_close: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract, return related data only if specified | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] + **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] + **side** | **str**| Query side. long or shot | [optional] + **pnl** | **str**| Query profit or loss | [optional] + +### Return type + +[**list[PositionClose]**](PositionClose.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List retrieved successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_liquidates** +> list[FuturesLiquidate] list_liquidates(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, at=at) + +Query liquidation history + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) +_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) +to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) +at = 0 # int | Specify liquidation timestamp (optional) (default to 0) + +try: + # Query liquidation history + api_response = api_instance.list_liquidates(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, at=at) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->list_liquidates: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract, return related data only if specified | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] + **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] + **at** | **int**| Specify liquidation timestamp | [optional] [default to 0] + +### Return type + +[**list[FuturesLiquidate]**](FuturesLiquidate.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List retrieved successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_auto_deleverages** +> list[FuturesAutoDeleverage] list_auto_deleverages(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, at=at) + +Query ADL auto-deleveraging order information + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) +offset = 0 # int | List offset, starting from 0 (optional) (default to 0) +_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) +to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) +at = 0 # int | Specify auto-deleveraging timestamp (optional) (default to 0) + +try: + # Query ADL auto-deleveraging order information + api_response = api_instance.list_auto_deleverages(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, at=at) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->list_auto_deleverages: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract, return related data only if specified | [optional] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] + **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] + **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] + **at** | **int**| Specify auto-deleveraging timestamp | [optional] [default to 0] + +### Return type + +[**list[FuturesAutoDeleverage]**](FuturesAutoDeleverage.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List retrieved successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **countdown_cancel_all_futures** +> TriggerTime countdown_cancel_all_futures(settle, countdown_cancel_all_futures_task) + +Countdown cancel orders + +Heartbeat detection for contract orders: When the user-set `timeout` time is reached, if neither the existing countdown is canceled nor a new countdown is set, the relevant contract orders will be automatically canceled. This API can be called repeatedly to or cancel the countdown. Usage example: Repeatedly call this API at 30-second intervals, setting the `timeout` to 30 (seconds) each time. If this API is not called again within 30 seconds, all open orders on your specified `market` will be automatically canceled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will terminate, and the automatic order cancellation function will be disabled. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +countdown_cancel_all_futures_task = gate_api.CountdownCancelAllFuturesTask() # CountdownCancelAllFuturesTask | + +try: + # Countdown cancel orders + api_response = api_instance.countdown_cancel_all_futures(settle, countdown_cancel_all_futures_task) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->countdown_cancel_all_futures: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **countdown_cancel_all_futures_task** | [**CountdownCancelAllFuturesTask**](CountdownCancelAllFuturesTask.md)| | + +### Return type + +[**TriggerTime**](TriggerTime.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Countdown set successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_futures_fee** +> dict(str, FuturesFee) get_futures_fee(settle, contract=contract) + +Query futures market trading fee rates + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) + +try: + # Query futures market trading fee rates + api_response = api_instance.get_futures_fee(settle, contract=contract) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->get_futures_fee: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract, return related data only if specified | [optional] + +### Return type + +[**dict(str, FuturesFee)**](FuturesFee.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **cancel_batch_future_orders** +> list[FutureCancelOrderResult] cancel_batch_future_orders(settle, request_body, x_gate_exptime=x_gate_exptime) + +Cancel batch orders by specified ID list + +Multiple different order IDs can be specified. A maximum of 20 records can be cancelled in one request + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +request_body = ['[\"1\",\"2\",\"3\"]'] # list[str] | +x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + +try: + # Cancel batch orders by specified ID list + api_response = api_instance.cancel_batch_future_orders(settle, request_body, x_gate_exptime=x_gate_exptime) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->cancel_batch_future_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **request_body** | [**list[str]**](str.md)| | + **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + +### Return type + +[**list[FutureCancelOrderResult]**](FutureCancelOrderResult.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Order cancellation operation completed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **amend_batch_future_orders** +> list[BatchFuturesOrder] amend_batch_future_orders(settle, batch_amend_order_req, x_gate_exptime=x_gate_exptime) + +Batch modify orders by specified IDs + +Multiple different order IDs can be specified. A maximum of 10 orders can be modified in one request + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +batch_amend_order_req = [gate_api.BatchAmendOrderReq()] # list[BatchAmendOrderReq] | +x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + +try: + # Batch modify orders by specified IDs + api_response = api_instance.amend_batch_future_orders(settle, batch_amend_order_req, x_gate_exptime=x_gate_exptime) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->amend_batch_future_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **batch_amend_order_req** | [**list[BatchAmendOrderReq]**](BatchAmendOrderReq.md)| | + **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + +### Return type + +[**list[BatchFuturesOrder]**](BatchFuturesOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request execution completed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_futures_risk_limit_table** +> list[FuturesRiskLimitTier] get_futures_risk_limit_table(settle, table_id) + +Query risk limit table by table_id + +Just pass table_id + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +table_id = 'CYBER_USDT_20241122' # str | Risk limit table ID + +try: + # Query risk limit table by table_id + api_response = api_instance.get_futures_risk_limit_table(settle, table_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->get_futures_risk_limit_table: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **settle** | **str**| Settle currency | + **table_id** | **str**| Risk limit table ID | + +### Return type + +[**list[FuturesRiskLimitTier]**](FuturesRiskLimitTier.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_futures_bbo_order** +> FuturesOrder create_futures_bbo_order(settle, futures_bbo_order, x_gate_exptime=x_gate_exptime) + +Level-based BBO Contract Order Placement + +Compared to the futures trading order placement interface (futures/{settle}/orders), it adds the `level` and `direction` parameters. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.FuturesApi(api_client) +settle = 'usdt' # str | Settle currency +futures_bbo_order = gate_api.FuturesBBOOrder() # FuturesBBOOrder | +x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) + +try: + # Level-based BBO Contract Order Placement + api_response = api_instance.create_futures_bbo_order(settle, futures_bbo_order, x_gate_exptime=x_gate_exptime) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling FuturesApi->create_futures_bbo_order: %s\n" % e) ``` ### Parameters @@ -2421,8 +3755,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | - **futures_order_amendment** | [**FuturesOrderAmendment**](FuturesOrderAmendment.md)| | + **futures_bbo_order** | [**FuturesBBOOrder**](FuturesBBOOrder.md)| | **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] ### Return type @@ -2441,14 +3774,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order details | - | +**201** | Order details | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **cancel_futures_order** -> FuturesOrder cancel_futures_order(settle, order_id, x_gate_exptime=x_gate_exptime) +# **create_trail_order** +> CreateTrailOrderResponse create_trail_order(settle, create_trail_order) -Cancel single order +Create trail order ### Example @@ -2475,17 +3808,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -order_id = '12345' # str | Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. -x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) +create_trail_order = gate_api.CreateTrailOrder() # CreateTrailOrder | try: - # Cancel single order - api_response = api_instance.cancel_futures_order(settle, order_id, x_gate_exptime=x_gate_exptime) + # Create trail order + api_response = api_instance.create_trail_order(settle, create_trail_order) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->cancel_futures_order: %s\n" % e) + print("Exception when calling FuturesApi->create_trail_order: %s\n" % e) ``` ### Parameters @@ -2493,12 +3825,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | - **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + **create_trail_order** | [**CreateTrailOrder**](CreateTrailOrder.md)| | ### Return type -[**FuturesOrder**](FuturesOrder.md) +[**CreateTrailOrderResponse**](CreateTrailOrderResponse.md) ### Authorization @@ -2506,22 +3837,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order details | - | +**201** | Created successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_my_trades** -> list[MyFuturesTrade] get_my_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id) - -Query personal trading records +# **stop_trail_order** +> TrailOrderResponse stop_trail_order(settle, stop_trail_order) -By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/my_trades_timerange`. +Terminate trail order ### Example @@ -2548,20 +3877,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) -order = 12345 # int | Futures order ID, return related data only if specified (optional) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) -offset = 0 # int | List offset, starting from 0 (optional) (default to 0) -last_id = '12345' # str | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'. (optional) +stop_trail_order = gate_api.StopTrailOrder() # StopTrailOrder | try: - # Query personal trading records - api_response = api_instance.get_my_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id) + # Terminate trail order + api_response = api_instance.stop_trail_order(settle, stop_trail_order) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->get_my_trades: %s\n" % e) + print("Exception when calling FuturesApi->stop_trail_order: %s\n" % e) ``` ### Parameters @@ -2569,15 +3894,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract, return related data only if specified | [optional] - **order** | **int**| Futures order ID, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] - **last_id** | **str**| Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'. | [optional] + **stop_trail_order** | [**StopTrailOrder**](StopTrailOrder.md)| | ### Return type -[**list[MyFuturesTrade]**](MyFuturesTrade.md) +[**TrailOrderResponse**](TrailOrderResponse.md) ### Authorization @@ -2585,20 +3906,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| +**200** | Termination successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_my_trades_with_time_range** -> list[MyFuturesTradeTimeRange] get_my_trades_with_time_range(settle, contract=contract, _from=_from, to=to, limit=limit, offset=offset, role=role) +# **stop_all_trail_orders** +> TrailOrderListResponse stop_all_trail_orders(settle, stop_all_trail_orders) -Query personal trading records by time range +Batch terminate trail orders ### Example @@ -2625,21 +3946,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) -_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) -to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) -offset = 0 # int | List offset, starting from 0 (optional) (default to 0) -role = 'maker' # str | Query role, maker or taker (optional) +stop_all_trail_orders = gate_api.StopAllTrailOrders() # StopAllTrailOrders | try: - # Query personal trading records by time range - api_response = api_instance.get_my_trades_with_time_range(settle, contract=contract, _from=_from, to=to, limit=limit, offset=offset, role=role) + # Batch terminate trail orders + api_response = api_instance.stop_all_trail_orders(settle, stop_all_trail_orders) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->get_my_trades_with_time_range: %s\n" % e) + print("Exception when calling FuturesApi->stop_all_trail_orders: %s\n" % e) ``` ### Parameters @@ -2647,16 +3963,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract, return related data only if specified | [optional] - **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] - **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] - **role** | **str**| Query role, maker or taker | [optional] + **stop_all_trail_orders** | [**StopAllTrailOrders**](StopAllTrailOrders.md)| | ### Return type -[**list[MyFuturesTradeTimeRange]**](MyFuturesTradeTimeRange.md) +[**TrailOrderListResponse**](TrailOrderListResponse.md) ### Authorization @@ -2664,20 +3975,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved successfully | * X-Pagination-Limit - Limit specified for pagination
* X-Pagination-Offset - Offset specified for pagination
| +**200** | Termination successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_position_close** -> list[PositionClose] list_position_close(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, side=side, pnl=pnl) +# **get_trail_orders** +> TrailOrderListResponse get_trail_orders(settle, contract=contract, is_finished=is_finished, start_at=start_at, end_at=end_at, page_num=page_num, page_size=page_size, sort_by=sort_by, hide_cancel=hide_cancel, related_position=related_position, sort_by_trigger=sort_by_trigger, reduce_only=reduce_only, side=side) -Query position close history +Get trail order list ### Example @@ -2704,22 +4015,27 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) -offset = 0 # int | List offset, starting from 0 (optional) (default to 0) -_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) -to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) -side = 'short' # str | Query side. long or shot (optional) -pnl = 'profit' # str | Query profit or loss (optional) +contract = 'contract_example' # str | Contract name (optional) +is_finished = True # bool | Whether historical order (optional) +start_at = 56 # int | Start time of time range (optional) +end_at = 56 # int | End time of time range (optional) +page_num = 1 # int | Page number, starting from 1 (optional) (default to 1) +page_size = 20 # int | Number of items per page (optional) (default to 20) +sort_by = 1 # int | Common sort field, 1-creation time, 2-end time (optional) (default to 1) +hide_cancel = False # bool | Hide cancelled orders (optional) (default to False) +related_position = 56 # int | Associated position, if provided, only return orders associated with this position, 1-long, 2-short (optional) +sort_by_trigger = False # bool | Sort by trigger price and activation price, easy to trigger or activate first, only for current orders associated with positions (optional) (default to False) +reduce_only = 56 # int | Whether reduce only, 1-yes, 2-no (optional) +side = 56 # int | Direction, 1-long position, 2-short position (optional) try: - # Query position close history - api_response = api_instance.list_position_close(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, side=side, pnl=pnl) + # Get trail order list + api_response = api_instance.get_trail_orders(settle, contract=contract, is_finished=is_finished, start_at=start_at, end_at=end_at, page_num=page_num, page_size=page_size, sort_by=sort_by, hide_cancel=hide_cancel, related_position=related_position, sort_by_trigger=sort_by_trigger, reduce_only=reduce_only, side=side) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->list_position_close: %s\n" % e) + print("Exception when calling FuturesApi->get_trail_orders: %s\n" % e) ``` ### Parameters @@ -2727,17 +4043,22 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] - **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] - **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] - **side** | **str**| Query side. long or shot | [optional] - **pnl** | **str**| Query profit or loss | [optional] + **contract** | **str**| Contract name | [optional] + **is_finished** | **bool**| Whether historical order | [optional] + **start_at** | **int**| Start time of time range | [optional] + **end_at** | **int**| End time of time range | [optional] + **page_num** | **int**| Page number, starting from 1 | [optional] [default to 1] + **page_size** | **int**| Number of items per page | [optional] [default to 20] + **sort_by** | **int**| Common sort field, 1-creation time, 2-end time | [optional] [default to 1] + **hide_cancel** | **bool**| Hide cancelled orders | [optional] [default to False] + **related_position** | **int**| Associated position, if provided, only return orders associated with this position, 1-long, 2-short | [optional] + **sort_by_trigger** | **bool**| Sort by trigger price and activation price, easy to trigger or activate first, only for current orders associated with positions | [optional] [default to False] + **reduce_only** | **int**| Whether reduce only, 1-yes, 2-no | [optional] + **side** | **int**| Direction, 1-long position, 2-short position | [optional] ### Return type -[**list[PositionClose]**](PositionClose.md) +[**TrailOrderListResponse**](TrailOrderListResponse.md) ### Authorization @@ -2751,14 +4072,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved successfully | - | +**200** | Query successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_liquidates** -> list[FuturesLiquidate] list_liquidates(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, at=at) +# **get_trail_order_detail** +> TrailOrderDetailResponse get_trail_order_detail(settle, id) -Query liquidation history +Get trail order details ### Example @@ -2785,21 +4106,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) -offset = 0 # int | List offset, starting from 0 (optional) (default to 0) -_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) -to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) -at = 0 # int | Specify liquidation timestamp (optional) (default to 0) +id = 56 # int | Order ID try: - # Query liquidation history - api_response = api_instance.list_liquidates(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, at=at) + # Get trail order details + api_response = api_instance.get_trail_order_detail(settle, id) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->list_liquidates: %s\n" % e) + print("Exception when calling FuturesApi->get_trail_order_detail: %s\n" % e) ``` ### Parameters @@ -2807,16 +4123,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] - **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] - **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] - **at** | **int**| Specify liquidation timestamp | [optional] [default to 0] + **id** | **int**| Order ID | ### Return type -[**list[FuturesLiquidate]**](FuturesLiquidate.md) +[**TrailOrderDetailResponse**](TrailOrderDetailResponse.md) ### Authorization @@ -2830,14 +4141,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved successfully | - | +**200** | Query successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_auto_deleverages** -> list[FuturesAutoDeleverage] list_auto_deleverages(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, at=at) +# **update_trail_order** +> TrailOrderResponse update_trail_order(settle, update_trail_order) -Query ADL auto-deleveraging order information +Update trail order ### Example @@ -2864,21 +4175,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) -limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) -offset = 0 # int | List offset, starting from 0 (optional) (default to 0) -_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) -to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) -at = 0 # int | Specify auto-deleveraging timestamp (optional) (default to 0) +update_trail_order = gate_api.UpdateTrailOrder() # UpdateTrailOrder | try: - # Query ADL auto-deleveraging order information - api_response = api_instance.list_auto_deleverages(settle, contract=contract, limit=limit, offset=offset, _from=_from, to=to, at=at) + # Update trail order + api_response = api_instance.update_trail_order(settle, update_trail_order) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->list_auto_deleverages: %s\n" % e) + print("Exception when calling FuturesApi->update_trail_order: %s\n" % e) ``` ### Parameters @@ -2886,16 +4192,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract, return related data only if specified | [optional] - **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] - **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] - **_from** | **int**| Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] - **to** | **int**| Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] - **at** | **int**| Specify auto-deleveraging timestamp | [optional] [default to 0] + **update_trail_order** | [**UpdateTrailOrder**](UpdateTrailOrder.md)| | ### Return type -[**list[FuturesAutoDeleverage]**](FuturesAutoDeleverage.md) +[**TrailOrderResponse**](TrailOrderResponse.md) ### Authorization @@ -2903,22 +4204,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List retrieved successfully | - | +**200** | Updated successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **countdown_cancel_all_futures** -> TriggerTime countdown_cancel_all_futures(settle, countdown_cancel_all_futures_task) - -Countdown cancel orders +# **get_trail_order_change_log** +> TrailOrderChangeLogResponse get_trail_order_change_log(settle, id, page_num=page_num, page_size=page_size) -Heartbeat detection for contract orders: When the user-set `timeout` time is reached, if neither the existing countdown is canceled nor a new countdown is set, the relevant contract orders will be automatically canceled. This API can be called repeatedly to or cancel the countdown. Usage example: Repeatedly call this API at 30-second intervals, setting the `timeout` to 30 (seconds) each time. If this API is not called again within 30 seconds, all open orders on your specified `market` will be automatically canceled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will terminate, and the automatic order cancellation function will be disabled. +Get trail order user modification records ### Example @@ -2945,16 +4244,18 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -countdown_cancel_all_futures_task = gate_api.CountdownCancelAllFuturesTask() # CountdownCancelAllFuturesTask | +id = 56 # int | Order ID +page_num = 1 # int | Page number, starting from 1 (optional) (default to 1) +page_size = 20 # int | Number of items per page (optional) (default to 20) try: - # Countdown cancel orders - api_response = api_instance.countdown_cancel_all_futures(settle, countdown_cancel_all_futures_task) + # Get trail order user modification records + api_response = api_instance.get_trail_order_change_log(settle, id, page_num=page_num, page_size=page_size) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->countdown_cancel_all_futures: %s\n" % e) + print("Exception when calling FuturesApi->get_trail_order_change_log: %s\n" % e) ``` ### Parameters @@ -2962,11 +4263,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **countdown_cancel_all_futures_task** | [**CountdownCancelAllFuturesTask**](CountdownCancelAllFuturesTask.md)| | + **id** | **int**| Order ID | + **page_num** | **int**| Page number, starting from 1 | [optional] [default to 1] + **page_size** | **int**| Number of items per page | [optional] [default to 20] ### Return type -[**TriggerTime**](TriggerTime.md) +[**TrailOrderChangeLogResponse**](TrailOrderChangeLogResponse.md) ### Authorization @@ -2974,20 +4277,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Countdown set successfully | - | +**200** | Query successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_futures_fee** -> dict(str, FuturesFee) get_futures_fee(settle, contract=contract) +# **create_chase_order** +> CreateChaseOrderResp create_chase_order(settle, create_chase_order_req) -Query futures market trading fee rates +Create a chase order ### Example @@ -3014,16 +4317,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) +create_chase_order_req = gate_api.CreateChaseOrderReq() # CreateChaseOrderReq | try: - # Query futures market trading fee rates - api_response = api_instance.get_futures_fee(settle, contract=contract) + # Create a chase order + api_response = api_instance.create_chase_order(settle, create_chase_order_req) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->get_futures_fee: %s\n" % e) + print("Exception when calling FuturesApi->create_chase_order: %s\n" % e) ``` ### Parameters @@ -3031,11 +4334,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **contract** | **str**| Futures contract, return related data only if specified | [optional] + **create_chase_order_req** | [**CreateChaseOrderReq**](CreateChaseOrderReq.md)| | ### Return type -[**dict(str, FuturesFee)**](FuturesFee.md) +[**CreateChaseOrderResp**](CreateChaseOrderResp.md) ### Authorization @@ -3043,22 +4346,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Query successful | - | +**200** | Success | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **cancel_batch_future_orders** -> list[FutureCancelOrderResult] cancel_batch_future_orders(settle, request_body, x_gate_exptime=x_gate_exptime) - -Cancel batch orders by specified ID list +# **stop_chase_order** +> StopChaseOrderResp stop_chase_order(settle, stop_chase_order_req) -Multiple different order IDs can be specified. A maximum of 20 records can be cancelled in one request +Stop a chase order ### Example @@ -3085,17 +4386,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -request_body = ['request_body_example'] # list[str] | -x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) +stop_chase_order_req = gate_api.StopChaseOrderReq() # StopChaseOrderReq | try: - # Cancel batch orders by specified ID list - api_response = api_instance.cancel_batch_future_orders(settle, request_body, x_gate_exptime=x_gate_exptime) + # Stop a chase order + api_response = api_instance.stop_chase_order(settle, stop_chase_order_req) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->cancel_batch_future_orders: %s\n" % e) + print("Exception when calling FuturesApi->stop_chase_order: %s\n" % e) ``` ### Parameters @@ -3103,12 +4403,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **request_body** | [**list[str]**](str.md)| | - **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + **stop_chase_order_req** | [**StopChaseOrderReq**](StopChaseOrderReq.md)| | ### Return type -[**list[FutureCancelOrderResult]**](FutureCancelOrderResult.md) +[**StopChaseOrderResp**](StopChaseOrderResp.md) ### Authorization @@ -3122,16 +4421,14 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order cancellation operation completed | - | +**200** | Success | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **amend_batch_future_orders** -> list[BatchFuturesOrder] amend_batch_future_orders(settle, batch_amend_order_req, x_gate_exptime=x_gate_exptime) - -Batch modify orders by specified IDs +# **stop_all_chase_orders** +> StopAllChaseOrdersResp stop_all_chase_orders(settle, stop_all_chase_orders_req) -Multiple different order IDs can be specified. A maximum of 10 orders can be modified in one request +Stop chase orders in batch ### Example @@ -3158,17 +4455,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -batch_amend_order_req = [gate_api.BatchAmendOrderReq()] # list[BatchAmendOrderReq] | -x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) +stop_all_chase_orders_req = gate_api.StopAllChaseOrdersReq() # StopAllChaseOrdersReq | try: - # Batch modify orders by specified IDs - api_response = api_instance.amend_batch_future_orders(settle, batch_amend_order_req, x_gate_exptime=x_gate_exptime) + # Stop chase orders in batch + api_response = api_instance.stop_all_chase_orders(settle, stop_all_chase_orders_req) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->amend_batch_future_orders: %s\n" % e) + print("Exception when calling FuturesApi->stop_all_chase_orders: %s\n" % e) ``` ### Parameters @@ -3176,12 +4472,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **batch_amend_order_req** | [**list[BatchAmendOrderReq]**](BatchAmendOrderReq.md)| | - **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + **stop_all_chase_orders_req** | [**StopAllChaseOrdersReq**](StopAllChaseOrdersReq.md)| | ### Return type -[**list[BatchFuturesOrder]**](BatchFuturesOrder.md) +[**StopAllChaseOrdersResp**](StopAllChaseOrdersResp.md) ### Authorization @@ -3195,43 +4490,59 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Request execution completed | - | +**200** | Success | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **get_futures_risk_limit_table** -> list[FuturesRiskLimitTier] get_futures_risk_limit_table(settle, table_id) - -Query risk limit table by table_id +# **get_chase_orders** +> GetChaseOrdersResp get_chase_orders(settle, sort_by, contract=contract, is_finished=is_finished, start_at=start_at, end_at=end_at, page_num=page_num, page_size=page_size, hide_cancel=hide_cancel, reduce_only=reduce_only, side=side) -Just pass table_id +List chase orders ### Example +* Api Key Authentication (apiv4): ```python from __future__ import print_function import gate_api from gate_api.exceptions import ApiException, GateApiException # Defining the host is optional and defaults to https://api.gateio.ws/api/v4 # See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization configuration = gate_api.Configuration( - host = "https://api.gateio.ws/api/v4" + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" ) api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -table_id = 'CYBER_USDT_20241122' # str | Risk limit table ID +sort_by = 56 # int | Sort field: 1 ORDER_SORT_CREATED_AT, 2 ORDER_SORT_FINISHED_AT; cannot be 0 +contract = 'contract_example' # str | Optional. When non-empty, must be a valid contract (validated against the market cache for the path settle); server-side converted to uppercase (optional) +is_finished = True # bool | true to query finished orders, false to query in-progress orders (optional) +start_at = 56 # int | Lower time bound for the history list, paired with end_at. Required when is_finished is true (optional) +end_at = 56 # int | Upper time bound for the history list, paired with start_at. Required when is_finished is true (optional) +page_num = 56 # int | Page number, starting from 1 (optional) +page_size = 56 # int | Page size; must be between 1 and 100 (optional) +hide_cancel = True # bool | When true, cancelled orders are hidden in the list (optional) +reduce_only = 56 # int | OptionalBool: 0 unknown, 1 true, 2 false; used to filter by reduce-only flag (optional) +side = 56 # int | Filter by long/short side: 1 long, 2 short (optional) try: - # Query risk limit table by table_id - api_response = api_instance.get_futures_risk_limit_table(settle, table_id) + # List chase orders + api_response = api_instance.get_chase_orders(settle, sort_by, contract=contract, is_finished=is_finished, start_at=start_at, end_at=end_at, page_num=page_num, page_size=page_size, hide_cancel=hide_cancel, reduce_only=reduce_only, side=side) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->get_futures_risk_limit_table: %s\n" % e) + print("Exception when calling FuturesApi->get_chase_orders: %s\n" % e) ``` ### Parameters @@ -3239,15 +4550,24 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **table_id** | **str**| Risk limit table ID | + **sort_by** | **int**| Sort field: 1 ORDER_SORT_CREATED_AT, 2 ORDER_SORT_FINISHED_AT; cannot be 0 | + **contract** | **str**| Optional. When non-empty, must be a valid contract (validated against the market cache for the path settle); server-side converted to uppercase | [optional] + **is_finished** | **bool**| true to query finished orders, false to query in-progress orders | [optional] + **start_at** | **int**| Lower time bound for the history list, paired with end_at. Required when is_finished is true | [optional] + **end_at** | **int**| Upper time bound for the history list, paired with start_at. Required when is_finished is true | [optional] + **page_num** | **int**| Page number, starting from 1 | [optional] + **page_size** | **int**| Page size; must be between 1 and 100 | [optional] + **hide_cancel** | **bool**| When true, cancelled orders are hidden in the list | [optional] + **reduce_only** | **int**| OptionalBool: 0 unknown, 1 true, 2 false; used to filter by reduce-only flag | [optional] + **side** | **int**| Filter by long/short side: 1 long, 2 short | [optional] ### Return type -[**list[FuturesRiskLimitTier]**](FuturesRiskLimitTier.md) +[**GetChaseOrdersResp**](GetChaseOrdersResp.md) ### Authorization -No authorization required +[apiv4](../README.md#apiv4) ### HTTP request headers @@ -3257,16 +4577,14 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Query successful | - | +**200** | Success | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **create_futures_bbo_order** -> FuturesOrder create_futures_bbo_order(settle, futures_bbo_order, x_gate_exptime=x_gate_exptime) - -Level-based BBO Contract Order Placement +# **get_chase_order_detail** +> GetChaseOrderDetailResp get_chase_order_detail(settle, id) -Compared to the futures trading order placement interface (futures/{settle}/orders), it adds the `level` and `direction` parameters. +Get chase order detail ### Example @@ -3293,17 +4611,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -futures_bbo_order = gate_api.FuturesBBOOrder() # FuturesBBOOrder | -x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) +id = 'id_example' # str | Order ID, must be a non-zero positive integer try: - # Level-based BBO Contract Order Placement - api_response = api_instance.create_futures_bbo_order(settle, futures_bbo_order, x_gate_exptime=x_gate_exptime) + # Get chase order detail + api_response = api_instance.get_chase_order_detail(settle, id) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->create_futures_bbo_order: %s\n" % e) + print("Exception when calling FuturesApi->get_chase_order_detail: %s\n" % e) ``` ### Parameters @@ -3311,12 +4628,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **futures_bbo_order** | [**FuturesBBOOrder**](FuturesBBOOrder.md)| | - **x_gate_exptime** | **str**| Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected | [optional] + **id** | **str**| Order ID, must be a non-zero positive integer | ### Return type -[**FuturesOrder**](FuturesOrder.md) +[**GetChaseOrderDetailResp**](GetChaseOrderDetailResp.md) ### Authorization @@ -3324,13 +4640,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | Order details | - | +**200** | Success | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3543,7 +4859,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Batch cancellation request accepted and processed, success determined by order list | - | +**200** | Batch cancel request is received and processed. Success is determined based on the order list | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -3577,7 +4893,7 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -order_id = 'order_id_example' # str | ID returned when order is successfully created +order_id = 56 # int | ID returned when order is successfully created try: # Query single auto order details @@ -3594,7 +4910,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| ID returned when order is successfully created | + **order_id** | **int**| ID returned when order is successfully created | ### Return type @@ -3616,10 +4932,10 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **update_price_triggered_order** -> TriggerOrderResponse update_price_triggered_order(settle, order_id, futures_update_price_triggered_order) +# **cancel_price_triggered_order** +> FuturesPriceTriggeredOrder cancel_price_triggered_order(settle, order_id) -Modify a Single Auto Order +Cancel single auto order ### Example @@ -3646,17 +4962,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -order_id = 'order_id_example' # str | ID returned when order is successfully created -futures_update_price_triggered_order = gate_api.FuturesUpdatePriceTriggeredOrder() # FuturesUpdatePriceTriggeredOrder | +order_id = 56 # int | ID returned when order is successfully created try: - # Modify a Single Auto Order - api_response = api_instance.update_price_triggered_order(settle, order_id, futures_update_price_triggered_order) + # Cancel single auto order + api_response = api_instance.cancel_price_triggered_order(settle, order_id) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->update_price_triggered_order: %s\n" % e) + print("Exception when calling FuturesApi->cancel_price_triggered_order: %s\n" % e) ``` ### Parameters @@ -3664,12 +4979,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| ID returned when order is successfully created | - **futures_update_price_triggered_order** | [**FuturesUpdatePriceTriggeredOrder**](FuturesUpdatePriceTriggeredOrder.md)| | + **order_id** | **int**| ID returned when order is successfully created | ### Return type -[**TriggerOrderResponse**](TriggerOrderResponse.md) +[**FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md) ### Authorization @@ -3677,20 +4991,20 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Order created successfully | - | +**200** | Auto order details | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **cancel_price_triggered_order** -> FuturesPriceTriggeredOrder cancel_price_triggered_order(settle, order_id) +# **update_price_triggered_order** +> TriggerOrderResponse update_price_triggered_order(settle, futures_update_price_triggered_order) -Cancel single auto order +Modify a Single Auto Order ### Example @@ -3717,16 +5031,16 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency -order_id = 'order_id_example' # str | ID returned when order is successfully created +futures_update_price_triggered_order = gate_api.FuturesUpdatePriceTriggeredOrder() # FuturesUpdatePriceTriggeredOrder | try: - # Cancel single auto order - api_response = api_instance.cancel_price_triggered_order(settle, order_id) + # Modify a Single Auto Order + api_response = api_instance.update_price_triggered_order(settle, futures_update_price_triggered_order) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) except ApiException as e: - print("Exception when calling FuturesApi->cancel_price_triggered_order: %s\n" % e) + print("Exception when calling FuturesApi->update_price_triggered_order: %s\n" % e) ``` ### Parameters @@ -3734,11 +5048,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | - **order_id** | **str**| ID returned when order is successfully created | + **futures_update_price_triggered_order** | [**FuturesUpdatePriceTriggeredOrder**](FuturesUpdatePriceTriggeredOrder.md)| | ### Return type -[**FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md) +[**TriggerOrderResponse**](TriggerOrderResponse.md) ### Authorization @@ -3746,13 +5060,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Auto order details | - | +**200** | Order created successfully | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/FuturesBBOOrder.md b/docs/FuturesBBOOrder.md index 97dba381..584d3303 100644 --- a/docs/FuturesBBOOrder.md +++ b/docs/FuturesBBOOrder.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **tif** | **str** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [optional] [default to 'gtc'] **left** | **int** | Unfilled quantity | [optional] [readonly] **fill_price** | **str** | Fill price | [optional] [readonly] -**text** | **str** | 订单自定义信息,用户可以用该字段设置自定义 ID,用户自定义字段必须满足以下条件: 1. 必须以 `t-` 开头 2. 不计算 `t-` ,长度不能超过 28 字节 3. 输入内容只能包含数字、字母、下划线(_)、中划线(-) 或者点(.) 除用户自定义信息以外,以下为内部保留字段,标识订单来源: - web: 网页 - api: API 调用 - app: 移动端 - auto_deleveraging: 自动减仓 - liquidation: ⽼经典模式仓位强制平仓 - liq-xxx: a. 新经典模式仓位强制平仓,包含逐仓、单向全仓、双向全仓⾮对冲仓位强平。 b. 统⼀账户单币种保证金模式逐仓强制平仓 - hedge-liq-xxx: 新经典模式双向全仓对冲部分强制平仓,即同时平多空仓位 - pm_liquidate: 统⼀账户跨币种保证金模式强制平仓 - comb_margin_liquidate: 统⼀账户组合保证金模式强制平仓 - scm_liquidate: 统⼀账户单币种保证金模式仓位强制平仓 - insurance: 保险 | [optional] +**text** | **str** | Order Custom Information: Users can set custom IDs via this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Content can only contain numbers, letters, underscores (_), hyphens (-), or dots (.) In addition to user custom information, the following are internal reserved fields identifying order sources: - web: Web - api: API Call - app: Mobile App - auto_deleveraging: Auto-Deleveraging - liquidation: Forced Liquidation of Legacy Classic Mode Positions - liq-xxx: a. Forced liquidation of New Classic Mode positions, including isolated margin, single-direction cross margin, and non-hedged dual-direction cross margin positions. b. Forced liquidation of isolated margin positions in Unified Account Single-Currency Margin Mode - hedge-liq-xxx: Forced liquidation of hedged portions in New Classic Mode dual-direction cross margin (simultaneous closing of long and short positions) - pm_liquidate: Forced liquidation in Unified Account Cross-Currency Margin Mode - comb_margin_liquidate: Forced liquidation in Unified Account Portfolio Margin Mode - scm_liquidate: Forced liquidation of positions in Unified Account Single-Currency Margin Mode - insurance: Insurance | [optional] **tkfr** | **str** | Taker fee | [optional] [readonly] **mkfr** | **str** | Maker fee | [optional] [readonly] **refu** | **int** | Referrer user ID | [optional] [readonly] @@ -25,7 +25,6 @@ Name | Type | Description | Notes **stp_id** | **int** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly] **stp_act** | **str** | Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies 1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy. 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter. 3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-' - cn: Cancel newest, cancel new orders and keep old ones - co: Cancel oldest, cancel old orders and keep new ones - cb: Cancel both, both old and new orders will be cancelled | [optional] **amend_text** | **str** | The custom data that the user remarked when amending the order | [optional] [readonly] -**limit_vip** | **int** | Counterparty user's VIP level for limit order fills. Current order will only match with orders whose VIP level is less than or equal to the specified level. Only 11~16 are supported; default is 0 | [optional] **pid** | **int** | Position ID | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesBatchAmendOrderRequest.md b/docs/FuturesBatchAmendOrderRequest.md index 278f3b6e..e67873f7 100644 --- a/docs/FuturesBatchAmendOrderRequest.md +++ b/docs/FuturesBatchAmendOrderRequest.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **size** | **str** | New order size, including filled size. - If less than or equal to the filled quantity, the order will be cancelled. - The new order side must be identical to the original one. - Close order size cannot be modified. - For reduce-only orders, increasing the size may cancel other reduce-only orders. - If the price is not modified, decreasing the size will not affect the depth queue, while increasing the size will place it at the end of the current price level. | [optional] **price** | **str** | New order price | [optional] **amend_text** | **str** | Custom info during order amendment | [optional] +**action_mode** | **str** | Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesDirection.md b/docs/FuturesDirection.md new file mode 100644 index 00000000..ff8eb863 --- /dev/null +++ b/docs/FuturesDirection.md @@ -0,0 +1,10 @@ +# FuturesDirection + +Direction enumeration supported by contract-based strategies. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FuturesGridCreateParams.md b/docs/FuturesGridCreateParams.md new file mode 100644 index 00000000..9cf9e000 --- /dev/null +++ b/docs/FuturesGridCreateParams.md @@ -0,0 +1,22 @@ +# FuturesGridCreateParams + +Creation parameters for the contract grid strategy. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**money** | **str** | | +**low_price** | **str** | | +**high_price** | **str** | | +**grid_num** | **int** | | +**price_type** | **int** | | +**leverage** | **str** | | +**direction** | [**FuturesDirection**](FuturesDirection.md) | | [optional] +**trigger_price** | **str** | | [optional] +**stop_profit** | **str** | | [optional] +**stop_loss** | **str** | | [optional] +**profit_sharing_ratio** | **str** | | [optional] +**is_use_base** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FuturesGridCreateRequest.md b/docs/FuturesGridCreateRequest.md new file mode 100644 index 00000000..e7349519 --- /dev/null +++ b/docs/FuturesGridCreateRequest.md @@ -0,0 +1,13 @@ +# FuturesGridCreateRequest + +Create the request body of the contract grid strategy. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_type** | **str** | | +**market** | **str** | | +**create_params** | [**FuturesGridCreateParams**](FuturesGridCreateParams.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FuturesInitialOrder.md b/docs/FuturesInitialOrder.md index a7a26d37..ecb4d673 100644 --- a/docs/FuturesInitialOrder.md +++ b/docs/FuturesInitialOrder.md @@ -5,8 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **contract** | **str** | Futures contract | **size** | **int** | Represents the number of contracts that need to be closed, full closing: size=0 Partial closing: plan-close-short-position size>0 Partial closing: plan-close-long-position size<0 | [optional] +**amount** | **str** | Same as `size`; used for decimal contract size. When both `size` and `amount` are provided, `amount` takes precedence. | [optional] **price** | **str** | Order price. Set to 0 to use market price | -**close** | **bool** | In One-way Mode, when closing all positions, this must be set to true to perform the closing operation When partially closing positions in One-way Mode or Hedge Mode, you can omit close or set close=false | [optional] [default to False] +**close** | **bool** | When fully closing a position in single-position mode, close must be set to true to execute the close operation. When partially closing a position in single-position mode or in dual-position mode, close can be left unset or set to false. | [optional] [default to False] **tif** | **str** | Time in force strategy, default is gtc, market orders currently only support ioc mode - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled | [optional] [default to 'gtc'] **text** | **str** | The source of the order, including: - web: Web - api: API call - app: Mobile app | [optional] **reduce_only** | **bool** | When set to true, perform automatic position reduction operation. Set to true to ensure that the order will not open a new position, and is only used to close or reduce positions | [optional] [default to False] diff --git a/docs/FuturesLeverage.md b/docs/FuturesLeverage.md new file mode 100644 index 00000000..df85dedf --- /dev/null +++ b/docs/FuturesLeverage.md @@ -0,0 +1,11 @@ +# FuturesLeverage + +Return result includes Lever field +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lever** | **str** | Leverage | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FuturesLiqOrder.md b/docs/FuturesLiqOrder.md index 400112c3..378a4e3a 100644 --- a/docs/FuturesLiqOrder.md +++ b/docs/FuturesLiqOrder.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **order_size** | **str** | Number of forced liquidation orders | [optional] [readonly] **order_price** | **str** | Liquidation order price | [optional] [readonly] **fill_price** | **str** | Liquidation order average taker price | [optional] [readonly] -**left** | **str** | System liquidation order maker size | [optional] [readonly] +**left** | **str** | Reserved field with no current business significance. | [optional] [readonly] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesOrder.md b/docs/FuturesOrder.md index 8b52de3c..9c610dfd 100644 --- a/docs/FuturesOrder.md +++ b/docs/FuturesOrder.md @@ -32,9 +32,13 @@ Name | Type | Description | Notes **stp_act** | **str** | Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies 1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy. 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter. 3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-' - cn: Cancel newest, cancel new orders and keep old ones - co: Cancel oldest, cancel old orders and keep new ones - cb: Cancel both, both old and new orders will be cancelled | [optional] **amend_text** | **str** | The custom data that the user remarked when amending the order | [optional] [readonly] **pid** | **int** | Position ID | [optional] -**order_value** | **str** | order's value | [optional] -**trade_value** | **str** | trade value | [optional] **market_order_slip_ratio** | **str** | Custom maximum slippage rate for market orders. If not provided, the default contract settings will be used | [optional] +**pos_margin_mode** | **str** | Position Margin Mode isolated - Isolated Margin, cross - Cross Margin, only passed in simple split position mode | [optional] +**action_mode** | **str** | Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) | [optional] +**tpsl_tp_trigger_price** | **str** | Take profit price | [optional] +**tpsl_sl_trigger_price** | **str** | Stop loss price | [optional] +**tpsl_tp_bbo_type** | **str** | Take profit BBO type | [optional] +**tpsl_sl_bbo_type** | **str** | Stop loss BBO type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesOrderAmendment.md b/docs/FuturesOrderAmendment.md index 90535a3c..9bbf3eb2 100644 --- a/docs/FuturesOrderAmendment.md +++ b/docs/FuturesOrderAmendment.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **price** | **str** | New order price | [optional] **amend_text** | **str** | Custom info during order amendment | [optional] **text** | **str** | Internal users can modify information in the text field. | [optional] +**action_mode** | **str** | Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesOrderTimerange.md b/docs/FuturesOrderTimerange.md new file mode 100644 index 00000000..565294ce --- /dev/null +++ b/docs/FuturesOrderTimerange.md @@ -0,0 +1,42 @@ +# FuturesOrderTimerange + +Futures order details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Futures order ID | [optional] [readonly] +**user** | **int** | User ID | [optional] [readonly] +**create_time** | **float** | Creation time of order | [optional] [readonly] +**update_time** | **str** | OrderUpdateTime | [optional] [readonly] +**finish_time** | **str** | Order finished time. Not returned if order is open | [optional] [readonly] +**finish_as** | **str** | How the order was finished: - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set - position_closed: cancelled because the position was closed - reduce_out: only reduce positions by excluding hard-to-fill orders - stp: cancelled because self trade prevention | [optional] [readonly] +**status** | **str** | Order status - `open`: Pending - `finished`: Completed | [optional] [readonly] +**contract** | **str** | Futures contract | +**size** | **str** | Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. | +**iceberg** | **str** | Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. | [optional] +**price** | **str** | Required. Order Price; a price of 0 with `tif` as `ioc` represents a market order. | +**close** | **bool** | Set as `true` to close the position, with `size` set to 0 | [optional] [default to False] +**is_close** | **bool** | Is the order to close position | [optional] [readonly] +**reduce_only** | **bool** | Set as `true` to be reduce-only order | [optional] [default to False] +**is_reduce_only** | **bool** | Is the order reduce-only | [optional] [readonly] +**is_liq** | **bool** | Is the order for liquidation | [optional] [readonly] +**tif** | **str** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none | [optional] [default to 'gtc'] +**left** | **str** | Unfilled quantity | [optional] [readonly] +**fill_price** | **str** | Fill price | [optional] [readonly] +**text** | **str** | Custom order information. If not empty, must follow the rules below: 1. Prefixed with `t-` 2. No longer than 28 bytes without `t-` prefix 3. Can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) In addition to user-defined information, the following are internal reserved fields that identify the order source: - web: Web - api: API call - app: Mobile app - auto_deleveraging: Automatic deleveraging - liquidation: Forced liquidation of positions under the old classic mode - liq-xxx: a. Forced liquidation of positions under the new classic mode, including isolated margin, one-way cross margin, and non-hedged positions under two-way cross margin. b. Forced liquidation of isolated positions under the unified account single-currency margin mode - hedge-liq-xxx: Forced liquidation of hedged positions under the new classic mode two-way cross margin, i.e., simultaneously closing long and short positions - pm_liquidate: Forced liquidation under unified account multi-currency margin mode - comb_margin_liquidate: Forced liquidation under unified account portfolio margin mode - scm_liquidate: Forced liquidation of positions under unified account single-currency margin mode - insurance: Insurance - clear: Contract delisting withdrawal | [optional] +**tkfr** | **str** | Taker fee | [optional] [readonly] +**mkfr** | **str** | Maker fee | [optional] [readonly] +**refu** | **int** | Referrer user ID | [optional] [readonly] +**auto_size** | **str** | Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 | [optional] +**stp_id** | **int** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly] +**stp_act** | **str** | Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies 1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy. 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter. 3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-' - cn: Cancel newest, cancel new orders and keep old ones - co: Cancel oldest, cancel old orders and keep new ones - cb: Cancel both, both old and new orders will be cancelled | [optional] +**amend_text** | **str** | The custom data that the user remarked when amending the order | [optional] [readonly] +**pid** | **int** | Position ID | [optional] +**market_order_slip_ratio** | **str** | Custom maximum slippage rate for market orders. If not provided, the default contract settings will be used | [optional] +**pos_margin_mode** | **str** | Position Margin Mode isolated - Isolated Margin, cross - Cross Margin, only passed in simple split position mode | [optional] +**tpsl_tp_trigger_price** | **str** | Take profit price | [optional] +**tpsl_sl_trigger_price** | **str** | Stop loss price | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FuturesPositionCrossMode.md b/docs/FuturesPositionCrossMode.md index 65b0f1d1..2b2e089b 100644 --- a/docs/FuturesPositionCrossMode.md +++ b/docs/FuturesPositionCrossMode.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mode** | **str** | Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode | +**mode** | **str** | Cross/isolated margin mode. ISOLATED - isolated margin, CROSS - cross margin | **contract** | **str** | Futures market | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesPremiumIndex.md b/docs/FuturesPremiumIndex.md index 91041efd..8060acd4 100644 --- a/docs/FuturesPremiumIndex.md +++ b/docs/FuturesPremiumIndex.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **t** | **float** | Unix timestamp in seconds | [optional] **c** | **str** | Close price | [optional] -**h** | **str** | Highest price | [optional] -**l** | **str** | Lowest price | [optional] +**h** | **str** | High price | [optional] +**l** | **str** | Low price | [optional] **o** | **str** | Open price | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesPriceTriggeredOrder.md b/docs/FuturesPriceTriggeredOrder.md index d28e9803..be14fe88 100644 --- a/docs/FuturesPriceTriggeredOrder.md +++ b/docs/FuturesPriceTriggeredOrder.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **initial** | [**FuturesInitialOrder**](FuturesInitialOrder.md) | | **trigger** | [**FuturesPriceTrigger**](FuturesPriceTrigger.md) | | **id** | **int** | Auto order ID | [optional] [readonly] +**id_string** | **str** | String form of the auto order ID; the same order as numeric `id`, as the decimal string of `id` to avoid int64 precision loss in JavaScript and similar environments. Prefer this field to display the order ID or when a string unique identifier is needed; one-to-one with `id`. Same meaning as the field of the same name in futures price-trigger REST APIs and in `futures.orders` / `futures.autoorders` WebSocket pushes. | [optional] [readonly] **user** | **int** | User ID | [optional] [readonly] **create_time** | **float** | Created time | [optional] [readonly] **finish_time** | **float** | End time | [optional] [readonly] @@ -16,6 +17,7 @@ Name | Type | Description | Notes **reason** | **str** | Additional description of how the order was completed | [optional] [readonly] **order_type** | **str** | Types of take-profit and stop-loss orders, including: - `close-long-order`: Order take-profit/stop-loss, close long position - `close-short-order`: Order take-profit/stop-loss, close short position - `close-long-position`: Position take-profit/stop-loss, used to close all long positions - `close-short-position`: Position take-profit/stop-loss, used to close all short positions - `plan-close-long-position`: Position plan take-profit/stop-loss, used to close all or partial long positions - `plan-close-short-position`: Position plan take-profit/stop-loss, used to close all or partial short positions The two types of order take-profit/stop-loss are read-only and cannot be passed in requests | [optional] **me_order_id** | **int** | Corresponding order ID for order take-profit/stop-loss orders | [optional] [readonly] +**pos_margin_mode** | **str** | Position margin mode: `isolated` (isolated margin) or `cross` (cross margin). Returned by the server in simple split-position mode; when writing, use only the values below. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesUpdatePriceTriggeredOrder.md b/docs/FuturesUpdatePriceTriggeredOrder.md index c9d997ef..197e84e9 100644 --- a/docs/FuturesUpdatePriceTriggeredOrder.md +++ b/docs/FuturesUpdatePriceTriggeredOrder.md @@ -4,14 +4,15 @@ Modify Price Order Details ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**settle** | **str** | Settlement Currency (e.g., USDT, BTC) | [optional] [readonly] -**order_id** | **int** | ID of the Pending Take-Profit/Stop-Loss Trigger Order | [optional] [readonly] -**contact** | **str** | The order ID of the modified price-triggered order. This ID is returned upon successful creation of the price-triggered order. Note: This ID must be passed in both the request path and request body. | [optional] +**settle** | **str** | Settlement Currency (e.g., USDT, BTC) | [optional] +**order_id** | **int** | ID of the Pending Take-Profit/Stop-Loss Trigger Order | **size** | **int** | Modified Contract Quantity. Full Close: 0; Partial Close: Positive/Negative values indicate direction (consistent with the creation interface logic). | [optional] +**amount** | **str** | Same as `size`; used for decimal contract size. When both `size` and `amount` are provided, `amount` takes precedence. | [optional] **price** | **str** | Represents the modified trading price. A value of 0 indicates a market order. | [optional] **trigger_price** | **str** | Modified Trigger Price | [optional] **price_type** | **int** | Reference price type. 0 - Latest trade price, 1 - Mark price, 2 - Index price | [optional] **auto_size** | **str** | One-way Mode: auto_size is not required Hedge Mode partial closing (size≠0): auto_size is not required Hedge Mode full closing (size=0): auto_size must be set, close_long for closing long positions, close_short for closing short positions | [optional] +**close** | **bool** | When fully closing a position in single-position mode, close must be set to true to execute the close operation. When partially closing a position in single-position mode or in dual-position mode, close can be left unset or set to false. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GateErrorResponse.md b/docs/GateErrorResponse.md new file mode 100644 index 00000000..1fc4dbed --- /dev/null +++ b/docs/GateErrorResponse.md @@ -0,0 +1,12 @@ +# GateErrorResponse + +error response body format when status code is non-2xx +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Error label | [optional] +**message** | **str** | Detailed error message | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetBeginnerTaskListError.md b/docs/GetBeginnerTaskListError.md new file mode 100644 index 00000000..f6f2048b --- /dev/null +++ b/docs/GetBeginnerTaskListError.md @@ -0,0 +1,11 @@ +# GetBeginnerTaskListError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Error identifier code | [optional] +**message** | **str** | Error details | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetChaseOrderDetailResp.md b/docs/GetChaseOrderDetailResp.md new file mode 100644 index 00000000..296e128a --- /dev/null +++ b/docs/GetChaseOrderDetailResp.md @@ -0,0 +1,10 @@ +# GetChaseOrderDetailResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order** | [**ChaseOrder**](ChaseOrder.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetChaseOrdersResp.md b/docs/GetChaseOrdersResp.md new file mode 100644 index 00000000..f7bad4f8 --- /dev/null +++ b/docs/GetChaseOrdersResp.md @@ -0,0 +1,10 @@ +# GetChaseOrdersResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orders** | [**list[ChaseOrder]**](ChaseOrder.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetChatsListRequest.md b/docs/GetChatsListRequest.md new file mode 100644 index 00000000..a4f7049f --- /dev/null +++ b/docs/GetChatsListRequest.md @@ -0,0 +1,13 @@ +# GetChatsListRequest + +Get chat history request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**txid** | **int** | Order ID; omit or `0` to return the latest order with chat for the user. | [optional] +**lastreceived** | **int** | Timestamp of the last received message for backward incremental fetch; omit on first load. | [optional] +**firstreceived** | **int** | Timestamp of first received message for paging backward; omit on first load. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetCompletedTransactionListRequest.md b/docs/GetCompletedTransactionListRequest.md new file mode 100644 index 00000000..717c2f05 --- /dev/null +++ b/docs/GetCompletedTransactionListRequest.md @@ -0,0 +1,20 @@ +# GetCompletedTransactionListRequest + +Get completed/historical transaction list request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**crypto_currency** | **str** | Cryptocurrency symbol. | +**fiat_currency** | **str** | Fiat currency | +**select_type** | **str** | Order side filter: `buy` buy orders; `sell` sell orders; empty: all. | [optional] +**status** | **str** | Order status filter. `closed`: filled (`ACCEPT`, `BCLOSED`); `cancel`: canceled (`CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`); `locked`: locked (`LOCKED`); `open`: unpaid (`OPEN`); `paid`: paid (`PAID`); `completed`: finished or canceled (`CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`, `ACCEPT`, `BCLOSED`); Empty or omitted uses the endpoint default range. | [optional] +**txid** | **int** | Order ID | [optional] +**start_time** | **int** | Start timestamp, default is 00:00 89 days ago | [optional] +**end_time** | **int** | End timestamp, default is 23:59:59 today | [optional] +**query_dispute** | **int** | Whether to flag dispute status in the response. `1`: yes; `0`: no. | [optional] +**page** | **int** | Page number starting at 1; values below 1 are treated as 1. | [optional] +**per_page** | **int** | Orders per page; default 10, max 200. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetCounterpartyUserInfoRequest.md b/docs/GetCounterpartyUserInfoRequest.md new file mode 100644 index 00000000..b5be266e --- /dev/null +++ b/docs/GetCounterpartyUserInfoRequest.md @@ -0,0 +1,11 @@ +# GetCounterpartyUserInfoRequest + +Get counterparty user info request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**biz_uid** | **str** | Counterparty crypto UID from order list or detail field `its_uid`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetMyActivityEntryResponse.md b/docs/GetMyActivityEntryResponse.md new file mode 100644 index 00000000..4ac58281 --- /dev/null +++ b/docs/GetMyActivityEntryResponse.md @@ -0,0 +1,13 @@ +# GetMyActivityEntryResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response status code, 0 means success | +**message** | **str** | 响应消息,成功时为 \"success\" | +**data** | [**GetMyActivityEntryResponseData**](GetMyActivityEntryResponseData.md) | | +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetMyActivityEntryResponseData.md b/docs/GetMyActivityEntryResponseData.md new file mode 100644 index 00000000..ea452a19 --- /dev/null +++ b/docs/GetMyActivityEntryResponseData.md @@ -0,0 +1,16 @@ +# GetMyActivityEntryResponseData + +Activity entry data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**icon_url** | **str** | Activity entry icon URL (light mode) | +**icon_url_dark** | **str** | Activity entry icon URL (dark mode) | +**source_type** | **str** | Source type, e.g., activity for campaign | +**title** | **str** | Activity entry title | +**url_type** | **str** | Redirect link type, e.g., h5 for H5 page | +**url** | **str** | Activity entry redirect URL | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetMyselfPaymentRequest.md b/docs/GetMyselfPaymentRequest.md new file mode 100644 index 00000000..1c27a5b7 --- /dev/null +++ b/docs/GetMyselfPaymentRequest.md @@ -0,0 +1,11 @@ +# GetMyselfPaymentRequest + +Get payment method list request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fiat** | **str** | Fiat currency; omit to return all available payment methods. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetPendingTransactionListRequest.md b/docs/GetPendingTransactionListRequest.md new file mode 100644 index 00000000..3aeff58d --- /dev/null +++ b/docs/GetPendingTransactionListRequest.md @@ -0,0 +1,18 @@ +# GetPendingTransactionListRequest + +Get pending transaction list request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**crypto_currency** | **str** | Cryptocurrency symbol. | +**fiat_currency** | **str** | Fiat currency | +**order_tab** | **str** | Order tab: `pending` in progress (`OPEN`, `PAID`, `LOCKED`, `TEMP`); `dispute` in dispute; default `pending`. | [optional] +**select_type** | **str** | Order side filter: `buy` buy orders; `sell` sell orders; empty: all. | [optional] +**status** | **str** | Order status filter. `open` unpaid (`OPEN`); `paid` paid (`PAID`); `locked` locked (`LOCKED`); `dispute` in dispute; empty or omitted uses the default range for `order_tab`. | [optional] +**txid** | **int** | Order ID | [optional] +**start_time** | **int** | Start timestamp, default is 00:00 89 days ago | [optional] +**end_time** | **int** | End timestamp, default is 23:59:59 today | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetTransactionDetailsRequest.md b/docs/GetTransactionDetailsRequest.md new file mode 100644 index 00000000..494b6179 --- /dev/null +++ b/docs/GetTransactionDetailsRequest.md @@ -0,0 +1,12 @@ +# GetTransactionDetailsRequest + +Get transaction details request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**txid** | **int** | Order ID | +**channel** | **str** | Channel tag: omit or empty for normal P2P; use `web3` for Web3 orders. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetUserCouponDetailResponse.md b/docs/GetUserCouponDetailResponse.md new file mode 100644 index 00000000..6f461f9c --- /dev/null +++ b/docs/GetUserCouponDetailResponse.md @@ -0,0 +1,13 @@ +# GetUserCouponDetailResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response code. `0` = success; `2002` = user not logged in; `50105` = parameter validation failed; `10001` = coupon record does not exist or does not belong to current user; `10000` = invalid parameter (e.g., task coupon missing coupon_info) | [optional] +**label** | **str** | Error identifier code. Empty string on success, machine-readable error label on error | [optional] +**message** | **str** | | [optional] +**data** | [**GetUserCouponDetailResponseData**](GetUserCouponDetailResponseData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetUserCouponDetailResponseData.md b/docs/GetUserCouponDetailResponseData.md new file mode 100644 index 00000000..304103ff --- /dev/null +++ b/docs/GetUserCouponDetailResponseData.md @@ -0,0 +1,37 @@ +# GetUserCouponDetailResponseData + +Returns coupon detail object when code=0; empty object {} otherwise +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Coupon distribution record ID (coupon_send_issuing_log.id) | [optional] +**details_id** | **int** | User coupon detail table primary key (separate table per type). This field is 0 for task coupons | [optional] +**coupon_type** | **str** | Coupon type, enum values same as the `coupon_type` parameter | [optional] +**name** | **str** | Coupon display name (i18n translated) | [optional] +**amount** | **str** | Coupon denomination (formatted string with thousand separators). Meaning by type: point card = balance, interest rate boost coupon = rate percentage (e.g., '5%'), VIP trial card = VIP level number, position voucher = face value x leverage, others = face value | [optional] +**origin_amount** | **str** | Original denomination (string with trailing zeros removed). Only returned for point card type, other types do not have this field | [optional] +**currency** | **str** | Denomination unit. Point card = 'POINT', interest rate boost coupon = 'APR', VIP trial card = 'VIP', Alpha cash coupon = base currency, others = uppercase currency symbol (e.g., 'USDT'/'GT') | [optional] +**rule_new** | **str** | Coupon usage rule text (i18n translated). Only has value in the detail endpoint, fixed as empty string in the list endpoint | [optional] +**status** | **str** | Coupon status. Regular coupon: NOT_ACTIVE (pending activation), ACTIVATED (activated), TO_BE_USED (to be used), EXPIRED (expired), RECYCLED (recycled), INVALID (invalidated), USED (used), UNKNOWN (unknown), LOCKED (locked, P2P only). Task coupon: TASK_START (task not started), TASK_WAIT (task in progress), TASK_DONE (task completed, processing), TASK_EXPIRED (task not completed, expired), TASK_NOT_STARTED_EXPIRED (not started, expired), TASK_RECEIVE_SUCCESS (reward claimed successfully), TASK_RECEIVE_FAIL (reward claim failed) | [optional] +**jump_url** | [**ListUserCouponsResponseDataJumpUrl**](ListUserCouponsResponseDataJumpUrl.md) | | [optional] +**help_url** | [**ListUserCouponsResponseDataHelpUrl**](ListUserCouponsResponseDataHelpUrl.md) | | [optional] +**expire_time** | **int** | Expiration time (Unix timestamp). Some types replace this with actual expiration time after activation/use. Point card type returns 0. Rules by type: cash=not_received_expired_timest; contract_bonus=uses expired_timest after activation/use; contract_bonus_new=always uses expired_timest; position_voucher/tradfi_position_voucher=uses expire_time after use; robot_bonus=not_received_expired_timest; commission_rebate=uses use_deadline after use; crypto_loan_interest=not_using_expired_timest; copy_trading=not_using_expired_timest; alpha_voucher=not_received_expired_timest; etf_voucher=not_using_expired_timest | [optional] +**expire_time_order_by** | **int** | Sorting expiration time (from the original expiration time of the distribution record, unaffected by activation) | [optional] +**expire_second** | **int** | Seconds remaining until expiration, returns 0 if expired or point card type | [optional] +**has_usage_history** | **bool** | Whether there is a usage history. Fixed as true for point card type, determined by type for others | [optional] +**has_progress** | **bool** | Whether to display a progress bar. Only true for commission_rebate, interest_voucher, and qualifying task coupons | [optional] +**progress_config** | [**ListUserCouponsResponseDataProgressConfig**](ListUserCouponsResponseDataProgressConfig.md) | | [optional] +**activation_info** | [**object**](.md) | Type-specific activation information. Types without specific fields return empty object {}. Fields by type: interest_voucher={supported_pairs (applicable trading pairs), transaction_type}; contract_bonus_new={received_expired_hour (valid hours after activation)}; contract_bonus={check_unified_account_mode, received_expired_days (valid days after activation), abtest}; commission_rebate={market (spot/margin/futures/alpha/etf/tradfi), market_name (market display name)}; robot_bonus={designated_bots (ENABLED = designated strategies only / DISABLED = unrestricted)}; position_voucher={symbols (applicable trading pairs, empty = unrestricted), leverage, need_user_funds (0 = no user funds required / 1 = user funds required), user_funds_amount, position_bonus (original face value)}; tradfi_position_voucher={symbols, leverage, position_bonus}; etf_voucher={currency_markets (ETF market list, comma-separated), amount (original face value)} | [optional] +**is_task_coupon** | **int** | Whether it is a task coupon. `0` = regular coupon; `1` = task coupon | [optional] +**upgrade_toast** | **bool** | Whether to prompt the user to upgrade the App (true when the app version is too old to support the coupon) | [optional] +**from_task** | **bool** | [Detail endpoint only] Whether this regular coupon was obtained by completing a task (a sub-coupon automatically issued after task completion). Regular coupons may be true, task coupons are always false | [optional] +**task_title** | **str** | Task title. Task coupons have value; regular coupons return empty string (but task_title is not assigned when from_task=true) | [optional] +**task_desc** | **str** | Task description. Task coupons have value; regular coupons return empty string | [optional] +**task_start_at** | **int** | Task start timestamp (Unix). Task coupon: has value when in TASK_EXPIRED status, otherwise 0; regular coupon (from_task=true): start time of the source task | [optional] +**task_expire_at** | **int** | Task validity expiration timestamp (Unix). Task coupon: claim validity deadline (0 means unlimited); regular coupon: fixed at 0 | [optional] +**task_completed_at** | **int** | Task completion timestamp (Unix). Task coupon: task completion time (0 means not completed); regular coupon (from_task=true): completion time of the source task | [optional] +**extra** | **list[list[object]]** | [Detail endpoint only] Coupon detail attributes organized by display blocks. The frontend renders them as separate sections. Point card type always returns empty array []. Other types return a 2D array composed of blocks: block 1 = coupon name/source/status, block 2 = coupon core attributes, block 3 = time information. Each item contains: type (display type: string/timestamp/day/hour/status/btn), key (label text, i18n translated), value (string or integer, timestamp type is Unix timestamp) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetUserIdentityError.md b/docs/GetUserIdentityError.md new file mode 100644 index 00000000..5bae91e4 --- /dev/null +++ b/docs/GetUserIdentityError.md @@ -0,0 +1,11 @@ +# GetUserIdentityError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Error identifier code | [optional] +**message** | **str** | Error details | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/I18nTxt.md b/docs/I18nTxt.md new file mode 100644 index 00000000..500ac6e3 --- /dev/null +++ b/docs/I18nTxt.md @@ -0,0 +1,11 @@ +# I18nTxt + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lang** | **str** | | [optional] +**value** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InfiniteGridCreateParams.md b/docs/InfiniteGridCreateParams.md new file mode 100644 index 00000000..a1471fc9 --- /dev/null +++ b/docs/InfiniteGridCreateParams.md @@ -0,0 +1,20 @@ +# InfiniteGridCreateParams + +Infinite grid creation parameters. Aligned with the app: **`money`**, **`price_floor`**, and **`profit_per_grid`** are required; `grid_num` and `price_type` are optional (defaults applied server-side when omitted). +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**money** | **str** | | +**price_floor** | **str** | price floor | +**profit_per_grid** | **str** | Profit per square | +**grid_num** | **int** | Optional; may be omitted like in the app. | [optional] +**price_type** | **int** | Optional. `0` arithmetic grid; `1` geometric; omit for server defaults. | [optional] +**trigger_price** | **str** | | [optional] +**stop_profit** | **str** | | [optional] +**stop_loss** | **str** | | [optional] +**profit_sharing_ratio** | **str** | | [optional] +**is_use_base** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CollateralLoanCurrency.md b/docs/InfiniteGridCreateRequest.md similarity index 54% rename from docs/CollateralLoanCurrency.md rename to docs/InfiniteGridCreateRequest.md index fc4151ae..6da191d2 100644 --- a/docs/CollateralLoanCurrency.md +++ b/docs/InfiniteGridCreateRequest.md @@ -1,11 +1,12 @@ -# CollateralLoanCurrency +# InfiniteGridCreateRequest -Supported borrowing and collateral currencies +Create the request body for the infinite grid policy. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**loan_currency** | **str** | Borrowed currency | [optional] -**collateral_currency** | **list[str]** | List of supported collateral currencies | [optional] +**strategy_type** | **str** | | +**market** | **str** | | +**create_params** | [**InfiniteGridCreateParams**](InfiniteGridCreateParams.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InlineResponse200.md b/docs/InlineResponse200.md index 30030f57..dcfe8c63 100644 --- a/docs/InlineResponse200.md +++ b/docs/InlineResponse200.md @@ -3,8 +3,14 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**time** | **int** | | [optional] -**value** | **str** | | [optional] +**exchange_type** | **str** | Exchange | [optional] +**spot_maker_fee** | **str** | spotMakerfee rate | +**spot_taker_fee** | **str** | spotTakerfee rate | +**spot_rpi_maker_fee** | **str** | Spot RPI order maker fee rate | [optional] +**future_maker_fee** | **str** | contractMakerfee rate | +**future_taker_fee** | **str** | contractTakerfee rate | +**future_rpi_maker_fee** | **str** | Futures RPI order maker fee rate | [optional] +**special_fee_list** | [**list[CrossexSpecialFee]**](CrossexSpecialFee.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InlineResponse2001.md b/docs/InlineResponse2001.md index 7f7e72a3..c93c8972 100644 --- a/docs/InlineResponse2001.md +++ b/docs/InlineResponse2001.md @@ -3,8 +3,18 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**currency** | **str** | | [optional] -**est_rate** | **str** | Estimated Annualized Rate, e.g., `est_rate`: `0.8014` represents an annualized rate of 80.14% | [optional] +**symbol** | **str** | Trading Pair | +**last_price** | **str** | Last price | [optional] +**open_24h** | **str** | 24-hour opening price | [optional] +**low_24h** | **str** | 24h Low | [optional] +**high_24h** | **str** | 24h High | [optional] +**volume_24h_base** | **str** | 24-hour trading volume in base currency | [optional] +**volume_24h_quote** | **str** | 24-hour trading volume in quote currency | [optional] +**mark_price** | **str** | Mark price | [optional] +**index_price** | **str** | Index price | [optional] +**open_interest** | **str** | Open interest | [optional] +**open_interest_quote** | **str** | Open interest (in quote currency) | [optional] +**timestamp** | **str** | Update timestamp | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InlineResponse2002.md b/docs/InlineResponse2002.md new file mode 100644 index 00000000..4670cb11 --- /dev/null +++ b/docs/InlineResponse2002.md @@ -0,0 +1,13 @@ +# InlineResponse2002 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Currency | +**funding_rate** | **str** | Funding rate | +**funding_interval** | **str** | Tier | +**funding_time** | **str** | Next funding time | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Klines.md b/docs/Klines.md new file mode 100644 index 00000000..ee03e8fe --- /dev/null +++ b/docs/Klines.md @@ -0,0 +1,11 @@ +# Klines + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**KlinesData**](KlinesData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/KlinesData.md b/docs/KlinesData.md new file mode 100644 index 00000000..1b30504a --- /dev/null +++ b/docs/KlinesData.md @@ -0,0 +1,11 @@ +# KlinesData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[KlinesDataList]**](KlinesDataList.md) | Kline data list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/KlinesDataList.md b/docs/KlinesDataList.md new file mode 100644 index 00000000..c2768ace --- /dev/null +++ b/docs/KlinesDataList.md @@ -0,0 +1,15 @@ +# KlinesDataList + +Single kline data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**o** | **str** | Open price | [optional] +**c** | **str** | Close price | [optional] +**h** | **str** | High price | [optional] +**l** | **str** | Low price | [optional] +**t** | **int** | Timestamp (Unix seconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LadderApr.md b/docs/LadderApr.md new file mode 100644 index 00000000..d80a4a7d --- /dev/null +++ b/docs/LadderApr.md @@ -0,0 +1,12 @@ +# LadderApr + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apr** | **str** | Annualized interest rate | +**left** | **str** | Range lower limit | +**right** | **str** | Range upper limit | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LeverageFailedCurrencies.md b/docs/LeverageFailedCurrencies.md new file mode 100644 index 00000000..7de2a115 --- /dev/null +++ b/docs/LeverageFailedCurrencies.md @@ -0,0 +1,12 @@ +# LeverageFailedCurrencies + +List of currencies for which the leverage update failed +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency for which the update failed | [optional] +**reason** | **str** | Reason the leverage update failed | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListActivitiesResponse.md b/docs/ListActivitiesResponse.md new file mode 100644 index 00000000..55d7fb2e --- /dev/null +++ b/docs/ListActivitiesResponse.md @@ -0,0 +1,13 @@ +# ListActivitiesResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response status code, 0 means success | +**message** | **str** | 响应消息,成功时为 \"success\" | +**data** | [**ListActivitiesResponseData**](ListActivitiesResponseData.md) | | +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListActivitiesResponseData.md b/docs/ListActivitiesResponseData.md new file mode 100644 index 00000000..ce92bc1a --- /dev/null +++ b/docs/ListActivitiesResponseData.md @@ -0,0 +1,16 @@ +# ListActivitiesResponseData + +Activity list data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[ListActivitiesResponseDataList]**](ListActivitiesResponseDataList.md) | Activity list | +**page** | **int** | Current page number | +**page_size** | **int** | Items per page | +**page_count** | **int** | Total pages | +**total_count** | **int** | Total Records | +**url** | **str** | Activity Center page link | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListActivitiesResponseDataList.md b/docs/ListActivitiesResponseDataList.md new file mode 100644 index 00000000..7df803fe --- /dev/null +++ b/docs/ListActivitiesResponseDataList.md @@ -0,0 +1,29 @@ +# ListActivitiesResponseDataList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Activity ID | +**type_id** | **int** | Activity type ID | +**type_name** | **str** | Activity type name | +**competition_name** | **str** | Activity name | +**start_at** | **int** | Activity start time (Unix timestamp, in seconds) | +**end_at** | **int** | Activity end time (Unix timestamp, in seconds) | +**img** | **str** | Activity image URL (light mode) | +**img_dark** | **str** | Activity image URL (dark mode) | +**url** | **str** | Activity redirect link | +**hot** | **int** | Popularity score | +**master_one_line** | **str** | Main title first line | +**master_two_line** | **str** | Main title second line | +**slave_one_line** | **str** | Subtitle first line | +**slave_two_line** | **str** | Subtitle second line | +**competition_title** | **str** | Activity title | +**top_id** | **int** | Pin ID, 0 means not pinned | +**parent_id** | **int** | Parent activity ID, 0 means no parent activity | +**new_img** | **str** | New activity image URL (light mode) | +**new_img_dark** | **str** | New activity image URL (dark mode) | +**tag** | **list[str]** | Activity tag list | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListActivityTypesResponse.md b/docs/ListActivityTypesResponse.md new file mode 100644 index 00000000..120e904f --- /dev/null +++ b/docs/ListActivityTypesResponse.md @@ -0,0 +1,13 @@ +# ListActivityTypesResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response status code, 0 means success | +**message** | **str** | 响应消息,成功时为 \"success\" | +**data** | [**ListActivityTypesResponseData**](ListActivityTypesResponseData.md) | | +**timestamp** | **int** | Server timestamp (milliseconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListActivityTypesResponseData.md b/docs/ListActivityTypesResponseData.md new file mode 100644 index 00000000..5acb5411 --- /dev/null +++ b/docs/ListActivityTypesResponseData.md @@ -0,0 +1,11 @@ +# ListActivityTypesResponseData + +Activity type data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[ListActivityTypesResponseDataList]**](ListActivityTypesResponseDataList.md) | Activity type list | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListActivityTypesResponseDataList.md b/docs/ListActivityTypesResponseDataList.md new file mode 100644 index 00000000..08af8ef9 --- /dev/null +++ b/docs/ListActivityTypesResponseDataList.md @@ -0,0 +1,11 @@ +# ListActivityTypesResponseDataList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Activity type ID | +**name** | **str** | Activity type name | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListEarnFixedTermHistoryResponse.md b/docs/ListEarnFixedTermHistoryResponse.md new file mode 100644 index 00000000..0787cbbf --- /dev/null +++ b/docs/ListEarnFixedTermHistoryResponse.md @@ -0,0 +1,13 @@ +# ListEarnFixedTermHistoryResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Return code, 0 means success | [optional] +**message** | **str** | Response message | [optional] +**data** | [**ListEarnFixedTermHistoryResponseData**](ListEarnFixedTermHistoryResponseData.md) | | [optional] +**timestamp** | **int** | Response timestamp (in seconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListEarnFixedTermHistoryResponseData.md b/docs/ListEarnFixedTermHistoryResponseData.md new file mode 100644 index 00000000..804cc636 --- /dev/null +++ b/docs/ListEarnFixedTermHistoryResponseData.md @@ -0,0 +1,11 @@ +# ListEarnFixedTermHistoryResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[FixedTermHistoryRecord]**](FixedTermHistoryRecord.md) | | [optional] +**total** | **int** | Total Records | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListEarnFixedTermLendsResponse.md b/docs/ListEarnFixedTermLendsResponse.md new file mode 100644 index 00000000..5aaa458c --- /dev/null +++ b/docs/ListEarnFixedTermLendsResponse.md @@ -0,0 +1,13 @@ +# ListEarnFixedTermLendsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Return code, 0 means success | +**message** | **str** | Response message | +**data** | [**ListEarnFixedTermLendsResponseData**](ListEarnFixedTermLendsResponseData.md) | | +**timestamp** | **int** | Response timestamp (in seconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListEarnFixedTermLendsResponseData.md b/docs/ListEarnFixedTermLendsResponseData.md new file mode 100644 index 00000000..af56e0df --- /dev/null +++ b/docs/ListEarnFixedTermLendsResponseData.md @@ -0,0 +1,12 @@ +# ListEarnFixedTermLendsResponseData + +Subscription order list data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[FixedTermLendOrder]**](FixedTermLendOrder.md) | Subscription order list | +**total** | **int** | Total Records | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListEarnFixedTermProductsByAssetResponse.md b/docs/ListEarnFixedTermProductsByAssetResponse.md new file mode 100644 index 00000000..198fe6df --- /dev/null +++ b/docs/ListEarnFixedTermProductsByAssetResponse.md @@ -0,0 +1,13 @@ +# ListEarnFixedTermProductsByAssetResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Return code, 0 means success | +**message** | **str** | Response message | +**data** | [**ListEarnFixedTermProductsByAssetResponseData**](ListEarnFixedTermProductsByAssetResponseData.md) | | +**timestamp** | **int** | Response timestamp (in seconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListEarnFixedTermProductsByAssetResponseData.md b/docs/ListEarnFixedTermProductsByAssetResponseData.md new file mode 100644 index 00000000..006260d9 --- /dev/null +++ b/docs/ListEarnFixedTermProductsByAssetResponseData.md @@ -0,0 +1,11 @@ +# ListEarnFixedTermProductsByAssetResponseData + +Product list data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[FixedTermProductSimple]**](FixedTermProductSimple.md) | Product list | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListEarnFixedTermProductsResponse.md b/docs/ListEarnFixedTermProductsResponse.md new file mode 100644 index 00000000..416c122a --- /dev/null +++ b/docs/ListEarnFixedTermProductsResponse.md @@ -0,0 +1,13 @@ +# ListEarnFixedTermProductsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Return code, 0 means success | +**message** | **str** | Response message | +**data** | [**ListEarnFixedTermProductsResponseData**](ListEarnFixedTermProductsResponseData.md) | | +**timestamp** | **int** | Response timestamp (in seconds) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListEarnFixedTermProductsResponseData.md b/docs/ListEarnFixedTermProductsResponseData.md new file mode 100644 index 00000000..5beb8d59 --- /dev/null +++ b/docs/ListEarnFixedTermProductsResponseData.md @@ -0,0 +1,12 @@ +# ListEarnFixedTermProductsResponseData + +Product list data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[FixedTermProduct]**](FixedTermProduct.md) | Product list | +**total** | **int** | Total Records | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListLiveReplayError.md b/docs/ListLiveReplayError.md new file mode 100644 index 00000000..a40bae40 --- /dev/null +++ b/docs/ListLiveReplayError.md @@ -0,0 +1,11 @@ +# ListLiveReplayError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Error identifier code | [optional] +**message** | **str** | Error details | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListLiveReplayResponse.md b/docs/ListLiveReplayResponse.md new file mode 100644 index 00000000..bd6ae04b --- /dev/null +++ b/docs/ListLiveReplayResponse.md @@ -0,0 +1,14 @@ +# ListLiveReplayResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Status code, 200 = success | [optional] +**label** | **str** | Status label | [optional] +**message** | **str** | Status message | [optional] +**request_id** | **str** | Request ID | [optional] +**data** | [**ListLiveReplayResponseData**](ListLiveReplayResponseData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListLiveReplayResponseData.md b/docs/ListLiveReplayResponseData.md new file mode 100644 index 00000000..f782ec57 --- /dev/null +++ b/docs/ListLiveReplayResponseData.md @@ -0,0 +1,10 @@ +# ListLiveReplayResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[ListLiveReplayResponseDataList]**](ListLiveReplayResponseDataList.md) | Live stream/replay list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListLiveReplayResponseDataList.md b/docs/ListLiveReplayResponseDataList.md new file mode 100644 index 00000000..630dbe00 --- /dev/null +++ b/docs/ListLiveReplayResponseDataList.md @@ -0,0 +1,12 @@ +# ListLiveReplayResponseDataList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content_type** | **str** | Content type: streaming = live broadcast, video = replay video | [optional] +**live** | [**ListLiveReplayResponseDataLive**](ListLiveReplayResponseDataLive.md) | | [optional] +**video** | [**ListLiveReplayResponseDataVideo**](ListLiveReplayResponseDataVideo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListLiveReplayResponseDataLive.md b/docs/ListLiveReplayResponseDataLive.md new file mode 100644 index 00000000..68ebe629 --- /dev/null +++ b/docs/ListLiveReplayResponseDataLive.md @@ -0,0 +1,22 @@ +# ListLiveReplayResponseDataLive + +Live stream information (has value when content_type=streaming) +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Live ID | [optional] +**uid** | **str** | Anchor User ID | [optional] +**chat_group_id** | **str** | Chat group ID | [optional] +**name** | **str** | Live room name | [optional] +**cover** | **str** | Cover image URL | [optional] +**started_at** | **str** | Broadcast start time (Unix timestamp string) | [optional] +**subscription_required** | **bool** | Whether subscription is required | [optional] +**hot_weight** | **int** | Popularity weight | [optional] +**live_type** | **int** | Live stream type | [optional] +**session_id** | **str** | Session ID | [optional] +**host** | [**ListLiveReplayResponseDataLiveHost**](ListLiveReplayResponseDataLiveHost.md) | | [optional] +**status** | **str** | Live stream status (e.g., streaming) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListLiveReplayResponseDataLiveHost.md b/docs/ListLiveReplayResponseDataLiveHost.md new file mode 100644 index 00000000..e566e501 --- /dev/null +++ b/docs/ListLiveReplayResponseDataLiveHost.md @@ -0,0 +1,15 @@ +# ListLiveReplayResponseDataLiveHost + +Streamer information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Streamer ID | [optional] +**name** | **str** | Streamer nickname | [optional] +**avatar** | **str** | Streamer avatar URL | [optional] +**fans** | **int** | Follower count | [optional] +**tier** | **int** | Streamer level | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListLiveReplayResponseDataVideo.md b/docs/ListLiveReplayResponseDataVideo.md new file mode 100644 index 00000000..2998222e --- /dev/null +++ b/docs/ListLiveReplayResponseDataVideo.md @@ -0,0 +1,28 @@ +# ListLiveReplayResponseDataVideo + +Replay video information (has value when content_type=video) +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Video ID | [optional] +**stream_id** | **str** | Live stream ID | [optional] +**title** | **str** | Video Title | [optional] +**avatar** | **str** | Author avatar URL | [optional] +**nick** | **str** | Author nickname | [optional] +**nick_en** | **str** | Author English nickname | [optional] +**cover** | **str** | Cover image URL | [optional] +**watched** | **int** | Viewer count | [optional] +**subscription_required** | **bool** | Whether subscription is required | [optional] +**has_subscribed** | **bool** | Whether the current user has subscribed | [optional] +**duration** | **int** | Video duration (in seconds) | [optional] +**weight** | **int** | Sort weight | [optional] +**moments_uid** | **str** | Square user ID | [optional] +**session_id** | **str** | Session ID | [optional] +**ended_at_format** | **str** | End time format | [optional] +**ended_at_type** | **int** | End time type | [optional] +**tier** | **int** | Author level | [optional] +**tag** | **str** | Tag | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListSquareAiSearchError.md b/docs/ListSquareAiSearchError.md new file mode 100644 index 00000000..29e0eec1 --- /dev/null +++ b/docs/ListSquareAiSearchError.md @@ -0,0 +1,11 @@ +# ListSquareAiSearchError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Error identifier code | [optional] +**message** | **str** | Error details | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListSquareAiSearchResponse.md b/docs/ListSquareAiSearchResponse.md new file mode 100644 index 00000000..9d3f4f27 --- /dev/null +++ b/docs/ListSquareAiSearchResponse.md @@ -0,0 +1,13 @@ +# ListSquareAiSearchResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Status code, 0 = success | [optional] +**label** | **str** | Error identifier code. Empty string on success, machine-readable error label on error | [optional] +**msg** | **str** | Status message | [optional] +**data** | [**ListSquareAiSearchResponseData**](ListSquareAiSearchResponseData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListSquareAiSearchResponseData.md b/docs/ListSquareAiSearchResponseData.md new file mode 100644 index 00000000..27505c5d --- /dev/null +++ b/docs/ListSquareAiSearchResponseData.md @@ -0,0 +1,11 @@ +# ListSquareAiSearchResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total number of results | [optional] +**items** | [**list[ListSquareAiSearchResponseDataItems]**](ListSquareAiSearchResponseDataItems.md) | Search result list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListSquareAiSearchResponseDataItems.md b/docs/ListSquareAiSearchResponseDataItems.md new file mode 100644 index 00000000..f7b38201 --- /dev/null +++ b/docs/ListSquareAiSearchResponseDataItems.md @@ -0,0 +1,16 @@ +# ListSquareAiSearchResponseDataItems + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Post ID | [optional] +**content** | **str** | Post content | [optional] +**image** | **str** | First image URL | [optional] +**avatar** | **str** | Author avatar | [optional] +**nickname** | **str** | Author nickname | [optional] +**like_count** | **int** | Like count | [optional] +**page_view** | **int** | View count | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListUserCouponsResponse.md b/docs/ListUserCouponsResponse.md new file mode 100644 index 00000000..ce0b4529 --- /dev/null +++ b/docs/ListUserCouponsResponse.md @@ -0,0 +1,13 @@ +# ListUserCouponsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Response Code. `0` = Success; `2002` = User not logged in; `50105` = Input parameter validation failed | [optional] +**label** | **str** | Error identifier code. Empty string on success, machine-readable error label on error | [optional] +**message** | **str** | | [optional] +**data** | [**ListUserCouponsResponseData**](ListUserCouponsResponseData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListUserCouponsResponseData.md b/docs/ListUserCouponsResponseData.md new file mode 100644 index 00000000..75a9ae89 --- /dev/null +++ b/docs/ListUserCouponsResponseData.md @@ -0,0 +1,12 @@ +# ListUserCouponsResponseData + +Returned when code=0; empty object {} otherwise +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_page** | **bool** | Whether there is a next page. `true` means more data is available. Pass the `id` of the last record as `last_id` and `expire_time_order_by` as `expire_time` in the next request | [optional] +**list** | [**list[ListUserCouponsResponseDataList]**](ListUserCouponsResponseDataList.md) | Coupon object array, see field details below | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListUserCouponsResponseDataHelpUrl.md b/docs/ListUserCouponsResponseDataHelpUrl.md new file mode 100644 index 00000000..bdd7719b --- /dev/null +++ b/docs/ListUserCouponsResponseDataHelpUrl.md @@ -0,0 +1,12 @@ +# ListUserCouponsResponseDataHelpUrl + +Help Center Link +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**web** | **str** | Web Help Link | [optional] +**app** | **str** | App Help Link | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListUserCouponsResponseDataJumpUrl.md b/docs/ListUserCouponsResponseDataJumpUrl.md new file mode 100644 index 00000000..555185e2 --- /dev/null +++ b/docs/ListUserCouponsResponseDataJumpUrl.md @@ -0,0 +1,13 @@ +# ListUserCouponsResponseDataJumpUrl + +Redirect Link +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**web** | **str** | Web Redirect Link | [optional] +**app** | **str** | App Redirect Link | [optional] +**mini_app** | **str** | Mini Program Redirect Link (empty string for most types) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListUserCouponsResponseDataList.md b/docs/ListUserCouponsResponseDataList.md new file mode 100644 index 00000000..9cb2bc3e --- /dev/null +++ b/docs/ListUserCouponsResponseDataList.md @@ -0,0 +1,35 @@ +# ListUserCouponsResponseDataList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Coupon distribution record ID (coupon_send_issuing_log.id), used as `last_id` for cursor-based pagination | [optional] +**details_id** | **int** | User coupon detail table primary key (separate table per type). This field is 0 for task coupons, has value for regular coupons | [optional] +**coupon_type** | **str** | Coupon type, enum values same as the `type` parameter | [optional] +**name** | **str** | Coupon display name (i18n translated) | [optional] +**amount** | **str** | Coupon denomination (formatted string with thousand separators). Meaning by type: point card = balance, interest rate boost coupon = interest rate percentage (e.g., '5%'), VIP trial card = VIP level number, position voucher = face value × leverage, others = face value | [optional] +**origin_amount** | **str** | Original denomination (string with trailing zeros removed). Only returned for point card type, other types do not have this field | [optional] +**currency** | **str** | Denomination unit. Point card = 'POINT', interest rate boost coupon = 'APR', VIP trial card = 'VIP', Alpha cash coupon = base currency, others = uppercase currency symbol (e.g., 'USDT'/'GT') | [optional] +**rule_new** | **str** | Coupon usage rule text. List endpoint always returns empty string \"\", only detail endpoint returns actual value | [optional] +**status** | **str** | Coupon status. Regular coupon: NOT_ACTIVE (pending activation), ACTIVATED (activated), TO_BE_USED (to be used), EXPIRED (expired), RECYCLED (recycled), INVALID (invalidated), USED (used), UNKNOWN (unknown), LOCKED (locked, P2P only). Task coupon: TASK_START (task not started), TASK_WAIT (task in progress), TASK_DONE (task completed, processing), TASK_EXPIRED (task not completed, expired), TASK_NOT_STARTED_EXPIRED (not started, expired), TASK_RECEIVE_SUCCESS (reward claimed successfully), TASK_RECEIVE_FAIL (reward claim failed) | [optional] +**jump_url** | [**ListUserCouponsResponseDataJumpUrl**](ListUserCouponsResponseDataJumpUrl.md) | | [optional] +**help_url** | [**ListUserCouponsResponseDataHelpUrl**](ListUserCouponsResponseDataHelpUrl.md) | | [optional] +**expire_time** | **int** | Expiration time (Unix timestamp). Some types replace this with actual expiration time after activation or use (e.g., contract_bonus uses expired_timest after activation). Point card type returns 0 | [optional] +**expire_time_order_by** | **int** | Sorting expiration time (from the original expiration time of the distribution record, unaffected by activation). Used as the `expire_time` parameter for the next request in cursor-based pagination | [optional] +**expire_second** | **int** | Seconds remaining until expiration. Returns 0 for expired or Point Card types | [optional] +**has_usage_history** | **bool** | Whether there is a usage history. Fixed as true for point card type, determined by type for others | [optional] +**has_progress** | **bool** | Whether to display a progress bar. Only true for commission_rebate, interest_voucher, and qualifying task coupons | [optional] +**progress_config** | [**ListUserCouponsResponseDataProgressConfig**](ListUserCouponsResponseDataProgressConfig.md) | | [optional] +**activation_info** | [**object**](.md) | Type-specific activation information. Types without specific fields return empty object {}. Fields by type: interest_voucher={supported_pairs,transaction_type}; contract_bonus_new={received_expired_hour}; contract_bonus={check_unified_account_mode,received_expired_days,abtest}; commission_rebate={market,market_name}; robot_bonus={designated_bots}; position_voucher={symbols,leverage,need_user_funds,user_funds_amount,position_bonus}; tradfi_position_voucher={symbols,leverage,position_bonus}; etf_voucher={currency_markets,amount} | [optional] +**is_task_coupon** | **int** | Whether it is a task coupon. `0` = regular coupon; `1` = task coupon | [optional] +**upgrade_toast** | **bool** | Whether to prompt the user to upgrade the App (true when app version is too old to support the coupon). Triggered types: copy_trading/alpha_voucher (Android<7320000/iOS<202507320000), commission_rebate subtype tradfi (Android<8040000/iOS<202608040000), etf_voucher (Android<8090000/iOS<202608090000), tradfi_position_voucher (Android<8100000/iOS<202508240000) | [optional] +**task_title** | **str** | Task title (only task coupons have value, regular coupons return empty string \"\") | [optional] +**task_desc** | **str** | Task description (only task coupons have value, regular coupons return empty string \"\") | [optional] +**task_start_at** | **int** | Task start timestamp (Unix). Only has value for task coupons in TASK_EXPIRED status, otherwise 0 | [optional] +**task_expire_at** | **int** | Task expiration timestamp (Unix). Currently fixed at 0, reserved field | [optional] +**task_completed_at** | **int** | Task completion timestamp (Unix). Currently fixed at 0, reserved field | [optional] +**extra** | **list[object]** | Extension fields. List endpoint always returns empty array [], only the detail endpoint has values | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListUserCouponsResponseDataProgressConfig.md b/docs/ListUserCouponsResponseDataProgressConfig.md new file mode 100644 index 00000000..e4696a60 --- /dev/null +++ b/docs/ListUserCouponsResponseDataProgressConfig.md @@ -0,0 +1,14 @@ +# ListUserCouponsResponseDataProgressConfig + +Progress bar configuration. All fields are empty strings when has_progress is false +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_balance** | **str** | Total Required Amount | [optional] +**current_used** | **str** | Used Amount | [optional] +**current_achived** | **str** | Amount achieved (note: field name is spelled as achived) | [optional] +**currency** | **str** | Progress unit (e.g., 'USDT') | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MarginGridCreateParams.md b/docs/MarginGridCreateParams.md new file mode 100644 index 00000000..f43ee48f --- /dev/null +++ b/docs/MarginGridCreateParams.md @@ -0,0 +1,22 @@ +# MarginGridCreateParams + +Creation parameters for the Leverage Grid strategy. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**money** | **str** | | +**low_price** | **str** | | +**high_price** | **str** | | +**grid_num** | **int** | | +**price_type** | **int** | | +**leverage** | **str** | | +**direction** | [**FuturesDirection**](FuturesDirection.md) | | [optional] +**trigger_price** | **str** | | [optional] +**stop_profit** | **str** | | [optional] +**stop_loss** | **str** | | [optional] +**profit_sharing_ratio** | **str** | | [optional] +**is_use_base** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MarginGridCreateRequest.md b/docs/MarginGridCreateRequest.md new file mode 100644 index 00000000..554e8cfa --- /dev/null +++ b/docs/MarginGridCreateRequest.md @@ -0,0 +1,13 @@ +# MarginGridCreateRequest + +Create the request body for the Leverage Grid strategy. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_type** | **str** | | +**market** | **str** | | +**create_params** | [**MarginGridCreateParams**](MarginGridCreateParams.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MarginMarketLeverage.md b/docs/MarginMarketLeverage.md index 63ce6867..e529ef19 100644 --- a/docs/MarginMarketLeverage.md +++ b/docs/MarginMarketLeverage.md @@ -5,7 +5,7 @@ Market leverage settings Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency_pair** | **str** | Market | [optional] -**leverage** | **str** | Position leverage | +**leverage** | **str** | Leverage multiplier | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MarginTiers.md b/docs/MarginTiers.md index 455092c9..bf169d15 100644 --- a/docs/MarginTiers.md +++ b/docs/MarginTiers.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes **tier** | **str** | Tier | [optional] **margin_rate** | **str** | Discount | [optional] **lower_limit** | **str** | Lower limit | [optional] -**upper_limit** | **str** | Upper limit, \"\" indicates greater than (the last tier) | [optional] -**leverage** | **str** | Position leverage | [optional] +**upper_limit** | **str** | Upper limit, `` indicates greater than (the last tier) | [optional] +**leverage** | **str** | Leverage multiplier | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MockFuturesOrder.md b/docs/MockFuturesOrder.md index 0d03d063..18db255e 100644 --- a/docs/MockFuturesOrder.md +++ b/docs/MockFuturesOrder.md @@ -4,7 +4,7 @@ Futures order ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contract** | **str** | Futures name, currently only supports USDT perpetual contracts for BTC and ETH | +**contract** | **str** | Perpetual contract name. Only USDT perpetual contracts for underlying currencies with active options trading are supported. | **size** | **str** | Contract quantity, representing the initial order quantity, not involved in actual settlement | **left** | **str** | Unfilled contract quantity, involved in actual calculation | diff --git a/docs/MockFuturesPosition.md b/docs/MockFuturesPosition.md index f6eccc7a..7cd9105a 100644 --- a/docs/MockFuturesPosition.md +++ b/docs/MockFuturesPosition.md @@ -4,7 +4,7 @@ Futures positions ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contract** | **str** | Futures name, currently only supports USDT perpetual contracts for BTC and ETH | +**contract** | **str** | Perpetual contract name. Only USDT perpetual contracts for underlying currencies with active options trading are supported. | **size** | **str** | Position size, measured in contract quantity | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MockOptionsOrder.md b/docs/MockOptionsOrder.md index 054d3f48..2c2db6d3 100644 --- a/docs/MockOptionsOrder.md +++ b/docs/MockOptionsOrder.md @@ -4,7 +4,7 @@ Option orders ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**options_name** | **str** | Option name, currently only supports USDT options for BTC and ETH | +**options_name** | **str** | Options contract name. Currently supports all options contract markets. | **size** | **str** | Initial order quantity, not involved in actual calculation | **left** | **str** | Unfilled contract quantity, involved in actual calculation | diff --git a/docs/MockOptionsPosition.md b/docs/MockOptionsPosition.md index f7c0e53a..b7e45da3 100644 --- a/docs/MockOptionsPosition.md +++ b/docs/MockOptionsPosition.md @@ -4,7 +4,7 @@ Options positions ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**options_name** | **str** | Option name, currently only supports USDT options for BTC and ETH | +**options_name** | **str** | Options contract name. Currently supports all options contract markets. | **size** | **str** | Position size, measured in contract quantity | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MockSpotBalance.md b/docs/MockSpotBalance.md index 54bb7620..255e74b3 100644 --- a/docs/MockSpotBalance.md +++ b/docs/MockSpotBalance.md @@ -5,7 +5,7 @@ Spot Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **str** | Currency name | -**equity** | **str** | Currency equity, where equity = balance - borrowed, represents the net delta exposure of your spot positions, which can be negative. Currently only supports BTC and ETH | +**equity** | **str** | Currency equity, where equity = balance - borrowed, represents the net delta exposure of your spot positions | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MockSpotOrder.md b/docs/MockSpotOrder.md index 3b3d3406..9f33508c 100644 --- a/docs/MockSpotOrder.md +++ b/docs/MockSpotOrder.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency_pairs** | **str** | Market | **order_price** | **str** | Price | -**count** | **str** | Initial order quantity for spot trading pairs, not involved in actual calculation. Currently only supports BTC and ETH Currently only supports three currencies: BTC, ETH | [optional] +**count** | **str** | Initial order quantity for spot trading pairs, not involved in actual calculation. | [optional] **left** | **str** | Unfilled quantity, involved in actual calculation | **type** | **str** | Order type, sell - sell order, buy - buy order | diff --git a/docs/Mt5Account.md b/docs/Mt5Account.md new file mode 100644 index 00000000..2440c2c7 --- /dev/null +++ b/docs/Mt5Account.md @@ -0,0 +1,13 @@ +# Mt5Account + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business Status Code; Non-zero Indicates Business Exception, Please Check Message | [optional] +**message** | **str** | Response message | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**Mt5AccountData**](Mt5AccountData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Mt5AccountData.md b/docs/Mt5AccountData.md new file mode 100644 index 00000000..a5e1ce07 --- /dev/null +++ b/docs/Mt5AccountData.md @@ -0,0 +1,14 @@ +# Mt5AccountData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mt5_uid** | **int** | MT5 userID | [optional] +**leverage** | **int** | Leverage multiplier | [optional] +**stop_out_level** | **str** | Liquidation margin ratio | [optional] +**status** | **int** | Account status (1=not opened, 2=pending review, 3=active) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MultiCollateralLoanApi.md b/docs/MultiCollateralLoanApi.md index d863e9f1..e3b4f466 100644 --- a/docs/MultiCollateralLoanApi.md +++ b/docs/MultiCollateralLoanApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**list_multi_collateral_records**](MultiCollateralLoanApi.md#list_multi_collateral_records) | **GET** /loan/multi_collateral/mortgage | Query collateral adjustment records [**operate_multi_collateral**](MultiCollateralLoanApi.md#operate_multi_collateral) | **POST** /loan/multi_collateral/mortgage | Add or withdraw collateral [**list_user_currency_quota**](MultiCollateralLoanApi.md#list_user_currency_quota) | **GET** /loan/multi_collateral/currency_quota | Query user's collateral and borrowing currency quota information -[**list_multi_collateral_currencies**](MultiCollateralLoanApi.md#list_multi_collateral_currencies) | **GET** /loan/multi_collateral/currencies | Query supported borrowing and collateral currencies for multi-currency collateral +[**list_multi_collateral_currencies**](MultiCollateralLoanApi.md#list_multi_collateral_currencies) | **GET** /loan/multi_collateral/currencies | Query borrow currencies and collateral currencies supported by multi-currency collateral [**get_multi_collateral_ltv**](MultiCollateralLoanApi.md#get_multi_collateral_ltv) | **GET** /loan/multi_collateral/ltv | Query collateralization ratio information [**get_multi_collateral_fix_rate**](MultiCollateralLoanApi.md#get_multi_collateral_fix_rate) | **GET** /loan/multi_collateral/fixed_rate | Query currency's 7-day and 30-day fixed interest rates [**get_multi_collateral_current_rate**](MultiCollateralLoanApi.md#get_multi_collateral_current_rate) | **GET** /loan/multi_collateral/current_rate | Query currency's current interest rate @@ -583,7 +583,7 @@ Name | Type | Description | Notes # **list_multi_collateral_currencies** > MultiCollateralCurrency list_multi_collateral_currencies() -Query supported borrowing and collateral currencies for multi-currency collateral +Query borrow currencies and collateral currencies supported by multi-currency collateral ### Example @@ -602,7 +602,7 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.MultiCollateralLoanApi(api_client) try: - # Query supported borrowing and collateral currencies for multi-currency collateral + # Query borrow currencies and collateral currencies supported by multi-currency collateral api_response = api_instance.list_multi_collateral_currencies() print(api_response) except GateApiException as ex: @@ -766,7 +766,7 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.MultiCollateralLoanApi(api_client) -currencies = ['[\"BTC\",\"GT\"]'] # list[str] | Specify currency name query array, separated by commas, maximum 100 items +currencies = ['[\"BTC\",\"GT\"]'] # list[str] | Specify currency name query array, separated by commas, maximum 100 vip_level = '0' # str | VIP level, defaults to 0 if not specified (optional) (default to '0') try: @@ -783,7 +783,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currencies** | [**list[str]**](str.md)| Specify currency name query array, separated by commas, maximum 100 items | + **currencies** | [**list[str]**](str.md)| Specify currency name query array, separated by commas, maximum 100 | **vip_level** | **str**| VIP level, defaults to 0 if not specified | [optional] [default to '0'] ### Return type diff --git a/docs/MyAdsListRequest.md b/docs/MyAdsListRequest.md new file mode 100644 index 00000000..039bcbbe --- /dev/null +++ b/docs/MyAdsListRequest.md @@ -0,0 +1,13 @@ +# MyAdsListRequest + +Get my ads list request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | Crypto asset; omit to skip asset filter. | [optional] +**fiat_unit** | **str** | Fiat currency; omit to skip fiat filter. | [optional] +**trade_type** | **str** | Ad side: `buy` for buy-crypto ads, `sell` for sell-crypto ads; omit for all sides. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OTCApi.md b/docs/OTCApi.md new file mode 100644 index 00000000..19c0e192 --- /dev/null +++ b/docs/OTCApi.md @@ -0,0 +1,1116 @@ +# gate_api.OTCApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_otc_quote**](OTCApi.md#create_otc_quote) | **POST** /otc/quote | Fiat and stablecoin quote +[**create_otc_order**](OTCApi.md#create_otc_order) | **POST** /otc/order/create | Create fiat order +[**create_stable_coin_order**](OTCApi.md#create_stable_coin_order) | **POST** /otc/stable_coin/order/create | Create stablecoin order +[**get_bank_list_inner_path**](OTCApi.md#get_bank_list_inner_path) | **GET** /otc/bank/list | Get user bank card list +[**create_otc_bank**](OTCApi.md#create_otc_bank) | **POST** /otc/bank/create | Create bank card +[**delete_otc_bank**](OTCApi.md#delete_otc_bank) | **POST** /otc/bank/delete | Delete bank card +[**set_default_otc_bank**](OTCApi.md#set_default_otc_bank) | **POST** /otc/bank/set_default | Set default bank card +[**get_otc_bank_supplement_checklist**](OTCApi.md#get_otc_bank_supplement_checklist) | **GET** /otc/bank/bank_supplement_checklist | Query the checklist of materials to supplement for a bank card +[**submit_otc_bank_personal_supplement**](OTCApi.md#submit_otc_bank_personal_supplement) | **POST** /otc/bank/personal/bank_supplement | Submit Bank Card Supplement Materials (Personal) +[**submit_otc_bank_enterprise_supplement**](OTCApi.md#submit_otc_bank_enterprise_supplement) | **POST** /otc/bank/enterprise/bank_supplement | Submit Bank Card Supplement Materials (Enterprise) +[**mark_otc_order_paid**](OTCApi.md#mark_otc_order_paid) | **POST** /otc/order/paid | Mark fiat order as paid (deposit confirmation) +[**cancel_otc_order**](OTCApi.md#cancel_otc_order) | **POST** /otc/order/cancel | Fiat order cancellation +[**list_otc_orders**](OTCApi.md#list_otc_orders) | **GET** /otc/order/list | Fiat order list +[**list_stable_coin_orders**](OTCApi.md#list_stable_coin_orders) | **GET** /otc/stable_coin/order/list | Stablecoin order list +[**get_otc_order_detail**](OTCApi.md#get_otc_order_detail) | **GET** /otc/order/detail | Fiat order details + + +# **create_otc_quote** +> OtcQuoteResponse create_otc_quote(otc_quote_request) + +Fiat and stablecoin quote + +Create fiat and stablecoin quotes, supporting both PAY and GET directions + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +otc_quote_request = gate_api.OtcQuoteRequest() # OtcQuoteRequest | + +try: + # Fiat and stablecoin quote + api_response = api_instance.create_otc_quote(otc_quote_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->create_otc_quote: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **otc_quote_request** | [**OtcQuoteRequest**](OtcQuoteRequest.md)| | + +### Return type + +[**OtcQuoteResponse**](OtcQuoteResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Quote retrieved successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_otc_order** +> OtcActionResponse create_otc_order(otc_order_request) + +Create fiat order + +Create a fiat order, supporting BUY for on-ramp and SELL for off-ramp + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +otc_order_request = gate_api.OtcOrderRequest() # OtcOrderRequest | + +try: + # Create fiat order + api_response = api_instance.create_otc_order(otc_order_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->create_otc_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **otc_order_request** | [**OtcOrderRequest**](OtcOrderRequest.md)| | + +### Return type + +[**OtcActionResponse**](OtcActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Order created successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_stable_coin_order** +> OtcStableCoinOrderCreateResponse create_stable_coin_order(otc_stable_coin_order_request) + +Create stablecoin order + +Create a stablecoin order. All request body fields except `promotion_code` are required. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +otc_stable_coin_order_request = gate_api.OtcStableCoinOrderRequest() # OtcStableCoinOrderRequest | + +try: + # Create stablecoin order + api_response = api_instance.create_stable_coin_order(otc_stable_coin_order_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->create_stable_coin_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **otc_stable_coin_order_request** | [**OtcStableCoinOrderRequest**](OtcStableCoinOrderRequest.md)| | + +### Return type + +[**OtcStableCoinOrderCreateResponse**](OtcStableCoinOrderCreateResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Stablecoin order created successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_bank_list_inner_path** +> OtcBankListResponse get_bank_list_inner_path() + +Get user bank card list + +List the user's bank cards for selecting a card when placing an order. **Default card**: use the `is_default` field in each list item (`1` indicates the default). The deprecated standalone default-bank-card endpoint is no longer required. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) + +try: + # Get user bank card list + api_response = api_instance.get_bank_list_inner_path() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->get_bank_list_inner_path: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**OtcBankListResponse**](OtcBankListResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_otc_bank** +> OtcBankCreateResponse create_otc_bank(bank_account_name, bank_name, bank_country, bank_address, iban, swift, documentation_file, remittance_line_number=remittance_line_number, agent_bank_name=agent_bank_name, agent_bank_swift=agent_bank_swift) + +Create bank card + +Bind a bank card. Under the Global entity, an account with a non-matching name may enter manual review (`status` pending) and require subsequent supplementary materials. Corresponding Inner: `POST /bank/create`. Fields and protocol are subject to the production form/gateway; in some environments `bank_account_name` is passed Base64-encoded, see the integration notes for details. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +bank_account_name = 'bank_account_name_example' # str | +bank_name = 'bank_name_example' # str | +bank_country = 'bank_country_example' # str | +bank_address = 'bank_address_example' # str | +iban = 'iban_example' # str | +swift = 'swift_example' # str | +documentation_file = 'documentation_file_example' # str | Account opening proof file content (multipart file field, binary/Base64; jpg/jpeg/png/pdf, etc.; maximum 10 MB per file, subject to the live environment) +remittance_line_number = 'remittance_line_number_example' # str | (optional) +agent_bank_name = 'agent_bank_name_example' # str | (optional) +agent_bank_swift = 'agent_bank_swift_example' # str | (optional) + +try: + # Create bank card + api_response = api_instance.create_otc_bank(bank_account_name, bank_name, bank_country, bank_address, iban, swift, documentation_file, remittance_line_number=remittance_line_number, agent_bank_name=agent_bank_name, agent_bank_swift=agent_bank_swift) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->create_otc_bank: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bank_account_name** | **str**| | + **bank_name** | **str**| | + **bank_country** | **str**| | + **bank_address** | **str**| | + **iban** | **str**| | + **swift** | **str**| | + **documentation_file** | **str**| Account opening proof file content (multipart file field, binary/Base64; jpg/jpeg/png/pdf, etc.; maximum 10 MB per file, subject to the live environment) | + **remittance_line_number** | **str**| | [optional] + **agent_bank_name** | **str**| | [optional] + **agent_bank_swift** | **str**| | [optional] + +### Return type + +[**OtcBankCreateResponse**](OtcBankCreateResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Accepted successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_otc_bank** +> OtcActionResponse delete_otc_bank(otc_bank_id_request) + +Delete bank card + +Delete the specified bank card. Corresponds to Inner: `POST /bank/delete`. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +otc_bank_id_request = gate_api.OtcBankIdRequest() # OtcBankIdRequest | + +try: + # Delete bank card + api_response = api_instance.delete_otc_bank(otc_bank_id_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->delete_otc_bank: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **otc_bank_id_request** | [**OtcBankIdRequest**](OtcBankIdRequest.md)| | + +### Return type + +[**OtcActionResponse**](OtcActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Deleted successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **set_default_otc_bank** +> OtcActionResponse set_default_otc_bank(otc_bank_id_request) + +Set default bank card + +Set the specified bank card as default. Corresponds to Inner: `POST /bank/set_default`. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +otc_bank_id_request = gate_api.OtcBankIdRequest() # OtcBankIdRequest | + +try: + # Set default bank card + api_response = api_instance.set_default_otc_bank(otc_bank_id_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->set_default_otc_bank: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **otc_bank_id_request** | [**OtcBankIdRequest**](OtcBankIdRequest.md)| | + +### Return type + +[**OtcActionResponse**](OtcActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Set successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_otc_bank_supplement_checklist** +> OtcBankSupplementChecklistResponse get_otc_bank_supplement_checklist(bank_id) + +Query the checklist of materials to supplement for a bank card + +**①** `bank_id` must be specified. After verifying that the card belongs to the current user and its status allows supplementary documents, the endpoint returns the required items based on the user's **approved advanced verification type** (personal/enterprise); each item's `description` states the submission requirements. Corresponding Inner endpoint: `GET /bank/bank_supplement_checklist`. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +bank_id = 'bank_id_example' # str | Bank card ID (otc_rds / the id returned by the list endpoint). + +try: + # Query the checklist of materials to supplement for a bank card + api_response = api_instance.get_otc_bank_supplement_checklist(bank_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->get_otc_bank_supplement_checklist: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bank_id** | **str**| Bank card ID (otc_rds / the id returned by the list endpoint). | + +### Return type + +[**OtcBankSupplementChecklistResponse**](OtcBankSupplementChecklistResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **submit_otc_bank_personal_supplement** +> OtcActionResponse submit_otc_bank_personal_supplement(bank_id, id_document_front, id_document_back, address_proof) + +Submit Bank Card Supplement Materials (Personal) + +**Personal professional verification (type=1)** users submit non-same-person/supplementary materials. Must match `user_type=personal` returned by `GET /otc/bank/bank_supplement_checklist?bank_id=`, otherwise the request is rejected. **multipart/form-data** is recommended: each material item is a separate file field, with field names matching the checklist `code` (`id_document_front`, `id_document_back`, `address_proof`). + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +bank_id = 'bank_id_example' # str | +id_document_front = 'id_document_front_example' # str | ID document front-side file content (multipart file field, binary/Base64) +id_document_back = 'id_document_back_example' # str | ID document back-side file content (multipart file field, binary/Base64) +address_proof = 'address_proof_example' # str | Proof-of-address file content (multipart file field, binary/Base64) + +try: + # Submit Bank Card Supplement Materials (Personal) + api_response = api_instance.submit_otc_bank_personal_supplement(bank_id, id_document_front, id_document_back, address_proof) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->submit_otc_bank_personal_supplement: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bank_id** | **str**| | + **id_document_front** | **str**| ID document front-side file content (multipart file field, binary/Base64) | + **id_document_back** | **str**| ID document back-side file content (multipart file field, binary/Base64) | + **address_proof** | **str**| Proof-of-address file content (multipart file field, binary/Base64) | + +### Return type + +[**OtcActionResponse**](OtcActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Accepted successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **submit_otc_bank_enterprise_supplement** +> OtcActionResponse submit_otc_bank_enterprise_supplement(bank_id, certificate, share_holders, passport, share_holding_structure, uid=uid, funds_statement=funds_statement, additional=additional) + +Submit Bank Card Supplement Materials (Enterprise) + +**Enterprise professional verification (type=2)** users submit supplementary materials. Must match `user_type=enterprise` returned by the checklist. **multipart** file field names: `certificate`, `share_holders`, `passport`, `share_holding_structure`. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +bank_id = 'bank_id_example' # str | +certificate = 'certificate_example' # str | Business license / registration certificate file content (multipart file field, binary/Base64) +share_holders = 'share_holders_example' # str | Register of shareholders file content (multipart file field, binary/Base64) +passport = 'passport_example' # str | Legal representative / shareholder passport file content (multipart file field, binary/Base64) +share_holding_structure = 'share_holding_structure_example' # str | Ownership structure chart file content (multipart file field, binary/Base64) +uid = 'uid_example' # str | (optional) +funds_statement = 'funds_statement_example' # str | Proof-of-funds file content (multipart file field, binary/Base64, optional) (optional) +additional = 'additional_example' # str | Other supplementary material file content (multipart file field, binary/Base64, optional) (optional) + +try: + # Submit Bank Card Supplement Materials (Enterprise) + api_response = api_instance.submit_otc_bank_enterprise_supplement(bank_id, certificate, share_holders, passport, share_holding_structure, uid=uid, funds_statement=funds_statement, additional=additional) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->submit_otc_bank_enterprise_supplement: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bank_id** | **str**| | + **certificate** | **str**| Business license / registration certificate file content (multipart file field, binary/Base64) | + **share_holders** | **str**| Register of shareholders file content (multipart file field, binary/Base64) | + **passport** | **str**| Legal representative / shareholder passport file content (multipart file field, binary/Base64) | + **share_holding_structure** | **str**| Ownership structure chart file content (multipart file field, binary/Base64) | + **uid** | **str**| | [optional] + **funds_statement** | **str**| Proof-of-funds file content (multipart file field, binary/Base64, optional) | [optional] + **additional** | **str**| Other supplementary material file content (multipart file field, binary/Base64, optional) | [optional] + +### Return type + +[**OtcActionResponse**](OtcActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Accepted successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **mark_otc_order_paid** +> OtcActionResponse mark_otc_order_paid(otc_mark_order_paid_request) + +Mark fiat order as paid (deposit confirmation) + +Mark a fiat BUY order as paid (deposit confirmation). **A user payment receipt must be uploaded**: `payment_receipt_file_key` is required; supported formats are jpg/jpeg/png/pdf, with a maximum size of 10 MB per file (validated jointly by the service and gateway). The compatibility field name `payment_receipt` is subject to the gateway/live environment. The persisted field is `otc_trade_record.payment_receipt_file_key`. The Pay Inner path is `POST .../pay/order_set_paid` (commonly associated by `client_order_id`); the Inner path corresponding to this OpenAPI endpoint, `POST /order/paid`, still primarily uses `order_id`. If the gateway standardizes on the merchant order ID, follow the gateway documentation. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +otc_mark_order_paid_request = gate_api.OtcMarkOrderPaidRequest() # OtcMarkOrderPaidRequest | + +try: + # Mark fiat order as paid (deposit confirmation) + api_response = api_instance.mark_otc_order_paid(otc_mark_order_paid_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->mark_otc_order_paid: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **otc_mark_order_paid_request** | [**OtcMarkOrderPaidRequest**](OtcMarkOrderPaidRequest.md)| | + +### Return type + +[**OtcActionResponse**](OtcActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The order has been marked as paid | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **cancel_otc_order** +> OtcActionResponse cancel_otc_order(order_id) + +Fiat order cancellation + +Cancel fiat order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +order_id = 'order_id_example' # str | Order ID + +try: + # Fiat order cancellation + api_response = api_instance.cancel_otc_order(order_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->cancel_otc_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| Order ID | + +### Return type + +[**OtcActionResponse**](OtcActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Order cancelled successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_otc_orders** +> OtcOrderListResponse list_otc_orders(type=type, fiat_currency=fiat_currency, crypto_currency=crypto_currency, start_time=start_time, end_time=end_time, status=status, pn=pn, ps=ps) + +Fiat order list + +Query the fiat order list with filters such as type, currency, time range, and status + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +type = 'type_example' # str | BUY for on-ramp, SELL for off-ramp (optional) +fiat_currency = 'fiat_currency_example' # str | Fiat currency (optional) +crypto_currency = 'crypto_currency_example' # str | Digital currency (optional) +start_time = 'start_time_example' # str | starttime for example : 2025-09-09 (optional) +end_time = 'end_time_example' # str | endtime for example :2025-09-09 (optional) +status = 'status_example' # str | DONE: completed CANCEL: canceled PROCESSING: in progress DISBURSED: disbursed (optional) +pn = 'pn_example' # str | Page number (optional) +ps = 'ps_example' # str | Number of items per page (optional) + +try: + # Fiat order list + api_response = api_instance.list_otc_orders(type=type, fiat_currency=fiat_currency, crypto_currency=crypto_currency, start_time=start_time, end_time=end_time, status=status, pn=pn, ps=ps) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->list_otc_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | **str**| BUY for on-ramp, SELL for off-ramp | [optional] + **fiat_currency** | **str**| Fiat currency | [optional] + **crypto_currency** | **str**| Digital currency | [optional] + **start_time** | **str**| starttime for example : 2025-09-09 | [optional] + **end_time** | **str**| endtime for example :2025-09-09 | [optional] + **status** | **str**| DONE: completed CANCEL: canceled PROCESSING: in progress DISBURSED: disbursed | [optional] + **pn** | **str**| Page number | [optional] + **ps** | **str**| Number of items per page | [optional] + +### Return type + +[**OtcOrderListResponse**](OtcOrderListResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_stable_coin_orders** +> OtcStableCoinOrderListResponse list_stable_coin_orders(page_size=page_size, page_number=page_number, coin_name=coin_name, start_time=start_time, end_time=end_time, status=status) + +Stablecoin order list + +Query stablecoin order list with filtering by currency, time range, status, etc. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +page_size = '10' # str | Number of records per page (optional) +page_number = '1' # str | Page number (optional) +coin_name = 'USDT' # str | ordercurrency (optional) +start_time = 'start_time_example' # str | Start Time (optional) +end_time = 'end_time_example' # str | End time (optional) +status = 'status_example' # str | Status: PROCESSING: in progress / DONE:completed / FAILED: failed (optional) + +try: + # Stablecoin order list + api_response = api_instance.list_stable_coin_orders(page_size=page_size, page_number=page_number, coin_name=coin_name, start_time=start_time, end_time=end_time, status=status) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->list_stable_coin_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_size** | **str**| Number of records per page | [optional] + **page_number** | **str**| Page number | [optional] + **coin_name** | **str**| ordercurrency | [optional] + **start_time** | **str**| Start Time | [optional] + **end_time** | **str**| End time | [optional] + **status** | **str**| Status: PROCESSING: in progress / DONE:completed / FAILED: failed | [optional] + +### Return type + +[**OtcStableCoinOrderListResponse**](OtcStableCoinOrderListResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_otc_order_detail** +> OtcOrderDetailResponse get_otc_order_detail(order_id) + +Fiat order details + +Query fiat order details + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OTCApi(api_client) +order_id = 'order_id_example' # str | Order ID + +try: + # Fiat order details + api_response = api_instance.get_otc_order_detail(order_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OTCApi->get_otc_order_detail: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| Order ID | + +### Return type + +[**OtcOrderDetailResponse**](OtcOrderDetailResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/OptionsAccount.md b/docs/OptionsAccount.md index f45e3904..24082a51 100644 --- a/docs/OptionsAccount.md +++ b/docs/OptionsAccount.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **short_enabled** | **bool** | If the account is allowed to short | [optional] **mmp_enabled** | **bool** | Whether to enable MMP | [optional] **liq_triggered** | **bool** | Whether the account is in a liquidation state | [optional] -**margin_mode** | **int** | 此字段表示统一账户所使用的保证金模式: - 0:经典现货保证金模式 - 1:跨币种保证金模式 - 2:组合保证金模式 - 3: 表示为单币种保证金模式 | [optional] +**margin_mode** | **int** | This field indicates the margin mode used by the unified account: - 0: Classic Spot Margin Mode - 1: Cross-Currency Margin Mode - 2: Portfolio Margin Mode - 3: Single-Currency Margin Mode | [optional] **unrealised_pnl** | **str** | Unrealised PnL = (mark price - entry price) * position size. For long postion, size is positive; for short positon, size is negative.This value is for reference only. | [optional] **init_margin** | **str** | Initial position margin | [optional] **maint_margin** | **str** | Position maintenance margin | [optional] diff --git a/docs/OptionsApi.md b/docs/OptionsApi.md index a1d2fdd8..7b4c94fb 100644 --- a/docs/OptionsApi.md +++ b/docs/OptionsApi.md @@ -26,6 +26,7 @@ Method | HTTP request | Description [**create_options_order**](OptionsApi.md#create_options_order) | **POST** /options/orders | Create an options order [**cancel_options_orders**](OptionsApi.md#cancel_options_orders) | **DELETE** /options/orders | Cancel all orders with 'open' status [**get_options_order**](OptionsApi.md#get_options_order) | **GET** /options/orders/{order_id} | Query single order details +[**amend_options_order**](OptionsApi.md#amend_options_order) | **PUT** /options/orders/{order_id} | Option Order Modification [**cancel_options_order**](OptionsApi.md#cancel_options_order) | **DELETE** /options/orders/{order_id} | Cancel single order [**countdown_cancel_all_options**](OptionsApi.md#countdown_cancel_all_options) | **POST** /options/countdown_cancel_all | Countdown cancel orders [**list_my_options_trades**](OptionsApi.md#list_my_options_trades) | **GET** /options/my_trades | Query personal trading records @@ -492,7 +493,7 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.OptionsApi(api_client) contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name -interval = '0' # str | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (optional) (default to '0') +interval = '0' # str | Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 (optional) (default to '0') limit = 10 # int | Number of depth levels (optional) (default to 10) with_id = False # bool | Whether to return depth update ID. This ID increments by 1 each time the depth changes (optional) (default to False) @@ -511,7 +512,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **str**| Options contract name | - **interval** | **str**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [optional] [default to '0'] + **interval** | **str**| Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 | [optional] [default to '0'] **limit** | **int**| Number of depth levels | [optional] [default to 10] **with_id** | **bool**| Whether to return depth update ID. This ID increments by 1 each time the depth changes | [optional] [default to False] @@ -1478,6 +1479,77 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **amend_options_order** +> OptionsOrder amend_options_order(order_id, amend_options_order_request) + +Option Order Modification + +Modify the order price and/or quantity of a specified order; only orders with status 'open' are supported + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.OptionsApi(api_client) +order_id = 12345 # int | Order ID returned when order is successfully created +amend_options_order_request = gate_api.AmendOptionsOrderRequest() # AmendOptionsOrderRequest | + +try: + # Option Order Modification + api_response = api_instance.amend_options_order(order_id, amend_options_order_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling OptionsApi->amend_options_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID returned when order is successfully created | + **amend_options_order_request** | [**AmendOptionsOrderRequest**](AmendOptionsOrderRequest.md)| | + +### Return type + +[**OptionsOrder**](OptionsOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Order detail | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **cancel_options_order** > OptionsOrder cancel_options_order(order_id) diff --git a/docs/OptionsContract.md b/docs/OptionsContract.md index bb73447c..fdbcefc8 100644 --- a/docs/OptionsContract.md +++ b/docs/OptionsContract.md @@ -19,8 +19,8 @@ Name | Type | Description | Notes **taker_fee_rate** | **str** | Taker fee rate | [optional] **order_price_round** | **str** | Minimum order price increment | [optional] **mark_price_round** | **str** | Minimum mark price increment | [optional] -**order_size_min** | **int** | Minimum order size allowed by the contract | [optional] -**order_size_max** | **int** | Maximum order size allowed by the contract | [optional] +**order_size_min** | **int** | Minimum order quantity | [optional] +**order_size_max** | **int** | Maximum order quantity | [optional] **order_price_deviate** | **str** | Deprecated | [optional] **ref_discount_rate** | **str** | Trading fee discount for referred users | [optional] **ref_rebate_rate** | **str** | Commission rate for referrers | [optional] diff --git a/docs/OptionsOrderBook.md b/docs/OptionsOrderBook.md index 7c2b4cf9..d1072e92 100644 --- a/docs/OptionsOrderBook.md +++ b/docs/OptionsOrderBook.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes **id** | **int** | Order Book ID. Increases by 1 on every order book change. Set `with_id=true` to include this field in response | [optional] **current** | **float** | Response data generation timestamp | [optional] **update** | **float** | Order book changed timestamp | [optional] -**asks** | [**list[FuturesOrderBookItem1]**](FuturesOrderBookItem1.md) | Ask Depth | -**bids** | [**list[FuturesOrderBookItem1]**](FuturesOrderBookItem1.md) | Bid Depth | +**asks** | [**list[DeliveryOrderBookItem]**](DeliveryOrderBookItem.md) | Ask Depth | +**bids** | [**list[DeliveryOrderBookItem]**](DeliveryOrderBookItem.md) | Bid Depth | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Order.md b/docs/Order.md index eac8a12c..14871869 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -5,18 +5,18 @@ Spot order details Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Order ID | [optional] [readonly] -**text** | **str** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 | [optional] +**text** | **str** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 pm_liquidate, comb_margin_liquidate, and scm_liquidate represent cross-margin liquidation orders liquidate represents isolated-margin liquidation orders | [optional] **amend_text** | **str** | The custom data that the user remarked when amending the order | [optional] [readonly] **create_time** | **str** | Creation time of order | [optional] [readonly] **update_time** | **str** | Last modification time of order | [optional] [readonly] **create_time_ms** | **int** | Creation time of order (in milliseconds) | [optional] [readonly] **update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly] -**status** | **str** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] +**status** | **str** | Order status - `open`: to be filled - `closed`: closed order - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **str** | Currency pair | **type** | **str** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] **account** | **str** | Account type, spot - spot account, margin - leveraged account, unified - unified account | [optional] [default to 'spot'] **side** | **str** | Buy or sell order | -**amount** | **str** | Trading quantity When `type` is `limit`, it refers to the base currency (the currency being traded), such as `BTC` in `BTC_USDT` When `type` is `market`, it refers to different currencies based on the side: - `side`: `buy` refers to quote currency, `BTC_USDT` means `USDT` - `side`: `sell` refers to base currency, `BTC_USDT` means `BTC` | +**amount** | **str** | Trade amount When `type` is `limit`, this is the base currency to trade (the currency being bought or sold), e.g. `BTC` in `BTC_USDT`. When `type` is `market`, the meaning depends on the side: - `side`: `buy` refers to the quote currency, e.g. `USDT` in `BTC_USDT` - `side`: `sell` refers to the base currency, e.g. `BTC` in `BTC_USDT` | **price** | **str** | Trading price, required when `type`=`limit` | [optional] **time_in_force** | **str** | Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none Only `ioc` and `fok` are supported when `type`=`market` | [optional] [default to 'gtc'] **iceberg** | **str** | Amount to display for the iceberg order. Null or 0 for normal orders. Hiding all amount is not supported | [optional] @@ -38,9 +38,11 @@ Name | Type | Description | Notes **rebated_fee_currency** | **str** | Rebated fee currency unit | [optional] [readonly] **stp_id** | **int** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly] **stp_act** | **str** | Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies 1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy. 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter. 3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-' - cn: Cancel newest, cancel new orders and keep old ones - co: Cancel oldest, cancel old orders and keep new ones - cb: Cancel both, both old and new orders will be cancelled | [optional] -**finish_as** | **str** | Order completion statuses include: - open: Awaiting processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled due to liquidation - small: Order quantity too small - depth_not_enough: Cancelled due to insufficient market depth - trader_not_enough: Cancelled due to insufficient counterparty - ioc: Not immediately filled because tif is set to ioc - poc: Not met the order poc - fok: Not fully filled immediately because tif is set to fok - stp: Cancelled due to self-trade prevention - unknown: Unknown | [optional] [readonly] +**finish_as** | **str** | How the order finished: - open: Pending processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled by liquidation - small: Order size too small - depth_not_enough: Cancelled due to insufficient order book depth - trader_not_enough: Cancelled due to insufficient counterparty liquidity - ioc: Not filled immediately because time-in-force is IOC - poc: Post-only requirement not met because time-in-force is set to poc (maker-only); rejected after being detected as taker - fok: Not fully filled immediately because time-in-force is FOK - stp: Cancelled due to self-trade prevention - price_protect_cancelled: Cancelled due to price protection - unknown: Unknown | [optional] [readonly] **action_mode** | **str** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional] -**slippage** | **str** | Slippage, default limit range 0.0001-0.05, converted to percentage is 0.01%-5%, indicating the acceptable price difference for market order transactions | [optional] +**slippage** | **str** | Maximum supported slippage ratio for Spot Market Order Placement, calculated based on the latest market price at the time of order placement as the benchmark (Example: 0.03 means 3%) | [optional] +**stop_profit** | [**SpotOrderStopProfit**](SpotOrderStopProfit.md) | | [optional] +**stop_loss** | [**SpotOrderStopLoss**](SpotOrderStopLoss.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/OrderBook2.md b/docs/OrderBook2.md new file mode 100644 index 00000000..389889e5 --- /dev/null +++ b/docs/OrderBook2.md @@ -0,0 +1,11 @@ +# OrderBook2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**OrderBook2Data**](OrderBook2Data.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderBook2Data.md b/docs/OrderBook2Data.md new file mode 100644 index 00000000..b37ac8b0 --- /dev/null +++ b/docs/OrderBook2Data.md @@ -0,0 +1,12 @@ +# OrderBook2Data + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Symbol | [optional] +**bids** | [**list[OrderBookPrice]**](OrderBookPrice.md) | Bid orders | [optional] +**asks** | [**list[OrderBookPrice]**](OrderBookPrice.md) | Ask orders | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderBookPrice.md b/docs/OrderBookPrice.md new file mode 100644 index 00000000..a9c984ac --- /dev/null +++ b/docs/OrderBookPrice.md @@ -0,0 +1,11 @@ +# OrderBookPrice + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**p** | **str** | Price | [optional] +**user_order** | **bool** | Whether it is the user's own order | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderCancel.md b/docs/OrderCancel.md index 0a14fe2f..84742b57 100644 --- a/docs/OrderCancel.md +++ b/docs/OrderCancel.md @@ -5,7 +5,7 @@ Spot order details Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Order ID | [optional] [readonly] -**text** | **str** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 | [optional] +**text** | **str** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 | [optional] **amend_text** | **str** | The custom data that the user remarked when amending the order | [optional] [readonly] **succeeded** | **bool** | Request execution result | [optional] **label** | **str** | Error label, if any, otherwise an empty string | [optional] @@ -14,7 +14,7 @@ Name | Type | Description | Notes **update_time** | **str** | Last modification time of order | [optional] [readonly] **create_time_ms** | **int** | Creation time of order (in milliseconds) | [optional] [readonly] **update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly] -**status** | **str** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] +**status** | **str** | Order status - `open`: to be filled - `closed`: closed order - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **str** | Currency pair | **type** | **str** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] **account** | **str** | Account type, spot - spot account, margin - leveraged account, unified - unified account | [optional] [default to 'spot'] diff --git a/docs/OrderCreateV1Req.md b/docs/OrderCreateV1Req.md new file mode 100644 index 00000000..94f09e3f --- /dev/null +++ b/docs/OrderCreateV1Req.md @@ -0,0 +1,12 @@ +# OrderCreateV1Req + +Asset allocation optimization order request. **The array elements of `from` and `to` are both `CreateParam`, and the fields are `asset` + `amount`. ** There is no `ratio` field; if you copy parameters from the preview interface, you must convert the `to[].ratio` in the preview into the `to[].amount` required for placing an order (according to the product agreement, usually based on the order details returned by the preview, etc.). The `ratio` string cannot be directly reused as `amount`. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_from** | [**list[CreateParam]**](CreateParam.md) | Sell ​​side list, at least one item; each item is the currency and amount `amount` to be swapped out. | +**to** | [**list[CreateParam]**](CreateParam.md) | Target side list, at least one item; each item is the target currency and **amount** `amount` (non-proportional). The structural semantics are different from `OrderPreviewV1Req.to` (`PreviewToParam`, including `ratio`), so do not mix them. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderCreateV1Resp.md b/docs/OrderCreateV1Resp.md new file mode 100644 index 00000000..a79795da --- /dev/null +++ b/docs/OrderCreateV1Resp.md @@ -0,0 +1,10 @@ +# OrderCreateV1Resp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order** | [**CreateOrder**](CreateOrder.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderHistoryList.md b/docs/OrderHistoryList.md new file mode 100644 index 00000000..ea3c2f35 --- /dev/null +++ b/docs/OrderHistoryList.md @@ -0,0 +1,11 @@ +# OrderHistoryList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**OrderHistoryListData**](OrderHistoryListData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderHistoryList2.md b/docs/OrderHistoryList2.md new file mode 100644 index 00000000..c84e1098 --- /dev/null +++ b/docs/OrderHistoryList2.md @@ -0,0 +1,11 @@ +# OrderHistoryList2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**OrderHistoryList2Data**](OrderHistoryList2Data.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderHistoryList2Data.md b/docs/OrderHistoryList2Data.md new file mode 100644 index 00000000..8c7de56b --- /dev/null +++ b/docs/OrderHistoryList2Data.md @@ -0,0 +1,12 @@ +# OrderHistoryList2Data + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total quantity | [optional] +**total_page** | **int** | Total pages | [optional] +**list** | [**list[OrderHistoryListItem]**](OrderHistoryListItem.md) | Query historical order list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderHistoryListData.md b/docs/OrderHistoryListData.md new file mode 100644 index 00000000..bb7e3a9a --- /dev/null +++ b/docs/OrderHistoryListData.md @@ -0,0 +1,11 @@ +# OrderHistoryListData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[OrderHistoryListDataList]**](OrderHistoryListDataList.md) | Historical order list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderHistoryListDataList.md b/docs/OrderHistoryListDataList.md new file mode 100644 index 00000000..11c0a290 --- /dev/null +++ b/docs/OrderHistoryListDataList.md @@ -0,0 +1,27 @@ +# OrderHistoryListDataList + +Order detail +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | [optional] +**symbol** | **str** | Currency pair | [optional] +**symbol_desc** | **str** | Symbol description | [optional] +**price_type** | **str** | Trade type (market=market price, trigger=trigger price) | [optional] +**order_opt_type** | **int** | Order operation type (1=sell, 2=buy, 3=close long, 4=close short, 5=force close long, 6=force close short) | [optional] +**state** | **int** | Order status code | [optional] +**state_desc** | **str** | Order status description | [optional] +**side** | **int** | Side (1=sell, 2=buy) | [optional] +**volume** | **str** | Order quantity | [optional] +**fill_volume** | **str** | Trading size | [optional] +**close_pnl** | **str** | Close Position P&L | [optional] +**price** | **str** | Average fill price | [optional] +**trigger_price** | **str** | Trigger price | [optional] +**price_tp** | **str** | Take profit price | [optional] +**price_sl** | **str** | Stop loss price | [optional] +**time_setup** | **int** | Order time (Unix timestamp in seconds) | [optional] +**time_done** | **int** | End time (Unix timestamp in seconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderHistoryListItem.md b/docs/OrderHistoryListItem.md new file mode 100644 index 00000000..af72477f --- /dev/null +++ b/docs/OrderHistoryListItem.md @@ -0,0 +1,29 @@ +# OrderHistoryListItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | | [optional] +**symbol** | **str** | | [optional] +**exchange** | **str** | Exchange, supports us, hk, and kr | [optional] +**quote_currency** | **str** | | [optional] +**fx_rate** | **str** | Quote currency to USD exchange rate | [optional] +**symbol_desc** | **str** | | [optional] +**price_type** | **str** | Price type (market = market order, limit = limit order) | [optional] +**status** | **int** | Order status | [optional] +**status_desc** | **str** | Order status description | [optional] +**status_detail** | [**OrderHistoryListItemStatusDetail**](OrderHistoryListItemStatusDetail.md) | | [optional] +**finish_as** | **int** | Order completion reason | [optional] +**side** | **int** | Side (1=sell, 2=buy) | [optional] +**time_in_force** | **str** | Time in force. - day: Day order. | [optional] +**volume** | **str** | | [optional] +**fill_volume** | **str** | | [optional] +**price** | **str** | | [optional] +**avg_fill_price** | **str** | | [optional] +**commission** | **str** | fee | [optional] +**time_setup** | **int** | | [optional] +**time_done** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderHistoryListItemStatusDetail.md b/docs/OrderHistoryListItemStatusDetail.md new file mode 100644 index 00000000..16a27cd4 --- /dev/null +++ b/docs/OrderHistoryListItemStatusDetail.md @@ -0,0 +1,11 @@ +# OrderHistoryListItemStatusDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | | [optional] +**message** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderList.md b/docs/OrderList.md new file mode 100644 index 00000000..4ccea57f --- /dev/null +++ b/docs/OrderList.md @@ -0,0 +1,11 @@ +# OrderList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**OrderListData**](OrderListData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderList2.md b/docs/OrderList2.md new file mode 100644 index 00000000..85587a40 --- /dev/null +++ b/docs/OrderList2.md @@ -0,0 +1,11 @@ +# OrderList2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**OrderList2Data**](OrderList2Data.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderList2Data.md b/docs/OrderList2Data.md new file mode 100644 index 00000000..8e095093 --- /dev/null +++ b/docs/OrderList2Data.md @@ -0,0 +1,10 @@ +# OrderList2Data + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[OrderListItem]**](OrderListItem.md) | Query active order list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderListData.md b/docs/OrderListData.md new file mode 100644 index 00000000..deb325e2 --- /dev/null +++ b/docs/OrderListData.md @@ -0,0 +1,11 @@ +# OrderListData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[OrderListDataList]**](OrderListDataList.md) | Order list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderListDataList.md b/docs/OrderListDataList.md new file mode 100644 index 00000000..b18fc3fe --- /dev/null +++ b/docs/OrderListDataList.md @@ -0,0 +1,23 @@ +# OrderListDataList + +Order detail +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | [optional] +**symbol** | **str** | Currency pair | [optional] +**symbol_desc** | **str** | Symbol description | [optional] +**price_type** | **str** | Trade type (market=market price, trigger=trigger price) | [optional] +**state** | **int** | Order status code | [optional] +**state_desc** | **str** | Order status description | [optional] +**finished** | **int** | Is completed (0=shown in active order list, 1=not shown in active list) | [optional] +**side** | **int** | Side (1=sell, 2=buy) | [optional] +**volume** | **str** | Order quantity | [optional] +**price** | **str** | Trigger price | [optional] +**price_tp** | **str** | Take profit price | [optional] +**price_sl** | **str** | Stop loss price | [optional] +**time_setup** | **int** | Order time (Unix timestamp in seconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderListItem.md b/docs/OrderListItem.md new file mode 100644 index 00000000..acf183e3 --- /dev/null +++ b/docs/OrderListItem.md @@ -0,0 +1,34 @@ +# OrderListItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | [optional] +**symbol** | **str** | Symbol | [optional] +**exchange** | **str** | Exchange, supports us, hk, and kr | [optional] +**quote_currency** | **str** | Quote currency | [optional] +**fx_rate** | **str** | Quote currency to USD exchange rate | [optional] +**symbol_desc** | **str** | Symbol description | [optional] +**trade_status** | **str** | Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. | [optional] +**trade_mode** | **int** | Current session trading mode. - 0: Trading disabled. - 1: Buy only. - 2: Sell only. - 4: Buy and sell supported. | [optional] +**price_type** | **str** | Price type (market = market order, limit = limit order) | [optional] +**side** | **int** | Side (1=sell, 2=buy) | [optional] +**status** | **int** | Order status | [optional] +**volume** | **str** | Order quantity | [optional] +**fill_volume** | **str** | Trading size | [optional] +**price** | **str** | Order price | [optional] +**time_setup** | **int** | Order creation time (Unix timestamp, seconds) | [optional] +**time_update** | **int** | Order update time (Unix timestamp, seconds) | [optional] +**max_order_volume** | **str** | Maximum order quantity | [optional] +**step_order_volume** | **str** | Order step size | [optional] +**min_order_volume** | **str** | Minimum order quantity | [optional] +**price_precision** | **int** | Price precision | [optional] +**price_protection** | **str** | Price protection range | [optional] +**sell_price_protection** | **str** | Sell price protection rate | [optional] +**buy_price_protection** | **str** | Buy price protection rate | [optional] +**commission_rate** | **str** | Fee Rate | [optional] +**slippage_rate** | **str** | Slippage | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderListStructList.md b/docs/OrderListStructList.md index 12d379a5..6a8f2587 100644 --- a/docs/OrderListStructList.md +++ b/docs/OrderListStructList.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **coin** | **str** | Staked and redeemed currencies | **amount** | **str** | Amount | **type** | **int** | Type 0-Staking 1-Redemption | -**status** | **int** | Status | +**status** | **int** | Status. 1 - success, 3 - delayed redemption in progress, 6 - redemption cancellation order | **redeem_stamp** | **int** | Redemption credit time | **create_stamp** | **int** | Order time | **exchange_amount** | **str** | Exchange rate | diff --git a/docs/OrderListV1Resp.md b/docs/OrderListV1Resp.md new file mode 100644 index 00000000..e22f6390 --- /dev/null +++ b/docs/OrderListV1Resp.md @@ -0,0 +1,11 @@ +# OrderListV1Resp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orders** | [**list[CreateOrder]**](CreateOrder.md) | | +**total** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderLog.md b/docs/OrderLog.md new file mode 100644 index 00000000..3aba05de --- /dev/null +++ b/docs/OrderLog.md @@ -0,0 +1,11 @@ +# OrderLog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**OrderLogData**](OrderLogData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderLogData.md b/docs/OrderLogData.md new file mode 100644 index 00000000..31b5d2d9 --- /dev/null +++ b/docs/OrderLogData.md @@ -0,0 +1,18 @@ +# OrderLogData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | [optional] +**log_id** | **int** | logID | [optional] +**symbol** | **str** | Trading pair of the order | [optional] +**price_type** | **str** | Trade type (market=market price, trigger=trigger price) | [optional] +**state** | **int** | Order status code (1=placed, 2=canceled, 3=partially filled, 4=filled, 5=rejected) | [optional] +**side** | **int** | Side (1=sell, 2=buy) | [optional] +**volume** | **str** | Order quantity | [optional] +**price** | **str** | Average fill price | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderPatch.md b/docs/OrderPatch.md index f5c838e6..97ef1ea1 100644 --- a/docs/OrderPatch.md +++ b/docs/OrderPatch.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **price** | **str** | Trading price. Either `amount` or `price` must be specified | [optional] **amend_text** | **str** | Custom info during order amendment | [optional] **action_mode** | **str** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional] +**stop_profit** | [**SpotOrderStopProfit**](SpotOrderStopProfit.md) | | [optional] +**stop_loss** | [**SpotOrderStopLoss**](SpotOrderStopLoss.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/OrderPreviewV1Req.md b/docs/OrderPreviewV1Req.md new file mode 100644 index 00000000..599752f2 --- /dev/null +++ b/docs/OrderPreviewV1Req.md @@ -0,0 +1,12 @@ +# OrderPreviewV1Req + +Asset allocation optimization **preview** request. `from` is the selling quantity; `to` is the target currency and **distribution ratio ratio** (not the absolute quantity). Please use `OrderCreateV1Req` to place a formal order, and its `to` is `amount`. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_from** | [**list[PreviewFromParam]**](PreviewFromParam.md) | Sell ​​side; each item is the currency + the swap amount `amount` (string decimal). | +**to** | [**list[PreviewToParam]**](PreviewToParam.md) | Target side; each item is currency + **ratio** `ratio` (string decimal, such as `0.5`). Typical source: `GET /asset-swap/config` → `recommend_v2` `schemes[].name` / `schemes[].ratio` of the strategy under a certain group. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderPreviewV1Resp.md b/docs/OrderPreviewV1Resp.md new file mode 100644 index 00000000..64265e6b --- /dev/null +++ b/docs/OrderPreviewV1Resp.md @@ -0,0 +1,11 @@ +# OrderPreviewV1Resp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order** | [**PreviewOrder**](PreviewOrder.md) | | +**transaction_fee** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderResponse.md b/docs/OrderResponse.md new file mode 100644 index 00000000..a13147e2 --- /dev/null +++ b/docs/OrderResponse.md @@ -0,0 +1,23 @@ +# OrderResponse + +Order response +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | [optional] +**tx_hash** | **str** | Transaction Hash | [optional] +**side** | **str** | Buy or sell orders - buy - sell | [optional] +**usdt_amount** | **str** | Amount (USDT) | [optional] +**currency** | **str** | Token | [optional] +**currency_amount** | **str** | Token amount | [optional] +**status** | **int** | Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed | [optional] +**gas_mode** | **str** | Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter | [optional] +**chain** | **str** | Blockchain | [optional] +**gas_fee** | **str** | Gas Fee (USDT-based) | [optional] +**transaction_fee** | **str** | Trading Fee (USDT-based) | [optional] +**failed_reason** | **str** | Failure reason (if applicable) | [optional] +**create_time** | **int** | Creation timestamp | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcActionResponse.md b/docs/OtcActionResponse.md new file mode 100644 index 00000000..a98b7d57 --- /dev/null +++ b/docs/OtcActionResponse.md @@ -0,0 +1,12 @@ +# OtcActionResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**timestamp** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankCreateMultipartRequest.md b/docs/OtcBankCreateMultipartRequest.md new file mode 100644 index 00000000..87aa21e5 --- /dev/null +++ b/docs/OtcBankCreateMultipartRequest.md @@ -0,0 +1,20 @@ +# OtcBankCreateMultipartRequest + +Inner create-bank-card `multipart/form-data`. Use the form field `documentation_file` to upload the account-opening proof. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bank_account_name** | **str** | | +**bank_name** | **str** | | +**bank_country** | **str** | | +**bank_address** | **str** | | +**iban** | **str** | | +**swift** | **str** | | +**remittance_line_number** | **str** | | [optional] +**agent_bank_name** | **str** | | [optional] +**agent_bank_swift** | **str** | | [optional] +**documentation_file** | **str** | Account opening proof file content (multipart file field, binary/Base64; jpg/jpeg/png/pdf, etc.; maximum 10 MB per file, subject to the live environment) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankCreateResponse.md b/docs/OtcBankCreateResponse.md new file mode 100644 index 00000000..7c03b843 --- /dev/null +++ b/docs/OtcBankCreateResponse.md @@ -0,0 +1,14 @@ +# OtcBankCreateResponse + +Bank card created successfully (Inner returns bank_id and status). +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**OtcBankCreateResponseData**](OtcBankCreateResponseData.md) | | +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankCreateResponseData.md b/docs/OtcBankCreateResponseData.md new file mode 100644 index 00000000..4afaf7e7 --- /dev/null +++ b/docs/OtcBankCreateResponseData.md @@ -0,0 +1,11 @@ +# OtcBankCreateResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bank_id** | **int** | Bank card primary key in otc_rds. | +**status** | **int** | Review status (e.g., pending review). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankEnterpriseSupplementMultipartRequest.md b/docs/OtcBankEnterpriseSupplementMultipartRequest.md new file mode 100644 index 00000000..cba28a70 --- /dev/null +++ b/docs/OtcBankEnterpriseSupplementMultipartRequest.md @@ -0,0 +1,18 @@ +# OtcBankEnterpriseSupplementMultipartRequest + +Enterprise supplement `multipart/form-data`. File field names: `certificate`, `share_holders`, `passport`, `share_holding_structure`; optional `funds_statement`, `additional`. Optional string field `relationship_proof` (JSON) is merged into the request. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **str** | | [optional] +**bank_id** | **str** | | +**certificate** | **str** | Business license / registration certificate file content (multipart file field, binary/Base64) | +**share_holders** | **str** | Register of shareholders file content (multipart file field, binary/Base64) | +**passport** | **str** | Legal representative / shareholder passport file content (multipart file field, binary/Base64) | +**share_holding_structure** | **str** | Ownership structure chart file content (multipart file field, binary/Base64) | +**funds_statement** | **str** | Proof-of-funds file content (multipart file field, binary/Base64, optional) | [optional] +**additional** | **str** | Other supplementary material file content (multipart file field, binary/Base64, optional) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankIdRequest.md b/docs/OtcBankIdRequest.md new file mode 100644 index 00000000..def7ea28 --- /dev/null +++ b/docs/OtcBankIdRequest.md @@ -0,0 +1,10 @@ +# OtcBankIdRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bank_id** | **str** | Bank card ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankListItem.md b/docs/OtcBankListItem.md new file mode 100644 index 00000000..8320a4e5 --- /dev/null +++ b/docs/OtcBankListItem.md @@ -0,0 +1,23 @@ +# OtcBankListItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Bank card ID (used when placing an order; the synonymous `bank_id` field has been consolidated into `id`) | +**bank_account_name** | **str** | Bank account name | +**bank_name** | **str** | Bank name | +**bank_country** | **str** | Bank country | [optional] +**bank_address** | **str** | Bank address | [optional] +**iban** | **str** | IBAN number | [optional] +**swift** | **str** | SWIFT code | [optional] +**remittance_line_number** | **str** | Remittance routing number | [optional] +**agent_bank_name** | **str** | Correspondent bank name | [optional] +**agent_bank_swift** | **str** | Correspondent bank SWIFT code | [optional] +**submit_time** | **str** | Submission time | [optional] +**update_time** | **str** | Update time | [optional] +**status** | **str** | Status | [optional] +**is_default** | **int** | Whether it is the default bank card. 1 - Yes, 0 - No | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankListResponse.md b/docs/OtcBankListResponse.md new file mode 100644 index 00000000..df220032 --- /dev/null +++ b/docs/OtcBankListResponse.md @@ -0,0 +1,13 @@ +# OtcBankListResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**OtcBankListResult**](OtcBankListResult.md) | | +**timestamp** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankListResult.md b/docs/OtcBankListResult.md new file mode 100644 index 00000000..5f049981 --- /dev/null +++ b/docs/OtcBankListResult.md @@ -0,0 +1,10 @@ +# OtcBankListResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lists** | [**list[OtcBankListItem]**](OtcBankListItem.md) | Bank card list | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankPersonalSupplementMultipartRequest.md b/docs/OtcBankPersonalSupplementMultipartRequest.md new file mode 100644 index 00000000..f74cdb54 --- /dev/null +++ b/docs/OtcBankPersonalSupplementMultipartRequest.md @@ -0,0 +1,14 @@ +# OtcBankPersonalSupplementMultipartRequest + +Personal supplement `multipart/form-data`. File field names are fixed: `id_document_front`, `id_document_back`, `address_proof` (aligned with the checklist `code`); the optional string field `relationship_proof` (JSON text) is merged with the upload result. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bank_id** | **str** | | +**id_document_front** | **str** | ID document front-side file content (multipart file field, binary/Base64) | +**id_document_back** | **str** | ID document back-side file content (multipart file field, binary/Base64) | +**address_proof** | **str** | Proof-of-address file content (multipart file field, binary/Base64) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankSupplementChecklistItem.md b/docs/OtcBankSupplementChecklistItem.md new file mode 100644 index 00000000..c0e8034a --- /dev/null +++ b/docs/OtcBankSupplementChecklistItem.md @@ -0,0 +1,11 @@ +# OtcBankSupplementChecklistItem + +Supplementary document item +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | Supplementary document submission description | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankSupplementChecklistResponse.md b/docs/OtcBankSupplementChecklistResponse.md new file mode 100644 index 00000000..05721732 --- /dev/null +++ b/docs/OtcBankSupplementChecklistResponse.md @@ -0,0 +1,13 @@ +# OtcBankSupplementChecklistResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**OtcBankSupplementChecklistResponseData**](OtcBankSupplementChecklistResponseData.md) | | +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcBankSupplementChecklistResponseData.md b/docs/OtcBankSupplementChecklistResponseData.md new file mode 100644 index 00000000..40dac8ca --- /dev/null +++ b/docs/OtcBankSupplementChecklistResponseData.md @@ -0,0 +1,11 @@ +# OtcBankSupplementChecklistResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_type** | **str** | `personal` or `enterprise`, matching the supplementary document submission type; `items[].description` describes the submission requirements for each item | +**items** | [**list[OtcBankSupplementChecklistItem]**](OtcBankSupplementChecklistItem.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcMarkOrderPaidRequest.md b/docs/OtcMarkOrderPaidRequest.md new file mode 100644 index 00000000..54518657 --- /dev/null +++ b/docs/OtcMarkOrderPaidRequest.md @@ -0,0 +1,14 @@ +# OtcMarkOrderPaidRequest + +Request body for marking a fiat order as paid (deposit confirmation). Must include the user's payment receipt (consistent with §3.2). **`payment_receipt_file_key` is required**; the order primary key for this path is `order_id`. When accessed via the Pay gateway using `client_order_id`, the gateway's rewritten field prevails. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | +**client_order_id** | **str** | Client order ID (used by some gateway/Inner Pay paths, optional) | [optional] +**payment_receipt_file_key** | **str** | User payment receipt: **required**. Stored as a file_key. One file; jpg/jpeg/png/pdf; maximum 10 MB. | +**payment_receipt** | **str** | Alias compatible with `payment_receipt_file_key` (depends on the gateway's external field name) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcOrderDetail.md b/docs/OtcOrderDetail.md new file mode 100644 index 00000000..a8b4ce6f --- /dev/null +++ b/docs/OtcOrderDetail.md @@ -0,0 +1,37 @@ +# OtcOrderDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | +**uid** | **str** | User ID | +**type** | **str** | Order Type | +**fiat_currency** | **str** | Fiat currency | +**fiat_amount** | **str** | Fiat amount | +**crypto_currency** | **str** | Digital currency | +**crypto_amount** | **str** | Cryptocurrency amount | +**rate** | **str** | Exchange rate | +**bank_account_name** | **str** | User payment/receiving name | [optional] +**bank_name** | **str** | User payment/receiving bank name | [optional] +**bank_country** | **str** | User payment/receiving bank country | [optional] +**bank_address** | **str** | User payment/receiving bank address | [optional] +**bank_account_number_iban** | **str** | User payment/receiving bank account number/IBAN | [optional] +**swift_code** | **str** | User payment/receiving bank SWIFT code | [optional] +**intermediate_bank_name** | **str** | User payment/receiving intermediary bank name | [optional] +**intermediary_bank_swift_code** | **str** | User payment/receiving intermediary bank SWIFT code | [optional] +**gate_bank_account_name** | **str** | Gate beneficiary name, shown for BUY only | [optional] +**gate_bank_name** | **str** | Gate beneficiary bank name, shown for BUY only | [optional] +**gate_bank_country** | **str** | Gate beneficiary bank country, shown for BUY only | [optional] +**gate_bank_address** | **str** | Gate beneficiary bank address, shown for BUY only | [optional] +**gate_bank_account_number_iban** | **str** | Gate beneficiary bank account number/IBAN, shown for BUY only | [optional] +**gate_swift_code** | **str** | Gate beneficiary bank SWIFT code, shown for BUY only | [optional] +**gate_intermediary_bank_name** | **str** | Gate beneficiary intermediary bank name, shown for BUY only | [optional] +**gate_intermediary_bank_swift_code** | **str** | Gate beneficiary intermediary bank SWIFT code, shown for BUY only | [optional] +**gate_transfer_remark** | **str** | Transfer remark (mutually exclusive with `gate_reference_code`; empty when a BUY deposit order has a reference code), shown for BUY only | [optional] +**gate_reference_code** | **str** | Be sure to include the reference code when making the transfer so that your order can be processed promptly. (Mutually exclusive with `gate_transfer_remark`.) | [optional] +**status** | **str** | Status | +**create_time** | **str** | Created time | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcOrderDetailResponse.md b/docs/OtcOrderDetailResponse.md new file mode 100644 index 00000000..25002871 --- /dev/null +++ b/docs/OtcOrderDetailResponse.md @@ -0,0 +1,12 @@ +# OtcOrderDetailResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | +**code** | **int** | | +**data** | [**OtcOrderDetail**](OtcOrderDetail.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcOrderListCryptoCurrencyInfo.md b/docs/OtcOrderListCryptoCurrencyInfo.md new file mode 100644 index 00000000..7a8d7ef0 --- /dev/null +++ b/docs/OtcOrderListCryptoCurrencyInfo.md @@ -0,0 +1,11 @@ +# OtcOrderListCryptoCurrencyInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**icon** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcOrderListFiatCurrencyInfo.md b/docs/OtcOrderListFiatCurrencyInfo.md new file mode 100644 index 00000000..6f246130 --- /dev/null +++ b/docs/OtcOrderListFiatCurrencyInfo.md @@ -0,0 +1,11 @@ +# OtcOrderListFiatCurrencyInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name | +**icon** | **str** | Image | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcOrderListItem.md b/docs/OtcOrderListItem.md new file mode 100644 index 00000000..8940d47c --- /dev/null +++ b/docs/OtcOrderListItem.md @@ -0,0 +1,23 @@ +# OtcOrderListItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **str** | Current time | [optional] +**timestamp** | **int** | Current timestamp | [optional] +**order_id** | **str** | orderId | [optional] +**trade_no** | **str** | Trade number | [optional] +**type** | **str** | BUY deposit / SELL withdrawal | [optional] +**status** | **str** | Order status | [optional] +**fiat_currency** | **str** | Fiat currency | [optional] +**fiat_currency_info** | [**OtcOrderListFiatCurrencyInfo**](OtcOrderListFiatCurrencyInfo.md) | | [optional] +**fiat_amount** | **str** | Fiat amount | [optional] +**crypto_currency** | **str** | Digital currency | [optional] +**crypto_currency_info** | [**OtcOrderListCryptoCurrencyInfo**](OtcOrderListCryptoCurrencyInfo.md) | | [optional] +**crypto_amount** | **str** | Cryptocurrency amount | [optional] +**rate** | **str** | Exchange rate | [optional] +**promotion_code** | **str** | Promotion code | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcOrderListResponse.md b/docs/OtcOrderListResponse.md new file mode 100644 index 00000000..6e52c9ce --- /dev/null +++ b/docs/OtcOrderListResponse.md @@ -0,0 +1,12 @@ +# OtcOrderListResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**OtcOrderListResult**](OtcOrderListResult.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcOrderListResult.md b/docs/OtcOrderListResult.md new file mode 100644 index 00000000..4af2a0e2 --- /dev/null +++ b/docs/OtcOrderListResult.md @@ -0,0 +1,14 @@ +# OtcOrderListResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pn** | **int** | | +**ps** | **int** | | +**total_pn** | **int** | | +**count** | **int** | | +**list** | [**list[OtcOrderListItem]**](OtcOrderListItem.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcOrderRequest.md b/docs/OtcOrderRequest.md new file mode 100644 index 00000000..91295064 --- /dev/null +++ b/docs/OtcOrderRequest.md @@ -0,0 +1,19 @@ +# OtcOrderRequest + +Fiat Order Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | BUY for on-ramp, SELL for off-ramp | +**side** | **str** | The side returned by the quote endpoint (used for order validation). For backward compatibility, `FIAT`/`CRYPTO` or `PAY`/`GET` are accepted; new integrations should use the value returned by the quote response. | +**crypto_currency** | **str** | Cryptocurrency (supported currencies can be queried from the OTC web fiat quote page) | +**fiat_currency** | **str** | Fiat currency (supported currencies can be queried from the OTC web fiat quote page) | +**crypto_amount** | **str** | Amount of cryptocurrency | +**fiat_amount** | **str** | Fiat amount | +**promotion_code** | **str** | Promotion code | [optional] +**quote_token** | **str** | Parameter returned by the quote API | +**bank_id** | **str** | Bank card ID used to place the order. Select one from the list returned by `GET /otc/bank/list`; the default card has `is_default=1`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcQuoteRequest.md b/docs/OtcQuoteRequest.md new file mode 100644 index 00000000..7f5b1610 --- /dev/null +++ b/docs/OtcQuoteRequest.md @@ -0,0 +1,17 @@ +# OtcQuoteRequest + +Fiat and Stablecoin Quote Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**side** | **str** | PAY: specify the payment amount (`pay_amount` is required); GET: specify the receive amount (`get_amount` is required). | +**pay_coin** | **str** | Payment currency. Supported currencies are available on the OTC web quote page. | +**get_coin** | **str** | Receive currency. Supported currencies are available on the OTC web quote page. | +**pay_amount** | **str** | User payment currency amount | [optional] +**get_amount** | **str** | Amount of currency received by the user | [optional] +**create_quote_token** | **str** | Create quote token: 0: quote preview only; 1: generate quote token for order placement. | [optional] +**promotion_code** | **str** | Promotion code | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcQuoteResponse.md b/docs/OtcQuoteResponse.md new file mode 100644 index 00000000..f1e08740 --- /dev/null +++ b/docs/OtcQuoteResponse.md @@ -0,0 +1,13 @@ +# OtcQuoteResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**OtcQuoteResult**](OtcQuoteResult.md) | | +**timestamp** | **int** | Server Unix timestamp in seconds | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcQuoteResult.md b/docs/OtcQuoteResult.md new file mode 100644 index 00000000..0a5687e1 --- /dev/null +++ b/docs/OtcQuoteResult.md @@ -0,0 +1,23 @@ +# OtcQuoteResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | BUY (on-ramp) or SELL (off-ramp) | +**pay_coin** | **str** | Payment currency | +**get_coin** | **str** | Currency | +**pay_amount** | **str** | Payment amount | +**get_amount** | **str** | Redemption Amount | +**rate** | **str** | Exchange rate | +**rate_reci** | **str** | Reciprocal of the exchange rate | +**promotion_code** | **str** | Promotion code | +**side** | **str** | Quote method | +**order_type** | **str** | Order type: FIAT (fiat) / STABLE (stablecoin) | +**quote_token** | **str** | Quote token required when placing an order | +**validity_period** | **str** | Quote validity period (seconds) | [optional] +**refresh_limit** | **int** | Quote refresh limit | [optional] +**refresh_limit_msg** | **str** | Quote refresh limit message | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcStableCoinOrderCreateResponse.md b/docs/OtcStableCoinOrderCreateResponse.md new file mode 100644 index 00000000..07c3e049 --- /dev/null +++ b/docs/OtcStableCoinOrderCreateResponse.md @@ -0,0 +1,12 @@ +# OtcStableCoinOrderCreateResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Business code; 0 indicates success | +**message** | **str** | Message | +**timestamp** | **int** | Server Unix timestamp in seconds | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcStableCoinOrderListItem.md b/docs/OtcStableCoinOrderListItem.md new file mode 100644 index 00000000..821769e3 --- /dev/null +++ b/docs/OtcStableCoinOrderListItem.md @@ -0,0 +1,22 @@ +# OtcStableCoinOrderListItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | [optional] +**trade_no** | **str** | Transaction reference number | [optional] +**pay_coin** | **str** | Payment currency | [optional] +**pay_icon** | **str** | Payment currency icon | [optional] +**pay_amount** | **str** | Payment amount | [optional] +**get_coin** | **str** | Received currency | [optional] +**get_icon** | **str** | Received currency icon | [optional] +**get_amount** | **str** | Received amount | [optional] +**rate** | **str** | Exchange rate | [optional] +**rate_reci** | **str** | Reciprocal of the exchange rate | [optional] +**status** | **str** | PROCESSING: in progress / DONE: completed / FAILED: failed | [optional] +**create_timest** | **int** | Created time | [optional] +**create_time** | **str** | Created time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcStableCoinOrderListResponse.md b/docs/OtcStableCoinOrderListResponse.md new file mode 100644 index 00000000..019ee605 --- /dev/null +++ b/docs/OtcStableCoinOrderListResponse.md @@ -0,0 +1,12 @@ +# OtcStableCoinOrderListResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | +**data** | [**OtcStableCoinOrderListResult**](OtcStableCoinOrderListResult.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcStableCoinOrderListResult.md b/docs/OtcStableCoinOrderListResult.md new file mode 100644 index 00000000..6e3c7af3 --- /dev/null +++ b/docs/OtcStableCoinOrderListResult.md @@ -0,0 +1,14 @@ +# OtcStableCoinOrderListResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | | +**page_size** | **int** | | +**page_number** | **int** | | +**total_page** | **int** | | +**list** | [**list[OtcStableCoinOrderListItem]**](OtcStableCoinOrderListItem.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtcStableCoinOrderRequest.md b/docs/OtcStableCoinOrderRequest.md new file mode 100644 index 00000000..9e1c60f0 --- /dev/null +++ b/docs/OtcStableCoinOrderRequest.md @@ -0,0 +1,17 @@ +# OtcStableCoinOrderRequest + +Stablecoin Order Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_coin** | **str** | Currency paid by the user. Supported currencies can be queried from the OTC web stablecoin quote page. | +**get_coin** | **str** | Currency to be received by the user. Supported currencies can be queried from the OTC web stablecoin quote page. | +**pay_amount** | **str** | User payment currency amount | +**get_amount** | **str** | Amount of currency received by the user | +**side** | **str** | The side returned by the quote endpoint (used for order validation). For backward compatibility, `PAY`/`GET` are accepted; new integrations should use the value returned by the quote response. | +**promotion_code** | **str** | Promotion code (optional) | [optional] +**quote_token** | **str** | Parameter returned by the quote API | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OtherContact.md b/docs/OtherContact.md new file mode 100644 index 00000000..7c78a68b --- /dev/null +++ b/docs/OtherContact.md @@ -0,0 +1,12 @@ +# OtherContact + +Other contact information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **int** | Contact type | [optional] +**value** | **str** | Contact value | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pAdDetail.md b/docs/P2pAdDetail.md new file mode 100644 index 00000000..f6a507b3 --- /dev/null +++ b/docs/P2pAdDetail.md @@ -0,0 +1,51 @@ +# P2pAdDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rate** | **str** | Advertisement price. | [optional] +**type** | **str** | Ad side: `buy` buy-crypto ad; `sell` sell-crypto ad. | [optional] +**amount** | **str** | Remaining crypto amount on the ad. | [optional] +**min_amount** | **str** | Minimum quantity per order, denominated by currency_type | [optional] +**max_amount** | **str** | Maximum quantity per order, denominated by currency_type | [optional] +**fiat_min_amount** | **str** | Minimum trade amount in `want_type`. | [optional] +**fiat_max_amount** | **str** | Maximum trade amount priced in `want_type`. | [optional] +**limit_basis** | **int** | Trading limit unit. 0: crypto quantity, 1: fiat amount | [optional] +**limit_basis_text** | **str** | Trading limit unit label. crypto: crypto quantity, fiat: fiat amount | [optional] +**total** | **str** | Fiat amount | [optional] +**pay_ali** | **int** | Whether Alipay is supported. `1`: yes; `0`: no. | [optional] +**pay_bank** | **int** | Whether bank transfer is supported. `1`: yes; `0`: no. | [optional] +**pay_paypal** | **int** | Whether PayPal is supported. `1`: yes; `0`: no. | [optional] +**pay_wechat** | **int** | Whether WeChat Pay is supported. `1`: yes; `0`: no. | [optional] +**pay_type_num** | **str** | Payment method ID list | [optional] +**pay_type_json** | **str** | JSON map of payment type -> payment method ID. | [optional] +**locked_amount** | **str** | Locked amount | [optional] +**orderid** | **int** | Order ID | [optional] +**timestamp** | **int** | Created time | [optional] +**currency_type** | **str** | Cryptocurrency symbol. | [optional] +**want_type** | **str** | Fiat type | [optional] +**hide_rate** | **str** | Hidden price | [optional] +**trade_tips** | **str** | Trading terms | [optional] +**auto_reply** | **str** | Auto reply | [optional] +**rate_ref_id** | **int** | Floating reference: `1` platform; `2` Gate; `3` spot; `<= 0` means fixed price. | [optional] +**rate_offset** | **float** | Floating ratio (absolute value) | [optional] +**status** | **str** | Ad status: `OPEN` listed; `OFFLIN` delisted; `CLOSED` closed; `CANCEL` canceled. | [optional] +**rate_fixed** | **int** | Price type: `0` floating; `1` fixed. | [optional] +**float_trend** | **int** | Floating direction: `0` markup; `1` markdown. | [optional] +**expire_min** | **int** | Timeout (minutes) | [optional] +**tier_limit** | **int** | Tier limit | [optional] +**reg_time_limit** | **int** | Registration time limit | [optional] +**advertisers_limit** | **int** | Whether trading with the advertiser is restricted. `0`: no; `1`: yes. | [optional] +**polymarket_limit** | **int** | Whether to restrict trading with Polymarket users. 0: no restriction, 1: restricted | [optional] +**min_completed_limit** | **int** | Minimum limit of completed orders | [optional] +**max_completed_limit** | **int** | Maximum limit of completed orders | [optional] +**user_orders_limit** | **int** | Order count limit | [optional] +**completed_rate_limit** | **float** | 30-day completion rate limit | [optional] +**limit_country_cn** | **str** | Restricted nationality (Chinese) | [optional] +**limit_country_en** | **str** | Restricted nationality (English) | [optional] +**is_hedge** | **int** | Whether auto-delegation is enabled. `1`: yes; `0`: no. | [optional] +**hide_payment** | **int** | Whether payment methods are hidden. `1`: hidden; `0`: visible. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pAdDetailResponse.md b/docs/P2pAdDetailResponse.md new file mode 100644 index 00000000..81d3f977 --- /dev/null +++ b/docs/P2pAdDetailResponse.md @@ -0,0 +1,15 @@ +# P2pAdDetailResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**P2pAdDetail**](P2pAdDetail.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pAdsListItem.md b/docs/P2pAdsListItem.md new file mode 100644 index 00000000..87754af2 --- /dev/null +++ b/docs/P2pAdsListItem.md @@ -0,0 +1,23 @@ +# P2pAdsListItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **int** | Serial number | [optional] +**asset** | **str** | Cryptocurrency | [optional] +**fiat_unit** | **str** | Fiat currency | [optional] +**adv_no** | **int** | Ad ID | [optional] +**price** | **str** | Price | [optional] +**surplus_amount** | **str** | Remaining tradable crypto quantity | [optional] +**max_single_trans_amount** | **str** | Maximum crypto size per trade. | [optional] +**min_single_trans_amount** | **str** | Minimum crypto size per trade. | [optional] +**fiat_min_amount** | **str** | Minimum fiat amount per order | [optional] +**fiat_max_amount** | **str** | Maximum fiat amount per order | [optional] +**limit_basis** | **int** | Trading limit unit. 0: crypto quantity, 1: fiat amount | [optional] +**limit_basis_text** | **str** | Trading limit unit label. crypto: crypto quantity, fiat: fiat amount | [optional] +**trade_methods** | [**list[P2pAdsListTradeMethod]**](P2pAdsListTradeMethod.md) | Supported payment methods list | [optional] +**nick_name** | **str** | Advertiser Nickname | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pAdsListResponse.md b/docs/P2pAdsListResponse.md new file mode 100644 index 00000000..bad02063 --- /dev/null +++ b/docs/P2pAdsListResponse.md @@ -0,0 +1,15 @@ +# P2pAdsListResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**list[P2pAdsListItem]**](P2pAdsListItem.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pAdsListTradeMethod.md b/docs/P2pAdsListTradeMethod.md new file mode 100644 index 00000000..1a028cc2 --- /dev/null +++ b/docs/P2pAdsListTradeMethod.md @@ -0,0 +1,14 @@ +# P2pAdsListTradeMethod + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**icon_url_color** | **str** | Payment method color icon URL | [optional] +**identifier** | **str** | Payment method identifier | [optional] +**pay_id** | **str** | Payment method ID | [optional] +**pay_type** | **str** | Payment method type | [optional] +**trade_method_name** | **str** | Payment method name | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pAdsUpdateStatusResponse.md b/docs/P2pAdsUpdateStatusResponse.md new file mode 100644 index 00000000..6b796302 --- /dev/null +++ b/docs/P2pAdsUpdateStatusResponse.md @@ -0,0 +1,15 @@ +# P2pAdsUpdateStatusResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**P2pAdsUpdateStatusResult**](P2pAdsUpdateStatusResult.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pAdsUpdateStatusResult.md b/docs/P2pAdsUpdateStatusResult.md new file mode 100644 index 00000000..ba67ff40 --- /dev/null +++ b/docs/P2pAdsUpdateStatusResult.md @@ -0,0 +1,10 @@ +# P2pAdsUpdateStatusResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **int** | Ad status after update: `1` listed; `3` delisted; `4` closed. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pApi.md b/docs/P2pApi.md new file mode 100644 index 00000000..8c2c2b6b --- /dev/null +++ b/docs/P2pApi.md @@ -0,0 +1,1299 @@ +# gate_api.P2pApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**p2p_merchant_query_spot_balance**](P2pApi.md#p2p_merchant_query_spot_balance) | **GET** /spot/accounts | Query spot balance +[**p2p_merchant_account_get_user_info**](P2pApi.md#p2p_merchant_account_get_user_info) | **POST** /p2p/merchant/account/get_user_info | Get account information +[**p2p_merchant_account_get_counterparty_user_info**](P2pApi.md#p2p_merchant_account_get_counterparty_user_info) | **POST** /p2p/merchant/account/get_counterparty_user_info | Get counterparty information +[**p2p_merchant_account_get_myself_payment**](P2pApi.md#p2p_merchant_account_get_myself_payment) | **POST** /p2p/merchant/account/get_myself_payment | Get payment method list +[**p2p_merchant_account_set_merchant_work_hours**](P2pApi.md#p2p_merchant_account_set_merchant_work_hours) | **POST** /p2p/merchant/account/set_merchant_work_hours | Set merchant working status and custom working hours +[**p2p_merchant_transaction_get_pending_transaction_list**](P2pApi.md#p2p_merchant_transaction_get_pending_transaction_list) | **POST** /p2p/merchant/transaction/get_pending_transaction_list | Get pending orders +[**p2p_merchant_transaction_get_completed_transaction_list**](P2pApi.md#p2p_merchant_transaction_get_completed_transaction_list) | **POST** /p2p/merchant/transaction/get_completed_transaction_list | Get all/historical orders +[**p2p_merchant_transaction_get_transaction_details**](P2pApi.md#p2p_merchant_transaction_get_transaction_details) | **POST** /p2p/merchant/transaction/get_transaction_details | Query order details +[**p2p_merchant_transaction_confirm_payment**](P2pApi.md#p2p_merchant_transaction_confirm_payment) | **POST** /p2p/merchant/transaction/confirm-payment | Confirm payment +[**p2p_merchant_transaction_confirm_receipt**](P2pApi.md#p2p_merchant_transaction_confirm_receipt) | **POST** /p2p/merchant/transaction/confirm-receipt | Confirm receipt +[**p2p_merchant_transaction_cancel**](P2pApi.md#p2p_merchant_transaction_cancel) | **POST** /p2p/merchant/transaction/cancel | Cancel order +[**p2p_merchant_books_place_biz_push_order**](P2pApi.md#p2p_merchant_books_place_biz_push_order) | **POST** /p2p/merchant/books/place_biz_push_order | Publish ad order +[**p2p_merchant_books_ads_update_status**](P2pApi.md#p2p_merchant_books_ads_update_status) | **POST** /p2p/merchant/books/ads_update_status | Update ad status +[**p2p_merchant_books_ads_detail**](P2pApi.md#p2p_merchant_books_ads_detail) | **POST** /p2p/merchant/books/ads_detail | Query ad details +[**p2p_merchant_books_my_ads_list**](P2pApi.md#p2p_merchant_books_my_ads_list) | **POST** /p2p/merchant/books/my_ads_list | Get my ad list +[**p2p_merchant_books_ads_list**](P2pApi.md#p2p_merchant_books_ads_list) | **POST** /p2p/merchant/books/ads_list | Get Advertisement List +[**p2p_merchant_chat_get_chats_list**](P2pApi.md#p2p_merchant_chat_get_chats_list) | **POST** /p2p/merchant/chat/get_chats_list | Get chat history +[**p2p_merchant_chat_send_chat_message**](P2pApi.md#p2p_merchant_chat_send_chat_message) | **POST** /p2p/merchant/chat/send_chat_message | Send text message +[**p2p_merchant_chat_upload_chat_file**](P2pApi.md#p2p_merchant_chat_upload_chat_file) | **POST** /p2p/merchant/chat/upload_chat_file | Upload chat file + + +# **p2p_merchant_query_spot_balance** +> p2p_merchant_query_spot_balance() + +Query spot balance + +Use Spot API `GET /spot/accounts` to query spot account balance; this entry is for guidance only and does not define separate P2P Merchant request parameters or response body. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) + +try: + # Query spot balance + api_instance.p2p_merchant_query_spot_balance() +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_query_spot_balance: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Refer to the Spot API `GET /spot/accounts` response definition. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_account_get_user_info** +> P2pMerchantUserInfoResponse p2p_merchant_account_get_user_info() + +Get account information + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) + +try: + # Get account information + api_response = api_instance.p2p_merchant_account_get_user_info() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_account_get_user_info: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**P2pMerchantUserInfoResponse**](P2pMerchantUserInfoResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_account_get_counterparty_user_info** +> P2pCounterpartyUserInfoResponse p2p_merchant_account_get_counterparty_user_info(get_counterparty_user_info_request) + +Get counterparty information + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +get_counterparty_user_info_request = gate_api.GetCounterpartyUserInfoRequest() # GetCounterpartyUserInfoRequest | + +try: + # Get counterparty information + api_response = api_instance.p2p_merchant_account_get_counterparty_user_info(get_counterparty_user_info_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_account_get_counterparty_user_info: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **get_counterparty_user_info_request** | [**GetCounterpartyUserInfoRequest**](GetCounterpartyUserInfoRequest.md)| | + +### Return type + +[**P2pCounterpartyUserInfoResponse**](P2pCounterpartyUserInfoResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_account_get_myself_payment** +> P2pPaymentMethodsResponse p2p_merchant_account_get_myself_payment(get_myself_payment_request=get_myself_payment_request) + +Get payment method list + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +get_myself_payment_request = gate_api.GetMyselfPaymentRequest() # GetMyselfPaymentRequest | (optional) + +try: + # Get payment method list + api_response = api_instance.p2p_merchant_account_get_myself_payment(get_myself_payment_request=get_myself_payment_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_account_get_myself_payment: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **get_myself_payment_request** | [**GetMyselfPaymentRequest**](GetMyselfPaymentRequest.md)| | [optional] + +### Return type + +[**P2pPaymentMethodsResponse**](P2pPaymentMethodsResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_account_set_merchant_work_hours** +> P2pMerchantWorkHoursResponse p2p_merchant_account_set_merchant_work_hours(set_merchant_work_hours_request) + +Set merchant working status and custom working hours + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +set_merchant_work_hours_request = gate_api.SetMerchantWorkHoursRequest() # SetMerchantWorkHoursRequest | + +try: + # Set merchant working status and custom working hours + api_response = api_instance.p2p_merchant_account_set_merchant_work_hours(set_merchant_work_hours_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_account_set_merchant_work_hours: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **set_merchant_work_hours_request** | [**SetMerchantWorkHoursRequest**](SetMerchantWorkHoursRequest.md)| | + +### Return type + +[**P2pMerchantWorkHoursResponse**](P2pMerchantWorkHoursResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_transaction_get_pending_transaction_list** +> P2pTransactionListResponse p2p_merchant_transaction_get_pending_transaction_list(get_pending_transaction_list_request) + +Get pending orders + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +get_pending_transaction_list_request = gate_api.GetPendingTransactionListRequest() # GetPendingTransactionListRequest | + +try: + # Get pending orders + api_response = api_instance.p2p_merchant_transaction_get_pending_transaction_list(get_pending_transaction_list_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_transaction_get_pending_transaction_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **get_pending_transaction_list_request** | [**GetPendingTransactionListRequest**](GetPendingTransactionListRequest.md)| | + +### Return type + +[**P2pTransactionListResponse**](P2pTransactionListResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_transaction_get_completed_transaction_list** +> P2pTransactionListResponse p2p_merchant_transaction_get_completed_transaction_list(get_completed_transaction_list_request) + +Get all/historical orders + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +get_completed_transaction_list_request = gate_api.GetCompletedTransactionListRequest() # GetCompletedTransactionListRequest | + +try: + # Get all/historical orders + api_response = api_instance.p2p_merchant_transaction_get_completed_transaction_list(get_completed_transaction_list_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_transaction_get_completed_transaction_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **get_completed_transaction_list_request** | [**GetCompletedTransactionListRequest**](GetCompletedTransactionListRequest.md)| | + +### Return type + +[**P2pTransactionListResponse**](P2pTransactionListResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_transaction_get_transaction_details** +> P2pTransactionDetailResponse p2p_merchant_transaction_get_transaction_details(get_transaction_details_request) + +Query order details + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +get_transaction_details_request = gate_api.GetTransactionDetailsRequest() # GetTransactionDetailsRequest | + +try: + # Query order details + api_response = api_instance.p2p_merchant_transaction_get_transaction_details(get_transaction_details_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_transaction_get_transaction_details: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **get_transaction_details_request** | [**GetTransactionDetailsRequest**](GetTransactionDetailsRequest.md)| | + +### Return type + +[**P2pTransactionDetailResponse**](P2pTransactionDetailResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_transaction_confirm_payment** +> P2pTransactionActionResponse p2p_merchant_transaction_confirm_payment(confirm_payment) + +Confirm payment + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +confirm_payment = gate_api.ConfirmPayment() # ConfirmPayment | + +try: + # Confirm payment + api_response = api_instance.p2p_merchant_transaction_confirm_payment(confirm_payment) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_transaction_confirm_payment: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **confirm_payment** | [**ConfirmPayment**](ConfirmPayment.md)| | + +### Return type + +[**P2pTransactionActionResponse**](P2pTransactionActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_transaction_confirm_receipt** +> P2pTransactionActionResponse p2p_merchant_transaction_confirm_receipt(confirm_receipt) + +Confirm receipt + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +confirm_receipt = gate_api.ConfirmReceipt() # ConfirmReceipt | + +try: + # Confirm receipt + api_response = api_instance.p2p_merchant_transaction_confirm_receipt(confirm_receipt) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_transaction_confirm_receipt: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **confirm_receipt** | [**ConfirmReceipt**](ConfirmReceipt.md)| | + +### Return type + +[**P2pTransactionActionResponse**](P2pTransactionActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_transaction_cancel** +> P2pTransactionActionResponse p2p_merchant_transaction_cancel(cancel_order) + +Cancel order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +cancel_order = gate_api.CancelOrder() # CancelOrder | + +try: + # Cancel order + api_response = api_instance.p2p_merchant_transaction_cancel(cancel_order) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_transaction_cancel: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cancel_order** | [**CancelOrder**](CancelOrder.md)| | + +### Return type + +[**P2pTransactionActionResponse**](P2pTransactionActionResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_books_place_biz_push_order** +> P2pMerchantBooksPlaceBizPushOrderResponse p2p_merchant_books_place_biz_push_order(place_biz_push_order) + +Publish ad order + +When publishing or editing an advertisement, trade_tips and auto_reply go through off-platform traffic diversion risk control; when hit, the advertisement is not saved, and code 70305102 with data.risk_event is returned. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +place_biz_push_order = gate_api.PlaceBizPushOrder() # PlaceBizPushOrder | + +try: + # Publish ad order + api_response = api_instance.p2p_merchant_books_place_biz_push_order(place_biz_push_order) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_books_place_biz_push_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **place_biz_push_order** | [**PlaceBizPushOrder**](PlaceBizPushOrder.md)| | + +### Return type + +[**P2pMerchantBooksPlaceBizPushOrderResponse**](P2pMerchantBooksPlaceBizPushOrderResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_books_ads_update_status** +> P2pAdsUpdateStatusResponse p2p_merchant_books_ads_update_status(ads_update_status) + +Update ad status + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +ads_update_status = gate_api.AdsUpdateStatus() # AdsUpdateStatus | + +try: + # Update ad status + api_response = api_instance.p2p_merchant_books_ads_update_status(ads_update_status) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_books_ads_update_status: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ads_update_status** | [**AdsUpdateStatus**](AdsUpdateStatus.md)| | + +### Return type + +[**P2pAdsUpdateStatusResponse**](P2pAdsUpdateStatusResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_books_ads_detail** +> P2pAdDetailResponse p2p_merchant_books_ads_detail(ads_detail_request) + +Query ad details + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +ads_detail_request = gate_api.AdsDetailRequest() # AdsDetailRequest | + +try: + # Query ad details + api_response = api_instance.p2p_merchant_books_ads_detail(ads_detail_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_books_ads_detail: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ads_detail_request** | [**AdsDetailRequest**](AdsDetailRequest.md)| | + +### Return type + +[**P2pAdDetailResponse**](P2pAdDetailResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_books_my_ads_list** +> P2pMyAdsListResponse p2p_merchant_books_my_ads_list(my_ads_list_request=my_ads_list_request) + +Get my ad list + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +my_ads_list_request = gate_api.MyAdsListRequest() # MyAdsListRequest | (optional) + +try: + # Get my ad list + api_response = api_instance.p2p_merchant_books_my_ads_list(my_ads_list_request=my_ads_list_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_books_my_ads_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **my_ads_list_request** | [**MyAdsListRequest**](MyAdsListRequest.md)| | [optional] + +### Return type + +[**P2pMyAdsListResponse**](P2pMyAdsListResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_books_ads_list** +> P2pAdsListResponse p2p_merchant_books_ads_list(ads_list_request) + +Get Advertisement List + +Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +ads_list_request = gate_api.AdsListRequest() # AdsListRequest | + +try: + # Get Advertisement List + api_response = api_instance.p2p_merchant_books_ads_list(ads_list_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_books_ads_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ads_list_request** | [**AdsListRequest**](AdsListRequest.md)| | + +### Return type + +[**P2pAdsListResponse**](P2pAdsListResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_chat_get_chats_list** +> P2pChatListResponse p2p_merchant_chat_get_chats_list(get_chats_list_request) + +Get chat history + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +get_chats_list_request = gate_api.GetChatsListRequest() # GetChatsListRequest | + +try: + # Get chat history + api_response = api_instance.p2p_merchant_chat_get_chats_list(get_chats_list_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_chat_get_chats_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **get_chats_list_request** | [**GetChatsListRequest**](GetChatsListRequest.md)| | + +### Return type + +[**P2pChatListResponse**](P2pChatListResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_chat_send_chat_message** +> P2pSendChatMessageResponse p2p_merchant_chat_send_chat_message(send_chat_message_request) + +Send text message + +Text messages go through off-platform traffic diversion risk control. When hit, the API still returns code 0, and data contains risk_type=1 and toast_msg. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +send_chat_message_request = gate_api.SendChatMessageRequest() # SendChatMessageRequest | + +try: + # Send text message + api_response = api_instance.p2p_merchant_chat_send_chat_message(send_chat_message_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_chat_send_chat_message: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **send_chat_message_request** | [**SendChatMessageRequest**](SendChatMessageRequest.md)| | + +### Return type + +[**P2pSendChatMessageResponse**](P2pSendChatMessageResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **p2p_merchant_chat_upload_chat_file** +> P2pUploadChatFileResponse p2p_merchant_chat_upload_chat_file(upload_chat_file) + +Upload chat file + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.P2pApi(api_client) +upload_chat_file = gate_api.UploadChatFile() # UploadChatFile | + +try: + # Upload chat file + api_response = api_instance.p2p_merchant_chat_upload_chat_file(upload_chat_file) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling P2pApi->p2p_merchant_chat_upload_chat_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **upload_chat_file** | [**UploadChatFile**](UploadChatFile.md)| | + +### Return type + +[**P2pUploadChatFileResponse**](P2pUploadChatFileResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME <EMAIL@ADDRESS> Language: en Language-Team: en <L@li.org> Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/P2pChatListResponse.md b/docs/P2pChatListResponse.md new file mode 100644 index 00000000..327890bc --- /dev/null +++ b/docs/P2pChatListResponse.md @@ -0,0 +1,15 @@ +# P2pChatListResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**P2pChatListResult**](P2pChatListResult.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pChatListResult.md b/docs/P2pChatListResult.md new file mode 100644 index 00000000..7df647f1 --- /dev/null +++ b/docs/P2pChatListResult.md @@ -0,0 +1,15 @@ +# P2pChatListResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messages** | [**list[P2pChatMessage]**](P2pChatMessage.md) | Message List | [optional] +**memo** | **str** | Payment tip (displayed on homepage only) | [optional] +**has_history** | **bool** | Whether historical records exist | [optional] +**txid** | **int** | Order ID | [optional] +**srvtm** | **int** | Timestamp of the latest message. | [optional] +**order_status** | **str** | Raw order status in DB; typical values: `OPEN`, `PAID`, `LOCKED`, `ACCEPT`, `BCLOSED`, `CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pChatMessage.md b/docs/P2pChatMessage.md new file mode 100644 index 00000000..0493cf76 --- /dev/null +++ b/docs/P2pChatMessage.md @@ -0,0 +1,22 @@ +# P2pChatMessage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_sell** | **int** | Whether the current user is the seller. `1`: yes; `0`: no. | [optional] +**msg_type** | **int** | Message type: `0` text; `1` file; `2` template; `3` order-share; `4` payment-share; `5` status update. | [optional] +**msg** | **str** | Message content; for file messages, usually URL or file key. | [optional] +**username** | **str** | Message sender username | [optional] +**timest** | **int** | Message timestamp | [optional] +**msg_obj** | [**P2pChatMessagePayload**](P2pChatMessagePayload.md) | | [optional] +**uid** | **str** | Sender's crypto UID; system messages may use `System` or an empty string. | [optional] +**type** | **int** | Display type: `1` file message; `2` system message. | [optional] +**pic** | **str** | File link | [optional] +**file_key** | **str** | File key | [optional] +**file_type** | **str** | File type: `image` for images, `video` for videos. | [optional] +**risk_type** | **int** | Risk control display type. 1: off-platform traffic diversion risk; returned when a text message hits risk control | [optional] +**toast_msg** | **str** | Risk control prompt message; returned only when risk_type=1 | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pChatMessagePayload.md b/docs/P2pChatMessagePayload.md new file mode 100644 index 00000000..f0625e11 --- /dev/null +++ b/docs/P2pChatMessagePayload.md @@ -0,0 +1,30 @@ +# P2pChatMessagePayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | Order status when sending a message. Typical values: `OPEN`, `PAID`, `LOCKED`, `ACCEPT`, `BCLOSED`, `CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`. | [optional] +**text** | **str** | Message content | [optional] +**payment_voucher** | **list[str]** | Payment voucher | [optional] +**reason_id** | **int** | Cancel reason ID. `1` no longer want to buy; `2` cannot reach seller; `3` will not pay; `4` seller account not real; `5` payout account issue; `6` price mismatch; `7` mutually agreed cancel; `8` poor communication; `9` other; `10` seller cannot release with refund; `11` terms not met; `12` seller payout risk-controlled. | [optional] +**toast_id** | **int** | Cancellation reason popup | [optional] +**reason_memo** | **str** | Cancel reason description. | [optional] +**cancel_time** | **int** | Cancellation time | [optional] +**seller_confirm** | **int** | Seller confirmation of cancel reason: `0` pending; `1` confirmed; `2` rejected. | [optional] +**id** | **str** | Payment method information ID | [optional] +**account_des** | **str** | Payment method description | [optional] +**pay_type** | **str** | Payment method type | [optional] +**file** | **str** | Payment method file link | [optional] +**file_key** | **str** | Payment method file key | [optional] +**account** | **str** | Payment account or masked payment account. | [optional] +**memo** | **str** | Payment method note | [optional] +**code** | **str** | Payment method code | [optional] +**memo_ext** | **str** | Payment method additional note | [optional] +**trade_tips** | **str** | Payment method tip | [optional] +**real_name** | **str** | Payment method username | [optional] +**is_delete** | **int** | Whether the payment method was deleted. `1`: deleted; `0`: not deleted. | [optional] +**pay_name** | **str** | Payment method full name | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pCounterpartyUserInfo.md b/docs/P2pCounterpartyUserInfo.md new file mode 100644 index 00000000..dac8d18f --- /dev/null +++ b/docs/P2pCounterpartyUserInfo.md @@ -0,0 +1,28 @@ +# P2pCounterpartyUserInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_timest** | **str** | User registration time (formatted string) | [optional] +**email_verified** | **str** | Whether email is verified. `1`: yes; `0`: no. | [optional] +**verified** | **str** | Whether KYC is completed. `1`: yes; `0`: no. | [optional] +**has_phone** | **str** | Whether a phone number is bound. `1`: yes; `0`: no. | [optional] +**user_name** | **str** | Username | [optional] +**user_note** | **str** | User note information | [optional] +**complete_transactions** | **str** | Total completed orders | [optional] +**paid_transactions** | **str** | Number of completed buy orders | [optional] +**accepted_transactions** | **str** | Number of completed sell orders | [optional] +**transactions_used_time** | **str** | Average time to confirm receipt | [optional] +**cancelled_used_time_month** | **str** | Cancellation time in last 30 days | [optional] +**complete_transactions_month** | **str** | Number of completed orders in last 30 days | [optional] +**complete_rate_month** | **float** | Completion rate in last 30 days | [optional] +**is_follow** | **int** | Whether you follow this user. `1`: yes; `0`: no. | [optional] +**have_traded** | **int** | Whether you have traded with this user before. `1`: yes; `0`: no. | [optional] +**biz_uid** | **str** | Encrypted UID | [optional] +**registration_days** | **int** | Registration days | [optional] +**first_trade_days** | **int** | Days since first trade | [optional] +**trade_versatile** | **bool** | Single user or composite user | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pCounterpartyUserInfoResponse.md b/docs/P2pCounterpartyUserInfoResponse.md new file mode 100644 index 00000000..bdc57df4 --- /dev/null +++ b/docs/P2pCounterpartyUserInfoResponse.md @@ -0,0 +1,15 @@ +# P2pCounterpartyUserInfoResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**P2pCounterpartyUserInfo**](P2pCounterpartyUserInfo.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMerchantBooksPlaceBizPushOrderResponse.md b/docs/P2pMerchantBooksPlaceBizPushOrderResponse.md new file mode 100644 index 00000000..2dfa61b9 --- /dev/null +++ b/docs/P2pMerchantBooksPlaceBizPushOrderResponse.md @@ -0,0 +1,15 @@ +# P2pMerchantBooksPlaceBizPushOrderResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Response timestamp. | [optional] +**method** | **str** | Placeholder for request method. | [optional] +**code** | **int** | Response code. 0 means success; 70305102 means the advertisement trade terms or auto reply hit off-platform traffic diversion risk control | [optional] +**message** | **str** | Response message | [optional] +**data** | [**P2pMerchantBooksPlaceBizPushOrderResponseData**](P2pMerchantBooksPlaceBizPushOrderResponseData.md) | | [optional] +**version** | **str** | API version. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMerchantBooksPlaceBizPushOrderResponseData.md b/docs/P2pMerchantBooksPlaceBizPushOrderResponseData.md new file mode 100644 index 00000000..3064d147 --- /dev/null +++ b/docs/P2pMerchantBooksPlaceBizPushOrderResponseData.md @@ -0,0 +1,12 @@ +# P2pMerchantBooksPlaceBizPushOrderResponseData + +Empty object when the advertisement is published or edited successfully; returns risk details when the advertisement content hits risk control +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**risk_code** | **int** | Risk control sub-code; 0 for advertisement content traffic diversion risk control | [optional] +**risk_event** | [**P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent**](P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent.md b/docs/P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent.md new file mode 100644 index 00000000..01f36143 --- /dev/null +++ b/docs/P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent.md @@ -0,0 +1,17 @@ +# P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent + +Risk control prompt event for advertisement content +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Prompt display type | [optional] +**title** | **str** | Risk control prompt title | [optional] +**msg** | **str** | Risk control prompt message generated based on the field that hit risk control | [optional] +**action** | [**list[P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction]**](P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction.md) | Available actions; advertisement content risk control only returns the close action | [optional] +**content_risk_type** | **str** | Advertisement content field that hit risk control | [optional] +**trade_tips** | **str** | Prompt message returned when the trade terms hit risk control | [optional] +**auto_reply** | **str** | Prompt message returned when the auto reply hits risk control | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction.md b/docs/P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction.md new file mode 100644 index 00000000..e9b60f1a --- /dev/null +++ b/docs/P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction.md @@ -0,0 +1,13 @@ +# P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action_type** | **str** | Action type | [optional] +**title** | **str** | Action button text | [optional] +**mainly** | **int** | Whether it is the primary action. 0: no | [optional] +**action_data** | [**object**](.md) | Additional data of the action; empty object for the close action | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMerchantMarketInfo.md b/docs/P2pMerchantMarketInfo.md new file mode 100644 index 00000000..8091aa63 --- /dev/null +++ b/docs/P2pMerchantMarketInfo.md @@ -0,0 +1,12 @@ +# P2pMerchantMarketInfo + +Markets where user can place orders +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**market** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMerchantUserInfo.md b/docs/P2pMerchantUserInfo.md new file mode 100644 index 00000000..56531471 --- /dev/null +++ b/docs/P2pMerchantUserInfo.md @@ -0,0 +1,40 @@ +# P2pMerchantUserInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_self** | **bool** | Whether self | [optional] +**user_timest** | **str** | User registration time (formatted string) | [optional] +**counterparties_num** | **int** | Number of counterparties | [optional] +**email_verified** | **str** | Whether email is verified. `1`: yes; `0`: no. | [optional] +**verified** | **str** | Whether KYC is completed. `1`: yes; `0`: no. | [optional] +**has_phone** | **str** | Whether a phone number is bound. `1`: yes; `0`: no. | [optional] +**user_name** | **str** | Username | [optional] +**user_note** | **str** | User note information | [optional] +**complete_transactions** | **str** | Total completed orders | [optional] +**paid_transactions** | **str** | Number of completed buy orders | [optional] +**accepted_transactions** | **str** | Number of completed sell orders | [optional] +**transactions_used_time** | **str** | Average time to confirm receipt | [optional] +**cancelled_used_time_month** | **str** | Cancellation time in last 30 days | [optional] +**complete_transactions_month** | **str** | Number of completed orders in last 30 days | [optional] +**complete_rate_month** | **float** | Completion rate in last 30 days | [optional] +**orders_buy_rate_month** | **float** | Buy order ratio in last 30 days | [optional] +**is_black** | **int** | Whether the user is blocked. `1`: yes; `0`: no. | [optional] +**is_follow** | **int** | Whether you follow this user. `1`: yes; `0`: no. | [optional] +**have_traded** | **int** | Whether you have traded with this user before. `1`: yes; `0`: no. | [optional] +**biz_uid** | **str** | Encrypted UID | [optional] +**blue_vip** | **int** | Blue V Crown Shield | [optional] +**work_status** | **int** | Merchant work status | [optional] +**registration_days** | **int** | Registration days | [optional] +**first_trade_days** | **int** | Days since first trade | [optional] +**need_replenish** | **int** | Whether additional margin is required. `1`: yes; `0`: no. | [optional] +**merchant_info** | [**P2pMerchantMarketInfo**](P2pMerchantMarketInfo.md) | | [optional] +**online_status** | **int** | Merchant online status: `1` online; `0` offline. | [optional] +**work_hours** | [**object**](.md) | Merchant online status details | [optional] +**transactions_month** | **float** | 30-day transaction volume | [optional] +**transactions_all** | **float** | Total transaction volume | [optional] +**trade_versatile** | **bool** | Single user or composite user | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMerchantUserInfoResponse.md b/docs/P2pMerchantUserInfoResponse.md new file mode 100644 index 00000000..eb547a69 --- /dev/null +++ b/docs/P2pMerchantUserInfoResponse.md @@ -0,0 +1,15 @@ +# P2pMerchantUserInfoResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**P2pMerchantUserInfo**](P2pMerchantUserInfo.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMerchantWorkHours.md b/docs/P2pMerchantWorkHours.md new file mode 100644 index 00000000..869e87d6 --- /dev/null +++ b/docs/P2pMerchantWorkHours.md @@ -0,0 +1,10 @@ +# P2pMerchantWorkHours + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**work_status** | **int** | Merchant's current working status. 0: normal resting, 1: normal working, 2: custom resting, 3: custom working | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMerchantWorkHoursResponse.md b/docs/P2pMerchantWorkHoursResponse.md new file mode 100644 index 00000000..94b61c50 --- /dev/null +++ b/docs/P2pMerchantWorkHoursResponse.md @@ -0,0 +1,15 @@ +# P2pMerchantWorkHoursResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Response timestamp. | [optional] +**method** | **str** | Placeholder for request method. | [optional] +**code** | **int** | Response code, 0 means success | [optional] +**message** | **str** | Response message | [optional] +**data** | [**P2pMerchantWorkHours**](P2pMerchantWorkHours.md) | | [optional] +**version** | **str** | API version. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMyAd.md b/docs/P2pMyAd.md new file mode 100644 index 00000000..833c143d --- /dev/null +++ b/docs/P2pMyAd.md @@ -0,0 +1,48 @@ +# P2pMyAd + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Ad side: `buy` buy-crypto ad; `sell` sell-crypto ad. | [optional] +**rate** | **str** | Price | [optional] +**original_rate** | **str** | Original price | [optional] +**amount** | **str** | Remaining crypto amount on the ad. | [optional] +**total** | **str** | Remaining fiat amount of ad | [optional] +**limit_total** | **str** | Single order limit range (cryptocurrency) | [optional] +**limit_fiat** | **str** | Single order limit range (fiat) | [optional] +**min_amount** | **str** | Minimum quantity per order | [optional] +**max_amount** | **str** | Maximum quantity per order | [optional] +**pay_type_num** | **str** | Payment method ID list | [optional] +**pay_type_json** | **str** | JSON map of payment type -> payment method ID. | [optional] +**expire_min** | **str** | Ad expiration time (minutes) | [optional] +**tier_limit** | **str** | VIP limit | [optional] +**advertisers_limit** | **int** | Whether trading with the advertiser is restricted. `0`: no; `1`: yes. | [optional] +**reg_time_limit** | **int** | Registration time limit | [optional] +**verified_limit** | **int** | KYC level limit | [optional] +**min_completed_limit** | **int** | Minimum limit of completed orders by counterparty | [optional] +**max_completed_limit** | **int** | Maximum limit of completed orders by counterparty | [optional] +**user_country_limit** | **int** | KYC nationality restriction | [optional] +**completed_rate_limit** | **float** | 30-day completion rate limit | [optional] +**user_orders_limit** | **int** | Maximum order limit for counterparty | [optional] +**hide_payment** | **str** | Whether payment methods are hidden. `1`: hidden; `0`: visible. | [optional] +**currency_type** | **str** | Cryptocurrency symbol. | [optional] +**want_type** | **str** | Fiat currency | [optional] +**trade_tips** | **str** | Trading terms | [optional] +**new_hand** | **int** | Special ad type. `0` normal; `1` newcomer guide; `2` newcomer discount; `3` featured promo; `4` KOL ad; `5` coupon ad. | [optional] +**id** | **str** | Advertisement ID. | [optional] +**status** | **str** | Ad status: `OPEN` listed; `OFFLIN` delisted; `CLOSED` closed; `CANCEL` canceled. | [optional] +**locked_amount** | **str** | Ad frozen amount | [optional] +**hide_rate** | **str** | Hidden price | [optional] +**is_out_time** | **int** | Whether the ad timed out. `1`: timed out; `0`: not yet. | [optional] +**rate_ref_id** | **int** | Floating reference: `1` platform; `2` Gate; `3` spot; `<= 0` means fixed price. | [optional] +**rate_offset** | **str** | Floating ratio | [optional] +**rate_fixed** | **int** | Price type: `0` floating; `1` fixed. | [optional] +**float_trend** | **int** | Floating direction: `0` markup; `1` markdown. | [optional] +**in_dispute** | **int** | Whether the ad had a disputed trade. `1`: yes; `0`: no. | [optional] +**auto_reply** | **str** | Auto reply data | [optional] +**timestamp** | **int** | Ad creation time | [optional] +**is_hedge** | **int** | Whether auto-delegation is enabled. `1`: yes; `0`: no. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMyAdsListResponse.md b/docs/P2pMyAdsListResponse.md new file mode 100644 index 00000000..56e5e1a7 --- /dev/null +++ b/docs/P2pMyAdsListResponse.md @@ -0,0 +1,15 @@ +# P2pMyAdsListResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**P2pMyAdsListResult**](P2pMyAdsListResult.md) | | [optional] +**version** | **str** | Version number | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pMyAdsListResult.md b/docs/P2pMyAdsListResult.md new file mode 100644 index 00000000..6b0a57f6 --- /dev/null +++ b/docs/P2pMyAdsListResult.md @@ -0,0 +1,10 @@ +# P2pMyAdsListResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lists** | [**list[P2pMyAd]**](P2pMyAd.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pPaymentMethodAccount.md b/docs/P2pPaymentMethodAccount.md new file mode 100644 index 00000000..92154322 --- /dev/null +++ b/docs/P2pPaymentMethodAccount.md @@ -0,0 +1,31 @@ +# P2pPaymentMethodAccount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **int** | useruID | [optional] +**bankid** | **str** | User's currently bound payment method (primary key ID) | [optional] +**nickname** | **int** | Cardholder UID | [optional] +**bankname** | **str** | Bank name | [optional] +**bankbranch** | **str** | Bank branch name | [optional] +**bankcity** | **str** | Bank city | [optional] +**bankprov** | **str** | Bank province | [optional] +**bankaddr** | **str** | Bank card number or masked card number. | [optional] +**bankdesc** | **str** | Bank note | [optional] +**hold_uid** | **int** | Cardholder UID | [optional] +**hold_username** | **str** | Cardholder name | [optional] +**real_name** | **str** | User verified display name. | [optional] +**id** | **str** | User's currently bound payment method (primary key ID) | [optional] +**account_des** | **str** | Payment method description | [optional] +**pay_type** | **str** | Payment method type | [optional] +**file** | **str** | Payment method file link | [optional] +**file_key** | **str** | Payment method file key | [optional] +**account** | **str** | Payment account or masked payment account. | [optional] +**memo** | **str** | Payment method note | [optional] +**code** | **str** | Payment method code | [optional] +**memo_ext** | **str** | Payment method additional note | [optional] +**trade_tips** | **str** | Payment method transaction information | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pPaymentMethodGroup.md b/docs/P2pPaymentMethodGroup.md new file mode 100644 index 00000000..ec894735 --- /dev/null +++ b/docs/P2pPaymentMethodGroup.md @@ -0,0 +1,13 @@ +# P2pPaymentMethodGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_type** | **str** | Payment method type | [optional] +**pay_name** | **str** | Payment method name | [optional] +**ids** | **list[int]** | User's currently bound payment method (primary key ID) | [optional] +**list** | [**list[P2pPaymentMethodAccount]**](P2pPaymentMethodAccount.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pPaymentMethodsResponse.md b/docs/P2pPaymentMethodsResponse.md new file mode 100644 index 00000000..79f2f263 --- /dev/null +++ b/docs/P2pPaymentMethodsResponse.md @@ -0,0 +1,15 @@ +# P2pPaymentMethodsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**list[P2pPaymentMethodGroup]**](P2pPaymentMethodGroup.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pSendChatMessageResponse.md b/docs/P2pSendChatMessageResponse.md new file mode 100644 index 00000000..d8322416 --- /dev/null +++ b/docs/P2pSendChatMessageResponse.md @@ -0,0 +1,15 @@ +# P2pSendChatMessageResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**P2pSendChatMessageResult**](P2pSendChatMessageResult.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pSendChatMessageResult.md b/docs/P2pSendChatMessageResult.md new file mode 100644 index 00000000..9858f29d --- /dev/null +++ b/docs/P2pSendChatMessageResult.md @@ -0,0 +1,15 @@ +# P2pSendChatMessageResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**srvtm** | **int** | Timestamp when message was successfully sent (current timestamp) | [optional] +**txid** | **int** | Order ID | [optional] +**conversation_id** | **str** | Chat ID, formatted as both parties' UIDs concatenated in ascending order | [optional] +**msg_type** | **int** | Message content type when risk control is hit. 0: text | [optional] +**risk_type** | **int** | Risk control display type. 1: off-platform traffic diversion risk; returned only when risk control is hit | [optional] +**toast_msg** | **str** | Risk control prompt message; returned only when risk_type=1 | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pTransactionActionResponse.md b/docs/P2pTransactionActionResponse.md new file mode 100644 index 00000000..c294d158 --- /dev/null +++ b/docs/P2pTransactionActionResponse.md @@ -0,0 +1,15 @@ +# P2pTransactionActionResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Response timestamp. | [optional] +**method** | **str** | Placeholder for request method. | [optional] +**code** | **int** | Response code, 0 means success | [optional] +**message** | **str** | Response message | [optional] +**data** | [**object**](.md) | Empty object on success. | [optional] +**version** | **str** | API version. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pTransactionConvertInfo.md b/docs/P2pTransactionConvertInfo.md new file mode 100644 index 00000000..23c373c5 --- /dev/null +++ b/docs/P2pTransactionConvertInfo.md @@ -0,0 +1,20 @@ +# P2pTransactionConvertInfo + +Flash swap order information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**convert_type** | **str** | Flash swap target currency | [optional] +**convert_status** | **str** | Flash swap order status | [optional] +**pre_rate** | **str** | Expected price when placing order | [optional] +**rate** | **str** | Execution price | [optional] +**pre_fiat_rate** | **str** | Expected fiat price when placing order | [optional] +**fiat_rate** | **str** | Fiat price at execution | [optional] +**amount** | **str** | Size | [optional] +**convert_amount** | **str** | Swap Amount | [optional] +**slippage** | **str** | Slippage calculation: slippage = (expected price when placing order - real-time price during auto swap) / expected price when placing order | [optional] +**status** | **str** | Flash swap order display status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pTransactionDetail.md b/docs/P2pTransactionDetail.md new file mode 100644 index 00000000..10c089cf --- /dev/null +++ b/docs/P2pTransactionDetail.md @@ -0,0 +1,57 @@ +# P2pTransactionDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_sell** | **int** | Whether the current user is the seller. `1`: yes; `0`: no. | [optional] +**txid** | **int** | Order ID | [optional] +**orderid** | **int** | Order ID | [optional] +**timest** | **int** | Order creation timestamp | [optional] +**last_pay_time** | **int** | Payment deadline | [optional] +**remain_pay_time** | **int** | Seconds left to pay; `<= 0` means overdue. | [optional] +**currency_type** | **str** | Cryptocurrency symbol. | [optional] +**want_type** | **str** | Fiat currency | [optional] +**symbol** | **str** | Fiat currency symbol | [optional] +**rate** | **str** | Order price in `want_type` units. | [optional] +**amount** | **str** | Order size in cryptocurrency. | [optional] +**total** | **str** | Total fiat amount of the order. | [optional] +**status** | **str** | Display status: `unpay` unpaid; `hide_payment` unpaid with payment info hidden; `paid` buyer paid; `unconfirmed` awaiting seller confirmation; `locked` locked; `finished` done; `cancel` canceled; `expired` expired; `bclosed` arbitration filled; `sclosed` arbitration canceled. | [optional] +**reason_id** | **str** | Cancel reason ID; empty string means none. Examples: `1` no longer want to buy; `2` cannot reach seller; `3` will not pay; `4` seller did not provide a real account; `6` price/amount mismatch; `9` other; `10` seller cannot release and refund issued; `11` terms not met; `12` seller payout account risk-controlled. | [optional] +**reason_desc** | **str** | Cancel reason description. | [optional] +**cancel_time** | **str** | Cancellation time | [optional] +**in_appeal** | **int** | Whether a dispute is active. `1`: yes; `0`: no. | [optional] +**dispute_time** | **int** | Earliest timestamp when a dispute may be opened. | [optional] +**cancelable** | **int** | Whether cancellation is allowed. `1`: yes; `0`: no. | [optional] +**hide_payment** | **int** | Whether payment methods are hidden. `1`: hidden; `0`: visible. | [optional] +**trade_tips** | **str** | Trading terms | [optional] +**show_bank** | **str** | Whether to show bank transfer details. `1`: show; `0`: hide. | [optional] +**bankname** | **str** | Bank name | [optional] +**bankbranch** | **str** | Bank branch name | [optional] +**bankid** | **str** | Bank account or masked account. | [optional] +**bank_holder_realname** | **str** | Bank cardholder name | [optional] +**show_ali** | **str** | Whether to show Alipay details. `1`: show; `0`: hide. | [optional] +**aliname** | **str** | Alipay account name | [optional] +**is_alicode** | **int** | Whether an Alipay QR exists. `1`: yes; `0`: no. | [optional] +**show_wechat** | **str** | Whether to show WeChat details. `1`: show; `0`: hide. | [optional] +**wename** | **str** | WeChat account name | [optional] +**show_others** | **str** | Whether to show other payment methods. `1`: show; `0`: hide. | [optional] +**pay_others** | [**list[P2pTransactionDetailPayOthers]**](P2pTransactionDetailPayOthers.md) | Other payment methods | [optional] +**sel_paytype** | **str** | Selected payment type for this order, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. | [optional] +**its_uid** | **str** | Counterparty crypto UID. | [optional] +**its_nickname** | **str** | Counterparty nickname | [optional] +**its_realname** | **str** | Counterparty real name or verified display name. | [optional] +**have_traded** | **int** | Whether you traded with the counterparty before. `1`: yes; `0`: no. | [optional] +**appeal_allow_cancel** | **int** | Whether the dispute can be withdrawn. `1`: allowed; `0`: not allowed. | [optional] +**appeal_verdict_has_open** | **str** | Dispute outcome or in-dispute notice text. | [optional] +**im_unread** | **int** | Unread chat message count. | [optional] +**payment_voucher_url** | **list[str]** | Payment voucher | [optional] +**timest_paid** | **int** | Timestamp when the buyer confirmed payment. | [optional] +**own_realname** | **str** | Current user's real name or verified display name. | [optional] +**order_type** | **int** | Order type: `1` standard; `2` partner; `3` flash swap; `4` Web3. | [optional] +**is_show_receive** | **int** | Whether to show confirm-receipt during dispute. `1`: show; `0`: hide. | [optional] +**show_seller_contact_info** | **bool** | Whether to display seller contact information | [optional] +**supported_pay_types** | **list[str]** | Supported payment method types for the order, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pTransactionDetailPayOthers.md b/docs/P2pTransactionDetailPayOthers.md new file mode 100644 index 00000000..5b371de5 --- /dev/null +++ b/docs/P2pTransactionDetailPayOthers.md @@ -0,0 +1,16 @@ +# P2pTransactionDetailPayOthers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Payment method record ID. | [optional] +**account_des** | **str** | Payment method description | [optional] +**pay_type** | **str** | Payment method type | [optional] +**account** | **str** | Payment account or masked account. | [optional] +**memo** | **str** | Payment note or memo. | [optional] +**trade_tips** | **str** | Payment instructions or tips. | [optional] +**pay_name** | **str** | Display name of the payment method. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pTransactionDetailResponse.md b/docs/P2pTransactionDetailResponse.md new file mode 100644 index 00000000..2c20ec37 --- /dev/null +++ b/docs/P2pTransactionDetailResponse.md @@ -0,0 +1,15 @@ +# P2pTransactionDetailResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**P2pTransactionDetail**](P2pTransactionDetail.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pTransactionListItem.md b/docs/P2pTransactionListItem.md new file mode 100644 index 00000000..2f9ae02e --- /dev/null +++ b/docs/P2pTransactionListItem.md @@ -0,0 +1,33 @@ +# P2pTransactionListItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type_buy** | **int** | Order side from current user's view. `1`: buy; `0`: sell. | [optional] +**timest** | **str** | Creation time of order | [optional] +**timest_expire** | **str** | Order expiration time | [optional] +**timestamp** | **int** | Order creation timestamp | [optional] +**rate** | **str** | Order price in fiat currency. | [optional] +**amount** | **str** | Order size in cryptocurrency. | [optional] +**total** | **str** | Total fiat amount of the order. | [optional] +**txid** | **int** | Order ID | [optional] +**status** | **str** | Display status: `unpay` awaiting payment; `paid` buyer paid; `unconfirmed` awaiting seller confirmation; `locked` locked; `finished` completed; `cancel` canceled; `expired` expired; `bclosed` arbitration filled; `sclosed` arbitration canceled. | [optional] +**its_realname** | **str** | Counterparty real name or verified display name. | [optional] +**its_uid** | **str** | Counterparty crypto UID. | [optional] +**its_nick** | **str** | Counterparty nickname | [optional] +**seller_realname** | **str** | Seller real name or verified display name. | [optional] +**buyer_realname** | **str** | Buyer real name or verified display name. | [optional] +**cancelable** | **int** | Whether the order can be canceled. `1`: yes; `0`: no. | [optional] +**currency_type** | **str** | Cryptocurrency symbol. | [optional] +**want_type** | **str** | Fiat currency | [optional] +**hide_payment** | **int** | Whether payment methods are hidden. `1`: hidden; `0`: visible. | [optional] +**sel_paytype** | **str** | Selected payment type for this order, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. | [optional] +**pay_others** | [**list[P2pTransactionListResultPayOthers]**](P2pTransactionListResultPayOthers.md) | Other payment method details; may appear on historical orders. | [optional] +**cd_time** | **int** | Countdown seconds for the current order. | [optional] +**order_type** | **int** | Order type: `1` standard; `2` partner; `3` flash swap; `4` Web3. | [optional] +**order_tag** | **list[str]** | Order tags | [optional] +**convert_info** | [**P2pTransactionConvertInfo**](P2pTransactionConvertInfo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pTransactionListResponse.md b/docs/P2pTransactionListResponse.md new file mode 100644 index 00000000..4b98c9ff --- /dev/null +++ b/docs/P2pTransactionListResponse.md @@ -0,0 +1,15 @@ +# P2pTransactionListResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**P2pTransactionListResult**](P2pTransactionListResult.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pTransactionListResult.md b/docs/P2pTransactionListResult.md new file mode 100644 index 00000000..2cdad4ed --- /dev/null +++ b/docs/P2pTransactionListResult.md @@ -0,0 +1,13 @@ +# P2pTransactionListResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[P2pTransactionListItem]**](P2pTransactionListItem.md) | | [optional] +**trans_time** | [**list[P2pTransactionTimeMarker]**](P2pTransactionTimeMarker.md) | Countdown time | [optional] +**count** | **int** | Number of orders | [optional] +**exported_num** | **int** | Export count | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pTransactionListResultPayOthers.md b/docs/P2pTransactionListResultPayOthers.md new file mode 100644 index 00000000..8fef83b0 --- /dev/null +++ b/docs/P2pTransactionListResultPayOthers.md @@ -0,0 +1,11 @@ +# P2pTransactionListResultPayOthers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pay_type** | **str** | Payment method type | [optional] +**pay_name** | **str** | Payment method name | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pTransactionTimeMarker.md b/docs/P2pTransactionTimeMarker.md new file mode 100644 index 00000000..3a7694f2 --- /dev/null +++ b/docs/P2pTransactionTimeMarker.md @@ -0,0 +1,10 @@ +# P2pTransactionTimeMarker + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**od_time** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pUploadChatFileResponse.md b/docs/P2pUploadChatFileResponse.md new file mode 100644 index 00000000..fd7989b1 --- /dev/null +++ b/docs/P2pUploadChatFileResponse.md @@ -0,0 +1,15 @@ +# P2pUploadChatFileResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | | [optional] +**method** | **str** | | [optional] +**code** | **int** | | [optional] +**message** | **str** | | [optional] +**data** | [**P2pUploadChatFileResult**](P2pUploadChatFileResult.md) | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/P2pUploadChatFileResult.md b/docs/P2pUploadChatFileResult.md new file mode 100644 index 00000000..923888bf --- /dev/null +++ b/docs/P2pUploadChatFileResult.md @@ -0,0 +1,10 @@ +# P2pUploadChatFileResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file_key** | **str** | File key | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PartnerApplication.md b/docs/PartnerApplication.md new file mode 100644 index 00000000..cca8c5d3 --- /dev/null +++ b/docs/PartnerApplication.md @@ -0,0 +1,41 @@ +# PartnerApplication + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Application record ID | [optional] +**uid** | **int** | User ID | [optional] +**language** | **str** | Language code | [optional] +**country_id** | **int** | Country ID | [optional] +**firstname** | **str** | First name | [optional] +**lastname** | **str** | Last name | [optional] +**email** | **str** | Email address | [optional] +**join_uid** | **int** | Joined user ID | [optional] +**join_country_id** | **int** | Joined country ID | [optional] +**identity_comment** | **str** | Identity description | [optional] +**promotion_channels** | **str** | Promotion channels, separated by | | [optional] +**contact_details** | **str** | Contact details (JSON string) | [optional] +**know_details** | **str** | Learn more | [optional] +**question_lang** | **str** | Question language | [optional] +**create_timest** | **datetime** | Created time | [optional] +**update_timest** | **datetime** | Update time | [optional] +**apply_type** | **int** | Application type | [optional] +**audit_status** | **int** | Review status (0 - pending, 1 - approved, 2 - rejected) | [optional] +**edit_counts** | **int** | Edit count | [optional] +**proof_images** | **str** | Proof image path | [optional] +**proof_videos** | **str** | Proof video path | [optional] +**proof_url** | **str** | Proof link | [optional] +**audit_reason** | **int** | Review reason code | [optional] +**channel_type** | **int** | Channel type | [optional] +**region** | **str** | Region | [optional] +**phone** | **str** | Phone number | [optional] +**telegram** | **str** | Telegram account | [optional] +**other_contact** | [**OtherContact**](OtherContact.md) | | [optional] +**proof_images_url_list** | **list[str]** | List of proof image URLs | [optional] +**proof_videos_url_list** | **list[str]** | List of proof video URLs | [optional] +**apply_msg** | **str** | Application message | [optional] +**jump_url** | **str** | Redirect URL | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PartnerApplicationResponse.md b/docs/PartnerApplicationResponse.md new file mode 100644 index 00000000..c46acff0 --- /dev/null +++ b/docs/PartnerApplicationResponse.md @@ -0,0 +1,13 @@ +# PartnerApplicationResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Error Code, 0 Indicates Success | +**message** | **str** | Error message description | +**data** | [**PartnerApplication**](PartnerApplication.md) | | +**timestamp** | **int** | Unix timestamp | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PartnerApplicationResponseAllOf.md b/docs/PartnerApplicationResponseAllOf.md new file mode 100644 index 00000000..fbad9fcc --- /dev/null +++ b/docs/PartnerApplicationResponseAllOf.md @@ -0,0 +1,10 @@ +# PartnerApplicationResponseAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**PartnerApplication**](PartnerApplication.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PartnerDataAggregated.md b/docs/PartnerDataAggregated.md new file mode 100644 index 00000000..4a4963ec --- /dev/null +++ b/docs/PartnerDataAggregated.md @@ -0,0 +1,17 @@ +# PartnerDataAggregated + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rebate_amount** | **str** | Rebate amount as a string for precision. Up to 6 decimal places; trailing zeros removed. | +**trade_volume** | **str** | Trading volume as a string for precision. Up to 6 decimal places; trailing zeros removed. | +**net_fee** | **str** | Net fee as a string for precision. Up to 6 decimal places; trailing zeros removed. | +**customer_count** | **int** | Customer count (invited users) | +**trading_user_count** | **str** | Transaction participant count​ (string format, consistent with online JSON serialization) only returns a specific value when business_type=0(all), and returns nullfor other business types. | +**time_range_desc** | **str** | Time range description | +**business_type** | **int** | Business Type | +**business_type_desc** | **str** | Business type description; allowed values: All, Spot, Futures, Alpha, Web3, Perps (DEX), Exchange All, Web3 All, TradFi | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PartnerDataAggregatedResponse.md b/docs/PartnerDataAggregatedResponse.md new file mode 100644 index 00000000..e0b4a046 --- /dev/null +++ b/docs/PartnerDataAggregatedResponse.md @@ -0,0 +1,13 @@ +# PartnerDataAggregatedResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Error Code, 0 Indicates Success | +**message** | **str** | Error message description | +**data** | [**PartnerDataAggregated**](PartnerDataAggregated.md) | | +**timestamp** | **int** | Unix timestamp | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PartnerDataAggregatedResponseAllOf.md b/docs/PartnerDataAggregatedResponseAllOf.md new file mode 100644 index 00000000..4cc18d5b --- /dev/null +++ b/docs/PartnerDataAggregatedResponseAllOf.md @@ -0,0 +1,10 @@ +# PartnerDataAggregatedResponseAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**PartnerDataAggregated**](PartnerDataAggregated.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PlaceBizPushOrder.md b/docs/PlaceBizPushOrder.md new file mode 100644 index 00000000..d1934aee --- /dev/null +++ b/docs/PlaceBizPushOrder.md @@ -0,0 +1,41 @@ +# PlaceBizPushOrder + +Place ad order request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_type** | **str** | Cryptocurrency symbol. | +**exchange_type** | **str** | Fiat currency | +**type** | **str** | Ad operation type. `0`: publish sell ad; `1`: publish buy ad; `2`: edit sell ad; `3`: edit buy ad. | +**unit_price** | **str** | Per-unit price in fixed-price mode. | +**number** | **str** | Ad amount priced in `currencyType`. | +**pay_type** | **str** | Payment types enabled for the ad, comma-separated; values can be obtained from `pay_type` in the payment method list, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. `pay_type_json` uses the types in this field as keys to specify the corresponding payment accounts. | +**pay_type_json** | **str** | JSON string of specific payment accounts corresponding to `payType`. Each key is a payment type listed in `payType`, and each value is the current user's payment method ID for that type. For example, when `payType` is `bank,swift`, this field can be {\"bank\":\"10001\",\"swift\":\"10002\"}. | [optional] +**rate_fixed** | **str** | Price type: `0` floating; `1` fixed. | [optional] +**oid** | **str** | Pass ad ID when editing; omit or empty when publishing a new ad. | [optional] +**min_amount** | **str** | Minimum quantity per order, denominated by currencyType; required when limitBasis is not passed or is 0 | [optional] +**max_amount** | **str** | Maximum quantity per order, denominated by currencyType; required when limitBasis is not passed or is 0 | [optional] +**limit_basis** | **int** | Trading limit unit. 0: by crypto quantity, 1: by fiat amount; defaults to 0 when not passed for a new ad. The limit unit of an existing ad cannot be changed when editing; a fiat-limit ad must keep passing 1 when edited | [optional] +**fiat_min_amount** | **str** | Minimum amount per order, denominated by exchangeType; required when limitBasis is 1 | [optional] +**fiat_max_amount** | **str** | Maximum amount per order, denominated by exchangeType; required when limitBasis is 1, and must not exceed the total fiat value of the ad quantity converted at the price | [optional] +**tier_limit** | **str** | Minimum counterparty VIP level; `0` means no requirement. | [optional] +**verified_limit** | **str** | Minimum counterparty verification level; `0` means no limit. | [optional] +**reg_time_limit** | **str** | Minimum counterparty account age in days; `0` means no limit. | [optional] +**advertisers_limit** | **str** | Whether trading with the advertiser is restricted. `0`: no; `1`: yes. | [optional] +**polymarket_limit** | **int** | Whether to restrict trading with Polymarket users. 0: no restriction, 1: restricted | [optional] +**expire_min** | **str** | Payment timeout in minutes. | [optional] +**trade_tips** | **str** | Advertisement trade terms displayed to ordering users; goes through off-platform traffic diversion risk control on submission, and when hit, the advertisement is not saved and code 70305102 is returned | [optional] +**auto_reply** | **str** | Auto reply content after order creation; goes through off-platform traffic diversion risk control on submission, and when hit, the advertisement is not saved and code 70305102 is returned | [optional] +**min_completed_limit** | **str** | Minimum completed orders for counterparty; `-1` unlimited. | [optional] +**max_completed_limit** | **str** | Maximum completed orders for counterparty; `-1` unlimited. | [optional] +**completed_rate_limit** | **str** | Counterparty minimum 30-day completion rate; `-1` means no limit. | [optional] +**user_country_limit** | **str** | KYC nationality restriction; `-1` means no restriction. | [optional] +**user_order_limit** | **str** | Maximum concurrent orders allowed for the counterparty. `-1`: unlimited. | [optional] +**rate_reference_id** | **str** | Floating price reference. `1`: platform reference; `2`: Gate reference; `3`: spot reference. | [optional] +**rate_offset** | **str** | Absolute floating offset ratio, e.g. `0.5` means 0.5%. | [optional] +**float_trend** | **str** | Floating direction: `0` markup; `1` markdown. | [optional] +**team_payment_uid** | **str** | Team payee UID; optional for non-team merchants. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PlaceDualInvestmentOrder.md b/docs/PlaceDualInvestmentOrder.md index f957b472..25c4f686 100644 --- a/docs/PlaceDualInvestmentOrder.md +++ b/docs/PlaceDualInvestmentOrder.md @@ -1,12 +1,24 @@ # PlaceDualInvestmentOrder -Dual Investment Order ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**plan_id** | **str** | Product ID | -**amount** | **str** | Subscription amount, mutually exclusive with copies field | -**text** | **str** | Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) | [optional] +**id** | **int** | Order ID | [optional] +**plan_id** | **int** | Product ID | [optional] +**invest_amount** | **str** | Investment Quantity | [optional] +**settlement_amount** | **str** | Settlement Quantity | [optional] +**create_time** | **int** | Created time | [optional] +**complete_time** | **int** | Completed Time | [optional] +**status** | **str** | Status: `INIT`-Created `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-Settlement Processing `CANCELED`-Canceled `FAILED`-Failed | [optional] +**invest_currency** | **str** | Investment Token | [optional] +**exercise_currency** | **str** | Strike Token | [optional] +**exercise_price** | **str** | Strike price | [optional] +**settlement_price** | **str** | Settlement price | [optional] +**settlement_currency** | **str** | Settlement currency | [optional] +**apy_display** | **str** | Annual Yield | [optional] +**apy_settlement** | **str** | Settlement Annual Yield | [optional] +**delivery_time** | **int** | Settlement time | [optional] +**text** | **str** | Custom order information | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PlaceDualInvestmentOrderParams.md b/docs/PlaceDualInvestmentOrderParams.md new file mode 100644 index 00000000..25cd3fd6 --- /dev/null +++ b/docs/PlaceDualInvestmentOrderParams.md @@ -0,0 +1,13 @@ +# PlaceDualInvestmentOrderParams + +Dual Investment Order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**plan_id** | **str** | Product ID | +**amount** | **str** | Subscription amount | +**text** | **str** | Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PlaceOrderRequest.md b/docs/PlaceOrderRequest.md new file mode 100644 index 00000000..6ca9043d --- /dev/null +++ b/docs/PlaceOrderRequest.md @@ -0,0 +1,16 @@ +# PlaceOrderRequest + +Order request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Trading symbol | +**side** | **str** | Buy or sell orders - buy - sell | +**amount** | **str** | Trade Quantity - `side` : `buy` refers to the quote currency, i.e., `USDT` - `side` : `sell` refers to the base currency | +**gas_mode** | **str** | Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter | +**slippage** | **str** | Slippage tolerance (10 means 10% tolerance) | [optional] +**quote_id** | **str** | Quote ID returned from quotation API | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PlaceOrderResponse.md b/docs/PlaceOrderResponse.md new file mode 100644 index 00000000..036b832f --- /dev/null +++ b/docs/PlaceOrderResponse.md @@ -0,0 +1,18 @@ +# PlaceOrderResponse + +Order response +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | [optional] +**status** | **int** | Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed | [optional] +**side** | **str** | Buy or sell orders - buy - sell | [optional] +**gas_mode** | **str** | Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter | [optional] +**create_time** | **int** | Creation timestamp | [optional] +**amount** | **str** | Trade Quantity - `side` : `buy` refers to the quote currency, i.e., `USDT` - `side` : `sell` refers to the base currency | [optional] +**token_address** | **str** | Token contract address | [optional] +**chain** | **str** | Blockchain name | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Position.md b/docs/Position.md index 5ea9ba58..f60b771e 100644 --- a/docs/Position.md +++ b/docs/Position.md @@ -7,12 +7,15 @@ Name | Type | Description | Notes **user** | **int** | User ID | [optional] [readonly] **contract** | **str** | Futures contract | [optional] [readonly] **size** | **str** | Position size | [optional] [readonly] +**hedge_status** | **str** | The hedging status of the position under the Delta-neutral strategy. Including: - `partial_hedged`: partially hedged - `full_hedged`: fully hedged | [optional] [readonly] +**hedged_size** | **str** | The hedged position size under the Delta-neutral strategy. | [optional] [readonly] +**unhedged_size** | **str** | The unhedged position size under the Delta-neutral strategy, calculated as `max(abs(size) - abs(hedged_size), 0)`. | [optional] [readonly] **leverage** | **str** | leverage for isolated margin. 0 means cross margin. For leverage of cross margin, please refer to `cross_leverage_limit`. | [optional] **risk_limit** | **str** | Position risk limit | [optional] **leverage_max** | **str** | the maximum permissible leverage given to the current positon value: the higher positon value, the lower maximum permissible leverage | [optional] [readonly] **maintenance_rate** | **str** | The maintenance margin requirement for the risk limit at which the current position size is located.Since the maintenance margin for the position has been calculated using a tiered system, the actual maintenance margin rate required for this position is based on `average_maintenance_rate`. | [optional] [readonly] **value** | **str** | Position value calculated in settlement currency | [optional] [readonly] -**margin** | **str** | Position margin | [optional] +**margin** | **str** | Margin | [optional] **entry_price** | **str** | Entry price | [optional] [readonly] **liq_price** | **str** | Estimated liquidation price, for reference only. The actual liquidation trigger is based on the position mmr or the account maintenance margin level. | [optional] [readonly] **mark_price** | **str** | Current mark price | [optional] [readonly] @@ -38,6 +41,8 @@ Name | Type | Description | Notes **risk_limit_table** | **str** | Risk limit table ID | [optional] [readonly] **average_maintenance_rate** | **str** | Average maintenance margin rate | [optional] [readonly] **pid** | **int** | Sub-account position ID | [optional] [readonly] +**pos_margin_mode** | **str** | Position Margin Mode isolated - Isolated Margin, cross - Cross Margin | [optional] +**lever** | **str** | Indicates the current leverage of the position, applicable to both isolated and cross margin, gradually replacing the current leverage and cross_leverage_limit | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PositionHistoryList.md b/docs/PositionHistoryList.md new file mode 100644 index 00000000..a0bd36c4 --- /dev/null +++ b/docs/PositionHistoryList.md @@ -0,0 +1,11 @@ +# PositionHistoryList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**PositionHistoryListData**](PositionHistoryListData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionHistoryListData.md b/docs/PositionHistoryListData.md new file mode 100644 index 00000000..69d94096 --- /dev/null +++ b/docs/PositionHistoryListData.md @@ -0,0 +1,13 @@ +# PositionHistoryListData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total amount | [optional] +**total_page** | **int** | Total pages | [optional] +**list** | [**list[PositionHistoryListDataList]**](PositionHistoryListDataList.md) | Query historical position list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionHistoryListDataCloseDetail.md b/docs/PositionHistoryListDataCloseDetail.md new file mode 100644 index 00000000..05e88a02 --- /dev/null +++ b/docs/PositionHistoryListDataCloseDetail.md @@ -0,0 +1,14 @@ +# PositionHistoryListDataCloseDetail + +Liquidation details (null for normal close) +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**margin_level** | **str** | Margin ratio (multiplied by 100) | [optional] +**margin** | **str** | Margin | [optional] +**equity** | **str** | Net equity | [optional] +**stop_out_level** | **str** | Liquidation ratio (multiplied by 100) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionHistoryListDataList.md b/docs/PositionHistoryListDataList.md new file mode 100644 index 00000000..05a3c0a1 --- /dev/null +++ b/docs/PositionHistoryListDataList.md @@ -0,0 +1,27 @@ +# PositionHistoryListDataList + +Position close history +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**position_id** | **int** | Position ID | +**symbol** | **str** | Market / Trading symbol | +**realized_pnl** | **str** | Realized PnL | +**realized_pnl_rate** | **str** | Realized return rate | [optional] +**volume** | **str** | Position size / Maximum position size | +**volume_closed** | **str** | Close volume | +**price_open** | **str** | Average Opening Price | +**position_dir** | **str** | Position Direction - Long: Long Position - Short: Short Position | +**price_tp** | **str** | Take profit price | [optional] +**price_sl** | **str** | Stop loss price | [optional] +**counterparty_price** | **str** | Counterparty price | [optional] +**close_price** | **str** | Close price | +**time_create** | **str** | Open time (timestamp in seconds) | +**time_close** | **str** | Close time (timestamp in seconds) | +**position_status** | **str** | Position Status - 1: Fully Closed - 2: Forced Liquidation | +**close_detail** | [**PositionHistoryListDataCloseDetail**](PositionHistoryListDataCloseDetail.md) | | [optional] +**realized_pnl_detail** | [**PositionHistoryListDataRealizedPnlDetail**](PositionHistoryListDataRealizedPnlDetail.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionHistoryListDataRealizedPnlDetail.md b/docs/PositionHistoryListDataRealizedPnlDetail.md new file mode 100644 index 00000000..d2cd8cce --- /dev/null +++ b/docs/PositionHistoryListDataRealizedPnlDetail.md @@ -0,0 +1,13 @@ +# PositionHistoryListDataRealizedPnlDetail + +Realized P&L details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**closed_pnl** | **str** | Close Position P&L | [optional] +**swap** | **str** | Swap fee | [optional] +**fee** | **str** | fee | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionList.md b/docs/PositionList.md new file mode 100644 index 00000000..a460ccf1 --- /dev/null +++ b/docs/PositionList.md @@ -0,0 +1,13 @@ +# PositionList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Business status code, non-empty indicates request exception, please refer to TradFi error enumeration in documentation | [optional] +**message** | **str** | Return message, returned when request error occurs | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**PositionListData**](PositionListData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionList2.md b/docs/PositionList2.md new file mode 100644 index 00000000..ece87e20 --- /dev/null +++ b/docs/PositionList2.md @@ -0,0 +1,11 @@ +# PositionList2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**PositionList2Data**](PositionList2Data.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionList2Data.md b/docs/PositionList2Data.md new file mode 100644 index 00000000..d24a56a5 --- /dev/null +++ b/docs/PositionList2Data.md @@ -0,0 +1,10 @@ +# PositionList2Data + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[PositionListItem]**](PositionListItem.md) | Query active position list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionListData.md b/docs/PositionListData.md new file mode 100644 index 00000000..6822d1e9 --- /dev/null +++ b/docs/PositionListData.md @@ -0,0 +1,11 @@ +# PositionListData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[PositionListDataList]**](PositionListDataList.md) | Position information | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionListDataList.md b/docs/PositionListDataList.md new file mode 100644 index 00000000..32f30902 --- /dev/null +++ b/docs/PositionListDataList.md @@ -0,0 +1,19 @@ +# PositionListDataList + +Position information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**position_id** | **int** | Position ID | [optional] +**symbol** | **str** | Trading market code | [optional] +**symbol_desc** | **str** | Market description | [optional] +**margin** | **str** | Used margin | [optional] +**unrealized_pnl** | **str** | Unrealized PNL | [optional] +**unrealized_pnl_rate** | **str** | Unrealized return rate | [optional] +**volume** | **str** | Position size | [optional] +**price_open** | **str** | Average Opening Price | [optional] +**position_dir** | **str** | Position direction (Long=long position, Short=short position) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionListItem.md b/docs/PositionListItem.md new file mode 100644 index 00000000..89e6d2fa --- /dev/null +++ b/docs/PositionListItem.md @@ -0,0 +1,40 @@ +# PositionListItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Symbol | [optional] +**exchange** | **str** | Exchange, supports us, hk, and kr | [optional] +**quote_currency** | **str** | Quote currency | [optional] +**quote_currency_precision** | **int** | Quote currency precision | [optional] +**fx_rate** | **str** | Quote currency to USD exchange rate | [optional] +**trade_status** | **str** | Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. | [optional] +**symbol_desc** | **str** | | [optional] +**position_pnl** | **str** | Position P&L | [optional] +**today_pnl** | **str** | Today's P&L | [optional] +**pnl_rate** | **str** | Yield | [optional] +**today_sell_amount** | **str** | Today's sales amount | [optional] +**today_buy_amount** | **str** | Today's purchase amount | [optional] +**today_sell_volume** | **str** | Today's sell volume | [optional] +**today_buy_volume** | **str** | Today's buy volume | [optional] +**yesterday_volume** | **str** | Previous close position quantity | [optional] +**volume** | **str** | Position quantity | [optional] +**available** | **str** | Available position quantity | [optional] +**transfer_out_pending_qty** | **str** | Stock transfer in progress quantity | [optional] +**avg_cost_price** | **str** | Cost price | [optional] +**diluted_cost_price** | **str** | Diluted cost price | [optional] +**last_price** | **str** | Latest price | [optional] +**extended_last_price** | **str** | Extended hours latest price | [optional] +**max_order_volume** | **str** | | [optional] +**step_order_volume** | **str** | | [optional] +**min_order_volume** | **str** | | [optional] +**price_precision** | **int** | | [optional] +**price_protection** | **str** | | [optional] +**sell_price_protection** | **str** | | [optional] +**buy_price_protection** | **str** | | [optional] +**commission_rate** | **str** | Fee Rate | [optional] +**slippage_rate** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PositionTimerange.md b/docs/PositionTimerange.md new file mode 100644 index 00000000..a0741985 --- /dev/null +++ b/docs/PositionTimerange.md @@ -0,0 +1,27 @@ +# PositionTimerange + +Contract position details (historical data) +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract** | **str** | Futures contract | [optional] [readonly] +**size** | **str** | Position size | [optional] [readonly] +**leverage** | **str** | Position leverage. 0 means cross margin; positive number means isolated margin | [optional] +**risk_limit** | **str** | Position risk limit | [optional] +**leverage_max** | **str** | the maximum permissible leverage given to the current positon value: the higher positon value, the lower maximum permissible leverage | [optional] [readonly] +**maintenance_rate** | **str** | The maintenance margin rate of the first tier of risk limit sheet | [optional] [readonly] +**margin** | **str** | Margin | [optional] +**liq_price** | **str** | Liquidation price | [optional] [readonly] +**realised_pnl** | **str** | Realized PnL | [optional] [readonly] +**history_pnl** | **str** | Total realized PnL from closed positions | [optional] [readonly] +**last_close_pnl** | **str** | PNL of last position close | [optional] [readonly] +**realised_point** | **str** | Realized POINT PNL | [optional] [readonly] +**history_point** | **str** | History realized POINT PNL | [optional] [readonly] +**mode** | **str** | Position mode, including: - `single`: One-way Mode - `dual_long`: Long position in Hedge Mode - `dual_short`: Short position in Hedge Mode | [optional] +**cross_leverage_limit** | **str** | Cross margin leverage (valid only when `leverage` is 0) | [optional] +**entry_price** | **str** | Entry price | [optional] [readonly] +**time** | **int** | Timestamp | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PreviewFromParam.md b/docs/PreviewFromParam.md new file mode 100644 index 00000000..d7b0837a --- /dev/null +++ b/docs/PreviewFromParam.md @@ -0,0 +1,12 @@ +# PreviewFromParam + +Preview the selling side of the request: currency + quantity. The semantics are similar to `CreateParam` on the `from` side (both `asset` + `amount`). +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | The currency symbol to be swapped out. | +**amount** | **str** | The currency swap quantity, decimal string. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PreviewOrder.md b/docs/PreviewOrder.md new file mode 100644 index 00000000..7cbe605a --- /dev/null +++ b/docs/PreviewOrder.md @@ -0,0 +1,13 @@ +# PreviewOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_from** | [**list[PreviewOrderDetail]**](PreviewOrderDetail.md) | | +**to** | [**list[PreviewOrderDetail]**](PreviewOrderDetail.md) | | +**usdt_evaluated_value** | **str** | | +**usdt_evaluated_value_show** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PreviewOrderDetail.md b/docs/PreviewOrderDetail.md new file mode 100644 index 00000000..d25e68a9 --- /dev/null +++ b/docs/PreviewOrderDetail.md @@ -0,0 +1,12 @@ +# PreviewOrderDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | | +**amount** | **str** | | +**amount_show** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PreviewToParam.md b/docs/PreviewToParam.md new file mode 100644 index 00000000..bcbfcf7b --- /dev/null +++ b/docs/PreviewToParam.md @@ -0,0 +1,12 @@ +# PreviewToParam + +**For preview only** `OrderPreviewV1Req.to`. Target currency + **ratio ratio**. **Forbidden** is confused with the order `CreateParam`: the `to` of the order must be **`amount`**, and there is no `ratio` field. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | Target currency symbol; often corresponds to `recommend_v2.*[].schemes[].name` in config. | +**ratio** | **str** | The weight ratio of the target currency in the portfolio, **decimal string** (such as `0.2`, `0.5`). Often consistent with the `schemes[].ratio` of a strategy under `recommend_v2` of `GET /asset-swap/config`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/QuickEstimatedRepayment.md b/docs/QuickEstimatedRepayment.md new file mode 100644 index 00000000..143a8631 --- /dev/null +++ b/docs/QuickEstimatedRepayment.md @@ -0,0 +1,11 @@ +# QuickEstimatedRepayment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**debt_currencies** | [**list[UnifiedQuickRepayDebtItem]**](UnifiedQuickRepayDebtItem.md) | Liability currencies | [optional] +**available_currencies** | [**list[UnifiedQuickRepayAvailableItem]**](UnifiedQuickRepayAvailableItem.md) | Currencies available for repayment | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/QuickRepaymentRequest.md b/docs/QuickRepaymentRequest.md new file mode 100644 index 00000000..55d38c7e --- /dev/null +++ b/docs/QuickRepaymentRequest.md @@ -0,0 +1,11 @@ +# QuickRepaymentRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**debt_currencies** | **list[str]** | Liability currencies | +**available_currencies** | **list[str]** | Currencies to repay with | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/QuickRepaymentResponse.md b/docs/QuickRepaymentResponse.md new file mode 100644 index 00000000..e502051b --- /dev/null +++ b/docs/QuickRepaymentResponse.md @@ -0,0 +1,13 @@ +# QuickRepaymentResponse + +Quick repayment result +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **str** | Order ID | +**repaid_infos** | [**list[UnifiedQuickRepayRepaidInfo]**](UnifiedQuickRepayRepaidInfo.md) | Repaid currency details | +**used_infos** | [**list[UnifiedQuickRepayUsedInfo]**](UnifiedQuickRepayUsedInfo.md) | Currencies used for repayment | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/QuoteRequest.md b/docs/QuoteRequest.md new file mode 100644 index 00000000..295c046a --- /dev/null +++ b/docs/QuoteRequest.md @@ -0,0 +1,15 @@ +# QuoteRequest + +Quote Request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Trading symbol | +**side** | **str** | Buy or sell orders - buy - sell | +**amount** | **str** | Trade Quantity - `side` : `buy` refers to the quote currency, i.e., `USDT` - `side` : `sell` refers to the base currency | +**gas_mode** | **str** | Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter | +**slippage** | **str** | Slippage tolerance (10 means 10% tolerance) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/QuoteResponse.md b/docs/QuoteResponse.md new file mode 100644 index 00000000..fa55485f --- /dev/null +++ b/docs/QuoteResponse.md @@ -0,0 +1,20 @@ +# QuoteResponse + +Quote Response +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quote_id** | **str** | Quote ID for order placement, valid for 1 minute | [optional] +**min_amount** | **str** | Minimum order size | [optional] +**max_amount** | **str** | Maximum order size | [optional] +**price** | **str** | Token Price (USDT-based) | [optional] +**slippage** | **str** | Slippage | [optional] +**estimate_gas_fee_amount_usdt** | **str** | Estimated Gas Fee (USDT-based) | [optional] +**order_fee** | **str** | Trading fee | [optional] +**target_token_min_amount** | **str** | Minimum received amount | [optional] +**target_token_max_amount** | **str** | Maximum received amount | [optional] +**error_type** | **int** | Failure Type - `0` : Success - `1` : Exceeds maximum value - `2` : Below minimum value | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RebateApi.md b/docs/RebateApi.md index f7e8f504..42f30a59 100644 --- a/docs/RebateApi.md +++ b/docs/RebateApi.md @@ -13,6 +13,9 @@ Method | HTTP request | Description [**rebate_broker_transaction_history**](RebateApi.md#rebate_broker_transaction_history) | **GET** /rebate/broker/transaction_history | Broker obtains user's trading history [**rebate_user_info**](RebateApi.md#rebate_user_info) | **GET** /rebate/user/info | User obtains rebate information [**user_sub_relation**](RebateApi.md#user_sub_relation) | **GET** /rebate/user/sub_relation | User subordinate relationship +[**get_partner_application_recent**](RebateApi.md#get_partner_application_recent) | **GET** /rebate/partner/applications/recent | Get recent partner application records +[**get_partner_eligibility**](RebateApi.md#get_partner_eligibility) | **GET** /rebate/partner/eligibility | Check partner application eligibility +[**get_partner_agent_data_aggregated**](RebateApi.md#get_partner_agent_data_aggregated) | **GET** /rebate/partner/data/aggregated | Aggregated partner agent statistics # **agency_transaction_history** @@ -48,7 +51,7 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.RebateApi(api_client) currency_pair = 'BTC_USDT' # str | Specify the trading pair. If not specified, returns all trading pairs (optional) user_id = 10003 # int | User ID. If not specified, all user records will be returned (optional) -_from = 1602120000 # int | Start time for querying records, defaults to 7 days before current time if not specified (optional) +_from = 1602120000 # int | Start time for querying records. If not specified, defaults to 7 days before current time (optional) to = 1602123600 # int | End timestamp for the query, defaults to current time if not specified (optional) limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) offset = 0 # int | List offset, starting from 0 (optional) (default to 0) @@ -69,7 +72,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **str**| Specify the trading pair. If not specified, returns all trading pairs | [optional] **user_id** | **int**| User ID. If not specified, all user records will be returned | [optional] - **_from** | **int**| Start time for querying records, defaults to 7 days before current time if not specified | [optional] + **_from** | **int**| Start time for querying records. If not specified, defaults to 7 days before current time | [optional] **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] @@ -128,7 +131,7 @@ api_instance = gate_api.RebateApi(api_client) currency = 'BTC' # str | Specify the currency. If not specified, returns all currencies (optional) commission_type = 1 # int | Rebate type: 1 - Direct rebate, 2 - Indirect rebate, 3 - Self rebate (optional) user_id = 10003 # int | User ID. If not specified, all user records will be returned (optional) -_from = 1602120000 # int | Start time for querying records, defaults to 7 days before current time if not specified (optional) +_from = 1602120000 # int | Start time for querying records. If not specified, defaults to 7 days before current time (optional) to = 1602123600 # int | End timestamp for the query, defaults to current time if not specified (optional) limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) offset = 0 # int | List offset, starting from 0 (optional) (default to 0) @@ -150,7 +153,7 @@ Name | Type | Description | Notes **currency** | **str**| Specify the currency. If not specified, returns all currencies | [optional] **commission_type** | **int**| Rebate type: 1 - Direct rebate, 2 - Indirect rebate, 3 - Self rebate | [optional] **user_id** | **int**| User ID. If not specified, all user records will be returned | [optional] - **_from** | **int**| Start time for querying records, defaults to 7 days before current time if not specified | [optional] + **_from** | **int**| Start time for querying records. If not specified, defaults to 7 days before current time | [optional] **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] @@ -208,7 +211,7 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.RebateApi(api_client) currency_pair = 'BTC_USDT' # str | Specify the trading pair. If not specified, returns all trading pairs (optional) user_id = 10003 # int | User ID. If not specified, all user records will be returned (optional) -_from = 1602120000 # int | Start time for querying records, defaults to 7 days before current time if not specified (optional) +_from = 1602120000 # int | Start time for querying records. If not specified, defaults to 7 days before current time (optional) to = 1602123600 # int | End timestamp for the query, defaults to current time if not specified (optional) limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) offset = 0 # int | List offset, starting from 0 (optional) (default to 0) @@ -229,7 +232,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **str**| Specify the trading pair. If not specified, returns all trading pairs | [optional] **user_id** | **int**| User ID. If not specified, all user records will be returned | [optional] - **_from** | **int**| Start time for querying records, defaults to 7 days before current time if not specified | [optional] + **_from** | **int**| Start time for querying records. If not specified, defaults to 7 days before current time | [optional] **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] @@ -287,7 +290,7 @@ api_client = gate_api.ApiClient(configuration) api_instance = gate_api.RebateApi(api_client) currency = 'BTC' # str | Specify the currency. If not specified, returns all currencies (optional) user_id = 10003 # int | User ID. If not specified, all user records will be returned (optional) -_from = 1602120000 # int | Start time for querying records, defaults to 7 days before current time if not specified (optional) +_from = 1602120000 # int | Start time for querying records. If not specified, defaults to 7 days before current time (optional) to = 1602123600 # int | End timestamp for the query, defaults to current time if not specified (optional) limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) offset = 0 # int | List offset, starting from 0 (optional) (default to 0) @@ -308,7 +311,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **str**| Specify the currency. If not specified, returns all currencies | [optional] **user_id** | **int**| User ID. If not specified, all user records will be returned | [optional] - **_from** | **int**| Start time for querying records, defaults to 7 days before current time if not specified | [optional] + **_from** | **int**| Start time for querying records. If not specified, defaults to 7 days before current time | [optional] **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] @@ -484,7 +487,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **rebate_broker_transaction_history** -> list[BrokerTransaction] rebate_broker_transaction_history(limit=limit, offset=offset, user_id=user_id, _from=_from, to=to) +> list[BrokerTransactionHistory] rebate_broker_transaction_history(limit=limit, offset=offset, user_id=user_id, _from=_from, to=to) Broker obtains user's trading history @@ -542,7 +545,7 @@ Name | Type | Description | Notes ### Return type -[**list[BrokerTransaction]**](BrokerTransaction.md) +[**list[BrokerTransactionHistory]**](BrokerTransactionHistory.md) ### Authorization @@ -692,3 +695,209 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_partner_application_recent** +> PartnerApplicationResponse get_partner_application_recent() + +Get recent partner application records + +Get the current user's recent partner application records. This endpoint returns application records within the last 30 days, including application status, review information, application materials, and other details. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.RebateApi(api_client) + +try: + # Get recent partner application records + api_response = api_instance.get_partner_application_recent() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling RebateApi->get_partner_application_recent: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PartnerApplicationResponse**](PartnerApplicationResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_partner_eligibility** +> EligibilityResponse get_partner_eligibility() + +Check partner application eligibility + +Check whether the current user is eligible to apply as a partner. This endpoint checks multiple conditions: account status (banned or not), whether it is a sub-account, whether already a partner, KYC verification status, whether under another agent's referral chain, whether on the blacklist, and other business rule restrictions + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.RebateApi(api_client) + +try: + # Check partner application eligibility + api_response = api_instance.get_partner_eligibility() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling RebateApi->get_partner_eligibility: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**EligibilityResponse**](EligibilityResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_partner_agent_data_aggregated** +> PartnerDataAggregatedResponse get_partner_agent_data_aggregated(start_date=start_date, end_date=end_date, business_type=business_type) + +Aggregated partner agent statistics + +Query aggregated partner-agent statistics for a time range, including rebate amount, trading volume, net fee, customer count, and trading user count. **Notes:** - `trading_user_count` is only returned when `business_type=0` (All). - Time parameters use UTC+8. - If no time range is passed, the last 7 days are queried by default. - Partner agents only; sub-accounts are not allowed. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.RebateApi(api_client) +start_date = '2024-01-01 00:00:00' # str | Query start time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the start of the last 7 days. (optional) +end_date = '2024-01-07 23:59:59' # str | Query end time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the end of the last 7 days. (optional) +business_type = 0 # int | Business type filter: - 0: All (default) - 1: Spot - 2: Futures - 3: Alpha - 4: Web3 - 5: Perps (DEX) - 6: Exchange All - 7: Web3 All - 8: TradFi (optional) (default to 0) + +try: + # Aggregated partner agent statistics + api_response = api_instance.get_partner_agent_data_aggregated(start_date=start_date, end_date=end_date, business_type=business_type) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling RebateApi->get_partner_agent_data_aggregated: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start_date** | **str**| Query start time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the start of the last 7 days. | [optional] + **end_date** | **str**| Query end time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the end of the last 7 days. | [optional] + **business_type** | **int**| Business type filter: - 0: All (default) - 1: Spot - 2: Futures - 3: Alpha - 4: Web3 - 5: Perps (DEX) - 6: Exchange All - 7: Web3 All - 8: TradFi | [optional] [default to 0] + +### Return type + +[**PartnerDataAggregatedResponse**](PartnerDataAggregatedResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | +**400** | Invalid request parameters | - | +**401** | Unauthorized access | - | +**403** | Access denied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Recommend.md b/docs/Recommend.md new file mode 100644 index 00000000..72e490f8 --- /dev/null +++ b/docs/Recommend.md @@ -0,0 +1,13 @@ +# Recommend + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balance** | **dict(str, str)** | Mapping of string keys to string values, corresponding to Go's map[string]string. | +**btc_faith** | **dict(str, str)** | Mapping of string keys to string values, corresponding to Go's map[string]string. | +**conservative** | **dict(str, str)** | Mapping of string keys to string values, corresponding to Go's map[string]string. | +**gt_faith** | **dict(str, str)** | Mapping of string keys to string values, corresponding to Go's map[string]string. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RecommendV2Scheme.md b/docs/RecommendV2Scheme.md new file mode 100644 index 00000000..df07e700 --- /dev/null +++ b/docs/RecommendV2Scheme.md @@ -0,0 +1,12 @@ +# RecommendV2Scheme + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**priority** | **int** | | +**ratio** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RecommendV2Strategy.md b/docs/RecommendV2Strategy.md new file mode 100644 index 00000000..61bda14d --- /dev/null +++ b/docs/RecommendV2Strategy.md @@ -0,0 +1,12 @@ +# RecommendV2Strategy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**priority** | **int** | | +**schemes** | [**list[RecommendV2Scheme]**](RecommendV2Scheme.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RepayLoan.md b/docs/RepayLoan.md deleted file mode 100644 index 92c84630..00000000 --- a/docs/RepayLoan.md +++ /dev/null @@ -1,13 +0,0 @@ -# RepayLoan - -Repay -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**order_id** | **int** | Order ID | -**repay_amount** | **str** | Repayment amount, it is mandatory when making partial repayments | -**repaid_all** | **bool** | Repayment method, set to `true` for full repayment, and `false` for partial repayment; When partial repayment, the repay_amount parameter cannot be greater than the remaining amount to be repaid by the user. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RepayRecord.md b/docs/RepayRecord.md deleted file mode 100644 index a9cf6cfc..00000000 --- a/docs/RepayRecord.md +++ /dev/null @@ -1,23 +0,0 @@ -# RepayRecord - -Repayment record -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**order_id** | **int** | Order ID | [optional] -**record_id** | **int** | Repayment record ID | [optional] -**repaid_amount** | **str** | Repayment amount | [optional] -**borrow_currency** | **str** | Borrowed currency | [optional] -**collateral_currency** | **str** | Collateral currency | [optional] -**init_ltv** | **str** | Initial collateralization rate | [optional] -**borrow_time** | **int** | Borrowing time, timestamp | [optional] -**repay_time** | **int** | Repayment time, timestamp | [optional] -**total_interest** | **str** | Total interest | [optional] -**before_left_principal** | **str** | Principal to be repaid before repayment | [optional] -**after_left_principal** | **str** | Principal to be repaid after repayment | [optional] -**before_left_collateral** | **str** | Collateral amount before repayment | [optional] -**after_left_collateral** | **str** | Collateral amount after repayment | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SendChatMessageRequest.md b/docs/SendChatMessageRequest.md new file mode 100644 index 00000000..3109c3fb --- /dev/null +++ b/docs/SendChatMessageRequest.md @@ -0,0 +1,13 @@ +# SendChatMessageRequest + +Send chat message request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**txid** | **int** | Order ID | +**type** | **int** | Message type: `0` text; `1` file (image or video); defaults to `0`. | [optional] +**message** | **str** | Message content. When type=0, pass text up to 500 characters, which goes through off-platform traffic diversion risk control; when hit, the response contains risk_type=1 and toast_msg. When type=1, pass the file_key returned by upload_chat_file | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SetMerchantWorkHoursRequest.md b/docs/SetMerchantWorkHoursRequest.md new file mode 100644 index 00000000..69853bcc --- /dev/null +++ b/docs/SetMerchantWorkHoursRequest.md @@ -0,0 +1,16 @@ +# SetMerchantWorkHoursRequest + +Request to set merchant working status or custom working hours +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**work_status** | **int** | Working status. 0: resting, 1: working, 2: using custom working hours | +**cycle_type** | **str** | Custom working cycle; required when work_status is 2 | [optional] +**day_of_week** | **str** | Weekly working days, comma-separated values 1-7 for Monday to Sunday; required when work_status is 2 and cycle_type is Weekly | [optional] +**time_zone** | **str** | UTC timezone offset, ranging from -12 to +14; required when work_status is 2 | [optional] +**start_time** | **str** | Custom working start time in HH:mm format; required when work_status is 2 and must not be later than end_time | [optional] +**end_time** | **str** | Custom working end time in HH:mm format; required when work_status is 2 and must not be earlier than start_time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpotAccount.md b/docs/SpotAccount.md deleted file mode 100644 index 6bb761ea..00000000 --- a/docs/SpotAccount.md +++ /dev/null @@ -1,13 +0,0 @@ -# SpotAccount - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currency** | **str** | Currency detail | [optional] -**available** | **str** | Available amount | [optional] -**locked** | **str** | Locked amount, used in trading | [optional] -**update_id** | **int** | Version number | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SpotAccountBook.md b/docs/SpotAccountBook.md index 80d34cb3..39d188e1 100644 --- a/docs/SpotAccountBook.md +++ b/docs/SpotAccountBook.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **currency** | **str** | Currency changed | [optional] **change** | **str** | Amount changed. Positive value means transferring in, while negative out | [optional] **balance** | **str** | Balance after change | [optional] -**type** | **str** | Account book type. Please refer to [account book type](#accountbook-type) for more detail | [optional] +**type** | **str** | Account change type; deprecated (see `code` for account change type encoding) | [optional] **code** | **str** | Account change code, see [Asset Record Code] (Asset Record Code) | [optional] **text** | **str** | Additional information | [optional] diff --git a/docs/SpotApi.md b/docs/SpotApi.md index c18ffa7f..598f4ead 100644 --- a/docs/SpotApi.md +++ b/docs/SpotApi.md @@ -14,13 +14,12 @@ Method | HTTP request | Description [**list_candlesticks**](SpotApi.md#list_candlesticks) | **GET** /spot/candlesticks | Market K-line chart [**get_fee**](SpotApi.md#get_fee) | **GET** /spot/fee | Query account fee rates [**get_batch_spot_fee**](SpotApi.md#get_batch_spot_fee) | **GET** /spot/batch_fee | Batch query account fee rates -[**list_spot_accounts**](SpotApi.md#list_spot_accounts) | **GET** /spot/accounts | List spot trading accounts [**list_spot_account_book**](SpotApi.md#list_spot_account_book) | **GET** /spot/account_book | Query spot account transaction history [**create_batch_orders**](SpotApi.md#create_batch_orders) | **POST** /spot/batch_orders | Batch place orders [**list_all_open_orders**](SpotApi.md#list_all_open_orders) | **GET** /spot/open_orders | List all open orders [**create_cross_liquidate_order**](SpotApi.md#create_cross_liquidate_order) | **POST** /spot/cross_liquidate_orders | Close position when cross-currency is disabled [**list_orders**](SpotApi.md#list_orders) | **GET** /spot/orders | List orders -[**create_order**](SpotApi.md#create_order) | **POST** /spot/orders | Create an order +[**create_order**](SpotApi.md#create_order) | **POST** /spot/orders | Create order [**cancel_orders**](SpotApi.md#cancel_orders) | **DELETE** /spot/orders | Cancel all `open` orders in specified currency pair [**cancel_batch_orders**](SpotApi.md#cancel_batch_orders) | **POST** /spot/cancel_batch_orders | Cancel batch orders by specified ID list [**get_order**](SpotApi.md#get_order) | **GET** /spot/orders/{order_id} | Query single order details @@ -36,6 +35,11 @@ Method | HTTP request | Description [**cancel_spot_price_triggered_order_list**](SpotApi.md#cancel_spot_price_triggered_order_list) | **DELETE** /spot/price_orders | Cancel all auto orders [**get_spot_price_triggered_order**](SpotApi.md#get_spot_price_triggered_order) | **GET** /spot/price_orders/{order_id} | Query single auto order details [**cancel_spot_price_triggered_order**](SpotApi.md#cancel_spot_price_triggered_order) | **DELETE** /spot/price_orders/{order_id} | Cancel single auto order +[**list_spot_pov_orders**](SpotApi.md#list_spot_pov_orders) | **GET** /spot/pov_orders | List Spot POV orders +[**create_spot_pov_order**](SpotApi.md#create_spot_pov_order) | **POST** /spot/pov_orders | Create a Spot POV order +[**cancel_spot_pov_orders**](SpotApi.md#cancel_spot_pov_orders) | **POST** /spot/pov_orders/cancel | Cancel Spot POV orders +[**get_spot_pov_order**](SpotApi.md#get_spot_pov_order) | **GET** /spot/pov_orders/{order_id} | Query Spot POV order details +[**cancel_spot_pov_order**](SpotApi.md#cancel_spot_pov_order) | **POST** /spot/pov_orders/{order_id}/cancel | Cancel a Spot POV order # **list_currencies** @@ -349,7 +353,7 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.SpotApi(api_client) currency_pair = 'BTC_USDT' # str | Currency pair -interval = '0' # str | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (optional) (default to '0') +interval = '0' # str | Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 (optional) (default to '0') limit = 10 # int | Number of depth levels (optional) (default to 10) with_id = False # bool | Return order book update ID (optional) (default to False) @@ -368,7 +372,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency_pair** | **str**| Currency pair | - **interval** | **str**| Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [optional] [default to '0'] + **interval** | **str**| Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 | [optional] [default to '0'] **limit** | **int**| Number of depth levels | [optional] [default to 10] **with_id** | **bool**| Return order book update ID | [optional] [default to False] @@ -469,7 +473,7 @@ No authorization required Market K-line chart -Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval +K-line chart data returns a maximum of 1000 points per request. When specifying from, to, and interval, ensure the number of points is not excessive ### Example @@ -668,73 +672,6 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_spot_accounts** -> list[SpotAccount] list_spot_accounts(currency=currency) - -List spot trading accounts - -### Example - -* Api Key Authentication (apiv4): -```python -from __future__ import print_function -import gate_api -from gate_api.exceptions import ApiException, GateApiException -# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 -# See configuration.py for a list of all supported configuration parameters. -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure APIv4 key authorization -configuration = gate_api.Configuration( - host = "https://api.gateio.ws/api/v4", - key = "YOU_API_KEY", - secret = "YOUR_API_SECRET" -) - -api_client = gate_api.ApiClient(configuration) -# Create an instance of the API class -api_instance = gate_api.SpotApi(api_client) -currency = 'BTC' # str | Query by specified currency name (optional) - -try: - # List spot trading accounts - api_response = api_instance.list_spot_accounts(currency=currency) - print(api_response) -except GateApiException as ex: - print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) -except ApiException as e: - print("Exception when calling SpotApi->list_spot_accounts: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **currency** | **str**| Query by specified currency name | [optional] - -### Return type - -[**list[SpotAccount]**](SpotAccount.md) - -### Authorization - -[apiv4](../README.md#apiv4) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | List retrieved successfully | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **list_spot_account_book** > list[SpotAccountBook] list_spot_account_book(currency=currency, _from=_from, to=to, page=page, limit=limit, type=type, code=code) @@ -1115,7 +1052,7 @@ Name | Type | Description | Notes # **create_order** > Order create_order(order, x_gate_exptime=x_gate_exptime) -Create an order +Create order Supports spot, margin, leverage, and cross-margin leverage orders. Use different accounts through the `account` field. Default is `spot`, which means using the spot account to place orders. If the user has a `unified` account, the default is to place orders with the unified account. When using leveraged account trading (i.e., when `account` is set to `margin`), you can set `auto_borrow` to `true`. In case of insufficient account balance, the system will automatically execute `POST /margin/uni/loans` to borrow the insufficient amount. Whether assets obtained after leveraged order execution are automatically used to repay borrowing orders of the isolated margin account depends on the automatic repayment settings of the user's isolated margin account. Account automatic repayment settings can be queried and set through `/margin/auto_repay`. When using unified account trading (i.e., when `account` is set to `unified`), `auto_borrow` can also be enabled to realize automatic borrowing of insufficient amounts. However, unlike the isolated margin account, whether unified account orders are automatically repaid depends on the `auto_repay` setting when placing the order. This setting only applies to the current order, meaning only assets obtained after order execution will be used to repay borrowing orders of the cross-margin account. Unified account ordering currently supports enabling both `auto_borrow` and `auto_repay` simultaneously. Auto repayment will be triggered when the order ends, i.e., when `status` is `cancelled` or `closed`. **Order Status** The order status in pending orders is `open`, which remains `open` until all quantity is filled. If fully filled, the order ends and status becomes `closed`. If the order is cancelled before all transactions are completed, regardless of partial fills, the status will become `cancelled`. **Iceberg Orders** `iceberg` is used to set the displayed quantity of iceberg orders and does not support complete hiding. Note that hidden portions are charged according to the taker's fee rate. **Self-Trade Prevention** Set `stp_act` to determine the self-trade prevention strategy to use @@ -1147,7 +1084,7 @@ order = gate_api.Order() # Order | x_gate_exptime = '1689560679123' # str | Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected (optional) try: - # Create an order + # Create order api_response = api_instance.create_order(order, x_gate_exptime=x_gate_exptime) print(api_response) except GateApiException as ex: @@ -1256,7 +1193,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Batch cancellation request accepted and processed, success determined by order list | - | +**200** | Batch cancel request is received and processed. Success is determined based on the order list | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1563,7 +1500,7 @@ Name | Type | Description | Notes Query personal trading records -By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts. The history within a specified time range can be queried by specifying `from` or (and) `to`. - If no time parameters are specified, only data for the last 7 days can be obtained. - If only any parameter of `from` or `to` is specified, only 7-day data from the start (or end) of the specified time is returned. - The range not allowed to exceed 30 days. The parameters of the time range filter are processed according to the order end time. The maximum number of pages when searching data using limit&page paging function is 100,0, that is, limit * (page - 1) <= 100,0. +By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts. The history within a specified time range can be queried by specifying `from` or (and) `to`. - If no time parameters are specified, only data for the last 7 days can be obtained. - If only any parameter of `from` or `to` is specified, only 7-day data from the start (or end) of the specified time is returned. - The range not allowed to exceed 30 days. The parameters of the time range filter are processed according to the order end time. The maximum number of pages when searching data using limit&page paging function is 100,000, that is, limit * (page - 1) <= 100,000. ### Example @@ -2108,7 +2045,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Batch cancellation request accepted and processed, success determined by order list | - | +**200** | Batch cancel request is received and processed. Success is determined based on the order list | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -2246,3 +2183,346 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_spot_pov_orders** +> list[SpotPovOrder] list_spot_pov_orders(status, currency_pair=currency_pair, side=side, page=page, limit=limit) + +List Spot POV orders + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.SpotApi(api_client) +status = 'open' # str | Order status. Defaults to open - open: Active orders - finished: Finished orders (default to 'open') +currency_pair = 'BTC_USDT' # str | Currency pair (optional) +side = 'sell' # str | Specify all bids or all asks, both included if not specified (optional) +page = 1 # int | Page number, up to 100 (optional) (default to 1) +limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) + +try: + # List Spot POV orders + api_response = api_instance.list_spot_pov_orders(status, currency_pair=currency_pair, side=side, page=page, limit=limit) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling SpotApi->list_spot_pov_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **str**| Order status. Defaults to open - open: Active orders - finished: Finished orders | [default to 'open'] + **currency_pair** | **str**| Currency pair | [optional] + **side** | **str**| Specify all bids or all asks, both included if not specified | [optional] + **page** | **int**| Page number, up to 100 | [optional] [default to 1] + **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] + +### Return type + +[**list[SpotPovOrder]**](SpotPovOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_spot_pov_order** +> SpotPovOrder create_spot_pov_order(spot_pov_order_creator) + +Create a Spot POV order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.SpotApi(api_client) +spot_pov_order_creator = gate_api.SpotPovOrderCreator() # SpotPovOrderCreator | + +try: + # Create a Spot POV order + api_response = api_instance.create_spot_pov_order(spot_pov_order_creator) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling SpotApi->create_spot_pov_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **spot_pov_order_creator** | [**SpotPovOrderCreator**](SpotPovOrderCreator.md)| | + +### Return type + +[**SpotPovOrder**](SpotPovOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Order created successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **cancel_spot_pov_orders** +> list[SpotPovOrder] cancel_spot_pov_orders(currency_pair=currency_pair) + +Cancel Spot POV orders + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.SpotApi(api_client) +currency_pair = 'BTC_USDT' # str | Currency pair (optional) + +try: + # Cancel Spot POV orders + api_response = api_instance.cancel_spot_pov_orders(currency_pair=currency_pair) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling SpotApi->cancel_spot_pov_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency_pair** | **str**| Currency pair | [optional] + +### Return type + +[**list[SpotPovOrder]**](SpotPovOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Batch cancel request is received and processed. Success is determined based on the order list | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_spot_pov_order** +> SpotPovOrder get_spot_pov_order(order_id) + +Query Spot POV order details + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.SpotApi(api_client) +order_id = '12345' # str | The order ID returned after successful creation, or the custom ID specified by the user in the `text` field. + +try: + # Query Spot POV order details + api_response = api_instance.get_spot_pov_order(order_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling SpotApi->get_spot_pov_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| The order ID returned after successful creation, or the custom ID specified by the user in the `text` field. | + +### Return type + +[**SpotPovOrder**](SpotPovOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Detail retrieved | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **cancel_spot_pov_order** +> SpotPovOrder cancel_spot_pov_order(order_id) + +Cancel a Spot POV order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.SpotApi(api_client) +order_id = '12345' # str | The order ID returned after successful creation, or the custom ID specified by the user in the `text` field. + +try: + # Cancel a Spot POV order + api_response = api_instance.cancel_spot_pov_order(order_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling SpotApi->cancel_spot_pov_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| The order ID returned after successful creation, or the custom ID specified by the user in the `text` field. | + +### Return type + +[**SpotPovOrder**](SpotPovOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Order cancelled | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/SpotGridCreateParams.md b/docs/SpotGridCreateParams.md new file mode 100644 index 00000000..b917b1ab --- /dev/null +++ b/docs/SpotGridCreateParams.md @@ -0,0 +1,20 @@ +# SpotGridCreateParams + +Creation parameters for the spot grid strategy. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**money** | **str** | Amount of investment | +**low_price** | **str** | Range lower limit | +**high_price** | **str** | Range upper limit | +**grid_num** | **int** | Number of grids | +**price_type** | **int** | | +**trigger_price** | **str** | | [optional] +**stop_profit** | **str** | | [optional] +**stop_loss** | **str** | | [optional] +**profit_sharing_ratio** | **str** | | [optional] +**is_use_base** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpotGridCreateRequest.md b/docs/SpotGridCreateRequest.md new file mode 100644 index 00000000..32aa2ba0 --- /dev/null +++ b/docs/SpotGridCreateRequest.md @@ -0,0 +1,13 @@ +# SpotGridCreateRequest + +Create the request body for the spot grid policy. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_type** | **str** | | +**market** | **str** | | +**create_params** | [**SpotGridCreateParams**](SpotGridCreateParams.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpotMartingaleCreateParams.md b/docs/SpotMartingaleCreateParams.md new file mode 100644 index 00000000..7e444b18 --- /dev/null +++ b/docs/SpotMartingaleCreateParams.md @@ -0,0 +1,17 @@ +# SpotMartingaleCreateParams + +Spot martingale creation parameters (serialized fields aligned with `MartingaleBot`). - **Stop-loss**: use `stop_loss_per_cycle` (ratio per round), same as the app; **do not** use `stop_loss_price`. - Optional **`trigger_price`**: trigger price. - If `stop_loss_per_cycle` is passed and > 0, the server validates roughly between `0.001` and `0.9999` (same as `check_martingale`). +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invest_amount** | **str** | | +**price_deviation** | **str** | Add-position deviation ratio as a decimal string (e.g. a 2% drop is `0.02`). | +**max_orders** | **int** | | +**take_profit_ratio** | **str** | Take-profit ratio per round as a decimal string. | +**stop_loss_per_cycle** | **str** | Stop-loss ratio per round as a decimal string; optional; aligned with app `stop_loss_per_cycle`. | [optional] +**trigger_price** | **str** | Trigger price; optional. | [optional] +**profit_sharing_ratio** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpotMartingaleCreateRequest.md b/docs/SpotMartingaleCreateRequest.md new file mode 100644 index 00000000..a1e819b7 --- /dev/null +++ b/docs/SpotMartingaleCreateRequest.md @@ -0,0 +1,13 @@ +# SpotMartingaleCreateRequest + +Create the request body of the Spot Martin strategy. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strategy_type** | **str** | | +**market** | **str** | | +**create_params** | [**SpotMartingaleCreateParams**](SpotMartingaleCreateParams.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpotOrderStopLoss.md b/docs/SpotOrderStopLoss.md new file mode 100644 index 00000000..ae029e18 --- /dev/null +++ b/docs/SpotOrderStopLoss.md @@ -0,0 +1,12 @@ +# SpotOrderStopLoss + +Stop loss for limit orders. Pass {} to cancel stop loss; pass null to leave stop loss unchanged. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**trigger_price** | **str** | Stop loss trigger price When `side == \"buy\"`, `trigger_price` must be less than `price` When `side == \"sell\"`, `trigger_price` must be greater than `price` | [optional] +**order_price** | **str** | Stop-loss order price | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpotOrderStopProfit.md b/docs/SpotOrderStopProfit.md new file mode 100644 index 00000000..f53135b5 --- /dev/null +++ b/docs/SpotOrderStopProfit.md @@ -0,0 +1,12 @@ +# SpotOrderStopProfit + +Take profit for limit orders. Pass {} to cancel take profit; pass null to leave take profit unchanged. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**trigger_price** | **str** | Take profit trigger price When `side == \"buy\"`, `trigger_price` must be greater than `price` When `side == \"sell\"`, `trigger_price` must be less than `price` | [optional] +**order_price** | **str** | Take profit order price | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpotPovOrder.md b/docs/SpotPovOrder.md new file mode 100644 index 00000000..4302b582 --- /dev/null +++ b/docs/SpotPovOrder.md @@ -0,0 +1,26 @@ +# SpotPovOrder + +Spot POV order details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Order ID | [readonly] +**currency_pair** | **str** | Currency pair | [readonly] +**side** | **str** | Buy or sell order | [readonly] +**amount** | **str** | Trade amount | [readonly] +**participation_rate** | **int** | Target participation rate as a percentage. Allowed values: 5, 10, 20, and 40 | [readonly] +**ttl** | **str** | Time to live. Valid values: 1h, 6h, 12h, 1d, 2d, 3d, 4d, 5d, 6d, and 7d | [readonly] +**limit_price** | **str** | Limit price. If omitted, the market price is used | [optional] [readonly] +**trigger_price** | **str** | Trigger price. If omitted, the order is triggered immediately | [optional] [readonly] +**status** | **str** | Order status - CREATED: Created - CANCELING: Canceling - RUNNING: Running - COMPLETED: Completed - EXPIRED: Expired - TERMINATED: Terminated | [readonly] +**terminated_as** | **str** | Order termination reason code | [optional] [readonly] +**start_time_ms** | **int** | Order execution start time in milliseconds | [optional] [readonly] +**end_time_ms** | **int** | Order execution end time in milliseconds | [optional] [readonly] +**expire_time_ms** | **int** | Order expiration time in milliseconds | [optional] [readonly] +**create_time_ms** | **int** | Creation time of order (in milliseconds) | [readonly] +**update_time_ms** | **int** | Last modification time of order (in milliseconds) | [optional] [readonly] +**text** | **str** | Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpotPovOrderCreator.md b/docs/SpotPovOrderCreator.md new file mode 100644 index 00000000..d0267dab --- /dev/null +++ b/docs/SpotPovOrderCreator.md @@ -0,0 +1,18 @@ +# SpotPovOrderCreator + +Spot POV order creation request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_pair** | **str** | Currency pair | +**side** | **str** | Buy or sell order | +**amount** | **str** | Trade amount | +**participation_rate** | **int** | Target participation rate as a percentage. Valid values: 5, 10, 20, and 40 | +**ttl** | **str** | Time to live. Valid values: 1h, 6h, 12h, 1d, 2d, 3d, 4d, 5d, 6d, and 7d | +**limit_price** | **str** | Limit price. If omitted, the market price is used | [optional] +**trigger_price** | **str** | Trigger price. If omitted, the order is triggered immediately | [optional] +**text** | **str** | Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpotPricePutOrder.md b/docs/SpotPricePutOrder.md index 535d7beb..511cd11b 100644 --- a/docs/SpotPricePutOrder.md +++ b/docs/SpotPricePutOrder.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **price** | **str** | Order price | **amount** | **str** | Trading quantity, refers to the trading quantity of the trading currency, i.e., the currency that needs to be traded, for example, the quantity of BTC in BTC_USDT. | **account** | **str** | Trading account type. Unified account must be set to `unified` - normal: spot trading - margin: margin trading - unified: unified account | [default to 'normal'] -**time_in_force** | **str** | time_in_force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only | [optional] [default to 'gtc'] +**time_in_force** | **str** | time_in_force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only | [default to 'gtc'] **auto_borrow** | **bool** | Whether to borrow coins automatically | [optional] [default to False] **auto_repay** | **bool** | Whether to repay the loan automatically | [optional] [default to False] **text** | **str** | The source of the order, including: - web: Web - api: API call - app: Mobile app | [optional] diff --git a/docs/SpotPriceTrigger.md b/docs/SpotPriceTrigger.md index 02085867..d51e52b0 100644 --- a/docs/SpotPriceTrigger.md +++ b/docs/SpotPriceTrigger.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **price** | **str** | Trigger price | **rule** | **str** | Price trigger condition - `>=`: triggered when market price is greater than or equal to `price` - `<=`: triggered when market price is less than or equal to `price` | -**expiration** | **int** | Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout | +**expiration** | **int** | Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SquareApi.md b/docs/SquareApi.md new file mode 100644 index 00000000..f68e76bd --- /dev/null +++ b/docs/SquareApi.md @@ -0,0 +1,148 @@ +# gate_api.SquareApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_square_ai_search**](SquareApi.md#list_square_ai_search) | **GET** /social/message/search | AI MCP Dynamic Search +[**list_live_replay**](SquareApi.md#list_live_replay) | **GET** /social/live/tag_coin_live_replay | Gate AI Assistant live stream data retrieval + + +# **list_square_ai_search** +> ListSquareAiSearchResponse list_square_ai_search(keyword=keyword, currency=currency, time_range=time_range, sort=sort, limit=limit, page=page) + +AI MCP Dynamic Search + +Dynamic search endpoint for AI MCP platform. All parameters are passed via query string. Returns simplified fields. Designed for LLM function calling / MCP tool scenarios. + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.SquareApi(api_client) +keyword = 'keyword_example' # str | Search keyword (currency name or content keyword, e.g., BTC, ETH) (optional) +currency = 'currency_example' # str | Filter by currency (exact currency code, e.g., BTC, ETH, SOL) (optional) +time_range = 0 # int | Time range: 0 = unlimited (default), 1 = last day, 2 = last week, 3 = last month (optional) (default to 0) +sort = 0 # int | Sort order: 0 = most popular (default), 1 = latest (optional) (default to 0) +limit = 10 # int | Return count, 1-50, default 10 (optional) (default to 10) +page = 1 # int | Page number (optional) (default to 1) + +try: + # AI MCP Dynamic Search + api_response = api_instance.list_square_ai_search(keyword=keyword, currency=currency, time_range=time_range, sort=sort, limit=limit, page=page) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling SquareApi->list_square_ai_search: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **keyword** | **str**| Search keyword (currency name or content keyword, e.g., BTC, ETH) | [optional] + **currency** | **str**| Filter by currency (exact currency code, e.g., BTC, ETH, SOL) | [optional] + **time_range** | **int**| Time range: 0 = unlimited (default), 1 = last day, 2 = last week, 3 = last month | [optional] [default to 0] + **sort** | **int**| Sort order: 0 = most popular (default), 1 = latest | [optional] [default to 0] + **limit** | **int**| Return count, 1-50, default 10 | [optional] [default to 10] + **page** | **int**| Page number | [optional] [default to 1] + +### Return type + +[**ListSquareAiSearchResponse**](ListSquareAiSearchResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The endpoint always returns HTTP 200. Business results are distinguished by the code field (code=0 means success) | - | +**400** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_live_replay** +> ListLiveReplayResponse list_live_replay(tag=tag, coin=coin, sort=sort, limit=limit) + +Gate AI Assistant live stream data retrieval + +AI assistant live stream/replay search endpoint. Filters live rooms or replay videos by business tags and currency. Each record in the returned list is distinguished by content_type: streaming = live broadcast (live field has value), video = replay video (video field has value). The number of results is controlled by the limit parameter (max 10), no additional pagination needed. + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.SquareApi(api_client) +tag = 'tag_example' # str | Business type filter. Available values: Market Analysis, Hot Topics, Blockchain, Others (optional) +coin = 'coin_example' # str | Filter by currency name (e.g., BTC, ETH) (optional) +sort = 'hot' # str | Sort order: hot = most popular (default), new = latest (optional) (default to 'hot') +limit = 3 # int | Return count, 1-10, default 3 (optional) (default to 3) + +try: + # Gate AI Assistant live stream data retrieval + api_response = api_instance.list_live_replay(tag=tag, coin=coin, sort=sort, limit=limit) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling SquareApi->list_live_replay: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag** | **str**| Business type filter. Available values: Market Analysis, Hot Topics, Blockchain, Others | [optional] + **coin** | **str**| Filter by currency name (e.g., BTC, ETH) | [optional] + **sort** | **str**| Sort order: hot = most popular (default), new = latest | [optional] [default to 'hot'] + **limit** | **int**| Return count, 1-10, default 3 | [optional] [default to 3] + +### Return type + +[**ListLiveReplayResponse**](ListLiveReplayResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The endpoint always returns HTTP 200. Business results are distinguished by the code field (code=200 means success) | - | +**400** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/StockApi.md b/docs/StockApi.md new file mode 100644 index 00000000..d83d1c8e --- /dev/null +++ b/docs/StockApi.md @@ -0,0 +1,1131 @@ +# gate_api.StockApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**query_stock_user_assets**](StockApi.md#query_stock_user_assets) | **GET** /stock/users/assets | Query user assets +[**query_stock_symbols**](StockApi.md#query_stock_symbols) | **GET** /stock/symbols | Query symbol list +[**query_stock_symbol_detail**](StockApi.md#query_stock_symbol_detail) | **GET** /stock/symbols/detail | Query symbol details +[**query_stock_order_book**](StockApi.md#query_stock_order_book) | **GET** /stock/market/{symbol}/orderbook | Query market order book +[**query_stock_order_list**](StockApi.md#query_stock_order_list) | **GET** /stock/orders | Query open order list +[**create_stock_order**](StockApi.md#create_stock_order) | **POST** /stock/orders | Create order +[**delete_all_stock_orders**](StockApi.md#delete_all_stock_orders) | **DELETE** /stock/orders | Cancel all open orders +[**query_stock_order_history**](StockApi.md#query_stock_order_history) | **GET** /stock/orders/history | Query historical order list +[**update_stock_order**](StockApi.md#update_stock_order) | **PUT** /stock/orders/{order_id} | Modify order +[**delete_stock_order**](StockApi.md#delete_stock_order) | **DELETE** /stock/orders/{order_id} | Cancel order +[**query_stock_positions**](StockApi.md#query_stock_positions) | **GET** /stock/positions | Query current position list +[**close_stock_position**](StockApi.md#close_stock_position) | **POST** /stock/positions/close | Close position +[**query_stock_transactions**](StockApi.md#query_stock_transactions) | **GET** /stock/transactions | Query transaction records +[**create_stock_transaction**](StockApi.md#create_stock_transaction) | **POST** /stock/transactions | Fund transfer +[**query_stock_exchanges**](StockApi.md#query_stock_exchanges) | **GET** /stock/exchanges | Query supported exchanges +[**query_stock_fee_rate**](StockApi.md#query_stock_fee_rate) | **GET** /stock/fee-rate | Query fee rates for Japanese and Korean stocks + + +# **query_stock_user_assets** +> UserAssetResp2 query_stock_user_assets(pnl_calc_type=pnl_calc_type, pnl_calc_price=pnl_calc_price) + +Query user assets + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +pnl_calc_type = 1 # int | PnL calculation cost type. Defaults to average cost price when omitted (1 = average cost price, 2 = diluted cost price) (optional) +pnl_calc_price = 1 # int | PnL calculation price type. Defaults to intraday price when omitted (1 = intraday price, 2 = latest extended-hours price) (optional) + +try: + # Query user assets + api_response = api_instance.query_stock_user_assets(pnl_calc_type=pnl_calc_type, pnl_calc_price=pnl_calc_price) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->query_stock_user_assets: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pnl_calc_type** | **int**| PnL calculation cost type. Defaults to average cost price when omitted (1 = average cost price, 2 = diluted cost price) | [optional] + **pnl_calc_price** | **int**| PnL calculation price type. Defaults to intraday price when omitted (1 = intraday price, 2 = latest extended-hours price) | [optional] + +### Return type + +[**UserAssetResp2**](UserAssetResp2.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_stock_symbols** +> Symbols2 query_stock_symbols(symbols=symbols, exchange=exchange, with_desc_i18n=with_desc_i18n, page=page, page_size=page_size) + +Query symbol list + +Rate limit: 5 qps. + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +symbols = 'AAPL,TSLA' # str | Symbol list, multiple separated by commas (optional) +exchange = 'us' # str | Exchange, supports us, hk, and kr (optional) +with_desc_i18n = true # bool | Whether to return multilingual symbol description (optional) +page = 1 # int | Page number, defaults to 1 (optional) +page_size = 100 # int | Page size, defaults to 10, max 500; server caps at 500 (optional) + +try: + # Query symbol list + api_response = api_instance.query_stock_symbols(symbols=symbols, exchange=exchange, with_desc_i18n=with_desc_i18n, page=page, page_size=page_size) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->query_stock_symbols: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbols** | **str**| Symbol list, multiple separated by commas | [optional] + **exchange** | **str**| Exchange, supports us, hk, and kr | [optional] + **with_desc_i18n** | **bool**| Whether to return multilingual symbol description | [optional] + **page** | **int**| Page number, defaults to 1 | [optional] + **page_size** | **int**| Page size, defaults to 10, max 500; server caps at 500 | [optional] + +### Return type + +[**Symbols2**](Symbols2.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_stock_symbol_detail** +> SymbolDetail query_stock_symbol_detail(symbols=symbols, exchange=exchange, page=page, page_size=page_size) + +Query symbol details + +Rate limit: 5 qps. + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +symbols = 'AAPL,TSLA' # str | Symbol list, multiple separated by commas (optional) +exchange = 'us' # str | Exchange, supports us, hk, and kr (optional) +page = 1 # int | Page number, defaults to 1 (optional) +page_size = 100 # int | Page size, defaults to 10, max 500; server caps at 500 (optional) + +try: + # Query symbol details + api_response = api_instance.query_stock_symbol_detail(symbols=symbols, exchange=exchange, page=page, page_size=page_size) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->query_stock_symbol_detail: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbols** | **str**| Symbol list, multiple separated by commas | [optional] + **exchange** | **str**| Exchange, supports us, hk, and kr | [optional] + **page** | **int**| Page number, defaults to 1 | [optional] + **page_size** | **int**| Page size, defaults to 10, max 500; server caps at 500 | [optional] + +### Return type + +[**SymbolDetail**](SymbolDetail.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_stock_order_book** +> OrderBook2 query_stock_order_book(symbol) + +Query market order book + +Rate limit: 5 qps. + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +symbol = 'AAPL' # str | Symbol + +try: + # Query market order book + api_response = api_instance.query_stock_order_book(symbol) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->query_stock_order_book: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Symbol | + +### Return type + +[**OrderBook2**](OrderBook2.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_stock_order_list** +> OrderList2 query_stock_order_list(symbol=symbol) + +Query open order list + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +symbol = 'AAPL' # str | Symbol (optional) + +try: + # Query open order list + api_response = api_instance.query_stock_order_list(symbol=symbol) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->query_stock_order_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Symbol | [optional] + +### Return type + +[**OrderList2**](OrderList2.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_stock_order** +> CreateOrder2 create_stock_order(trad_fi_spot_order_request) + +Create order + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +trad_fi_spot_order_request = gate_api.TradFiSpotOrderRequest() # TradFiSpotOrderRequest | + +try: + # Create order + api_response = api_instance.create_stock_order(trad_fi_spot_order_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->create_stock_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **trad_fi_spot_order_request** | [**TradFiSpotOrderRequest**](TradFiSpotOrderRequest.md)| | + +### Return type + +[**CreateOrder2**](CreateOrder2.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Order placed successfully | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_all_stock_orders** +> DeleteOrder delete_all_stock_orders() + +Cancel all open orders + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) + +try: + # Cancel all open orders + api_response = api_instance.delete_all_stock_orders() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->delete_all_stock_orders: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**DeleteOrder**](DeleteOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_stock_order_history** +> OrderHistoryList2 query_stock_order_history(symbol=symbol, order_ids=order_ids, begin_time=begin_time, end_time=end_time, side=side, page=page, page_size=page_size) + +Query historical order list + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +symbol = 'AAPL' # str | Symbol (optional) +order_ids = '123456,123457' # str | Order ID list, multiple separated by commas; max 20, each must be a positive integer (optional) +begin_time = 1769378400 # int | Start time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. (optional) +end_time = 1769464800 # int | End time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. (optional) +side = 2 # int | Side (1=sell, 2=buy) (optional) +page = 1 # int | Page number, defaults to 1 (optional) +page_size = 100 # int | Page size, defaults to 10, max 500; server caps at 500 (optional) + +try: + # Query historical order list + api_response = api_instance.query_stock_order_history(symbol=symbol, order_ids=order_ids, begin_time=begin_time, end_time=end_time, side=side, page=page, page_size=page_size) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->query_stock_order_history: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| Symbol | [optional] + **order_ids** | **str**| Order ID list, multiple separated by commas; max 20, each must be a positive integer | [optional] + **begin_time** | **int**| Start time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. | [optional] + **end_time** | **int**| End time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. | [optional] + **side** | **int**| Side (1=sell, 2=buy) | [optional] + **page** | **int**| Page number, defaults to 1 | [optional] + **page_size** | **int**| Page size, defaults to 10, max 500; server caps at 500 | [optional] + +### Return type + +[**OrderHistoryList2**](OrderHistoryList2.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_stock_order** +> UpdateOrder2 update_stock_order(order_id, trad_fi_spot_order_update_request) + +Modify order + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +order_id = 123456 # int | Order ID +trad_fi_spot_order_update_request = gate_api.TradFiSpotOrderUpdateRequest() # TradFiSpotOrderUpdateRequest | + +try: + # Modify order + api_response = api_instance.update_stock_order(order_id, trad_fi_spot_order_update_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->update_stock_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID | + **trad_fi_spot_order_update_request** | [**TradFiSpotOrderUpdateRequest**](TradFiSpotOrderUpdateRequest.md)| | + +### Return type + +[**UpdateOrder2**](UpdateOrder2.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_stock_order** +> DeleteOrder delete_stock_order(order_id) + +Cancel order + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +order_id = 123456 # int | Order ID + +try: + # Cancel order + api_response = api_instance.delete_stock_order(order_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->delete_stock_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID | + +### Return type + +[**DeleteOrder**](DeleteOrder.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_stock_positions** +> PositionList2 query_stock_positions(pnl_calc_type=pnl_calc_type, pnl_calc_price=pnl_calc_price, symbol=symbol, exchange=exchange) + +Query current position list + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +pnl_calc_type = 1 # int | PnL calculation cost type. Defaults to average cost price when omitted (1 = average cost price, 2 = diluted cost price) (optional) +pnl_calc_price = 1 # int | PnL calculation price type. Defaults to intraday price when omitted (1 = intraday price, 2 = latest extended-hours price) (optional) +symbol = 'AAPL' # str | Symbol (optional) +exchange = 'us' # str | Exchange, supports us, hk, and kr (optional) + +try: + # Query current position list + api_response = api_instance.query_stock_positions(pnl_calc_type=pnl_calc_type, pnl_calc_price=pnl_calc_price, symbol=symbol, exchange=exchange) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->query_stock_positions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pnl_calc_type** | **int**| PnL calculation cost type. Defaults to average cost price when omitted (1 = average cost price, 2 = diluted cost price) | [optional] + **pnl_calc_price** | **int**| PnL calculation price type. Defaults to intraday price when omitted (1 = intraday price, 2 = latest extended-hours price) | [optional] + **symbol** | **str**| Symbol | [optional] + **exchange** | **str**| Exchange, supports us, hk, and kr | [optional] + +### Return type + +[**PositionList2**](PositionList2.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **close_stock_position** +> ClosePosition close_stock_position(trad_fi_spot_close_position_request) + +Close position + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +trad_fi_spot_close_position_request = gate_api.TradFiSpotClosePositionRequest() # TradFiSpotClosePositionRequest | + +try: + # Close position + api_response = api_instance.close_stock_position(trad_fi_spot_close_position_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->close_stock_position: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **trad_fi_spot_close_position_request** | [**TradFiSpotClosePositionRequest**](TradFiSpotClosePositionRequest.md)| | + +### Return type + +[**ClosePosition**](ClosePosition.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_stock_transactions** +> TransactionList2 query_stock_transactions(begin_time=begin_time, end_time=end_time, ref_id=ref_id, type=type, page=page, page_size=page_size) + +Query transaction records + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +begin_time = 1769378400 # int | Start time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. (optional) +end_time = 1769464800 # int | End time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. (optional) +ref_id = 'transfer-202607070001' # str | Business idempotent ID. When ref_id is provided, the server queries by ref_id, ignoring other parameters such as begin_time, end_time, type, page, page_size (optional) +type = 'deposit' # str | Transaction type (optional) +page = 1 # int | Page number, defaults to 1 (optional) +page_size = 100 # int | Page size, defaults to 10, max 500; server caps at 500 (optional) + +try: + # Query transaction records + api_response = api_instance.query_stock_transactions(begin_time=begin_time, end_time=end_time, ref_id=ref_id, type=type, page=page, page_size=page_size) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->query_stock_transactions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **begin_time** | **int**| Start time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. | [optional] + **end_time** | **int**| End time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. | [optional] + **ref_id** | **str**| Business idempotent ID. When ref_id is provided, the server queries by ref_id, ignoring other parameters such as begin_time, end_time, type, page, page_size | [optional] + **type** | **str**| Transaction type | [optional] + **page** | **int**| Page number, defaults to 1 | [optional] + **page_size** | **int**| Page size, defaults to 10, max 500; server caps at 500 | [optional] + +### Return type + +[**TransactionList2**](TransactionList2.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_stock_transaction** +> CreateTransaction2 create_stock_transaction(trad_fi_spot_transaction_request) + +Fund transfer + +Rate limit: 5 qps. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) +trad_fi_spot_transaction_request = gate_api.TradFiSpotTransactionRequest() # TradFiSpotTransactionRequest | + +try: + # Fund transfer + api_response = api_instance.create_stock_transaction(trad_fi_spot_transaction_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->create_stock_transaction: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **trad_fi_spot_transaction_request** | [**TradFiSpotTransactionRequest**](TradFiSpotTransactionRequest.md)| | + +### Return type + +[**CreateTransaction2**](CreateTransaction2.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_stock_exchanges** +> Exchanges query_stock_exchanges() + +Query supported exchanges + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) + +try: + # Query supported exchanges + api_response = api_instance.query_stock_exchanges() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->query_stock_exchanges: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Exchanges**](Exchanges.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **query_stock_fee_rate** +> FeeRate query_stock_fee_rate() + +Query fee rates for Japanese and Korean stocks + +Query fee rates for Japanese and Korean stocks. Rate limit: 5 qps. + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.StockApi(api_client) + +try: + # Query fee rates for Japanese and Korean stocks + api_response = api_instance.query_stock_fee_rate() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling StockApi->query_stock_fee_rate: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FeeRate**](FeeRate.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request success | - | +**400** | Request failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/StopAllChaseOrdersReq.md b/docs/StopAllChaseOrdersReq.md new file mode 100644 index 00000000..409e89f5 --- /dev/null +++ b/docs/StopAllChaseOrdersReq.md @@ -0,0 +1,13 @@ +# StopAllChaseOrdersReq + +Request body for stopping chase orders in batch +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract** | **str** | Optional contract name | [optional] +**settle** | **str** | Overridden by the path parameter | [optional] +**pos_margin_mode** | **str** | Optional margin mode | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StopAllChaseOrdersResp.md b/docs/StopAllChaseOrdersResp.md new file mode 100644 index 00000000..de47c8b9 --- /dev/null +++ b/docs/StopAllChaseOrdersResp.md @@ -0,0 +1,10 @@ +# StopAllChaseOrdersResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orders** | [**list[ChaseOrder]**](ChaseOrder.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StopAllTrailOrders.md b/docs/StopAllTrailOrders.md new file mode 100644 index 00000000..fdaeb5dd --- /dev/null +++ b/docs/StopAllTrailOrders.md @@ -0,0 +1,11 @@ +# StopAllTrailOrders + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract** | **str** | Contract name | [optional] +**related_position** | **int** | Associated position, if provided, only cancel orders associated with this position, 1-long, 2-short | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StopChaseOrderReq.md b/docs/StopChaseOrderReq.md new file mode 100644 index 00000000..311546b2 --- /dev/null +++ b/docs/StopChaseOrderReq.md @@ -0,0 +1,13 @@ +# StopChaseOrderReq + +Request body for stopping a chase order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Order ID. Either id or text must be provided | [optional] +**text** | **str** | Custom text. Required only when id is 0 or omitted | [optional] +**settle** | **str** | Overridden by the path parameter | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StopChaseOrderResp.md b/docs/StopChaseOrderResp.md new file mode 100644 index 00000000..afa2bfc5 --- /dev/null +++ b/docs/StopChaseOrderResp.md @@ -0,0 +1,10 @@ +# StopChaseOrderResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order** | [**ChaseOrder**](ChaseOrder.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StopTrailOrder.md b/docs/StopTrailOrder.md new file mode 100644 index 00000000..3d7f9a00 --- /dev/null +++ b/docs/StopTrailOrder.md @@ -0,0 +1,11 @@ +# StopTrailOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID, if ID is specified, text is not needed | [optional] +**text** | **str** | Custom text, if ID is not specified, terminate based on user_id and text | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StrategyType.md b/docs/StrategyType.md new file mode 100644 index 00000000..22cdca45 --- /dev/null +++ b/docs/StrategyType.md @@ -0,0 +1,10 @@ +# StrategyType + +The complete enumeration of policy types supported by AIHub. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StructuredGetProjectList.md b/docs/StructuredGetProjectList.md deleted file mode 100644 index ab944fb5..00000000 --- a/docs/StructuredGetProjectList.md +++ /dev/null @@ -1,22 +0,0 @@ -# StructuredGetProjectList - -Structured Investment -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | Product ID | [optional] -**type** | **str** | Product Type: `SharkFin2.0`-Shark Fin 2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-Range Accrual `SnowBall`-Snow Ball | [optional] -**name_en** | **str** | Product Name | [optional] -**investment_coin** | **str** | Investment Token | [optional] -**investment_period** | **str** | Investment Period | [optional] -**min_annual_rate** | **str** | Minimum Annual Rate | [optional] -**mid_annual_rate** | **str** | Intermediate Annual Rate | [optional] -**max_annual_rate** | **str** | Maximum Annual Rate | [optional] -**watch_market** | **str** | Underlying Market | [optional] -**start_time** | **int** | Start Time | [optional] -**end_time** | **int** | End time | [optional] -**status** | **str** | Status: `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/StructuredOrderList.md b/docs/StructuredOrderList.md deleted file mode 100644 index 3f52c758..00000000 --- a/docs/StructuredOrderList.md +++ /dev/null @@ -1,17 +0,0 @@ -# StructuredOrderList - -Structured order -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | Order ID | [optional] -**pid** | **str** | Product ID | [optional] -**lock_coin** | **str** | Locked coin | [optional] -**amount** | **str** | Locked amount | [optional] -**status** | **str** | Status: SUCCESS - SUCCESS FAILED - FAILED DONE - DONE | [optional] -**income** | **str** | Income | [optional] -**create_time** | **int** | Created time | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SubAccountBalance.md b/docs/SubAccountBalance.md index 753d3dd6..2bb012aa 100644 --- a/docs/SubAccountBalance.md +++ b/docs/SubAccountBalance.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uid** | **str** | User ID | [optional] **available** | **dict(str, str)** | Available balances of currencies | [optional] +**locking** | **dict(str, str)** | Locked amount by currency | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SubAccountToSubAccount.md b/docs/SubAccountToSubAccount.md index ad18fafe..dd90f8eb 100644 --- a/docs/SubAccountToSubAccount.md +++ b/docs/SubAccountToSubAccount.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **sub_account_from_type** | **str** | Source sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account | **sub_account_to** | **str** | Transfer to the user id of the sub-account | **sub_account_to_type** | **str** | Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account | -**amount** | **str** | Transfer amount | +**amount** | **str** | Transfer Amount, supports up to 8 decimal places, must be greater than 0 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SubAccountTransfer.md b/docs/SubAccountTransfer.md index c591078b..b9002269 100644 --- a/docs/SubAccountTransfer.md +++ b/docs/SubAccountTransfer.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **sub_account** | **str** | Sub account user ID | **sub_account_type** | **str** | Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account | [optional] [default to 'spot'] **currency** | **str** | Transfer currency name | -**amount** | **str** | Transfer amount | +**amount** | **str** | Transfer Amount, supports up to 8 decimal places, must be greater than 0 | **direction** | **str** | Transfer direction: to - transfer into sub-account, from - transfer out from sub-account | **client_order_id** | **str** | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters | [optional] diff --git a/docs/SubAccountTransferRecordItem.md b/docs/SubAccountTransferRecordItem.md index ebfe07e9..5da285f9 100644 --- a/docs/SubAccountTransferRecordItem.md +++ b/docs/SubAccountTransferRecordItem.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **sub_account** | **str** | Sub account user ID | **sub_account_type** | **str** | Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account | [optional] [default to 'spot'] **currency** | **str** | Transfer currency name | -**amount** | **str** | Transfer amount | +**amount** | **str** | Transfer Amount | **direction** | **str** | Transfer direction: to - transfer into sub-account, from - transfer out from sub-account | **source** | **str** | Source of the transfer operation | [optional] [readonly] **client_order_id** | **str** | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters | [optional] diff --git a/docs/SubCrossMarginAccount.md b/docs/SubCrossMarginAccount.md index b3ab2241..8cfdead7 100644 --- a/docs/SubCrossMarginAccount.md +++ b/docs/SubCrossMarginAccount.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **borrowed** | **str** | Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` | [optional] **borrowed_net** | **str** | Total borrowed value in USDT * leverage factor | [optional] **net** | **str** | Total net assets in USDT | [optional] -**leverage** | **str** | Position leverage | [optional] +**leverage** | **str** | Leverage multiplier | [optional] **interest** | **str** | Total unpaid interest in USDT, i.e., the sum of all currencies' `interest*price*discount` | [optional] **risk** | **str** | Risk rate. When it falls below 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` | [optional] **total_initial_margin** | **str** | Total initial margin | [optional] diff --git a/docs/SwapCoin.md b/docs/SwapCoin.md index 3dc278b7..9cdc7450 100644 --- a/docs/SwapCoin.md +++ b/docs/SwapCoin.md @@ -5,7 +5,7 @@ Blockchain Mining Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **coin** | **str** | Currency | -**side** | **str** | 0 - Stake 1 - Redeem | +**side** | **int** | 0 - Stake 1 - Redeem | **amount** | **str** | Size | **pid** | **int** | DeFi-type Mining Protocol Identifier | [optional] diff --git a/docs/SwapCoinStruct.md b/docs/SwapCoinStruct.md index 15735e16..9b3296f9 100644 --- a/docs/SwapCoinStruct.md +++ b/docs/SwapCoinStruct.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **amount** | **str** | Amount | [optional] **exchange_rate** | **str** | Exchange ratio | [optional] **exchange_amount** | **str** | Redemption Amount | [optional] -**update_stamp** | **int** | UpdateTimestamp | [optional] +**update_stamp** | **int** | Update timestamp | [optional] **create_stamp** | **int** | Transaction timestamp | [optional] **status** | **int** | status 1-success | [optional] **protocol_type** | **int** | DEFI Protocol Type | [optional] diff --git a/docs/Symbol.md b/docs/Symbol.md new file mode 100644 index 00000000..2cd7343f --- /dev/null +++ b/docs/Symbol.md @@ -0,0 +1,24 @@ +# Symbol + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Unique trading pair identifier in the form ExchangeType_BusinessType_Base_Counter. | +**exchange_type** | **str** | Venue bucket (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT`). | +**business_type** | **str** | Business type (`SPOT` Spot / `FUTURE` Futures / `MARGIN` Margin). | +**state** | **str** | Status (`live` running / `suspend` paused). | +**min_size** | **str** | Minimum order quantity | +**min_notional** | **str** | Minimum Order Value | +**lot_size** | **str** | Quantity Step | +**tick_size** | **str** | Price Step | +**max_num_orders** | **str** | maximumopen orderamount | +**max_market_size** | **str** | Maximum Market Order Quantity | +**max_limit_size** | **str** | Maximum order quantity for limit orders. | +**contract_size** | **str** | Contract multiplier (deprecated; quantity is used uniformly) | +**liquidation_fee** | **str** | Liquidation Fee Rate | +**delist_time** | **str** | Millisecond timestamp; `0` means not delisted. | +**support_rpi** | **str** | Whether RPI order placement is supported (true if supported; false otherwise) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SymbolCommissions.md b/docs/SymbolCommissions.md new file mode 100644 index 00000000..58b742af --- /dev/null +++ b/docs/SymbolCommissions.md @@ -0,0 +1,11 @@ +# SymbolCommissions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**SymbolCommissionsData**](SymbolCommissionsData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SymbolCommissionsData.md b/docs/SymbolCommissionsData.md new file mode 100644 index 00000000..bdd5b51f --- /dev/null +++ b/docs/SymbolCommissionsData.md @@ -0,0 +1,11 @@ +# SymbolCommissionsData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[SymbolCommissionsDataList]**](SymbolCommissionsDataList.md) | List of symbol commission rates | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SymbolCommissionsDataList.md b/docs/SymbolCommissionsDataList.md new file mode 100644 index 00000000..4e2f1367 --- /dev/null +++ b/docs/SymbolCommissionsDataList.md @@ -0,0 +1,13 @@ +# SymbolCommissionsDataList + +Symbol commission rate +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category_code** | **str** | Category code | [optional] +**symbol** | **str** | Trading symbol code | [optional] +**fee_per_lot** | **str** | Commission rate per lot | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SymbolDetail.md b/docs/SymbolDetail.md new file mode 100644 index 00000000..626bf7d4 --- /dev/null +++ b/docs/SymbolDetail.md @@ -0,0 +1,11 @@ +# SymbolDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**SymbolDetailData**](SymbolDetailData.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SymbolDetailData.md b/docs/SymbolDetailData.md new file mode 100644 index 00000000..cfbf4355 --- /dev/null +++ b/docs/SymbolDetailData.md @@ -0,0 +1,12 @@ +# SymbolDetailData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | | [optional] +**total_page** | **int** | | [optional] +**list** | [**list[SymbolDetailItem]**](SymbolDetailItem.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SymbolDetailItem.md b/docs/SymbolDetailItem.md new file mode 100644 index 00000000..24216502 --- /dev/null +++ b/docs/SymbolDetailItem.md @@ -0,0 +1,35 @@ +# SymbolDetailItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | | [optional] +**exchange** | **str** | Exchange, supports us, hk, and kr | [optional] +**exchange_desc** | **str** | | [optional] +**quote_currency** | **str** | | [optional] +**quote_currency_precision** | **int** | | [optional] +**fx_rate** | **str** | Quote currency to USD exchange rate | [optional] +**symbol_desc** | **str** | | [optional] +**category** | **str** | | [optional] +**settlement_currency** | **str** | | [optional] +**max_order_volume** | **str** | | [optional] +**step_order_volume** | **str** | | [optional] +**min_order_volume** | **str** | | [optional] +**price_precision** | **int** | Price precision | [optional] +**volume_precision** | **int** | | [optional] +**is_ipo** | **bool** | | [optional] +**ipo_price** | **str** | | [optional] +**price_protection** | **str** | | [optional] +**sell_price_protection** | **str** | | [optional] +**buy_price_protection** | **str** | | [optional] +**slippage_rate** | **str** | | [optional] +**commission_rate** | **str** | Fee Rate | [optional] +**trade_status** | **str** | Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. | [optional] +**trade_mode** | **int** | Current session trading mode. - 0: Trading disabled. - 1: Buy only. - 2: Sell only. - 4: Buy and sell supported. | [optional] +**order_fill_timing** | **int** | Order fill timing (1=immediate, 2=after pre-market opens, 3=after regular session opens) | [optional] +**symbol_descs** | [**list[SymbolDetailItemSymbolDescs]**](SymbolDetailItemSymbolDescs.md) | | [optional] +**icon_link** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SymbolDetailItemSymbolDescs.md b/docs/SymbolDetailItemSymbolDescs.md new file mode 100644 index 00000000..9df04daf --- /dev/null +++ b/docs/SymbolDetailItemSymbolDescs.md @@ -0,0 +1,11 @@ +# SymbolDetailItemSymbolDescs + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lang** | **str** | | [optional] +**value** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SymbolListItem.md b/docs/SymbolListItem.md new file mode 100644 index 00000000..92453ad5 --- /dev/null +++ b/docs/SymbolListItem.md @@ -0,0 +1,29 @@ +# SymbolListItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Symbol | [optional] +**exchange** | **str** | Exchange, supports us, hk, and kr | [optional] +**exchange_desc** | **str** | Exchange description | [optional] +**quote_currency** | **str** | Quote currency | [optional] +**quote_currency_precision** | **int** | Quote currency precision | [optional] +**fx_rate** | **str** | Quote currency to USD exchange rate | [optional] +**symbol_desc** | **str** | Symbol description | [optional] +**category** | **str** | Category | [optional] +**trade_status** | **str** | Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. | [optional] +**trade_mode** | **int** | Current session trading mode. - 0: Trading disabled. - 1: Buy only. - 2: Sell only. - 4: Buy and sell supported. | [optional] +**order_fill_timing** | **int** | Order fill timing (1=immediate, 2=after pre-market opens, 3=after regular session opens) | [optional] +**icon_link** | **str** | Icon URL | [optional] +**quote_currency_symbol** | **str** | Quote currency symbol | [optional] +**price_precision** | **int** | Price precision | [optional] +**volume_precision** | **int** | Quantity precision | [optional] +**is_ipo** | **bool** | Whether it is an IPO symbol | [optional] +**ipo_price** | **str** | IPO price | [optional] +**sell_price_protection** | **str** | Sell price protection rate | [optional] +**buy_price_protection** | **str** | Buy price protection rate | [optional] +**symbol_descs** | [**list[I18nTxt]**](I18nTxt.md) | Multilingual symbol description | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Symbols.md b/docs/Symbols.md new file mode 100644 index 00000000..e8de0921 --- /dev/null +++ b/docs/Symbols.md @@ -0,0 +1,11 @@ +# Symbols + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**SymbolsData**](SymbolsData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Symbols2.md b/docs/Symbols2.md new file mode 100644 index 00000000..9c701a97 --- /dev/null +++ b/docs/Symbols2.md @@ -0,0 +1,11 @@ +# Symbols2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Symbols2Data**](Symbols2Data.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Symbols2Data.md b/docs/Symbols2Data.md new file mode 100644 index 00000000..7096f643 --- /dev/null +++ b/docs/Symbols2Data.md @@ -0,0 +1,12 @@ +# Symbols2Data + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total quantity | [optional] +**total_page** | **int** | Total pages | [optional] +**list** | [**list[SymbolListItem]**](SymbolListItem.md) | Symbol list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SymbolsData.md b/docs/SymbolsData.md new file mode 100644 index 00000000..8b52d1d3 --- /dev/null +++ b/docs/SymbolsData.md @@ -0,0 +1,11 @@ +# SymbolsData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**list** | [**list[SymbolsDataList]**](SymbolsDataList.md) | Trading symbol list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SymbolsDataList.md b/docs/SymbolsDataList.md new file mode 100644 index 00000000..d9b08ab2 --- /dev/null +++ b/docs/SymbolsDataList.md @@ -0,0 +1,22 @@ +# SymbolsDataList + +Trading symbol information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Trading symbol code | [optional] +**symbol_desc** | **str** | Trading symbol description | [optional] +**category_id** | **int** | Category ID | [optional] +**status** | **str** | Trading status (open=tradable, closed=non-tradable) | [optional] +**trade_mode** | **str** | Trading mode code (0=disabled, 1=long only, 2=short only, 3=close only, 4=full trading access) | [optional] +**icon_link** | **str** | Symbol icon URL | [optional] +**close_time** | **int** | Close time (Unix timestamp in seconds) | [optional] +**open_time** | **int** | Open time (Unix timestamp in seconds) | [optional] +**next_open_time** | **int** | Next open time (Unix timestamp in seconds, 0 means none) | [optional] +**settlement_currency** | **str** | Settlement currency | [optional] +**settlement_currency_symbol** | **str** | Settlement currency symbol | [optional] +**price_precision** | **int** | Price precision (decimal places) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Tokens.md b/docs/Tokens.md new file mode 100644 index 00000000..8abd3247 --- /dev/null +++ b/docs/Tokens.md @@ -0,0 +1,16 @@ +# Tokens + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency symbol | [optional] +**name** | **str** | Currency name | [optional] +**chain** | **str** | The main chain corresponding to the coin | [optional] +**address** | **str** | Contract Address | [optional] +**amount_precision** | **int** | Quantity precision | [optional] +**precision** | **int** | Price precision | [optional] +**status** | **int** | Currency Trading Status - `1` : Normal trading - `2` : Suspended trading - `3` : Delisted | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TotalBalance.md b/docs/TotalBalance.md index bead2e30..3339439f 100644 --- a/docs/TotalBalance.md +++ b/docs/TotalBalance.md @@ -5,7 +5,7 @@ User's total balance information Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total** | [**AccountBalance**](AccountBalance.md) | | [optional] -**details** | [**dict(str, AccountBalance)**](AccountBalance.md) | Total balances in different accounts - cross_margin: cross margin account - spot: spot account - finance: finance account - margin: margin account - quant: quant account - futures: perpetual contract account - delivery: delivery contract account - warrant: warrant account - cbbc: CBBC account | [optional] +**details** | [**dict(str, AccountBalance)**](AccountBalance.md) | Total Balances of All Accounts - cross_margin: Cross Margin Account - spot: Spot Account - finance: Finance Account - margin: Margin Account - quant: Quantitative Account - futures: Futures Account (Perpetual Contracts) - delivery: Delivery Account (Delivery Contracts) - warrant: Warrant Account - cbbc: CBBC Account (Covered Bull/Bear Contract) - meme_box: Alpha Account - options: Options Account - payment: Payment Account | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TradFiClosePositionRequest.md b/docs/TradFiClosePositionRequest.md new file mode 100644 index 00000000..51e6c7b7 --- /dev/null +++ b/docs/TradFiClosePositionRequest.md @@ -0,0 +1,12 @@ +# TradFiClosePositionRequest + +Close position request parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**close_type** | **int** | Close Type Description: - 1: Partial Close (close_volume is required) - 2: Full Close (close_volume is not required) | +**close_volume** | **str** | Close Volume Description: - Required when close_type = 1 - Ignored when close_type = 2 | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiError.md b/docs/TradFiError.md new file mode 100644 index 00000000..9209126a --- /dev/null +++ b/docs/TradFiError.md @@ -0,0 +1,12 @@ +# TradFiError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Business status code, non-empty indicates request exception, please refer to TradFi error enumeration in documentation | [optional] +**message** | **str** | Return message, returned when request error occurs | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiOrderRequest.md b/docs/TradFiOrderRequest.md new file mode 100644 index 00000000..cce19c0e --- /dev/null +++ b/docs/TradFiOrderRequest.md @@ -0,0 +1,17 @@ +# TradFiOrderRequest + +Place order request parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**price** | **str** | Order price | +**price_type** | **str** | Price type (trigger=trigger price, market=market price) | +**side** | **int** | Side (1=sell, 2=buy) | +**symbol** | **str** | Trading symbol code | +**volume** | **str** | Order quantity | +**price_tp** | **str** | Take profit price (optional) | [optional] +**price_sl** | **str** | Stop loss price (optional) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiOrderUpdateRequest.md b/docs/TradFiOrderUpdateRequest.md new file mode 100644 index 00000000..226582f5 --- /dev/null +++ b/docs/TradFiOrderUpdateRequest.md @@ -0,0 +1,13 @@ +# TradFiOrderUpdateRequest + +Modify order price and take profit/stop loss parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**price** | **str** | Price Description: - Required | +**price_tp** | **str** | Take Profit Price Description: - If not provided or set to \"0\": The original take profit price will be cleared - If you do not want to clear it, pass the original take profit price returned by the interface | [optional] +**price_sl** | **str** | Stop Loss Price Description: - If not provided or set to \"0\": The original stop loss price will be cleared - If you do not want to clear it, pass the original stop loss price returned by the interface | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiPositionUpdateRequest.md b/docs/TradFiPositionUpdateRequest.md new file mode 100644 index 00000000..d5aeee6b --- /dev/null +++ b/docs/TradFiPositionUpdateRequest.md @@ -0,0 +1,12 @@ +# TradFiPositionUpdateRequest + +Modify position take profit/stop loss parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**price_tp** | **str** | Take Profit Price Description: - If not provided or set to \"0\": The original take profit price will be cleared - If you do not want to clear it, pass the original take profit price returned by the interface | [optional] +**price_sl** | **str** | Stop Loss Price Description: - If not provided or set to \"0\": The original stop loss price will be cleared - If you do not want to clear it, pass the original stop loss price returned by the interface | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiSpotClosePositionRequest.md b/docs/TradFiSpotClosePositionRequest.md new file mode 100644 index 00000000..360bedf2 --- /dev/null +++ b/docs/TradFiSpotClosePositionRequest.md @@ -0,0 +1,13 @@ +# TradFiSpotClosePositionRequest + +Close position request parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | Symbol | +**close_volume** | **str** | Close quantity; required for partial close | [optional] +**close_type** | **int** | Close type (1=partial close, 2=close all) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiSpotError.md b/docs/TradFiSpotError.md new file mode 100644 index 00000000..ca8d7019 --- /dev/null +++ b/docs/TradFiSpotError.md @@ -0,0 +1,13 @@ +# TradFiSpotError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Business error label | [optional] +**message** | **str** | Error message | [optional] +**data** | [**object**](.md) | Error additional data | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiSpotOrderRequest.md b/docs/TradFiSpotOrderRequest.md new file mode 100644 index 00000000..1dbc9c6d --- /dev/null +++ b/docs/TradFiSpotOrderRequest.md @@ -0,0 +1,18 @@ +# TradFiSpotOrderRequest + +Place order request parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**volume** | **str** | Order quantity | +**symbol** | **str** | Symbol | +**side** | **int** | Side (1=sell, 2=buy) | +**price_type** | **str** | Price type (market = market order, limit = limit order) | +**trading_session** | **str** | Trading session. Limit orders support only All, while market orders support only Regular. | +**time_in_force** | **str** | Time in force. - day: Day order. | +**price** | **str** | Order price, used for limit orders | [optional] +**client_order_id** | **str** | Client-defined order ID | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiSpotOrderUpdateRequest.md b/docs/TradFiSpotOrderUpdateRequest.md new file mode 100644 index 00000000..3c82e379 --- /dev/null +++ b/docs/TradFiSpotOrderUpdateRequest.md @@ -0,0 +1,12 @@ +# TradFiSpotOrderUpdateRequest + +Modify order request parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**volume** | **str** | Modified order quantity | +**price** | **str** | Modified order price | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiSpotTransactionRequest.md b/docs/TradFiSpotTransactionRequest.md new file mode 100644 index 00000000..d56cf6bf --- /dev/null +++ b/docs/TradFiSpotTransactionRequest.md @@ -0,0 +1,14 @@ +# TradFiSpotTransactionRequest + +Transfer request parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | Asset, USDT only | +**change** | **str** | Change amount | +**type** | **str** | Transaction type (deposit=deposit, withdraw=withdrawal) | +**ref_id** | **str** | Business idempotent ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiTicker.md b/docs/TradFiTicker.md new file mode 100644 index 00000000..6baea695 --- /dev/null +++ b/docs/TradFiTicker.md @@ -0,0 +1,14 @@ +# TradFiTicker + +Ticker summary information +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | Business status code, non-empty indicates request exception, please refer to TradFi error enumeration in documentation | [optional] +**message** | **str** | Return message, returned when request error occurs | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**TradFiTickerData**](TradFiTickerData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiTickerData.md b/docs/TradFiTickerData.md new file mode 100644 index 00000000..155dbfab --- /dev/null +++ b/docs/TradFiTickerData.md @@ -0,0 +1,26 @@ +# TradFiTickerData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**highest_price** | **str** | High price | [optional] +**lowest_price** | **str** | Low price | [optional] +**price_change** | **str** | Price change percentage (multiplied by 100) | [optional] +**price_change_amount** | **str** | Price change amount | [optional] +**today_open_price** | **str** | Today's open price | [optional] +**last_today_close_price** | **str** | Previous close price | [optional] +**last_price** | **str** | Last trading price | [optional] +**bid_price** | **str** | Bid price | [optional] +**ask_price** | **str** | Ask price | [optional] +**favorite** | **bool** | Is favorited | [optional] +**status** | **str** | Trading status (open=tradable, closed=non-tradable) | [optional] +**close_time** | **int** | Close time (Unix timestamp in seconds) | [optional] +**open_time** | **int** | Open time (Unix timestamp in seconds) | [optional] +**next_open_time** | **int** | Next open time (0 means none) | [optional] +**trade_mode** | **str** | Trading mode code | [optional] +**category_name** | **str** | Category name | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TradFiTransactionRequest.md b/docs/TradFiTransactionRequest.md new file mode 100644 index 00000000..2d45b361 --- /dev/null +++ b/docs/TradFiTransactionRequest.md @@ -0,0 +1,13 @@ +# TradFiTransactionRequest + +Fund Transfer Request Body +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | Asset type, e.g., USDT, currently only USDT is supported | +**change** | **str** | Change Quantity, supports up to two decimal places | +**type** | **str** | Transaction Type (deposit - transfer in, withdraw - transfer out) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Trade.md b/docs/Trade.md index 650edf62..3441a265 100644 --- a/docs/Trade.md +++ b/docs/Trade.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **gt_fee** | **str** | GT used to deduct fee, not returned in public endpoints | [optional] **amend_text** | **str** | The custom data that the user remarked when amending the order | [optional] **sequence_id** | **str** | Consecutive trade ID within a single market. Used to track and identify trades in the specific market | [optional] -**text** | **str** | User-defined information, not returned in public endpoints | [optional] +**text** | **str** | Order's Custom Information. This field is not returned by public interfaces. The scenarios pm_liquidate, comb_margin_liquidate, and scm_liquidate represent full-account forced liquidation orders. liquidate represents isolated-account forced liquidation orders. | [optional] **deal** | **str** | Total Executed Value | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TrailChangeLog.md b/docs/TrailChangeLog.md new file mode 100644 index 00000000..d7dbf0e2 --- /dev/null +++ b/docs/TrailChangeLog.md @@ -0,0 +1,17 @@ +# TrailChangeLog + +Trail order modification records +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updated_at** | **int** | Update time | [optional] [readonly] +**amount** | **str** | Trading quantity in contracts, positive for buy, negative for sell | [optional] [readonly] +**is_gte** | **bool** | true: activate when market price >= activation price, false: <= activation price | [optional] [readonly] +**activation_price** | **str** | Activation price, 0 means trigger immediately | [optional] [readonly] +**price_type** | **int** | Activation price type: 0-unknown, 1-latest price, 2-index price, 3-mark price | [optional] [readonly] +**price_offset** | **str** | Callback ratio or price distance, e.g., `0.1` or `0.1%` | [optional] [readonly] +**is_create** | **bool** | true - order creation, false - order modification | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TrailOrder.md b/docs/TrailOrder.md new file mode 100644 index 00000000..645ca9ad --- /dev/null +++ b/docs/TrailOrder.md @@ -0,0 +1,49 @@ +# TrailOrder + +Trail order details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | [optional] [readonly] +**user_id** | **int** | User ID | [optional] [readonly] +**user** | **int** | User ID | [optional] [readonly] +**contract** | **str** | Contract name | [optional] +**settle** | **str** | Settle currency | [optional] +**amount** | **str** | Trading quantity in contracts, positive for buy, negative for sell | [optional] +**is_gte** | **bool** | true: activate when market price >= activation price, false: <= activation price | [optional] +**activation_price** | **str** | Activation price, 0 means trigger immediately | [optional] +**price_type** | **int** | Activation price type: 0-unknown, 1-latest price, 2-index price, 3-mark price | [optional] +**price_offset** | **str** | Callback ratio or price distance, e.g., `0.1` or `0.1%` | [optional] +**text** | **str** | Custom field | [optional] +**reduce_only** | **bool** | Reduce Position Only | [optional] +**position_related** | **bool** | Whether bound to position | [optional] +**created_at** | **int** | Created time | [optional] [readonly] +**activated_at** | **int** | Activation time | [optional] [readonly] +**finished_at** | **int** | End time | [optional] [readonly] +**create_time** | **int** | Created time | [optional] [readonly] +**active_time** | **int** | Activation time | [optional] [readonly] +**finish_time** | **int** | End time | [optional] [readonly] +**reason** | **str** | End reason | [optional] [readonly] +**suborder_text** | **str** | Sub-order text field | [optional] [readonly] +**is_dual_mode** | **bool** | Whether dual position mode when creating order | [optional] [readonly] +**trigger_price** | **str** | Trigger price | [optional] [readonly] +**suborder_id** | **int** | Sub-order ID | [optional] [readonly] +**side_label** | **str** | Order direction label: long/short/open long/open short/close long/close short | [optional] [readonly] +**original_status** | **int** | Order status | [optional] [readonly] +**status** | **str** | Simplified order status: open/finished | [optional] [readonly] +**position_side_output** | **str** | Same as side_label, client requires consistency with other order types | [optional] [readonly] +**updated_at** | **int** | Update time | [optional] [readonly] +**extremum_price** | **str** | Extremum price | [optional] [readonly] +**status_code** | **str** | Status code value | [optional] [readonly] +**created_at_precise** | **str** | Creation time (high precision, seconds.microseconds format) | [optional] [readonly] +**finished_at_precise** | **str** | End time (high precision, seconds.microseconds format) | [optional] [readonly] +**activated_at_precise** | **str** | Activation time (high precision, seconds.microseconds format) | [optional] [readonly] +**status_label** | **str** | Status internationalization label (translated status text) | [optional] [readonly] +**pos_margin_mode** | **str** | Position margin mode: isolated/cross | [optional] [readonly] +**position_mode** | **str** | Position mode: single, dual, and dual_plus | [optional] [readonly] +**error_label** | **str** | Error label | [optional] [readonly] +**leverage** | **str** | Leverage | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TrailOrderChangeLogResponse.md b/docs/TrailOrderChangeLogResponse.md new file mode 100644 index 00000000..e7aed06c --- /dev/null +++ b/docs/TrailOrderChangeLogResponse.md @@ -0,0 +1,10 @@ +# TrailOrderChangeLogResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**change_log** | [**list[TrailChangeLog]**](TrailChangeLog.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TrailOrderDetailResponse.md b/docs/TrailOrderDetailResponse.md new file mode 100644 index 00000000..c135f18f --- /dev/null +++ b/docs/TrailOrderDetailResponse.md @@ -0,0 +1,13 @@ +# TrailOrderDetailResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | Status code, 0 means success | [optional] +**message** | **str** | Response message | [optional] +**data** | [**TrailOrderResponse**](TrailOrderResponse.md) | | [optional] +**timestamp** | **int** | Response timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TrailOrderListResponse.md b/docs/TrailOrderListResponse.md new file mode 100644 index 00000000..22a7cfe4 --- /dev/null +++ b/docs/TrailOrderListResponse.md @@ -0,0 +1,10 @@ +# TrailOrderListResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orders** | [**list[TrailOrder]**](TrailOrder.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TrailOrderResponse.md b/docs/TrailOrderResponse.md new file mode 100644 index 00000000..ba3c5adc --- /dev/null +++ b/docs/TrailOrderResponse.md @@ -0,0 +1,10 @@ +# TrailOrderResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order** | [**TrailOrder**](TrailOrder.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TransactionItem.md b/docs/TransactionItem.md new file mode 100644 index 00000000..31d1d75b --- /dev/null +++ b/docs/TransactionItem.md @@ -0,0 +1,20 @@ +# TransactionItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | Asset | [optional] +**symbol** | **str** | Symbol | [optional] +**symbol_display** | **str** | Symbol display name | [optional] +**type** | **str** | Transaction type. - deposit: Funds transfer in. - withdraw: Funds transfer out. - fee: Trading fee. - dividend: Dividend payout. - sell: Stock sale credit. - buy: Stock purchase debit. - award: Airdrop reward. - stock_transfer_in: Stock transfer in. - stock_transfer_out: Stock transfer out. | [optional] +**type_desc** | **str** | Transaction type description | [optional] +**change** | **str** | Change amount | [optional] +**balance** | **str** | Balance after change | [optional] +**ref_id** | **str** | Business idempotent ID | [optional] +**time** | **int** | Unix timestamp (seconds) | [optional] +**unit_text** | **str** | Unit display text | [optional] +**detail** | **dict(str, object)** | Business details | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TransactionList.md b/docs/TransactionList.md new file mode 100644 index 00000000..3535c887 --- /dev/null +++ b/docs/TransactionList.md @@ -0,0 +1,11 @@ +# TransactionList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**TransactionListData**](TransactionListData.md) | | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TransactionList2.md b/docs/TransactionList2.md new file mode 100644 index 00000000..2d0f098f --- /dev/null +++ b/docs/TransactionList2.md @@ -0,0 +1,11 @@ +# TransactionList2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**TransactionList2Data**](TransactionList2Data.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TransactionList2Data.md b/docs/TransactionList2Data.md new file mode 100644 index 00000000..af71229a --- /dev/null +++ b/docs/TransactionList2Data.md @@ -0,0 +1,12 @@ +# TransactionList2Data + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | | [optional] +**total_page** | **int** | | [optional] +**list** | [**list[TransactionItem]**](TransactionItem.md) | Transaction record list | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TransactionListData.md b/docs/TransactionListData.md new file mode 100644 index 00000000..f7940920 --- /dev/null +++ b/docs/TransactionListData.md @@ -0,0 +1,12 @@ +# TransactionListData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | Total Records | [optional] +**total_page** | **int** | Total pages | [optional] +**list** | [**list[TransactionListDataList]**](TransactionListDataList.md) | Record List | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TransactionListDataList.md b/docs/TransactionListDataList.md new file mode 100644 index 00000000..6d529125 --- /dev/null +++ b/docs/TransactionListDataList.md @@ -0,0 +1,15 @@ +# TransactionListDataList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset** | **str** | Asset Type | [optional] +**type** | **str** | Trading Type | [optional] +**type_desc** | **str** | Transaction Type Description | [optional] +**change** | **str** | Change amount | [optional] +**balance** | **str** | Current Balance | [optional] +**time** | **int** | Occurrence Time (Second-level Timestamp) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Transfer.md b/docs/Transfer.md index bf9cac3c..93d355c6 100644 --- a/docs/Transfer.md +++ b/docs/Transfer.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **currency** | **str** | Transfer currency name. For contract accounts, `currency` can be set to `POINT` (points) or supported settlement currencies (e.g., `BTC`, `USDT`) | **_from** | **str** | Account to transfer from | **to** | **str** | Account to transfer to | -**amount** | **str** | Transfer amount | +**amount** | **str** | Transfer Amount, supports up to 8 decimal places, must be greater than 0 | **currency_pair** | **str** | Margin trading pair. Required when transferring to or from margin account | [optional] **settle** | **str** | Contract settlement currency. Required when transferring to or from contract account | [optional] diff --git a/docs/TriggerOrderResponse.md b/docs/TriggerOrderResponse.md index 6f44aa38..2f3847c0 100644 --- a/docs/TriggerOrderResponse.md +++ b/docs/TriggerOrderResponse.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Auto order ID | [optional] +**id_string** | **str** | String form of the auto order ID; the same order as numeric `id`, as the decimal string of `id` to avoid int64 precision loss in JavaScript and similar environments. Prefer this field to display the order ID or when a string unique identifier is needed; one-to-one with `id`. Same meaning as the field of the same name in futures price-trigger REST APIs and in `futures.orders` / `futures.autoorders` WebSocket pushes. | [optional] [readonly] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UidPushWithdrawalResp.md b/docs/UidPushWithdrawalResp.md index 5363c0fb..4b1da8aa 100644 --- a/docs/UidPushWithdrawalResp.md +++ b/docs/UidPushWithdrawalResp.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | Order ID | [optional] +**id** | **str** | Order ID | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UniChartPoint.md b/docs/UniChartPoint.md new file mode 100644 index 00000000..a08ae594 --- /dev/null +++ b/docs/UniChartPoint.md @@ -0,0 +1,11 @@ +# UniChartPoint + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **int** | | [optional] +**value** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UniCurrencyPair.md b/docs/UniCurrencyPair.md index 4e0d0c61..20539dbf 100644 --- a/docs/UniCurrencyPair.md +++ b/docs/UniCurrencyPair.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **currency_pair** | **str** | Currency pair | [optional] [readonly] **base_min_borrow_amount** | **str** | Minimum borrow amount of base currency | [optional] [readonly] **quote_min_borrow_amount** | **str** | Minimum borrow amount of quote currency | [optional] [readonly] -**leverage** | **str** | Position leverage | [optional] [readonly] +**leverage** | **str** | Leverage multiplier | [optional] [readonly] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UniEstimatedRate.md b/docs/UniEstimatedRate.md new file mode 100644 index 00000000..87a85659 --- /dev/null +++ b/docs/UniEstimatedRate.md @@ -0,0 +1,11 @@ +# UniEstimatedRate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | | [optional] +**est_rate** | **str** | Estimated Annualized Rate, e.g., `est_rate`: `0.8014` represents an annualized rate of 80.14% | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedAccount.md b/docs/UnifiedAccount.md index bd5da422..1a8aef3a 100644 --- a/docs/UnifiedAccount.md +++ b/docs/UnifiedAccount.md @@ -3,22 +3,23 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**mode** | **str** | Unified account mode: - classic: Classic account mode - multi_currency: Multi-currency margin mode - portfolio: Portfolio margin mode - single_currency: Single-currency margin mode | [optional] **user_id** | **int** | User ID | [optional] **refresh_time** | **int** | Last refresh time | [optional] **locked** | **bool** | Whether the account is locked, valid in cross-currency margin/combined margin mode, false in other modes such as single-currency margin mode | [optional] **balances** | [**dict(str, UnifiedBalance)**](UnifiedBalance.md) | | [optional] **total** | **str** | Total account assets converted to USD, i.e. the sum of `(available + freeze) * price` in all currencies (deprecated, to be removed, replaced by unified_account_total) | [optional] **borrowed** | **str** | Total borrowed amount converted to USD, i.e. the sum of `borrowed * price` of all currencies (excluding point cards), valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] -**total_initial_margin** | **str** | Total initial margin, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] -**total_margin_balance** | **str** | Total margin balance, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] -**total_maintenance_margin** | **str** | Total maintenance margin is valid in cross-currency margin/combined margin mode, and is 0 in other modes such as single-currency margin mode | [optional] -**total_initial_margin_rate** | **str** | Total initial margin rate, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] -**total_maintenance_margin_rate** | **str** | Total maintenance margin rate, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] +**total_initial_margin** | **str** | Total initial margin (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode | [optional] +**total_margin_balance** | **str** | Total margin balance (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode | [optional] +**total_maintenance_margin** | **str** | Total maintenance margin (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode | [optional] +**total_initial_margin_rate** | **str** | Total initial margin rate (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode | [optional] +**total_maintenance_margin_rate** | **str** | Total maintenance margin rate (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode | [optional] **total_available_margin** | **str** | Available margin amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] -**unified_account_total** | **str** | Total unified account assets, valid in single currency margin/cross-currency margin/combined margin mode | [optional] -**unified_account_total_liab** | **str** | Total unified account borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] -**unified_account_total_equity** | **str** | Total unified account equity, valid in single currency margin/cross-currency margin/combined margin mode | [optional] -**leverage** | **str** | Actual leverage ratio, valid in cross-currency margin/combined margin mode | [optional] [readonly] +**unified_account_total** | **str** | Total unified account assets, includes both cross and isolated total assets in single-currency/multi-currency mode, only cross total assets in portfolio margin mode | [optional] +**unified_account_total_liab** | **str** | Total unified account borrowed, i.e. total cross borrowed, effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode | [optional] +**unified_account_total_equity** | **str** | Total unified account equity, includes both cross and isolated total equity in single-currency/multi-currency mode, only cross total equity in portfolio margin mode | [optional] +**leverage** | **str** | Account leverage multiplier, effective in multi-currency/portfolio margin mode (deprecated). Currency leverage query API: GET /unified/leverage/user_currency_setting | [optional] [readonly] **spot_order_loss** | **str** | Spot Pending Order Loss, in USDT, effective only in Cross-Currency Margin Mode and Portfolio Margin Mode. | [optional] **options_order_loss** | **str** | Option Pending Order Loss, in USDT, effective only in Portfolio Margin Mode. | [optional] **spot_hedge** | **bool** | Spot hedging status: true - enabled, false - disabled | [optional] diff --git a/docs/UnifiedApi.md b/docs/UnifiedApi.md index 5c23e084..79e38161 100644 --- a/docs/UnifiedApi.md +++ b/docs/UnifiedApi.md @@ -20,12 +20,17 @@ Method | HTTP request | Description [**list_currency_discount_tiers**](UnifiedApi.md#list_currency_discount_tiers) | **GET** /unified/currency_discount_tiers | Query unified account tiered [**list_loan_margin_tiers**](UnifiedApi.md#list_loan_margin_tiers) | **GET** /unified/loan_margin_tiers | Query unified account tiered loan margin [**calculate_portfolio_margin**](UnifiedApi.md#calculate_portfolio_margin) | **POST** /unified/portfolio_calculator | Portfolio margin calculator +[**set_user_leverage**](UnifiedApi.md#set_user_leverage) | **POST** /unified/leverage/user_setting | Set leverage for all of the user's borrowed currencies [**get_user_leverage_currency_config**](UnifiedApi.md#get_user_leverage_currency_config) | **GET** /unified/leverage/user_currency_config | Maximum and minimum currency leverage that can be set [**get_user_leverage_currency_setting**](UnifiedApi.md#get_user_leverage_currency_setting) | **GET** /unified/leverage/user_currency_setting | Get user currency leverage [**set_user_leverage_currency_setting**](UnifiedApi.md#set_user_leverage_currency_setting) | **POST** /unified/leverage/user_currency_setting | Set loan currency leverage [**list_unified_currencies**](UnifiedApi.md#list_unified_currencies) | **GET** /unified/currencies | List of loan currencies supported by unified account [**get_history_loan_rate**](UnifiedApi.md#get_history_loan_rate) | **GET** /unified/history_loan_rate | Get historical lending rates [**set_unified_collateral**](UnifiedApi.md#set_unified_collateral) | **POST** /unified/collateral_currencies | Set collateral currency +[**get_estimated_quick_repayment**](UnifiedApi.md#get_estimated_quick_repayment) | **GET** /unified/estimated_quick_repayment | Estimated quick repayment details +[**create_quick_repayment**](UnifiedApi.md#create_quick_repayment) | **POST** /unified/quick_repayment | Quick repayment +[**get_unified_delta_neutral**](UnifiedApi.md#get_unified_delta_neutral) | **GET** /unified/delta_neutral | Query the account Delta-neutral strategy mode setting +[**set_unified_delta_neutral**](UnifiedApi.md#set_unified_delta_neutral) | **POST** /unified/delta_neutral | Set the account Delta-neutral strategy mode # **list_unified_accounts** @@ -301,7 +306,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_unified_borrowable_list** -> list[UnifiedBorrowable1] get_unified_borrowable_list(currencies) +> list[UnifiedBorrowable] get_unified_borrowable_list(currencies) Batch query unified account maximum borrowable amount @@ -349,7 +354,7 @@ Name | Type | Description | Notes ### Return type -[**list[UnifiedBorrowable1]**](UnifiedBorrowable1.md) +[**list[UnifiedBorrowable]**](UnifiedBorrowable.md) ### Authorization @@ -1039,7 +1044,7 @@ No authorization required Portfolio margin calculator -Portfolio Margin Calculator When inputting simulated position portfolios, each position includes the position name and quantity held, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. When inputting simulated orders, each order includes the market identifier, order price, and order quantity, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. Market orders are not included. +Portfolio Margin Calculator This interface calculates maintenance and initial margin requirements under the portfolio margin model for custom simulated position and order portfolios. It currently supports all underlying currencies with active options trading. Each simulated position requires a name and holding quantity; each simulated pending order requires a market identifier, price, and quantity. Market orders are not supported. ### Example @@ -1094,6 +1099,75 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **set_user_leverage** +> list[LeverageFailedCurrencies] set_user_leverage(user_leverage_setting) + +Set leverage for all of the user's borrowed currencies + +Note the following: - Leverage cannot be changed for currencies with outstanding loans. - A leverage value above a currency's limit is capped at that limit. - Failures are not rolled back and affect only the currencies that failed. For example, if USDT has an outstanding loan, only the USDT leverage remains unchanged. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +user_leverage_setting = gate_api.UserLeverageSetting() # UserLeverageSetting | + +try: + # Set leverage for all of the user's borrowed currencies + api_response = api_instance.set_user_leverage(user_leverage_setting) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->set_user_leverage: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_leverage_setting** | [**UserLeverageSetting**](UserLeverageSetting.md)| | + +### Return type + +[**list[LeverageFailedCurrencies]**](LeverageFailedCurrencies.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Set successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_user_leverage_currency_config** > UnifiedLeverageConfig get_user_leverage_currency_config(currency) @@ -1485,3 +1559,280 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_estimated_quick_repayment** +> QuickEstimatedRepayment get_estimated_quick_repayment() + +Estimated quick repayment details + +Available for unified account cross-currency margin mode and portfolio margin mode + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) + +try: + # Estimated quick repayment details + api_response = api_instance.get_estimated_quick_repayment() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->get_estimated_quick_repayment: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**QuickEstimatedRepayment**](QuickEstimatedRepayment.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | +**400** | Invalid request parameters | - | +**401** | Authentication failed | - | +**403** | Access denied (e.g. account mode does not support quick repayment) | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_quick_repayment** +> QuickRepaymentResponse create_quick_repayment(quick_repayment_request) + +Quick repayment + +Available for unified account cross-currency margin mode and portfolio margin mode. Use `GET /unified/estimated_quick_repayment` to query liabilities and pending repayment information. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +quick_repayment_request = gate_api.QuickRepaymentRequest() # QuickRepaymentRequest | + +try: + # Quick repayment + api_response = api_instance.create_quick_repayment(quick_repayment_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->create_quick_repayment: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **quick_repayment_request** | [**QuickRepaymentRequest**](QuickRepaymentRequest.md)| | + +### Return type + +[**QuickRepaymentResponse**](QuickRepaymentResponse.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Repayment successful | - | +**400** | Invalid request parameters | - | +**401** | Authentication failed | - | +**403** | Access denied (e.g. account mode does not support quick repayment) | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_unified_delta_neutral** +> DeltaNeutralEnabled get_unified_delta_neutral() + +Query the account Delta-neutral strategy mode setting + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) + +try: + # Query the account Delta-neutral strategy mode setting + api_response = api_instance.get_unified_delta_neutral() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->get_unified_delta_neutral: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**DeltaNeutralEnabled**](DeltaNeutralEnabled.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Query successful | - | +**401** | Authentication failed | - | +**403** | Access denied (e.g. insufficient VIP level or the account is not in cross-currency margin mode) | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **set_unified_delta_neutral** +> DeltaNeutralEnabled set_unified_delta_neutral(delta_neutral_enabled) + +Set the account Delta-neutral strategy mode + +Enable or disable the account Delta-neutral strategy mode. Requirements for enabling: VIP level >= 4 and the account is in cross-currency margin mode; otherwise 403 is returned. Returns the enabled status after the setting takes effect. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +delta_neutral_enabled = gate_api.DeltaNeutralEnabled() # DeltaNeutralEnabled | + +try: + # Set the account Delta-neutral strategy mode + api_response = api_instance.set_unified_delta_neutral(delta_neutral_enabled) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->set_unified_delta_neutral: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **delta_neutral_enabled** | [**DeltaNeutralEnabled**](DeltaNeutralEnabled.md)| | + +### Return type + +[**DeltaNeutralEnabled**](DeltaNeutralEnabled.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Set successfully | - | +**400** | Invalid request parameters | - | +**401** | Authentication failed | - | +**403** | Access denied (e.g. insufficient VIP level or the account is not in cross-currency margin mode) | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/UnifiedBalance.md b/docs/UnifiedBalance.md index 9d28adf9..8cbc9960 100644 --- a/docs/UnifiedBalance.md +++ b/docs/UnifiedBalance.md @@ -3,26 +3,27 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**available** | **str** | Available balance, valid in single currency margin/cross-currency margin/combined margin mode, calculation varies by mode | [optional] -**freeze** | **str** | Locked balance, valid in single currency margin/cross-currency margin/combined margin mode | [optional] +**available** | **str** | Cross available balance, deducted futures isolated margin occupation and frozen amount (futures isolated occupation, i.e. futures isolated balance), effective in single-currency/multi-currency/portfolio margin mode. | [optional] +**freeze** | **str** | Frozen amount, effective in single-currency/multi-currency/portfolio margin mode | [optional] **borrowed** | **str** | Borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] **negative_liab** | **str** | Negative balance borrowing, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] **futures_pos_liab** | **str** | Contract opening position borrowing currency (abandoned, to be offline field) | [optional] -**equity** | **str** | Equity, valid in single currency margin/cross currency margin/combined margin mode | [optional] +**equity** | **str** | Currency equity amount (cross), effective in single-currency/multi-currency/portfolio margin mode | [optional] **total_freeze** | **str** | Total frozen (deprecated, to be removed) | [optional] **total_liab** | **str** | Total borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode | [optional] **spot_in_use** | **str** | The amount of spot hedging is valid in the combined margin mode, and is 0 in other margin modes such as single currency and cross-currency margin modes | [optional] **funding** | **str** | Uniloan financial management amount, effective when turned on as a unified account margin switch | [optional] **funding_version** | **str** | Funding version | [optional] **cross_balance** | **str** | Full margin balance is valid in single currency margin mode, and is 0 in other modes such as cross currency margin/combined margin mode | [optional] -**iso_balance** | **str** | Isolated Margin Balance applies to Single-Currency Margin Mode and Cross-Currency Margin Mode, and is 0 in other modes such as Portfolio Margin Mode. | [optional] -**im** | **str** | Full-position initial margin is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode | [optional] -**mm** | **str** | Cross margin maintenance margin, valid in single-currency margin mode, 0 in other modes such as cross-currency margin/combined margin mode | [optional] -**imr** | **str** | Full-position initial margin rate is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode | [optional] -**mmr** | **str** | Full-position maintenance margin rate is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode | [optional] -**margin_balance** | **str** | Full margin balance is valid in single currency margin mode and is 0 in other modes such as cross currency margin/combined margin mode | [optional] -**available_margin** | **str** | Cross margin available balance, valid in single currency margin mode, 0 in other modes such as cross-currency margin/combined margin mode | [optional] +**iso_balance** | **str** | Futures isolated balance, effective in single-currency and multi-currency margin mode, 0 in portfolio margin mode | [optional] +**im** | **str** | Cross initial margin, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode | [optional] +**mm** | **str** | Cross maintenance margin, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode | [optional] +**imr** | **str** | Cross initial margin rate, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode | [optional] +**mmr** | **str** | Cross maintenance margin rate, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode | [optional] +**margin_balance** | **str** | Cross margin balance, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode | [optional] +**available_margin** | **str** | Cross available margin, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode | [optional] **enabled_collateral** | **bool** | Currency enabled as margin: true - Enabled, false - Disabled | [optional] +**balance_version** | **float** | Balance version number | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UnifiedBorrowable.md b/docs/UnifiedBorrowable.md index edd2c953..b736493a 100644 --- a/docs/UnifiedBorrowable.md +++ b/docs/UnifiedBorrowable.md @@ -1,5 +1,6 @@ # UnifiedBorrowable +Maximum borrowable amount for unified account ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/UnifiedBorrowable1.md b/docs/UnifiedBorrowable1.md deleted file mode 100644 index 81b38b3d..00000000 --- a/docs/UnifiedBorrowable1.md +++ /dev/null @@ -1,12 +0,0 @@ -# UnifiedBorrowable1 - -Batch query unified account maximum borrowable results -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currency** | **str** | Currency detail | [optional] -**amount** | **str** | Maximum borrowable amount | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UnifiedDiscountTiers.md b/docs/UnifiedDiscountTiers.md index ba78cc73..740dbffe 100644 --- a/docs/UnifiedDiscountTiers.md +++ b/docs/UnifiedDiscountTiers.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **discount** | **str** | Discount | [optional] **lower_limit** | **str** | Lower limit | [optional] **upper_limit** | **str** | Upper limit, + indicates positive infinity | [optional] -**leverage** | **str** | Position leverage | [optional] +**leverage** | **str** | Leverage multiplier | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UnifiedQuickRepayAvailableItem.md b/docs/UnifiedQuickRepayAvailableItem.md new file mode 100644 index 00000000..e2cb3907 --- /dev/null +++ b/docs/UnifiedQuickRepayAvailableItem.md @@ -0,0 +1,12 @@ +# UnifiedQuickRepayAvailableItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | [optional] +**available** | **str** | Available Balance | [optional] +**estimated_usd** | **str** | Estimated USD value | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedQuickRepayDebtItem.md b/docs/UnifiedQuickRepayDebtItem.md new file mode 100644 index 00000000..4ea739f3 --- /dev/null +++ b/docs/UnifiedQuickRepayDebtItem.md @@ -0,0 +1,14 @@ +# UnifiedQuickRepayDebtItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | [optional] +**debt_amount** | **str** | Debt Quantity | [optional] +**estimated_usd** | **str** | Estimated USD value | [optional] +**borrowed** | **str** | Borrowed amount | [optional] +**neg_balance** | **str** | Negative balance | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedQuickRepayRepaidInfo.md b/docs/UnifiedQuickRepayRepaidInfo.md new file mode 100644 index 00000000..bdcbb24c --- /dev/null +++ b/docs/UnifiedQuickRepayRepaidInfo.md @@ -0,0 +1,13 @@ +# UnifiedQuickRepayRepaidInfo + +Repayment details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | +**repaid** | **str** | Repaid amount | +**left** | **str** | Remaining liability amount | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedQuickRepayUsedInfo.md b/docs/UnifiedQuickRepayUsedInfo.md new file mode 100644 index 00000000..3f473dcf --- /dev/null +++ b/docs/UnifiedQuickRepayUsedInfo.md @@ -0,0 +1,12 @@ +# UnifiedQuickRepayUsedInfo + +Repayment details +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency name | +**used** | **str** | Amount converted | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InlineObject.md b/docs/UpdateDualCompPositionCrossModeRequest.md similarity index 69% rename from docs/InlineObject.md rename to docs/UpdateDualCompPositionCrossModeRequest.md index dccf5f1c..280e5d0e 100644 --- a/docs/InlineObject.md +++ b/docs/UpdateDualCompPositionCrossModeRequest.md @@ -1,9 +1,9 @@ -# InlineObject +# UpdateDualCompPositionCrossModeRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mode** | **str** | Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode | +**mode** | **str** | Cross/isolated margin mode. ISOLATED - isolated margin, CROSS - cross margin | **contract** | **str** | Futures market | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateOrder.md b/docs/UpdateOrder.md new file mode 100644 index 00000000..4ebe02d7 --- /dev/null +++ b/docs/UpdateOrder.md @@ -0,0 +1,12 @@ +# UpdateOrder + +Order modification result +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**UpdateOrderData**](UpdateOrderData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateOrder2.md b/docs/UpdateOrder2.md new file mode 100644 index 00000000..a6316f62 --- /dev/null +++ b/docs/UpdateOrder2.md @@ -0,0 +1,11 @@ +# UpdateOrder2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**UpdateOrder2Data**](UpdateOrder2Data.md) | | [optional] +**timestamp** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateOrder2Data.md b/docs/UpdateOrder2Data.md new file mode 100644 index 00000000..5643cd26 --- /dev/null +++ b/docs/UpdateOrder2Data.md @@ -0,0 +1,10 @@ +# UpdateOrder2Data + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateOrderData.md b/docs/UpdateOrderData.md new file mode 100644 index 00000000..e296f02e --- /dev/null +++ b/docs/UpdateOrderData.md @@ -0,0 +1,17 @@ +# UpdateOrderData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **int** | Order ID | [optional] +**symbol** | **str** | Currency pair | [optional] +**state** | **str** | Order status code | [optional] +**volume** | **str** | Order quantity | [optional] +**price** | **str** | Current price | [optional] +**price_tp** | **str** | Current take profit price | [optional] +**price_sl** | **str** | Current stop loss price | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdatePosition.md b/docs/UpdatePosition.md new file mode 100644 index 00000000..b6d18c9f --- /dev/null +++ b/docs/UpdatePosition.md @@ -0,0 +1,11 @@ +# UpdatePosition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**object**](.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateTrailOrder.md b/docs/UpdateTrailOrder.md new file mode 100644 index 00000000..4431cbeb --- /dev/null +++ b/docs/UpdateTrailOrder.md @@ -0,0 +1,15 @@ +# UpdateTrailOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | +**amount** | **str** | Total trading quantity in contracts, positive for buy, negative for sell, 0 means no modification | [optional] +**activation_price** | **str** | Activation price, 0 means trigger immediately, empty means no modification | [optional] +**is_gte_str** | **str** | true: activate when market price >= activation price, false: <= activation price, empty means no modification | [optional] +**price_type** | **int** | Activation price type, not provided or 0 means no modification, 1-latest price, 2-index price, 3-mark price | [optional] +**price_offset** | **str** | Callback ratio or price distance, e.g., `0.1` or `0.1%`; empty means no modification | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UploadChatFile.md b/docs/UploadChatFile.md new file mode 100644 index 00000000..9ce5329e --- /dev/null +++ b/docs/UploadChatFile.md @@ -0,0 +1,12 @@ +# UploadChatFile + +Upload chat file request +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image_content_type** | **str** | File MIME type: supports `image/jpeg`, `image/jpg`, `image/png`, `video/mp4`. | +**base64_img** | **str** | Base64 file content; max 20 MB. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Eth2RateList.md b/docs/UserAssetResp.md similarity index 62% rename from docs/Eth2RateList.md rename to docs/UserAssetResp.md index 574d27a4..c9c3a729 100644 --- a/docs/Eth2RateList.md +++ b/docs/UserAssetResp.md @@ -1,11 +1,10 @@ -# Eth2RateList +# UserAssetResp ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**date_time** | **int** | Date Timestamp | [optional] -**date** | **str** | Date | [optional] -**rate** | **str** | Percentage Rate | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] +**data** | [**UserAssetRespData**](UserAssetRespData.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UserAssetResp2.md b/docs/UserAssetResp2.md new file mode 100644 index 00000000..7e5970d0 --- /dev/null +++ b/docs/UserAssetResp2.md @@ -0,0 +1,11 @@ +# UserAssetResp2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**UserAssetResp2Data**](UserAssetResp2Data.md) | | [optional] +**timestamp** | **int** | Server timestamp (milliseconds) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserAssetResp2Data.md b/docs/UserAssetResp2Data.md new file mode 100644 index 00000000..f7bfc365 --- /dev/null +++ b/docs/UserAssetResp2Data.md @@ -0,0 +1,16 @@ +# UserAssetResp2Data + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**equity** | **str** | Account equity | [optional] +**balance** | **str** | Account Balance | [optional] +**available** | **str** | Available Balance | [optional] +**position_market_value** | **str** | Position market value | [optional] +**position_pnl** | **str** | Position P&L | [optional] +**today_pnl** | **str** | Today's P&L | [optional] +**user_exists** | **bool** | Whether the user has activated the service | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserAssetRespData.md b/docs/UserAssetRespData.md new file mode 100644 index 00000000..d42cfe20 --- /dev/null +++ b/docs/UserAssetRespData.md @@ -0,0 +1,17 @@ +# UserAssetRespData + +Response data +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**equity** | **str** | Account equity | [optional] +**margin_level** | **str** | Margin level (percentage) | [optional] +**balance** | **str** | Account Balance | [optional] +**margin** | **str** | Used margin | [optional] +**margin_free** | **str** | Available Margin | [optional] +**unrealized_pnl** | **str** | Unrealized PNL | [optional] +**mt5_uid** | **str** | MT5 userID | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserLeverageSetting.md b/docs/UserLeverageSetting.md new file mode 100644 index 00000000..59870ffb --- /dev/null +++ b/docs/UserLeverageSetting.md @@ -0,0 +1,11 @@ +# UserLeverageSetting + +User leverage settings +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**leverage** | **str** | Leverage. Values exceeding a currency's leverage limit are capped at that limit. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UserLtvInfo.md b/docs/UserLtvInfo.md deleted file mode 100644 index 1483aff6..00000000 --- a/docs/UserLtvInfo.md +++ /dev/null @@ -1,17 +0,0 @@ -# UserLtvInfo - -User's currency statistics data -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**collateral_currency** | **str** | Collateral currency | [optional] -**borrow_currency** | **str** | Borrowed currency | [optional] -**init_ltv** | **str** | Initial collateralization rate | [optional] -**alert_ltv** | **str** | Warning collateralization rate | [optional] -**liquidate_ltv** | **str** | Liquidation collateralization rate | [optional] -**min_borrow_amount** | **str** | Minimum borrowable amount for the loan currency | [optional] -**left_borrowable_amount** | **str** | Remaining borrowable amount for the loan currency | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UserTotalAmount.md b/docs/UserTotalAmount.md deleted file mode 100644 index 87460d1e..00000000 --- a/docs/UserTotalAmount.md +++ /dev/null @@ -1,12 +0,0 @@ -# UserTotalAmount - -User's total borrowing and collateral amount -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**borrow_amount** | **str** | Total borrowing amount in USDT | [optional] -**collateral_amount** | **str** | Total collateral amount in USDT | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WalletApi.md b/docs/WalletApi.md index e7cb895e..50862c01 100644 --- a/docs/WalletApi.md +++ b/docs/WalletApi.md @@ -8,17 +8,18 @@ Method | HTTP request | Description [**get_deposit_address**](WalletApi.md#get_deposit_address) | **GET** /wallet/deposit_address | Generate currency deposit address [**list_withdrawals**](WalletApi.md#list_withdrawals) | **GET** /wallet/withdrawals | Get withdrawal records [**list_deposits**](WalletApi.md#list_deposits) | **GET** /wallet/deposits | Get deposit records +[**get_transfer**](WalletApi.md#get_transfer) | **GET** /wallet/transfers | Get trading account transfer [**transfer**](WalletApi.md#transfer) | **POST** /wallet/transfers | Transfer between trading accounts [**list_sub_account_transfers**](WalletApi.md#list_sub_account_transfers) | **GET** /wallet/sub_account_transfers | Get transfer records between main and sub accounts [**transfer_with_sub_account**](WalletApi.md#transfer_with_sub_account) | **POST** /wallet/sub_account_transfers | Transfer between main and sub accounts [**sub_account_to_sub_account**](WalletApi.md#sub_account_to_sub_account) | **POST** /wallet/sub_account_to_sub_account | Transfer between sub-accounts -[**get_transfer_order_status**](WalletApi.md#get_transfer_order_status) | **GET** /wallet/order_status | Transfer status query +[**get_transfer_order_status**](WalletApi.md#get_transfer_order_status) | **GET** /wallet/order_status | Main-Sub Account Transfer Status Query [**list_withdraw_status**](WalletApi.md#list_withdraw_status) | **GET** /wallet/withdraw_status | Query withdrawal status [**list_sub_account_balances**](WalletApi.md#list_sub_account_balances) | **GET** /wallet/sub_account_balances | Query sub-account balance information [**list_sub_account_margin_balances**](WalletApi.md#list_sub_account_margin_balances) | **GET** /wallet/sub_account_margin_balances | Query sub-account isolated margin account balance information [**list_sub_account_futures_balances**](WalletApi.md#list_sub_account_futures_balances) | **GET** /wallet/sub_account_futures_balances | Query sub-account perpetual futures account balance information [**list_sub_account_cross_margin_balances**](WalletApi.md#list_sub_account_cross_margin_balances) | **GET** /wallet/sub_account_cross_margin_balances | Query sub-account cross margin account balance information -[**list_saved_address**](WalletApi.md#list_saved_address) | **GET** /wallet/saved_address | Query withdrawal address whitelist +[**list_saved_address**](WalletApi.md#list_saved_address) | **GET** /wallet/saved_address | Query saved address [**get_trade_fee**](WalletApi.md#get_trade_fee) | **GET** /wallet/fee | Query personal trading fees [**get_total_balance**](WalletApi.md#get_total_balance) | **GET** /wallet/total_balance | Query personal account totals [**list_small_balance**](WalletApi.md#list_small_balance) | **GET** /wallet/small_balance | Get list of convertible small balance currencies @@ -190,7 +191,7 @@ currency = 'BTC' # str | Specify the currency. If not specified, returns all cur withdraw_id = 'withdraw_id_example' # str | Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled (optional) asset_class = 'asset_class_example' # str | Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone (optional) withdraw_order_id = 'withdraw_order_id_example' # str | User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried (optional) -_from = 1602120000 # int | Start time for querying records, defaults to 7 days before current time if not specified (optional) +_from = 1602120000 # int | Start time for querying records. If not specified, defaults to 7 days before current time (optional) to = 1602123600 # int | End timestamp for the query, defaults to current time if not specified (optional) limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) offset = 0 # int | List offset, starting from 0 (optional) (default to 0) @@ -213,7 +214,7 @@ Name | Type | Description | Notes **withdraw_id** | **str**| Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled | [optional] **asset_class** | **str**| Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone | [optional] **withdraw_order_id** | **str**| User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried | [optional] - **_from** | **int**| Start time for querying records, defaults to 7 days before current time if not specified | [optional] + **_from** | **int**| Start time for querying records. If not specified, defaults to 7 days before current time | [optional] **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] @@ -270,7 +271,7 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.WalletApi(api_client) currency = 'BTC' # str | Specify the currency. If not specified, returns all currencies (optional) -_from = 1602120000 # int | Start time for querying records, defaults to 7 days before current time if not specified (optional) +_from = 1602120000 # int | Start time for querying records. If not specified, defaults to 7 days before current time (optional) to = 1602123600 # int | End timestamp for the query, defaults to current time if not specified (optional) limit = 100 # int | Maximum number of entries returned in the list, limited to 500 transactions (optional) (default to 100) offset = 0 # int | List offset, starting from 0 (optional) (default to 0) @@ -290,7 +291,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **currency** | **str**| Specify the currency. If not specified, returns all currencies | [optional] - **_from** | **int**| Start time for querying records, defaults to 7 days before current time if not specified | [optional] + **_from** | **int**| Start time for querying records. If not specified, defaults to 7 days before current time | [optional] **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] **limit** | **int**| Maximum number of entries returned in the list, limited to 500 transactions | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] @@ -315,6 +316,75 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_transfer** +> AccountTransferDetail get_transfer(tx_id) + +Get trading account transfer + +Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.WalletApi(api_client) +tx_id = '59636381286' # str | Transfer transaction ID + +try: + # Get trading account transfer + api_response = api_instance.get_transfer(tx_id) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling WalletApi->get_transfer: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tx_id** | **str**| Transfer transaction ID | + +### Return type + +[**AccountTransferDetail**](AccountTransferDetail.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Trading account transfer retrieved successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **transfer** > TransactionID transfer(transfer) @@ -416,7 +486,7 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.WalletApi(api_client) sub_uid = '10003' # str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional) -_from = 1602120000 # int | Start time for querying records, defaults to 7 days before current time if not specified (optional) +_from = 1602120000 # int | Start time for querying records. If not specified, defaults to 7 days before current time (optional) to = 1602123600 # int | End timestamp for the query, defaults to current time if not specified (optional) limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100) offset = 0 # int | List offset, starting from 0 (optional) (default to 0) @@ -436,7 +506,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **sub_uid** | **str**| Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts | [optional] - **_from** | **int**| Start time for querying records, defaults to 7 days before current time if not specified | [optional] + **_from** | **int**| Start time for querying records. If not specified, defaults to 7 days before current time | [optional] **to** | **int**| End timestamp for the query, defaults to current time if not specified | [optional] **limit** | **int**| Maximum number of records returned in a single list | [optional] [default to 100] **offset** | **int**| List offset, starting from 0 | [optional] [default to 0] @@ -602,9 +672,9 @@ Name | Type | Description | Notes # **get_transfer_order_status** > TransferOrderStatus get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id) -Transfer status query +Main-Sub Account Transfer Status Query -Supports querying transfer status based on user-defined client_order_id or tx_id returned by the transfer interface +Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface ### Example @@ -634,7 +704,7 @@ client_order_id = 'da3ce7a088c8b0372b741419c7829033' # str | Customer-defined ID tx_id = '59636381286' # str | Transfer operation number, cannot be empty at the same time as client_order_id (optional) try: - # Transfer status query + # Main-Sub Account Transfer Status Query api_response = api_instance.get_transfer_order_status(client_order_id=client_order_id, tx_id=tx_id) print(api_response) except GateApiException as ex: @@ -666,7 +736,7 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Transfer status retrieved successfully | - | +**200** | Main-Sub Account Transfer Status Retrieval Successful | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -740,7 +810,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_sub_account_balances** -> list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid) +> list[SubAccountBalance] list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit) Query sub-account balance information @@ -769,10 +839,12 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.WalletApi(api_client) sub_uid = '10003' # str | Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum number of records returned. Default 20, max 100. (optional) (default to 100) try: # Query sub-account balance information - api_response = api_instance.list_sub_account_balances(sub_uid=sub_uid) + api_response = api_instance.list_sub_account_balances(sub_uid=sub_uid, page=page, limit=limit) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -785,6 +857,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **sub_uid** | **str**| Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum number of records returned. Default 20, max 100. | [optional] [default to 100] ### Return type @@ -1010,9 +1084,9 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_saved_address** -> list[SavedAddress] list_saved_address(currency, chain=chain, limit=limit, page=page) +> list[SavedAddress] list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page) -Query withdrawal address whitelist +Query saved address ### Example @@ -1038,14 +1112,15 @@ configuration = gate_api.Configuration( api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.WalletApi(api_client) -currency = 'USDT' # str | Currency +currency = 'USDT' # str | Currency (optional) chain = '' # str | Chain name (optional) (default to '') +verified = '' # str | 1 means verified address, 0 means normal address, empty string means no limit (optional) (default to '') limit = '50' # str | Maximum number returned, up to 100 (optional) (default to '50') -page = 1 # int | Page number (optional) (default to 1) +page = 1 # int | page number (optional) (default to 1) try: - # Query withdrawal address whitelist - api_response = api_instance.list_saved_address(currency, chain=chain, limit=limit, page=page) + # Query saved address + api_response = api_instance.list_saved_address(currency=currency, chain=chain, verified=verified, limit=limit, page=page) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -1057,10 +1132,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currency** | **str**| Currency | + **currency** | **str**| Currency | [optional] **chain** | **str**| Chain name | [optional] [default to ''] + **verified** | **str**| 1 means verified address, 0 means normal address, empty string means no limit | [optional] [default to ''] **limit** | **str**| Maximum number returned, up to 100 | [optional] [default to '50'] - **page** | **int**| Page number | [optional] [default to 1] + **page** | **int**| page number | [optional] [default to 1] ### Return type diff --git a/docs/WelfareApi.md b/docs/WelfareApi.md new file mode 100644 index 00000000..d864c5b3 --- /dev/null +++ b/docs/WelfareApi.md @@ -0,0 +1,284 @@ +# gate_api.WelfareApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_user_identity**](WelfareApi.md#get_user_identity) | **GET** /rewards/getUserIdentity | Get user identity +[**get_beginner_task_list**](WelfareApi.md#get_beginner_task_list) | **GET** /rewards/getBeginnerTaskList | Get beginner task list +[**claim_task**](WelfareApi.md#claim_task) | **POST** /rewards/claimTask | Get the task +[**claim_reward**](WelfareApi.md#claim_reward) | **POST** /rewards/claimReward | Receive mission rewards + + +# **get_user_identity** +> ApiResponseExSkillGetUserIdentityResp get_user_identity() + +Get user identity + +Validate whether the user is eligible for new user rewards. Returns the corresponding error code on validation failure, data is an empty object on success. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.WelfareApi(api_client) + +try: + # Get user identity + api_response = api_instance.get_user_identity() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling WelfareApi->get_user_identity: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ApiResponseExSkillGetUserIdentityResp**](ApiResponseExSkillGetUserIdentityResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The endpoint always returns HTTP 200. Business results are distinguished by the code field | - | +**400** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_beginner_task_list** +> ApiResponseExSkillGetBeginnerTaskListResp get_beginner_task_list() + +Get beginner task list + +Get the current user's onboarding task list. By default, the registration tasks (type=10) and guidance tasks (type=11) that have been assigned to the current user are returned. The registration tasks are ranked first and the guidance tasks are ranked behind. When the user does not have a download task and the system determines that the user has not downloaded the app, a \"Download task to be received\" card will be dynamically added. Among them: - `task_type = 23` for download tasks - `status = 0` for download tasks to be collected Results are cached for 60 seconds. Task lists are limited in number (usually no more than 10) and do not require pagination. + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.WelfareApi(api_client) + +try: + # Get beginner task list + api_response = api_instance.get_beginner_task_list() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling WelfareApi->get_beginner_task_list: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ApiResponseExSkillGetBeginnerTaskListResp**](ApiResponseExSkillGetBeginnerTaskListResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The endpoint always returns HTTP 200. Business results are distinguished by the code field | - | +**400** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **claim_task** +> ApiResponseExSkillClaimTaskResp claim_task(ex_skill_claim_task_req) + +Get the task + +Receive a single welfare task. The current main scene is for new customer download tasks to be collected, but the interface itself supports new customer registration, guidance, and advanced task types. Processing flow: 1. Read the logged in user 2. Verify user qualifications 3. Risk control verification (event code `task_center`) 4. Verify task configuration and task center tasks 5. Verify whether there is an ongoing task 6. If it is a download task, verify whether the App has been downloaded 7. Write `welfare_user_tasks_xx` 8. Report to task center Risk control transparent transmission fields: - Old fields: `user_id`, `ip`, `const_id`, `is_async`, `action`, `task_id` - New fields: `req_method`, `traceid` - Among them: - `req_method` from `X-Gate-Request-Source` - `ip` from `X-Gate-Ip` - `traceid` from `X-Gate-Trace-Id` - `const_id` is fixed to an empty string + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.WelfareApi(api_client) +ex_skill_claim_task_req = gate_api.ExSkillClaimTaskReq() # ExSkillClaimTaskReq | + +try: + # Get the task + api_response = api_instance.claim_task(ex_skill_claim_task_req) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling WelfareApi->claim_task: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ex_skill_claim_task_req** | [**ExSkillClaimTaskReq**](ExSkillClaimTaskReq.md)| | + +### Return type + +[**ApiResponseExSkillClaimTaskResp**](ApiResponseExSkillClaimTaskResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The endpoint always returns HTTP 200. Business results are distinguished by the code field | - | +**400** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **claim_reward** +> ApiResponseExSkillClaimRewardResp claim_reward(ex_skill_claim_reward_req) + +Receive mission rewards + +Receive rewards from a single welfare task. Processing flow: 1. Read the logged in user 2. Verify user qualifications 3. Query `welfare_user_tasks_xx` and require the task status to be `StatusDone(2)` 4. Risk control verification (event code `index_page_check`) 5. Query task details and reward information in the task center 6. If the reward is m and n is selected from the prize pool, then `has_m_n_task = true` will be returned and the reward will not be actually issued. 7. Ordinary rewards will enter the original reward collection logic of the Welfare Center Risk control transparent transmission fields: - Old fields: `user_id`, `ip`, `const_id`, `is_async` - New fields: `req_method`, `traceid` - Among them: - `req_method` from `X-Gate-Request-Source` - `ip` from `X-Gate-Ip` - `traceid` from `X-Gate-Trace-Id` - `const_id` is fixed to an empty string + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.WelfareApi(api_client) +ex_skill_claim_reward_req = gate_api.ExSkillClaimRewardReq() # ExSkillClaimRewardReq | + +try: + # Receive mission rewards + api_response = api_instance.claim_reward(ex_skill_claim_reward_req) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling WelfareApi->claim_reward: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ex_skill_claim_reward_req** | [**ExSkillClaimRewardReq**](ExSkillClaimRewardReq.md)| | + +### Return type + +[**ApiResponseExSkillClaimRewardResp**](ApiResponseExSkillClaimRewardResp.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The endpoint always returns HTTP 200. Business results are distinguished by the code field | - | +**400** | Invalid request parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/WithdrawalRecord.md b/docs/WithdrawalRecord.md index 4a01e58a..cf190c22 100644 --- a/docs/WithdrawalRecord.md +++ b/docs/WithdrawalRecord.md @@ -14,9 +14,9 @@ Name | Type | Description | Notes **address** | **str** | Withdrawal address | [optional] **type** | **str** | Business Type | [optional] **fail_reason** | **str** | Reason for withdrawal failure. Has a value when status = CANCEL, empty for all other statuses | [optional] -**timestamp2** | **str** | Withdrawal final time, i.e.: withdrawal cancellation time or withdrawal success time When status = CANCEL, corresponds to cancellation time When status = DONE and block_number > 0, it is the withdrawal success time | [optional] +**timestamp2** | **str** | Withdrawal final time, i.e.: withdrawal cancellation time or withdrawal success time When status = CANCEL, corresponds to cancellation time When status = DONE, it is the withdrawal success time | [optional] **memo** | **str** | Additional remarks with regards to the withdrawal | [optional] -**status** | **str** | Transaction Status - BCODE: Deposit Code Operation - CANCEL: Cancelled - CANCELPEND: Withdrawal Cancellation Pending - DONE: Completed (Only considered truly on-chain when block_number > 0) - EXTPEND: Sent and Waiting for Confirmation - FAIL: On-Chain Failure Pending Confirmation - FVERIFY: Facial Verification in Progress - LOCKED: Wallet-Side Order Locked - MANUAL: Pending Manual Review - REJECT: Rejected - REQUEST: Request in Progress - REVIEW: Under Review | [optional] [readonly] +**status** | **str** | Transaction Status - BCODE: Deposit Code Operation - CANCEL: Cancelled - CANCELPEND: Withdrawal Cancellation Pending - DONE: Completed - EXTPEND: Sent and Waiting for Confirmation - FAIL: On-Chain Failure Pending Confirmation - FVERIFY: Facial Verification in Progress - LOCKED: Wallet-Side Order Locked - MANUAL: Pending Manual Review - REJECT: Rejected - REQUEST: Request in Progress - REVIEW: Under Review | [optional] [readonly] **chain** | **str** | Name of the chain used in withdrawals | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/example/app.py b/example/app.py index a12992e6..0f35011b 100644 --- a/example/app.py +++ b/example/app.py @@ -7,6 +7,7 @@ from futures import futures_demo from margin import margin_demo from spot import spot_demo +from p2p_merchant_api import p2p_merchant_demo logging.basicConfig(format="%(asctime)s: %(message)s", level=logging.DEBUG) logger = logging.getLogger(__name__) @@ -38,6 +39,8 @@ def main(): margin_demo(run_config) elif t == 'futures': futures_demo(run_config) + elif t == 'p2p_merchant': + p2p_merchant_demo(run_config) else: logger.warning("ignore unknown test %s", t) diff --git a/example/p2p_merchant_api.py b/example/p2p_merchant_api.py new file mode 100644 index 00000000..3a29fe86 --- /dev/null +++ b/example/p2p_merchant_api.py @@ -0,0 +1,245 @@ +#!/usr/bin/env python +# coding: utf-8 + +import logging + +from gate_api import ( + ApiClient, Configuration, P2pApi, + AdsDetailRequest, AdsListRequest, AdsUpdateStatus, + CancelOrder, ConfirmPayment, ConfirmReceipt, + GetChatsListRequest, GetCompletedTransactionListRequest, + GetCounterpartyUserInfoRequest, GetMyselfPaymentRequest, + GetPendingTransactionListRequest, GetTransactionDetailsRequest, + MyAdsListRequest, PlaceBizPushOrder, + SendChatMessageRequest, SetMerchantWorkHoursRequest, UploadChatFile, +) +from gate_api.exceptions import ApiException + +from config import RunConfig + +logger = logging.getLogger(__name__) + + +def p2p_merchant_demo(run_config): + # type: (RunConfig) -> None + """ + P2P Merchant API demo. Covers all endpoints in p2p-merchant-api.yaml in business order: + Account -> Ads -> Orders (list & detail) -> Order actions -> Chat. + """ + config = Configuration( + key=run_config.api_key, + secret=run_config.api_secret, + host=run_config.host_used, + ) + api = P2pApi(ApiClient(config)) + + try: + # ============================================================ + # 1. Account - user info, payment methods, and work hours + # ============================================================ + logger.info("=== 1. P2P Merchant Account ===") + + user_info = api.p2p_merchant_account_get_user_info() + logger.info("User info: %s", user_info) + + myself_payment = api.p2p_merchant_account_get_myself_payment( + get_myself_payment_request=GetMyselfPaymentRequest(fiat="USD") + ) + logger.info("Payment methods: %s", myself_payment) + + # Set merchant work hours (write op, use with care) + # api.p2p_merchant_account_set_merchant_work_hours( + # SetMerchantWorkHoursRequest( + # work_status=2, + # cycle_type="Weekly", + # day_of_week="1,2,3,4,5", + # time_zone="+8", + # start_time="09:00", + # end_time="18:00", + # ) + # ) + + # ============================================================ + # 2. Ads - my ads, market ads, ad detail; place/update (write ops commented) + # ============================================================ + logger.info("=== 2. P2P Ads ===") + + my_ads = api.p2p_merchant_books_my_ads_list( + my_ads_list_request=MyAdsListRequest(asset="USDT", fiat_unit="USD", trade_type="sell") + ) + logger.info("My ads list: %s", my_ads) + + ads = api.p2p_merchant_books_ads_list( + AdsListRequest(asset="USDT", fiat_unit="USD", trade_type="sell") + ) + logger.info("Market ads list: %s", ads) + + if my_ads and getattr(my_ads, "data", None) and getattr(my_ads.data, "lists", None) and my_ads.data.lists: + first_ad_id = getattr(my_ads.data.lists[0], "id", None) or getattr(my_ads.data.lists[0], "orderid", None) + if first_ad_id is not None: + ad_detail = api.p2p_merchant_books_ads_detail( + AdsDetailRequest(adv_no=str(first_ad_id)) + ) + logger.info("Ad detail: %s", ad_detail) + # Example when no my ads (replace with real adv_no): + # ad_detail = api.p2p_merchant_books_ads_detail( + # AdsDetailRequest(adv_no="2124000001") + # ) + + # Place/edit ad (write op, use with care). + # Content risk rejection returns code 70305102 with data.risk_event. + # api.p2p_merchant_books_place_biz_push_order( + # PlaceBizPushOrder( + # currency_type="USDT", + # exchange_type="USD", + # type="0", + # unit_price="7.20", + # number="1000", + # limit_basis=1, + # fiat_min_amount="100", + # fiat_max_amount="1000", + # pay_type="bank", + # pay_type_json='{"bank":"10001"}', + # rate_fixed="1", + # polymarket_limit=0, + # expire_min="20", + # trade_tips="Please pay from an account under your own name.", + # auto_reply="Please tap Paid after completing the transfer.", + # ) + # ) + + # Update ad status: 1=active, 3=inactive, 4=closed + # api.p2p_merchant_books_ads_update_status( + # AdsUpdateStatus(adv_no=2124000001, adv_status=3) + # ) + + # ============================================================ + # 3. Orders - pending list, completed list, order detail + # ============================================================ + logger.info("=== 3. P2P Orders ===") + + pending_list = api.p2p_merchant_transaction_get_pending_transaction_list( + GetPendingTransactionListRequest( + crypto_currency="USDT", + fiat_currency="USD", + order_tab="pending", + select_type="sell", + # status="OPEN", + # txid=40000001, + # start_time=1700000000, + # end_time=1700086399, + ) + ) + logger.info("Pending orders: %s", pending_list) + + completed_list = api.p2p_merchant_transaction_get_completed_transaction_list( + GetCompletedTransactionListRequest( + crypto_currency="USDT", + fiat_currency="USD", + # select_type="sell", + # status="ACCEPT", + # txid=40000001, + # start_time=1700000000, + # end_time=1700086399, + # query_dispute=0, + # page=1, + # per_page=20, + ) + ) + logger.info("Completed orders: %s", completed_list) + + txid_for_detail = None + for resp in (pending_list, completed_list): + if not resp or not getattr(resp, "data", None): + continue + data = resp.data + lst = getattr(data, "list", None) or getattr(data, "lists", None) + if lst and len(lst) > 0: + first = lst[0] + txid_for_detail = getattr(first, "txid", None) + if txid_for_detail is not None: + break + if txid_for_detail is not None: + order_detail = api.p2p_merchant_transaction_get_transaction_details( + GetTransactionDetailsRequest( + txid=txid_for_detail, + # channel="", + ) + ) + logger.info("Order detail: %s", order_detail) + if order_detail and getattr(order_detail, "data", None): + biz_uid = getattr(order_detail.data, "its_uid", None) + if biz_uid: + counterparty = api.p2p_merchant_account_get_counterparty_user_info( + GetCounterpartyUserInfoRequest(biz_uid=biz_uid) + ) + logger.info("Counterparty info: %s", counterparty) + chats = api.p2p_merchant_chat_get_chats_list( + GetChatsListRequest( + txid=txid_for_detail, + # lastreceived=1700000000, + # firstreceived=1700000000, + ) + ) + logger.info("Chat list: %s", chats) + # Example when no orders (replace with real txid): + # order_detail = api.p2p_merchant_transaction_get_transaction_details( + # GetTransactionDetailsRequest(txid=40000001) + # ) + # chats = api.p2p_merchant_chat_get_chats_list( + # GetChatsListRequest(txid=40000001) + # ) + + # ============================================================ + # 4. Order actions - confirm payment, confirm receipt, cancel (write ops, commented) + # ============================================================ + logger.info("=== 4. P2P Order actions (examples commented) ===") + + # Buyer confirms payment + # api.p2p_merchant_transaction_confirm_payment( + # ConfirmPayment(txid="40000001", payment_method="bank") + # ) + + # Seller confirms receipt and release + # api.p2p_merchant_transaction_confirm_receipt( + # ConfirmReceipt(txid="40000001") + # ) + + # Cancel order + # api.p2p_merchant_transaction_cancel( + # CancelOrder( + # txid="40000001", + # reason_id="1", + # reason_memo="Canceled after agreement with the counterparty.", + # ) + # ) + + # ============================================================ + # 5. Chat - send message, upload file (write ops, commented) + # ============================================================ + logger.info("=== 5. P2P Chat write ops (examples commented) ===") + + # Send text message (requires real txid). + # Content risk matches return code=0 with data.risk_type=1 and data.toast_msg. + # api.p2p_merchant_chat_send_chat_message( + # SendChatMessageRequest( + # txid=40000001, + # message="Payment completed, please check.", + # type=0, + # ) + # ) + + # Upload chat file (image/video base64) + # api.p2p_merchant_chat_upload_chat_file( + # UploadChatFile( + # image_content_type="image/png", + # base64_img="iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB...", + # ) + # ) + + logger.info("=== P2P Merchant demo finished ===") + + except ApiException as e: + logger.error("Gate API exception: %s", e) + except Exception as e: + logger.exception("Unexpected exception: %s", e) diff --git a/gate_api/__init__.py b/gate_api/__init__.py index 1b826cbc..6c34fe73 100644 --- a/gate_api/__init__.py +++ b/gate_api/__init__.py @@ -14,15 +14,23 @@ from __future__ import absolute_import -__version__ = "7.2.8" +__version__ = "7.2.123" # import apis into sdk package +from gate_api.api.activity_api import ActivityApi +from gate_api.api.cfd_api import CFDApi +from gate_api.api.cross_ex_api import CrossExApi from gate_api.api.earn_uni_api import EarnUniApi from gate_api.api.margin_uni_api import MarginUniApi +from gate_api.api.otc_api import OTCApi +from gate_api.api.stock_api import StockApi from gate_api.api.sub_account_api import SubAccountApi from gate_api.api.unified_api import UnifiedApi from gate_api.api.account_api import AccountApi -from gate_api.api.collateral_loan_api import CollateralLoanApi +from gate_api.api.alpha_api import AlphaApi +from gate_api.api.assetswap_api import AssetswapApi +from gate_api.api.bot_api import BotApi +from gate_api.api.coupon_api import CouponApi from gate_api.api.delivery_api import DeliveryApi from gate_api.api.earn_api import EarnApi from gate_api.api.flash_swap_api import FlashSwapApi @@ -30,9 +38,12 @@ from gate_api.api.margin_api import MarginApi from gate_api.api.multi_collateral_loan_api import MultiCollateralLoanApi from gate_api.api.options_api import OptionsApi +from gate_api.api.p2p_api import P2pApi from gate_api.api.rebate_api import RebateApi from gate_api.api.spot_api import SpotApi +from gate_api.api.square_api import SquareApi from gate_api.api.wallet_api import WalletApi +from gate_api.api.welfare_api import WelfareApi from gate_api.api.withdrawal_api import WithdrawalApi # import ApiClient @@ -44,63 +55,195 @@ from gate_api.exceptions import ApiKeyError from gate_api.exceptions import ApiException # import models into sdk package +from gate_api.models.ai_hub_create_data import AIHubCreateData +from gate_api.models.ai_hub_create_success_response import AIHubCreateSuccessResponse +from gate_api.models.ai_hub_discover_data import AIHubDiscoverData +from gate_api.models.ai_hub_discover_success_response import AIHubDiscoverSuccessResponse +from gate_api.models.ai_hub_portfolio_base_info import AIHubPortfolioBaseInfo +from gate_api.models.ai_hub_portfolio_detail_data import AIHubPortfolioDetailData +from gate_api.models.ai_hub_portfolio_detail_success_response import AIHubPortfolioDetailSuccessResponse +from gate_api.models.ai_hub_portfolio_metrics import AIHubPortfolioMetrics +from gate_api.models.ai_hub_portfolio_position import AIHubPortfolioPosition +from gate_api.models.ai_hub_portfolio_running_data import AIHubPortfolioRunningData +from gate_api.models.ai_hub_portfolio_running_item import AIHubPortfolioRunningItem +from gate_api.models.ai_hub_portfolio_running_success_response import AIHubPortfolioRunningSuccessResponse +from gate_api.models.ai_hub_portfolio_stop_data import AIHubPortfolioStopData +from gate_api.models.ai_hub_portfolio_stop_request import AIHubPortfolioStopRequest +from gate_api.models.ai_hub_portfolio_stop_success_response import AIHubPortfolioStopSuccessResponse +from gate_api.models.ai_hub_recommendation import AIHubRecommendation from gate_api.models.account_balance import AccountBalance +from gate_api.models.account_book_response import AccountBookResponse from gate_api.models.account_detail import AccountDetail from gate_api.models.account_detail_key import AccountDetailKey from gate_api.models.account_key_info import AccountKeyInfo from gate_api.models.account_key_info_perms import AccountKeyInfoPerms from gate_api.models.account_rate_limit import AccountRateLimit +from gate_api.models.account_transfer_detail import AccountTransferDetail +from gate_api.models.accounts_response import AccountsResponse +from gate_api.models.ads_detail_request import AdsDetailRequest +from gate_api.models.ads_list_request import AdsListRequest +from gate_api.models.ads_update_status import AdsUpdateStatus from gate_api.models.agency_commission import AgencyCommission from gate_api.models.agency_commission_history import AgencyCommissionHistory from gate_api.models.agency_transaction import AgencyTransaction from gate_api.models.agency_transaction_history import AgencyTransactionHistory +from gate_api.models.alpha_currency import AlphaCurrency +from gate_api.models.alpha_ticker import AlphaTicker +from gate_api.models.amend_options_order_request import AmendOptionsOrderRequest +from gate_api.models.api_response_asset_swap_config import ApiResponseAssetSwapConfig +from gate_api.models.api_response_asset_swap_evaluate import ApiResponseAssetSwapEvaluate +from gate_api.models.api_response_asset_swap_list_assets import ApiResponseAssetSwapListAssets +from gate_api.models.api_response_asset_swap_order_create_v1 import ApiResponseAssetSwapOrderCreateV1 +from gate_api.models.api_response_asset_swap_order_list_v1 import ApiResponseAssetSwapOrderListV1 +from gate_api.models.api_response_asset_swap_order_preview_v1 import ApiResponseAssetSwapOrderPreviewV1 +from gate_api.models.api_response_asset_swap_order_query_v1 import ApiResponseAssetSwapOrderQueryV1 +from gate_api.models.api_response_ex_skill_claim_reward_resp import ApiResponseExSkillClaimRewardResp +from gate_api.models.api_response_ex_skill_claim_reward_resp_data import ApiResponseExSkillClaimRewardRespData +from gate_api.models.api_response_ex_skill_claim_task_resp import ApiResponseExSkillClaimTaskResp +from gate_api.models.api_response_ex_skill_get_beginner_task_list_resp import ApiResponseExSkillGetBeginnerTaskListResp +from gate_api.models.api_response_ex_skill_get_beginner_task_list_resp_data import ApiResponseExSkillGetBeginnerTaskListRespData +from gate_api.models.api_response_ex_skill_get_beginner_task_list_resp_data_tasks import ApiResponseExSkillGetBeginnerTaskListRespDataTasks +from gate_api.models.api_response_ex_skill_get_user_identity_resp import ApiResponseExSkillGetUserIdentityResp +from gate_api.models.asset_list_resp import AssetListResp +from gate_api.models.asset_swap_frontend import AssetSwapFrontend +from gate_api.models.auto_invest_coins_item import AutoInvestCoinsItem +from gate_api.models.auto_invest_config_item import AutoInvestConfigItem +from gate_api.models.auto_invest_min_invest_amount import AutoInvestMinInvestAmount +from gate_api.models.auto_invest_min_invest_amount_items import AutoInvestMinInvestAmountItems +from gate_api.models.auto_invest_min_invest_amount_resp import AutoInvestMinInvestAmountResp +from gate_api.models.auto_invest_order_item import AutoInvestOrderItem +from gate_api.models.auto_invest_plan_add_position import AutoInvestPlanAddPosition +from gate_api.models.auto_invest_plan_create import AutoInvestPlanCreate +from gate_api.models.auto_invest_plan_create_items import AutoInvestPlanCreateItems +from gate_api.models.auto_invest_plan_create_resp import AutoInvestPlanCreateResp +from gate_api.models.auto_invest_plan_detail import AutoInvestPlanDetail +from gate_api.models.auto_invest_plan_list_info_resp import AutoInvestPlanListInfoResp +from gate_api.models.auto_invest_plan_record_item import AutoInvestPlanRecordItem +from gate_api.models.auto_invest_plan_records_resp import AutoInvestPlanRecordsResp +from gate_api.models.auto_invest_plan_stop import AutoInvestPlanStop +from gate_api.models.auto_invest_plan_update import AutoInvestPlanUpdate +from gate_api.models.auto_invest_portfolio_item import AutoInvestPortfolioItem from gate_api.models.auto_repay_setting import AutoRepaySetting from gate_api.models.award_list_struct import AwardListStruct from gate_api.models.award_list_struct_list import AwardListStructList +from gate_api.models.base_response import BaseResponse from gate_api.models.batch_amend_item import BatchAmendItem from gate_api.models.batch_amend_order_req import BatchAmendOrderReq +from gate_api.models.batch_funding_rates_request import BatchFundingRatesRequest +from gate_api.models.batch_funding_rates_response import BatchFundingRatesResponse from gate_api.models.batch_futures_order import BatchFuturesOrder from gate_api.models.batch_order import BatchOrder from gate_api.models.borrow_currency_info import BorrowCurrencyInfo from gate_api.models.broker_commission import BrokerCommission -from gate_api.models.broker_commission1 import BrokerCommission1 +from gate_api.models.broker_commission_item import BrokerCommissionItem from gate_api.models.broker_commission_sub_broker_info import BrokerCommissionSubBrokerInfo from gate_api.models.broker_transaction import BrokerTransaction -from gate_api.models.broker_transaction1 import BrokerTransaction1 +from gate_api.models.broker_transaction_history import BrokerTransactionHistory from gate_api.models.cancel_batch_order import CancelBatchOrder +from gate_api.models.cancel_order import CancelOrder from gate_api.models.cancel_order_result import CancelOrderResult +from gate_api.models.categories import Categories +from gate_api.models.categories_data import CategoriesData +from gate_api.models.categories_data_list import CategoriesDataList +from gate_api.models.chase_order import ChaseOrder +from gate_api.models.claim_reward_error import ClaimRewardError +from gate_api.models.claim_task_error import ClaimTaskError +from gate_api.models.close_position import ClosePosition +from gate_api.models.close_position_data import ClosePositionData from gate_api.models.collateral_adjust import CollateralAdjust from gate_api.models.collateral_adjust_res import CollateralAdjustRes -from gate_api.models.collateral_align import CollateralAlign from gate_api.models.collateral_currency import CollateralCurrency from gate_api.models.collateral_currency_info import CollateralCurrencyInfo from gate_api.models.collateral_currency_res import CollateralCurrencyRes from gate_api.models.collateral_current_rate import CollateralCurrentRate from gate_api.models.collateral_fix_rate import CollateralFixRate -from gate_api.models.collateral_loan_currency import CollateralLoanCurrency from gate_api.models.collateral_ltv import CollateralLtv -from gate_api.models.collateral_order import CollateralOrder -from gate_api.models.collateral_record import CollateralRecord +from gate_api.models.confirm_payment import ConfirmPayment +from gate_api.models.confirm_receipt import ConfirmReceipt from gate_api.models.contract import Contract +from gate_api.models.contract_detail import ContractDetail +from gate_api.models.contract_detail_data import ContractDetailData +from gate_api.models.contract_detail_data_list import ContractDetailDataList +from gate_api.models.contract_martingale_create_params import ContractMartingaleCreateParams +from gate_api.models.contract_martingale_create_request import ContractMartingaleCreateRequest +from gate_api.models.contract_martingale_direction import ContractMartingaleDirection from gate_api.models.contract_stat import ContractStat +from gate_api.models.convert_currencies_v2_item import ConvertCurrenciesV2Item from gate_api.models.convert_small_balance import ConvertSmallBalance from gate_api.models.countdown_cancel_all_futures_task import CountdownCancelAllFuturesTask from gate_api.models.countdown_cancel_all_options_task import CountdownCancelAllOptionsTask from gate_api.models.countdown_cancel_all_spot_task import CountdownCancelAllSpotTask -from gate_api.models.create_collateral_order import CreateCollateralOrder +from gate_api.models.create_chase_order_req import CreateChaseOrderReq +from gate_api.models.create_chase_order_resp import CreateChaseOrderResp +from gate_api.models.create_earn_fixed_term_lend_response import CreateEarnFixedTermLendResponse +from gate_api.models.create_earn_fixed_term_lend_response_data import CreateEarnFixedTermLendResponseData +from gate_api.models.create_earn_fixed_term_pre_redeem_response import CreateEarnFixedTermPreRedeemResponse from gate_api.models.create_multi_collateral_order import CreateMultiCollateralOrder +from gate_api.models.create_order import CreateOrder +from gate_api.models.create_order2 import CreateOrder2 +from gate_api.models.create_order2_data import CreateOrder2Data +from gate_api.models.create_order_detail import CreateOrderDetail +from gate_api.models.create_param import CreateParam +from gate_api.models.create_trail_order import CreateTrailOrder +from gate_api.models.create_trail_order_response import CreateTrailOrderResponse +from gate_api.models.create_trail_order_result import CreateTrailOrderResult +from gate_api.models.create_transaction import CreateTransaction +from gate_api.models.create_transaction2 import CreateTransaction2 from gate_api.models.create_uni_lend import CreateUniLend from gate_api.models.create_uni_loan import CreateUniLoan +from gate_api.models.create_user_resp import CreateUserResp +from gate_api.models.create_user_resp_data import CreateUserRespData from gate_api.models.cross_margin_balance import CrossMarginBalance from gate_api.models.cross_margin_loan import CrossMarginLoan from gate_api.models.cross_margin_repayment import CrossMarginRepayment +from gate_api.models.crossex_account import CrossexAccount +from gate_api.models.crossex_account_asset import CrossexAccountAsset +from gate_api.models.crossex_account_book_record import CrossexAccountBookRecord +from gate_api.models.crossex_account_update_request import CrossexAccountUpdateRequest +from gate_api.models.crossex_account_update_response import CrossexAccountUpdateResponse +from gate_api.models.crossex_adl_rank import CrossexAdlRank +from gate_api.models.crossex_batch_cancel_order_request import CrossexBatchCancelOrderRequest +from gate_api.models.crossex_batch_cancel_order_response import CrossexBatchCancelOrderResponse +from gate_api.models.crossex_close_position_request import CrossexClosePositionRequest +from gate_api.models.crossex_coin_discount_rate import CrossexCoinDiscountRate +from gate_api.models.crossex_convert_order_request import CrossexConvertOrderRequest +from gate_api.models.crossex_convert_order_response import CrossexConvertOrderResponse +from gate_api.models.crossex_convert_quote_request import CrossexConvertQuoteRequest +from gate_api.models.crossex_convert_quote_response import CrossexConvertQuoteResponse +from gate_api.models.crossex_historical_margin_position import CrossexHistoricalMarginPosition +from gate_api.models.crossex_historical_position import CrossexHistoricalPosition +from gate_api.models.crossex_interest_rate import CrossexInterestRate +from gate_api.models.crossex_isolated_margin_request import CrossexIsolatedMarginRequest +from gate_api.models.crossex_isolated_margin_response import CrossexIsolatedMarginResponse +from gate_api.models.crossex_leverage_request import CrossexLeverageRequest +from gate_api.models.crossex_leverage_response import CrossexLeverageResponse +from gate_api.models.crossex_margin_interest_record import CrossexMarginInterestRecord +from gate_api.models.crossex_margin_mode_request import CrossexMarginModeRequest +from gate_api.models.crossex_margin_mode_response import CrossexMarginModeResponse +from gate_api.models.crossex_margin_position import CrossexMarginPosition +from gate_api.models.crossex_order import CrossexOrder +from gate_api.models.crossex_order_action_response import CrossexOrderActionResponse +from gate_api.models.crossex_order_request import CrossexOrderRequest +from gate_api.models.crossex_order_update_request import CrossexOrderUpdateRequest +from gate_api.models.crossex_position import CrossexPosition +from gate_api.models.crossex_risk_limit import CrossexRiskLimit +from gate_api.models.crossex_risk_limit_tier import CrossexRiskLimitTier +from gate_api.models.crossex_special_fee import CrossexSpecialFee +from gate_api.models.crossex_trade import CrossexTrade +from gate_api.models.crossex_transfer_coin import CrossexTransferCoin +from gate_api.models.crossex_transfer_record import CrossexTransferRecord +from gate_api.models.crossex_transfer_request import CrossexTransferRequest +from gate_api.models.crossex_transfer_response import CrossexTransferResponse from gate_api.models.currency import Currency from gate_api.models.currency_chain import CurrencyChain from gate_api.models.currency_pair import CurrencyPair from gate_api.models.currency_quota import CurrencyQuota from gate_api.models.debit_fee import DebitFee +from gate_api.models.delete_order import DeleteOrder +from gate_api.models.delete_position import DeletePosition from gate_api.models.delivery_account import DeliveryAccount from gate_api.models.delivery_account_book import DeliveryAccountBook +from gate_api.models.delivery_account_history import DeliveryAccountHistory from gate_api.models.delivery_candlestick import DeliveryCandlestick from gate_api.models.delivery_contract import DeliveryContract from gate_api.models.delivery_limit_risk_tiers import DeliveryLimitRiskTiers @@ -108,21 +251,72 @@ from gate_api.models.delivery_my_trade import DeliveryMyTrade from gate_api.models.delivery_order import DeliveryOrder from gate_api.models.delivery_order_book import DeliveryOrderBook +from gate_api.models.delivery_order_book_item import DeliveryOrderBookItem from gate_api.models.delivery_position import DeliveryPosition from gate_api.models.delivery_position_close import DeliveryPositionClose from gate_api.models.delivery_settlement import DeliverySettlement from gate_api.models.delivery_ticker import DeliveryTicker from gate_api.models.delivery_trade import DeliveryTrade +from gate_api.models.delta_neutral_enabled import DeltaNeutralEnabled from gate_api.models.deposit_address import DepositAddress from gate_api.models.deposit_record import DepositRecord +from gate_api.models.discover_scene import DiscoverScene +from gate_api.models.dual_get_balance import DualGetBalance from gate_api.models.dual_get_orders import DualGetOrders from gate_api.models.dual_get_plans import DualGetPlans -from gate_api.models.eth2_rate_list import Eth2RateList -from gate_api.models.eth2_swap import Eth2Swap -from gate_api.models.find_coin import FindCoin +from gate_api.models.dual_modify_order_reinvest_params import DualModifyOrderReinvestParams +from gate_api.models.dual_order_refund_params import DualOrderRefundParams +from gate_api.models.dual_order_refund_preview import DualOrderRefundPreview +from gate_api.models.dual_project_recommend import DualProjectRecommend +from gate_api.models.earn_fixed_term_pre_redeem_request import EarnFixedTermPreRedeemRequest +from gate_api.models.eligibility import Eligibility +from gate_api.models.eligibility_response import EligibilityResponse +from gate_api.models.eligibility_response_all_of import EligibilityResponseAllOf +from gate_api.models.err_code_msg import ErrCodeMsg +from gate_api.models.error_response import ErrorResponse +from gate_api.models.evaluate_item import EvaluateItem +from gate_api.models.evaluate_resp import EvaluateResp +from gate_api.models.ex_skill_claim_reward_req import ExSkillClaimRewardReq +from gate_api.models.ex_skill_claim_task_req import ExSkillClaimTaskReq +from gate_api.models.exchanges import Exchanges +from gate_api.models.exchanges_data import ExchangesData +from gate_api.models.exchanges_data_list import ExchangesDataList +from gate_api.models.fee_rate import FeeRate +from gate_api.models.fee_rate_data import FeeRateData +from gate_api.models.fee_rate_data_list import FeeRateDataList +from gate_api.models.fixed_term_bonus_info import FixedTermBonusInfo +from gate_api.models.fixed_term_coupon_info import FixedTermCouponInfo +from gate_api.models.fixed_term_history_record import FixedTermHistoryRecord +from gate_api.models.fixed_term_lend_order import FixedTermLendOrder +from gate_api.models.fixed_term_lend_request import FixedTermLendRequest +from gate_api.models.fixed_term_product import FixedTermProduct +from gate_api.models.fixed_term_product_info import FixedTermProductInfo +from gate_api.models.fixed_term_product_simple import FixedTermProductSimple from gate_api.models.flash_swap_currency_pair import FlashSwapCurrencyPair +from gate_api.models.flash_swap_error_response import FlashSwapErrorResponse +from gate_api.models.flash_swap_multi_currency_create_param import FlashSwapMultiCurrencyCreateParam +from gate_api.models.flash_swap_multi_currency_many_to_one_order_create_req import FlashSwapMultiCurrencyManyToOneOrderCreateReq +from gate_api.models.flash_swap_multi_currency_many_to_one_order_create_resp import FlashSwapMultiCurrencyManyToOneOrderCreateResp +from gate_api.models.flash_swap_multi_currency_many_to_one_order_create_resp_data import FlashSwapMultiCurrencyManyToOneOrderCreateRespData +from gate_api.models.flash_swap_multi_currency_many_to_one_order_preview_req import FlashSwapMultiCurrencyManyToOneOrderPreviewReq +from gate_api.models.flash_swap_multi_currency_many_to_one_order_preview_resp import FlashSwapMultiCurrencyManyToOneOrderPreviewResp +from gate_api.models.flash_swap_multi_currency_many_to_one_order_preview_resp_data import FlashSwapMultiCurrencyManyToOneOrderPreviewRespData +from gate_api.models.flash_swap_multi_currency_one_to_many_order_create_req import FlashSwapMultiCurrencyOneToManyOrderCreateReq +from gate_api.models.flash_swap_multi_currency_one_to_many_order_create_resp import FlashSwapMultiCurrencyOneToManyOrderCreateResp +from gate_api.models.flash_swap_multi_currency_one_to_many_order_create_resp_data import FlashSwapMultiCurrencyOneToManyOrderCreateRespData +from gate_api.models.flash_swap_multi_currency_one_to_many_order_preview_req import FlashSwapMultiCurrencyOneToManyOrderPreviewReq +from gate_api.models.flash_swap_multi_currency_one_to_many_order_preview_resp import FlashSwapMultiCurrencyOneToManyOrderPreviewResp +from gate_api.models.flash_swap_multi_currency_one_to_many_order_preview_resp_data import FlashSwapMultiCurrencyOneToManyOrderPreviewRespData +from gate_api.models.flash_swap_multi_currency_order import FlashSwapMultiCurrencyOrder +from gate_api.models.flash_swap_multi_currency_preview_order import FlashSwapMultiCurrencyPreviewOrder +from gate_api.models.flash_swap_multi_currency_preview_param import FlashSwapMultiCurrencyPreviewParam from gate_api.models.flash_swap_order import FlashSwapOrder +from gate_api.models.flash_swap_order_create_req import FlashSwapOrderCreateReq +from gate_api.models.flash_swap_order_create_resp import FlashSwapOrderCreateResp +from gate_api.models.flash_swap_order_create_resp_data import FlashSwapOrderCreateRespData from gate_api.models.flash_swap_order_preview import FlashSwapOrderPreview +from gate_api.models.flash_swap_order_preview_resp import FlashSwapOrderPreviewResp +from gate_api.models.flash_swap_order_preview_resp_data import FlashSwapOrderPreviewRespData from gate_api.models.flash_swap_order_request import FlashSwapOrderRequest from gate_api.models.flash_swap_preview_request import FlashSwapPreviewRequest from gate_api.models.funding_account import FundingAccount @@ -135,9 +329,13 @@ from gate_api.models.futures_bbo_order import FuturesBBOOrder from gate_api.models.futures_batch_amend_order_request import FuturesBatchAmendOrderRequest from gate_api.models.futures_candlestick import FuturesCandlestick +from gate_api.models.futures_direction import FuturesDirection from gate_api.models.futures_fee import FuturesFee +from gate_api.models.futures_grid_create_params import FuturesGridCreateParams +from gate_api.models.futures_grid_create_request import FuturesGridCreateRequest from gate_api.models.futures_index_constituents import FuturesIndexConstituents from gate_api.models.futures_initial_order import FuturesInitialOrder +from gate_api.models.futures_leverage import FuturesLeverage from gate_api.models.futures_limit_risk_tiers import FuturesLimitRiskTiers from gate_api.models.futures_liq_order import FuturesLiqOrder from gate_api.models.futures_liquidate import FuturesLiquidate @@ -145,7 +343,7 @@ from gate_api.models.futures_order_amendment import FuturesOrderAmendment from gate_api.models.futures_order_book import FuturesOrderBook from gate_api.models.futures_order_book_item import FuturesOrderBookItem -from gate_api.models.futures_order_book_item1 import FuturesOrderBookItem1 +from gate_api.models.futures_order_timerange import FuturesOrderTimerange from gate_api.models.futures_position_cross_mode import FuturesPositionCrossMode from gate_api.models.futures_premium_index import FuturesPremiumIndex from gate_api.models.futures_price_trigger import FuturesPriceTrigger @@ -154,16 +352,72 @@ from gate_api.models.futures_ticker import FuturesTicker from gate_api.models.futures_trade import FuturesTrade from gate_api.models.futures_update_price_triggered_order import FuturesUpdatePriceTriggeredOrder +from gate_api.models.gate_error_response import GateErrorResponse +from gate_api.models.get_beginner_task_list_error import GetBeginnerTaskListError +from gate_api.models.get_chase_order_detail_resp import GetChaseOrderDetailResp +from gate_api.models.get_chase_orders_resp import GetChaseOrdersResp +from gate_api.models.get_chats_list_request import GetChatsListRequest +from gate_api.models.get_completed_transaction_list_request import GetCompletedTransactionListRequest +from gate_api.models.get_counterparty_user_info_request import GetCounterpartyUserInfoRequest +from gate_api.models.get_my_activity_entry_response import GetMyActivityEntryResponse +from gate_api.models.get_my_activity_entry_response_data import GetMyActivityEntryResponseData +from gate_api.models.get_myself_payment_request import GetMyselfPaymentRequest +from gate_api.models.get_pending_transaction_list_request import GetPendingTransactionListRequest +from gate_api.models.get_transaction_details_request import GetTransactionDetailsRequest +from gate_api.models.get_user_coupon_detail_response import GetUserCouponDetailResponse +from gate_api.models.get_user_coupon_detail_response_data import GetUserCouponDetailResponseData +from gate_api.models.get_user_identity_error import GetUserIdentityError +from gate_api.models.i18n_txt import I18nTxt from gate_api.models.index_constituent import IndexConstituent -from gate_api.models.inline_object import InlineObject +from gate_api.models.infinite_grid_create_params import InfiniteGridCreateParams +from gate_api.models.infinite_grid_create_request import InfiniteGridCreateRequest from gate_api.models.inline_response200 import InlineResponse200 from gate_api.models.inline_response2001 import InlineResponse2001 +from gate_api.models.inline_response2002 import InlineResponse2002 from gate_api.models.insurance_record import InsuranceRecord +from gate_api.models.klines import Klines +from gate_api.models.klines_data import KlinesData +from gate_api.models.klines_data_list import KlinesDataList +from gate_api.models.ladder_apr import LadderApr from gate_api.models.ledger_record import LedgerRecord +from gate_api.models.leverage_failed_currencies import LeverageFailedCurrencies from gate_api.models.liquidate_order import LiquidateOrder +from gate_api.models.list_activities_response import ListActivitiesResponse +from gate_api.models.list_activities_response_data import ListActivitiesResponseData +from gate_api.models.list_activities_response_data_list import ListActivitiesResponseDataList +from gate_api.models.list_activity_types_response import ListActivityTypesResponse +from gate_api.models.list_activity_types_response_data import ListActivityTypesResponseData +from gate_api.models.list_activity_types_response_data_list import ListActivityTypesResponseDataList +from gate_api.models.list_earn_fixed_term_history_response import ListEarnFixedTermHistoryResponse +from gate_api.models.list_earn_fixed_term_history_response_data import ListEarnFixedTermHistoryResponseData +from gate_api.models.list_earn_fixed_term_lends_response import ListEarnFixedTermLendsResponse +from gate_api.models.list_earn_fixed_term_lends_response_data import ListEarnFixedTermLendsResponseData +from gate_api.models.list_earn_fixed_term_products_by_asset_response import ListEarnFixedTermProductsByAssetResponse +from gate_api.models.list_earn_fixed_term_products_by_asset_response_data import ListEarnFixedTermProductsByAssetResponseData +from gate_api.models.list_earn_fixed_term_products_response import ListEarnFixedTermProductsResponse +from gate_api.models.list_earn_fixed_term_products_response_data import ListEarnFixedTermProductsResponseData +from gate_api.models.list_live_replay_error import ListLiveReplayError +from gate_api.models.list_live_replay_response import ListLiveReplayResponse +from gate_api.models.list_live_replay_response_data import ListLiveReplayResponseData +from gate_api.models.list_live_replay_response_data_list import ListLiveReplayResponseDataList +from gate_api.models.list_live_replay_response_data_live import ListLiveReplayResponseDataLive +from gate_api.models.list_live_replay_response_data_live_host import ListLiveReplayResponseDataLiveHost +from gate_api.models.list_live_replay_response_data_video import ListLiveReplayResponseDataVideo +from gate_api.models.list_square_ai_search_error import ListSquareAiSearchError +from gate_api.models.list_square_ai_search_response import ListSquareAiSearchResponse +from gate_api.models.list_square_ai_search_response_data import ListSquareAiSearchResponseData +from gate_api.models.list_square_ai_search_response_data_items import ListSquareAiSearchResponseDataItems +from gate_api.models.list_user_coupons_response import ListUserCouponsResponse +from gate_api.models.list_user_coupons_response_data import ListUserCouponsResponseData +from gate_api.models.list_user_coupons_response_data_help_url import ListUserCouponsResponseDataHelpUrl +from gate_api.models.list_user_coupons_response_data_jump_url import ListUserCouponsResponseDataJumpUrl +from gate_api.models.list_user_coupons_response_data_list import ListUserCouponsResponseDataList +from gate_api.models.list_user_coupons_response_data_progress_config import ListUserCouponsResponseDataProgressConfig from gate_api.models.margin_account import MarginAccount from gate_api.models.margin_account_book import MarginAccountBook from gate_api.models.margin_account_currency import MarginAccountCurrency +from gate_api.models.margin_grid_create_params import MarginGridCreateParams +from gate_api.models.margin_grid_create_request import MarginGridCreateRequest from gate_api.models.margin_leverage_tier import MarginLeverageTier from gate_api.models.margin_market_leverage import MarginMarketLeverage from gate_api.models.margin_tiers import MarginTiers @@ -177,6 +431,8 @@ from gate_api.models.mock_risk_unit import MockRiskUnit from gate_api.models.mock_spot_balance import MockSpotBalance from gate_api.models.mock_spot_order import MockSpotOrder +from gate_api.models.mt5_account import Mt5Account +from gate_api.models.mt5_account_data import Mt5AccountData from gate_api.models.multi_chain_address_item import MultiChainAddressItem from gate_api.models.multi_collateral_currency import MultiCollateralCurrency from gate_api.models.multi_collateral_item import MultiCollateralItem @@ -187,6 +443,7 @@ from gate_api.models.multi_loan_repay_item import MultiLoanRepayItem from gate_api.models.multi_repay_record import MultiRepayRecord from gate_api.models.multi_repay_resp import MultiRepayResp +from gate_api.models.my_ads_list_request import MyAdsListRequest from gate_api.models.my_futures_trade import MyFuturesTrade from gate_api.models.my_futures_trade_time_range import MyFuturesTradeTimeRange from gate_api.models.open_orders import OpenOrders @@ -210,48 +467,189 @@ from gate_api.models.options_underlying_ticker import OptionsUnderlyingTicker from gate_api.models.order import Order from gate_api.models.order_book import OrderBook +from gate_api.models.order_book2 import OrderBook2 +from gate_api.models.order_book2_data import OrderBook2Data +from gate_api.models.order_book_price import OrderBookPrice from gate_api.models.order_cancel import OrderCancel +from gate_api.models.order_create_v1_req import OrderCreateV1Req +from gate_api.models.order_create_v1_resp import OrderCreateV1Resp +from gate_api.models.order_history_list import OrderHistoryList +from gate_api.models.order_history_list2 import OrderHistoryList2 +from gate_api.models.order_history_list2_data import OrderHistoryList2Data +from gate_api.models.order_history_list_data import OrderHistoryListData +from gate_api.models.order_history_list_data_list import OrderHistoryListDataList +from gate_api.models.order_history_list_item import OrderHistoryListItem +from gate_api.models.order_history_list_item_status_detail import OrderHistoryListItemStatusDetail +from gate_api.models.order_list import OrderList +from gate_api.models.order_list2 import OrderList2 +from gate_api.models.order_list2_data import OrderList2Data +from gate_api.models.order_list_data import OrderListData +from gate_api.models.order_list_data_list import OrderListDataList +from gate_api.models.order_list_item import OrderListItem from gate_api.models.order_list_struct import OrderListStruct from gate_api.models.order_list_struct_list import OrderListStructList +from gate_api.models.order_list_v1_resp import OrderListV1Resp +from gate_api.models.order_log import OrderLog +from gate_api.models.order_log_data import OrderLogData from gate_api.models.order_patch import OrderPatch +from gate_api.models.order_preview_v1_req import OrderPreviewV1Req +from gate_api.models.order_preview_v1_resp import OrderPreviewV1Resp from gate_api.models.order_resp import OrderResp +from gate_api.models.order_response import OrderResponse +from gate_api.models.otc_action_response import OtcActionResponse +from gate_api.models.otc_bank_create_multipart_request import OtcBankCreateMultipartRequest +from gate_api.models.otc_bank_create_response import OtcBankCreateResponse +from gate_api.models.otc_bank_create_response_data import OtcBankCreateResponseData +from gate_api.models.otc_bank_enterprise_supplement_multipart_request import OtcBankEnterpriseSupplementMultipartRequest +from gate_api.models.otc_bank_id_request import OtcBankIdRequest +from gate_api.models.otc_bank_list_item import OtcBankListItem +from gate_api.models.otc_bank_list_response import OtcBankListResponse +from gate_api.models.otc_bank_list_result import OtcBankListResult +from gate_api.models.otc_bank_personal_supplement_multipart_request import OtcBankPersonalSupplementMultipartRequest +from gate_api.models.otc_bank_supplement_checklist_item import OtcBankSupplementChecklistItem +from gate_api.models.otc_bank_supplement_checklist_response import OtcBankSupplementChecklistResponse +from gate_api.models.otc_bank_supplement_checklist_response_data import OtcBankSupplementChecklistResponseData +from gate_api.models.otc_mark_order_paid_request import OtcMarkOrderPaidRequest +from gate_api.models.otc_order_detail import OtcOrderDetail +from gate_api.models.otc_order_detail_response import OtcOrderDetailResponse +from gate_api.models.otc_order_list_crypto_currency_info import OtcOrderListCryptoCurrencyInfo +from gate_api.models.otc_order_list_fiat_currency_info import OtcOrderListFiatCurrencyInfo +from gate_api.models.otc_order_list_item import OtcOrderListItem +from gate_api.models.otc_order_list_response import OtcOrderListResponse +from gate_api.models.otc_order_list_result import OtcOrderListResult +from gate_api.models.otc_order_request import OtcOrderRequest +from gate_api.models.otc_quote_request import OtcQuoteRequest +from gate_api.models.otc_quote_response import OtcQuoteResponse +from gate_api.models.otc_quote_result import OtcQuoteResult +from gate_api.models.otc_stable_coin_order_create_response import OtcStableCoinOrderCreateResponse +from gate_api.models.otc_stable_coin_order_list_item import OtcStableCoinOrderListItem +from gate_api.models.otc_stable_coin_order_list_response import OtcStableCoinOrderListResponse +from gate_api.models.otc_stable_coin_order_list_result import OtcStableCoinOrderListResult +from gate_api.models.otc_stable_coin_order_request import OtcStableCoinOrderRequest +from gate_api.models.other_contact import OtherContact +from gate_api.models.p2p_ad_detail import P2pAdDetail +from gate_api.models.p2p_ad_detail_response import P2pAdDetailResponse +from gate_api.models.p2p_ads_list_item import P2pAdsListItem +from gate_api.models.p2p_ads_list_response import P2pAdsListResponse +from gate_api.models.p2p_ads_list_trade_method import P2pAdsListTradeMethod +from gate_api.models.p2p_ads_update_status_response import P2pAdsUpdateStatusResponse +from gate_api.models.p2p_ads_update_status_result import P2pAdsUpdateStatusResult +from gate_api.models.p2p_chat_list_response import P2pChatListResponse +from gate_api.models.p2p_chat_list_result import P2pChatListResult +from gate_api.models.p2p_chat_message import P2pChatMessage +from gate_api.models.p2p_chat_message_payload import P2pChatMessagePayload +from gate_api.models.p2p_counterparty_user_info import P2pCounterpartyUserInfo +from gate_api.models.p2p_counterparty_user_info_response import P2pCounterpartyUserInfoResponse +from gate_api.models.p2p_merchant_books_place_biz_push_order_response import P2pMerchantBooksPlaceBizPushOrderResponse +from gate_api.models.p2p_merchant_books_place_biz_push_order_response_data import P2pMerchantBooksPlaceBizPushOrderResponseData +from gate_api.models.p2p_merchant_books_place_biz_push_order_response_data_risk_event import P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent +from gate_api.models.p2p_merchant_books_place_biz_push_order_response_data_risk_event_action import P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction +from gate_api.models.p2p_merchant_market_info import P2pMerchantMarketInfo +from gate_api.models.p2p_merchant_user_info import P2pMerchantUserInfo +from gate_api.models.p2p_merchant_user_info_response import P2pMerchantUserInfoResponse +from gate_api.models.p2p_merchant_work_hours import P2pMerchantWorkHours +from gate_api.models.p2p_merchant_work_hours_response import P2pMerchantWorkHoursResponse +from gate_api.models.p2p_my_ad import P2pMyAd +from gate_api.models.p2p_my_ads_list_response import P2pMyAdsListResponse +from gate_api.models.p2p_my_ads_list_result import P2pMyAdsListResult +from gate_api.models.p2p_payment_method_account import P2pPaymentMethodAccount +from gate_api.models.p2p_payment_method_group import P2pPaymentMethodGroup +from gate_api.models.p2p_payment_methods_response import P2pPaymentMethodsResponse +from gate_api.models.p2p_send_chat_message_response import P2pSendChatMessageResponse +from gate_api.models.p2p_send_chat_message_result import P2pSendChatMessageResult +from gate_api.models.p2p_transaction_action_response import P2pTransactionActionResponse +from gate_api.models.p2p_transaction_convert_info import P2pTransactionConvertInfo +from gate_api.models.p2p_transaction_detail import P2pTransactionDetail +from gate_api.models.p2p_transaction_detail_pay_others import P2pTransactionDetailPayOthers +from gate_api.models.p2p_transaction_detail_response import P2pTransactionDetailResponse +from gate_api.models.p2p_transaction_list_item import P2pTransactionListItem +from gate_api.models.p2p_transaction_list_response import P2pTransactionListResponse +from gate_api.models.p2p_transaction_list_result import P2pTransactionListResult +from gate_api.models.p2p_transaction_list_result_pay_others import P2pTransactionListResultPayOthers +from gate_api.models.p2p_transaction_time_marker import P2pTransactionTimeMarker +from gate_api.models.p2p_upload_chat_file_response import P2pUploadChatFileResponse +from gate_api.models.p2p_upload_chat_file_result import P2pUploadChatFileResult +from gate_api.models.partner_application import PartnerApplication +from gate_api.models.partner_application_response import PartnerApplicationResponse +from gate_api.models.partner_application_response_all_of import PartnerApplicationResponseAllOf from gate_api.models.partner_commission_history import PartnerCommissionHistory +from gate_api.models.partner_data_aggregated import PartnerDataAggregated +from gate_api.models.partner_data_aggregated_response import PartnerDataAggregatedResponse +from gate_api.models.partner_data_aggregated_response_all_of import PartnerDataAggregatedResponseAllOf from gate_api.models.partner_sub import PartnerSub from gate_api.models.partner_sub_list import PartnerSubList from gate_api.models.partner_transaction_history import PartnerTransactionHistory from gate_api.models.patch_uni_lend import PatchUniLend +from gate_api.models.place_biz_push_order import PlaceBizPushOrder from gate_api.models.place_dual_investment_order import PlaceDualInvestmentOrder +from gate_api.models.place_dual_investment_order_params import PlaceDualInvestmentOrderParams +from gate_api.models.place_order_request import PlaceOrderRequest +from gate_api.models.place_order_response import PlaceOrderResponse from gate_api.models.position import Position from gate_api.models.position_close import PositionClose from gate_api.models.position_close_order import PositionCloseOrder +from gate_api.models.position_history_list import PositionHistoryList +from gate_api.models.position_history_list_data import PositionHistoryListData +from gate_api.models.position_history_list_data_close_detail import PositionHistoryListDataCloseDetail +from gate_api.models.position_history_list_data_list import PositionHistoryListDataList +from gate_api.models.position_history_list_data_realized_pnl_detail import PositionHistoryListDataRealizedPnlDetail +from gate_api.models.position_list import PositionList +from gate_api.models.position_list2 import PositionList2 +from gate_api.models.position_list2_data import PositionList2Data +from gate_api.models.position_list_data import PositionListData +from gate_api.models.position_list_data_list import PositionListDataList +from gate_api.models.position_list_item import PositionListItem +from gate_api.models.position_timerange import PositionTimerange +from gate_api.models.preview_from_param import PreviewFromParam +from gate_api.models.preview_order import PreviewOrder +from gate_api.models.preview_order_detail import PreviewOrderDetail +from gate_api.models.preview_to_param import PreviewToParam from gate_api.models.profit_loss_range import ProfitLossRange +from gate_api.models.quick_estimated_repayment import QuickEstimatedRepayment +from gate_api.models.quick_repayment_request import QuickRepaymentRequest +from gate_api.models.quick_repayment_response import QuickRepaymentResponse +from gate_api.models.quote_request import QuoteRequest +from gate_api.models.quote_response import QuoteResponse from gate_api.models.rebate_user_info import RebateUserInfo +from gate_api.models.recommend import Recommend +from gate_api.models.recommend_v2_scheme import RecommendV2Scheme +from gate_api.models.recommend_v2_strategy import RecommendV2Strategy from gate_api.models.repay_currency_res import RepayCurrencyRes -from gate_api.models.repay_loan import RepayLoan from gate_api.models.repay_multi_loan import RepayMultiLoan -from gate_api.models.repay_record import RepayRecord from gate_api.models.repay_record_currency import RepayRecordCurrency from gate_api.models.repay_record_left_interest import RepayRecordLeftInterest from gate_api.models.repay_record_repaid_currency import RepayRecordRepaidCurrency from gate_api.models.repay_record_total_interest import RepayRecordTotalInterest -from gate_api.models.repay_resp import RepayResp from gate_api.models.risk_units import RiskUnits from gate_api.models.saved_address import SavedAddress +from gate_api.models.send_chat_message_request import SendChatMessageRequest +from gate_api.models.set_merchant_work_hours_request import SetMerchantWorkHoursRequest from gate_api.models.small_balance import SmallBalance from gate_api.models.small_balance_history import SmallBalanceHistory -from gate_api.models.spot_account import SpotAccount from gate_api.models.spot_account_book import SpotAccountBook from gate_api.models.spot_currency_chain import SpotCurrencyChain from gate_api.models.spot_fee import SpotFee +from gate_api.models.spot_grid_create_params import SpotGridCreateParams +from gate_api.models.spot_grid_create_request import SpotGridCreateRequest from gate_api.models.spot_insurance_history import SpotInsuranceHistory +from gate_api.models.spot_martingale_create_params import SpotMartingaleCreateParams +from gate_api.models.spot_martingale_create_request import SpotMartingaleCreateRequest +from gate_api.models.spot_order_stop_loss import SpotOrderStopLoss +from gate_api.models.spot_order_stop_profit import SpotOrderStopProfit +from gate_api.models.spot_pov_order import SpotPovOrder +from gate_api.models.spot_pov_order_creator import SpotPovOrderCreator from gate_api.models.spot_price_put_order import SpotPricePutOrder from gate_api.models.spot_price_trigger import SpotPriceTrigger from gate_api.models.spot_price_triggered_order import SpotPriceTriggeredOrder +from gate_api.models.stop_all_chase_orders_req import StopAllChaseOrdersReq +from gate_api.models.stop_all_chase_orders_resp import StopAllChaseOrdersResp +from gate_api.models.stop_all_trail_orders import StopAllTrailOrders +from gate_api.models.stop_chase_order_req import StopChaseOrderReq +from gate_api.models.stop_chase_order_resp import StopChaseOrderResp +from gate_api.models.stop_trail_order import StopTrailOrder from gate_api.models.stp_group import StpGroup from gate_api.models.stp_group_user import StpGroupUser -from gate_api.models.structured_buy import StructuredBuy -from gate_api.models.structured_get_project_list import StructuredGetProjectList -from gate_api.models.structured_order_list import StructuredOrderList +from gate_api.models.strategy_type import StrategyType from gate_api.models.sub_account import SubAccount from gate_api.models.sub_account_balance import SubAccountBalance from gate_api.models.sub_account_cross_margin_balance import SubAccountCrossMarginBalance @@ -266,12 +664,52 @@ from gate_api.models.sub_user_mode import SubUserMode from gate_api.models.swap_coin import SwapCoin from gate_api.models.swap_coin_struct import SwapCoinStruct +from gate_api.models.symbol import Symbol +from gate_api.models.symbol_commissions import SymbolCommissions +from gate_api.models.symbol_commissions_data import SymbolCommissionsData +from gate_api.models.symbol_commissions_data_list import SymbolCommissionsDataList +from gate_api.models.symbol_detail import SymbolDetail +from gate_api.models.symbol_detail_data import SymbolDetailData +from gate_api.models.symbol_detail_item import SymbolDetailItem +from gate_api.models.symbol_detail_item_symbol_descs import SymbolDetailItemSymbolDescs +from gate_api.models.symbol_list_item import SymbolListItem +from gate_api.models.symbols import Symbols +from gate_api.models.symbols2 import Symbols2 +from gate_api.models.symbols2_data import Symbols2Data +from gate_api.models.symbols_data import SymbolsData +from gate_api.models.symbols_data_list import SymbolsDataList from gate_api.models.system_time import SystemTime from gate_api.models.ticker import Ticker +from gate_api.models.tokens import Tokens from gate_api.models.total_balance import TotalBalance +from gate_api.models.trad_fi_close_position_request import TradFiClosePositionRequest +from gate_api.models.trad_fi_error import TradFiError +from gate_api.models.trad_fi_order_request import TradFiOrderRequest +from gate_api.models.trad_fi_order_update_request import TradFiOrderUpdateRequest +from gate_api.models.trad_fi_position_update_request import TradFiPositionUpdateRequest +from gate_api.models.trad_fi_spot_close_position_request import TradFiSpotClosePositionRequest +from gate_api.models.trad_fi_spot_error import TradFiSpotError +from gate_api.models.trad_fi_spot_order_request import TradFiSpotOrderRequest +from gate_api.models.trad_fi_spot_order_update_request import TradFiSpotOrderUpdateRequest +from gate_api.models.trad_fi_spot_transaction_request import TradFiSpotTransactionRequest +from gate_api.models.trad_fi_ticker import TradFiTicker +from gate_api.models.trad_fi_ticker_data import TradFiTickerData +from gate_api.models.trad_fi_transaction_request import TradFiTransactionRequest from gate_api.models.trade import Trade from gate_api.models.trade_fee import TradeFee +from gate_api.models.trail_change_log import TrailChangeLog +from gate_api.models.trail_order import TrailOrder +from gate_api.models.trail_order_change_log_response import TrailOrderChangeLogResponse +from gate_api.models.trail_order_detail_response import TrailOrderDetailResponse +from gate_api.models.trail_order_list_response import TrailOrderListResponse +from gate_api.models.trail_order_response import TrailOrderResponse from gate_api.models.transaction_id import TransactionID +from gate_api.models.transaction_item import TransactionItem +from gate_api.models.transaction_list import TransactionList +from gate_api.models.transaction_list2 import TransactionList2 +from gate_api.models.transaction_list2_data import TransactionList2Data +from gate_api.models.transaction_list_data import TransactionListData +from gate_api.models.transaction_list_data_list import TransactionListDataList from gate_api.models.transfer import Transfer from gate_api.models.transfer_order_status import TransferOrderStatus from gate_api.models.transferables_result import TransferablesResult @@ -280,9 +718,11 @@ from gate_api.models.uid_push_order import UidPushOrder from gate_api.models.uid_push_withdrawal import UidPushWithdrawal from gate_api.models.uid_push_withdrawal_resp import UidPushWithdrawalResp +from gate_api.models.uni_chart_point import UniChartPoint from gate_api.models.uni_currency import UniCurrency from gate_api.models.uni_currency_interest import UniCurrencyInterest from gate_api.models.uni_currency_pair import UniCurrencyPair +from gate_api.models.uni_estimated_rate import UniEstimatedRate from gate_api.models.uni_interest_record import UniInterestRecord from gate_api.models.uni_lend import UniLend from gate_api.models.uni_lend_interest import UniLendInterest @@ -293,7 +733,6 @@ from gate_api.models.unified_account import UnifiedAccount from gate_api.models.unified_balance import UnifiedBalance from gate_api.models.unified_borrowable import UnifiedBorrowable -from gate_api.models.unified_borrowable1 import UnifiedBorrowable1 from gate_api.models.unified_collateral_req import UnifiedCollateralReq from gate_api.models.unified_collateral_res import UnifiedCollateralRes from gate_api.models.unified_currency import UnifiedCurrency @@ -310,13 +749,28 @@ from gate_api.models.unified_mode_set import UnifiedModeSet from gate_api.models.unified_portfolio_input import UnifiedPortfolioInput from gate_api.models.unified_portfolio_output import UnifiedPortfolioOutput +from gate_api.models.unified_quick_repay_available_item import UnifiedQuickRepayAvailableItem +from gate_api.models.unified_quick_repay_debt_item import UnifiedQuickRepayDebtItem +from gate_api.models.unified_quick_repay_repaid_info import UnifiedQuickRepayRepaidInfo +from gate_api.models.unified_quick_repay_used_info import UnifiedQuickRepayUsedInfo from gate_api.models.unified_risk_units import UnifiedRiskUnits from gate_api.models.unified_settings import UnifiedSettings from gate_api.models.unified_transferable import UnifiedTransferable -from gate_api.models.user_ltv_info import UserLtvInfo +from gate_api.models.update_dual_comp_position_cross_mode_request import UpdateDualCompPositionCrossModeRequest +from gate_api.models.update_order import UpdateOrder +from gate_api.models.update_order2 import UpdateOrder2 +from gate_api.models.update_order2_data import UpdateOrder2Data +from gate_api.models.update_order_data import UpdateOrderData +from gate_api.models.update_position import UpdatePosition +from gate_api.models.update_trail_order import UpdateTrailOrder +from gate_api.models.upload_chat_file import UploadChatFile +from gate_api.models.user_asset_resp import UserAssetResp +from gate_api.models.user_asset_resp2 import UserAssetResp2 +from gate_api.models.user_asset_resp2_data import UserAssetResp2Data +from gate_api.models.user_asset_resp_data import UserAssetRespData +from gate_api.models.user_leverage_setting import UserLeverageSetting from gate_api.models.user_sub import UserSub from gate_api.models.user_sub_relation import UserSubRelation -from gate_api.models.user_total_amount import UserTotalAmount from gate_api.models.withdraw_status import WithdrawStatus from gate_api.models.withdrawal_record import WithdrawalRecord from gate_api.models.withdrawals_del import WithdrawalsDel diff --git a/gate_api/api/__init__.py b/gate_api/api/__init__.py index 6cd727a3..2112f429 100644 --- a/gate_api/api/__init__.py +++ b/gate_api/api/__init__.py @@ -3,12 +3,20 @@ # flake8: noqa # import apis into api package +from gate_api.api.activity_api import ActivityApi +from gate_api.api.cfd_api import CFDApi +from gate_api.api.cross_ex_api import CrossExApi from gate_api.api.earn_uni_api import EarnUniApi from gate_api.api.margin_uni_api import MarginUniApi +from gate_api.api.otc_api import OTCApi +from gate_api.api.stock_api import StockApi from gate_api.api.sub_account_api import SubAccountApi from gate_api.api.unified_api import UnifiedApi from gate_api.api.account_api import AccountApi -from gate_api.api.collateral_loan_api import CollateralLoanApi +from gate_api.api.alpha_api import AlphaApi +from gate_api.api.assetswap_api import AssetswapApi +from gate_api.api.bot_api import BotApi +from gate_api.api.coupon_api import CouponApi from gate_api.api.delivery_api import DeliveryApi from gate_api.api.earn_api import EarnApi from gate_api.api.flash_swap_api import FlashSwapApi @@ -16,7 +24,10 @@ from gate_api.api.margin_api import MarginApi from gate_api.api.multi_collateral_loan_api import MultiCollateralLoanApi from gate_api.api.options_api import OptionsApi +from gate_api.api.p2p_api import P2pApi from gate_api.api.rebate_api import RebateApi from gate_api.api.spot_api import SpotApi +from gate_api.api.square_api import SquareApi from gate_api.api.wallet_api import WalletApi +from gate_api.api.welfare_api import WelfareApi from gate_api.api.withdrawal_api import WithdrawalApi diff --git a/gate_api/api/account_api.py b/gate_api/api/account_api.py index fd8899fa..8e0bd569 100644 --- a/gate_api/api/account_api.py +++ b/gate_api/api/account_api.py @@ -245,6 +245,7 @@ def get_account_main_keys_with_http_info(self, **kwargs): # noqa: E501 def get_account_rate_limit(self, **kwargs): # noqa: E501 """Get user transaction rate limit information # noqa: E501 + This interface is not yet open for use # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_account_rate_limit(async_req=True) @@ -268,6 +269,7 @@ def get_account_rate_limit(self, **kwargs): # noqa: E501 def get_account_rate_limit_with_http_info(self, **kwargs): # noqa: E501 """Get user transaction rate limit information # noqa: E501 + This interface is not yet open for use # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_account_rate_limit_with_http_info(async_req=True) diff --git a/gate_api/api/activity_api.py b/gate_api/api/activity_api.py new file mode 100644 index 00000000..0cfdf775 --- /dev/null +++ b/gate_api/api/activity_api.py @@ -0,0 +1,382 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ActivityApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_my_activity_entry(self, **kwargs): # noqa: E501 + """My activity entry # noqa: E501 + + Query user's Activity Center entry information, including activity icon and redirect link # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_my_activity_entry(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.GetMyActivityEntryResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_my_activity_entry_with_http_info(**kwargs) # noqa: E501 + + def get_my_activity_entry_with_http_info(self, **kwargs): # noqa: E501 + """My activity entry # noqa: E501 + + Query user's Activity Center entry information, including activity icon and redirect link # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_my_activity_entry_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.GetMyActivityEntryResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_my_activity_entry" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/rewards/activity/my-activity-entry', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetMyActivityEntryResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_activities(self, **kwargs): # noqa: E501 + """Recommended activity list # noqa: E501 + + Query recommended activity list from Activity Center, supports pagination and sorting # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_activities(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str recommend_type: Recommendation type: hot for popular activities, type for filtering by activity type (type_ids), scenario for matching by activity name + :param str type_ids: Activity type ID, multiple IDs separated by commas (supports filtering by activity type through this field) + :param str keywords: Activity name. When scenario type is used, keyword matching is applied + :param int page: Page number, starting from 1 + :param int page_size: Items per page + :param str sort_by: Sort order, e.g., hot for sorting by popularity + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ListActivitiesResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_activities_with_http_info(**kwargs) # noqa: E501 + + def list_activities_with_http_info(self, **kwargs): # noqa: E501 + """Recommended activity list # noqa: E501 + + Query recommended activity list from Activity Center, supports pagination and sorting # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_activities_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str recommend_type: Recommendation type: hot for popular activities, type for filtering by activity type (type_ids), scenario for matching by activity name + :param str type_ids: Activity type ID, multiple IDs separated by commas (supports filtering by activity type through this field) + :param str keywords: Activity name. When scenario type is used, keyword matching is applied + :param int page: Page number, starting from 1 + :param int page_size: Items per page + :param str sort_by: Sort order, e.g., hot for sorting by popularity + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ListActivitiesResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'recommend_type', + 'type_ids', + 'keywords', + 'page', + 'page_size', + 'sort_by' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_activities" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'recommend_type' in local_var_params and local_var_params['recommend_type'] is not None: # noqa: E501 + query_params.append(('recommend_type', local_var_params['recommend_type'])) # noqa: E501 + if 'type_ids' in local_var_params and local_var_params['type_ids'] is not None: # noqa: E501 + query_params.append(('type_ids', local_var_params['type_ids'])) # noqa: E501 + if 'keywords' in local_var_params and local_var_params['keywords'] is not None: # noqa: E501 + query_params.append(('keywords', local_var_params['keywords'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + if 'sort_by' in local_var_params and local_var_params['sort_by'] is not None: # noqa: E501 + query_params.append(('sort_by', local_var_params['sort_by'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/rewards/activity/activity-list', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListActivitiesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_activity_types(self, **kwargs): # noqa: E501 + """Activity type list # noqa: E501 + + Query all activity types supported by Activity Center # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_activity_types(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ListActivityTypesResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_activity_types_with_http_info(**kwargs) # noqa: E501 + + def list_activity_types_with_http_info(self, **kwargs): # noqa: E501 + """Activity type list # noqa: E501 + + Query all activity types supported by Activity Center # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_activity_types_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ListActivityTypesResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_activity_types" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/rewards/activity/activity-type', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListActivityTypesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/collateral_loan_api.py b/gate_api/api/alpha_api.py similarity index 64% rename from gate_api/api/collateral_loan_api.py rename to gate_api/api/alpha_api.py index a96b3750..e5665220 100644 --- a/gate_api/api/collateral_loan_api.py +++ b/gate_api/api/alpha_api.py @@ -24,7 +24,7 @@ ) -class CollateralLoanApi(object): +class AlphaApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -36,19 +36,16 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def list_collateral_loan_orders(self, **kwargs): # noqa: E501 - """Query collateral loan order list # noqa: E501 + def list_alpha_accounts(self, **kwargs): # noqa: E501 + """Alpha Account API # noqa: E501 + Query position assets # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_collateral_loan_orders(async_req=True) + >>> thread = api.list_alpha_accounts(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int page: Page number - :param int limit: Maximum number of records returned in a single list - :param str collateral_currency: Collateral currency - :param str borrow_currency: Borrowed currency :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -56,26 +53,23 @@ def list_collateral_loan_orders(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.CollateralOrder] + :rtype: list[gate_api.AccountsResponse] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_collateral_loan_orders_with_http_info(**kwargs) # noqa: E501 + return self.list_alpha_accounts_with_http_info(**kwargs) # noqa: E501 - def list_collateral_loan_orders_with_http_info(self, **kwargs): # noqa: E501 - """Query collateral loan order list # noqa: E501 + def list_alpha_accounts_with_http_info(self, **kwargs): # noqa: E501 + """Alpha Account API # noqa: E501 + Query position assets # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_collateral_loan_orders_with_http_info(async_req=True) + >>> thread = api.list_alpha_accounts_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int page: Page number - :param int limit: Maximum number of records returned in a single list - :param str collateral_currency: Collateral currency - :param str borrow_currency: Borrowed currency :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -85,7 +79,7 @@ def list_collateral_loan_orders_with_http_info(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.CollateralOrder], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.AccountsResponse], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -93,10 +87,6 @@ def list_collateral_loan_orders_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ - 'page', - 'limit', - 'collateral_currency', - 'borrow_currency' ] all_params.extend( [ @@ -111,30 +101,16 @@ def list_collateral_loan_orders_with_http_info(self, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_collateral_loan_orders" % k + " to method list_alpha_accounts" % k ) local_var_params[k] = v del local_var_params['kwargs'] - if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `page` when calling `list_collateral_loan_orders`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_collateral_loan_orders`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_collateral_loan_orders`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'collateral_currency' in local_var_params and local_var_params['collateral_currency'] is not None: # noqa: E501 - query_params.append(('collateral_currency', local_var_params['collateral_currency'])) # noqa: E501 - if 'borrow_currency' in local_var_params and local_var_params['borrow_currency'] is not None: # noqa: E501 - query_params.append(('borrow_currency', local_var_params['borrow_currency'])) # noqa: E501 header_params = {} @@ -150,14 +126,14 @@ def list_collateral_loan_orders_with_http_info(self, **kwargs): # noqa: E501 auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/loan/collateral/orders', 'GET', + '/alpha/accounts', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[CollateralOrder]', # noqa: E501 + response_type='list[AccountsResponse]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -165,132 +141,20 @@ def list_collateral_loan_orders_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_collateral_loan(self, create_collateral_order, **kwargs): # noqa: E501 - """Place collateral loan order # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_collateral_loan(create_collateral_order, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param CreateCollateralOrder create_collateral_order: (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :rtype: gate_api.OrderResp - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.create_collateral_loan_with_http_info(create_collateral_order, **kwargs) # noqa: E501 - - def create_collateral_loan_with_http_info(self, create_collateral_order, **kwargs): # noqa: E501 - """Place collateral loan order # noqa: E501 + def list_alpha_account_book(self, _from, **kwargs): # noqa: E501 + """Alpha Account Transaction History API # noqa: E501 + Query asset transactions # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_collateral_loan_with_http_info(create_collateral_order, async_req=True) + >>> thread = api.list_alpha_account_book(_from, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param CreateCollateralOrder create_collateral_order: (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :rtype: tuple(gate_api.OrderResp, status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = [ - 'create_collateral_order' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout' - ] - ) - - for k, v in six.iteritems(local_var_params['kwargs']): - if k not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_collateral_loan" % k - ) - local_var_params[k] = v - del local_var_params['kwargs'] - # verify the required parameter 'create_collateral_order' is set - if self.api_client.client_side_validation and ('create_collateral_order' not in local_var_params or # noqa: E501 - local_var_params['create_collateral_order'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `create_collateral_order` when calling `create_collateral_loan`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'create_collateral_order' in local_var_params: - body_params = local_var_params['create_collateral_order'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiv4'] # noqa: E501 - - return self.api_client.call_api( - '/loan/collateral/orders', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OrderResp', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_collateral_loan_order_detail(self, order_id, **kwargs): # noqa: E501 - """Query single order details # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_collateral_loan_order_detail(order_id, async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param int order_id: Order ID returned when order is successfully created (required) + :param int _from: Start timestamp for the query (required) + :param int to: End timestamp for the query, defaults to current time if not specified + :param int page: Page number + :param int limit: Maximum 100 items per page :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -298,23 +162,27 @@ def get_collateral_loan_order_detail(self, order_id, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.CollateralOrder + :rtype: list[gate_api.AccountBookResponse] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_collateral_loan_order_detail_with_http_info(order_id, **kwargs) # noqa: E501 + return self.list_alpha_account_book_with_http_info(_from, **kwargs) # noqa: E501 - def get_collateral_loan_order_detail_with_http_info(self, order_id, **kwargs): # noqa: E501 - """Query single order details # noqa: E501 + def list_alpha_account_book_with_http_info(self, _from, **kwargs): # noqa: E501 + """Alpha Account Transaction History API # noqa: E501 + Query asset transactions # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_collateral_loan_order_detail_with_http_info(order_id, async_req=True) + >>> thread = api.list_alpha_account_book_with_http_info(_from, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int order_id: Order ID returned when order is successfully created (required) + :param int _from: Start timestamp for the query (required) + :param int to: End timestamp for the query, defaults to current time if not specified + :param int page: Page number + :param int limit: Maximum 100 items per page :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -324,7 +192,7 @@ def get_collateral_loan_order_detail_with_http_info(self, order_id, **kwargs): number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.CollateralOrder, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.AccountBookResponse], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -332,7 +200,10 @@ def get_collateral_loan_order_detail_with_http_info(self, order_id, **kwargs): local_var_params = locals() all_params = [ - 'order_id' + '_from', + 'to', + 'page', + 'limit' ] all_params.extend( [ @@ -347,22 +218,28 @@ def get_collateral_loan_order_detail_with_http_info(self, order_id, **kwargs): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_collateral_loan_order_detail" % k + " to method list_alpha_account_book" % k ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `get_collateral_loan_order_detail`") # noqa: E501 + # verify the required parameter '_from' is set + if self.api_client.client_side_validation and ('_from' not in local_var_params or # noqa: E501 + local_var_params['_from'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `_from` when calling `list_alpha_account_book`") # noqa: E501 collection_formats = {} path_params = {} - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 query_params = [] + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 header_params = {} @@ -378,14 +255,14 @@ def get_collateral_loan_order_detail_with_http_info(self, order_id, **kwargs): auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/loan/collateral/orders/{order_id}', 'GET', + '/alpha/account_book', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='CollateralOrder', # noqa: E501 + response_type='list[AccountBookResponse]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -393,16 +270,17 @@ def get_collateral_loan_order_detail_with_http_info(self, order_id, **kwargs): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def repay_collateral_loan(self, repay_loan, **kwargs): # noqa: E501 - """Collateral loan repayment # noqa: E501 + def quote_alpha_order(self, quote_request, **kwargs): # noqa: E501 + """Alpha Quote API # noqa: E501 + The quote_id returned by the price inquiry interface is valid for one minute; an order must be placed within this minute. If it times out, a new price inquiry is required. Rate-limited at 10 requests per second per user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.repay_collateral_loan(repay_loan, async_req=True) + >>> thread = api.quote_alpha_order(quote_request, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param RepayLoan repay_loan: (required) + :param QuoteRequest quote_request: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -410,23 +288,24 @@ def repay_collateral_loan(self, repay_loan, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.RepayResp + :rtype: gate_api.QuoteResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.repay_collateral_loan_with_http_info(repay_loan, **kwargs) # noqa: E501 + return self.quote_alpha_order_with_http_info(quote_request, **kwargs) # noqa: E501 - def repay_collateral_loan_with_http_info(self, repay_loan, **kwargs): # noqa: E501 - """Collateral loan repayment # noqa: E501 + def quote_alpha_order_with_http_info(self, quote_request, **kwargs): # noqa: E501 + """Alpha Quote API # noqa: E501 + The quote_id returned by the price inquiry interface is valid for one minute; an order must be placed within this minute. If it times out, a new price inquiry is required. Rate-limited at 10 requests per second per user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.repay_collateral_loan_with_http_info(repay_loan, async_req=True) + >>> thread = api.quote_alpha_order_with_http_info(quote_request, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param RepayLoan repay_loan: (required) + :param QuoteRequest quote_request: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -436,7 +315,7 @@ def repay_collateral_loan_with_http_info(self, repay_loan, **kwargs): # noqa: E number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.RepayResp, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.QuoteResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -444,7 +323,7 @@ def repay_collateral_loan_with_http_info(self, repay_loan, **kwargs): # noqa: E local_var_params = locals() all_params = [ - 'repay_loan' + 'quote_request' ] all_params.extend( [ @@ -459,14 +338,14 @@ def repay_collateral_loan_with_http_info(self, repay_loan, **kwargs): # noqa: E if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method repay_collateral_loan" % k + " to method quote_alpha_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'repay_loan' is set - if self.api_client.client_side_validation and ('repay_loan' not in local_var_params or # noqa: E501 - local_var_params['repay_loan'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `repay_loan` when calling `repay_collateral_loan`") # noqa: E501 + # verify the required parameter 'quote_request' is set + if self.api_client.client_side_validation and ('quote_request' not in local_var_params or # noqa: E501 + local_var_params['quote_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `quote_request` when calling `quote_alpha_order`") # noqa: E501 collection_formats = {} @@ -480,8 +359,8 @@ def repay_collateral_loan_with_http_info(self, repay_loan, **kwargs): # noqa: E local_var_files = {} body_params = None - if 'repay_loan' in local_var_params: - body_params = local_var_params['repay_loan'] + if 'quote_request' in local_var_params: + body_params = local_var_params['quote_request'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -494,14 +373,14 @@ def repay_collateral_loan_with_http_info(self, repay_loan, **kwargs): # noqa: E auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/loan/collateral/repay', 'POST', + '/alpha/quote', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='RepayResp', # noqa: E501 + response_type='QuoteResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -509,22 +388,22 @@ def repay_collateral_loan_with_http_info(self, repay_loan, **kwargs): # noqa: E _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_repay_records(self, source, **kwargs): # noqa: E501 - """Query collateral loan repayment records # noqa: E501 + def list_alpha_order(self, **kwargs): # noqa: E501 + """Alpha Order List API # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_repay_records(source, async_req=True) + >>> thread = api.list_alpha_order(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str source: Operation type: repay - Regular repayment, liquidate - Liquidation (required) - :param str borrow_currency: Borrowed currency - :param str collateral_currency: Collateral currency + :param str currency: Trading symbol + :param str side: Buy or sell orders - buy - sell + :param int status: Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed + :param int _from: Start time for order query + :param int to: End time for order query, defaults to current time if not specified + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 :param int page: Page number - :param int limit: Maximum number of records returned in a single list - :param int _from: Start timestamp for the query - :param int to: End timestamp for the query, defaults to current time if not specified :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -532,29 +411,29 @@ def list_repay_records(self, source, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.RepayRecord] + :rtype: list[gate_api.OrderResponse] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_repay_records_with_http_info(source, **kwargs) # noqa: E501 + return self.list_alpha_order_with_http_info(**kwargs) # noqa: E501 - def list_repay_records_with_http_info(self, source, **kwargs): # noqa: E501 - """Query collateral loan repayment records # noqa: E501 + def list_alpha_order_with_http_info(self, **kwargs): # noqa: E501 + """Alpha Order List API # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_repay_records_with_http_info(source, async_req=True) + >>> thread = api.list_alpha_order_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str source: Operation type: repay - Regular repayment, liquidate - Liquidation (required) - :param str borrow_currency: Borrowed currency - :param str collateral_currency: Collateral currency + :param str currency: Trading symbol + :param str side: Buy or sell orders - buy - sell + :param int status: Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed + :param int _from: Start time for order query + :param int to: End time for order query, defaults to current time if not specified + :param int limit: Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 :param int page: Page number - :param int limit: Maximum number of records returned in a single list - :param int _from: Start timestamp for the query - :param int to: End timestamp for the query, defaults to current time if not specified :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -564,7 +443,7 @@ def list_repay_records_with_http_info(self, source, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.RepayRecord], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.OrderResponse], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -572,13 +451,13 @@ def list_repay_records_with_http_info(self, source, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ - 'source', - 'borrow_currency', - 'collateral_currency', - 'page', - 'limit', + 'currency', + 'side', + 'status', '_from', - 'to' + 'to', + 'limit', + 'page' ] all_params.extend( [ @@ -593,40 +472,36 @@ def list_repay_records_with_http_info(self, source, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_repay_records" % k + " to method list_alpha_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'source' is set - if self.api_client.client_side_validation and ('source' not in local_var_params or # noqa: E501 - local_var_params['source'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `source` when calling `list_repay_records`") # noqa: E501 - if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `page` when calling `list_repay_records`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_repay_records`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_alpha_order`, must be a value less than or equal to `100`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_repay_records`, must be a value greater than or equal to `1`") # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_alpha_order`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page` when calling `list_alpha_order`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if 'source' in local_var_params and local_var_params['source'] is not None: # noqa: E501 - query_params.append(('source', local_var_params['source'])) # noqa: E501 - if 'borrow_currency' in local_var_params and local_var_params['borrow_currency'] is not None: # noqa: E501 - query_params.append(('borrow_currency', local_var_params['borrow_currency'])) # noqa: E501 - if 'collateral_currency' in local_var_params and local_var_params['collateral_currency'] is not None: # noqa: E501 - query_params.append(('collateral_currency', local_var_params['collateral_currency'])) # noqa: E501 - if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 + query_params.append(('currency', local_var_params['currency'])) # noqa: E501 + if 'side' in local_var_params and local_var_params['side'] is not None: # noqa: E501 + query_params.append(('side', local_var_params['side'])) # noqa: E501 + if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + query_params.append(('status', local_var_params['status'])) # noqa: E501 if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 query_params.append(('from', local_var_params['_from'])) # noqa: E501 if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 header_params = {} @@ -642,14 +517,14 @@ def list_repay_records_with_http_info(self, source, **kwargs): # noqa: E501 auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/loan/collateral/repay_records', 'GET', + '/alpha/orders', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[RepayRecord]', # noqa: E501 + response_type='list[OrderResponse]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -657,21 +532,17 @@ def list_repay_records_with_http_info(self, source, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_collateral_records(self, **kwargs): # noqa: E501 - """Query collateral adjustment records # noqa: E501 + def place_alpha_order(self, place_order_request, **kwargs): # noqa: E501 + """Alpha Order API # noqa: E501 + Order placement interface, rate-limited at 5 requests per second per user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_collateral_records(async_req=True) + >>> thread = api.place_alpha_order(place_order_request, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int page: Page number - :param int limit: Maximum number of records returned in a single list - :param int _from: Start timestamp for the query - :param int to: End timestamp for the query, defaults to current time if not specified - :param str borrow_currency: Borrowed currency - :param str collateral_currency: Collateral currency + :param PlaceOrderRequest place_order_request: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -679,28 +550,24 @@ def list_collateral_records(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.CollateralRecord] + :rtype: gate_api.PlaceOrderResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_collateral_records_with_http_info(**kwargs) # noqa: E501 + return self.place_alpha_order_with_http_info(place_order_request, **kwargs) # noqa: E501 - def list_collateral_records_with_http_info(self, **kwargs): # noqa: E501 - """Query collateral adjustment records # noqa: E501 + def place_alpha_order_with_http_info(self, place_order_request, **kwargs): # noqa: E501 + """Alpha Order API # noqa: E501 + Order placement interface, rate-limited at 5 requests per second per user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_collateral_records_with_http_info(async_req=True) + >>> thread = api.place_alpha_order_with_http_info(place_order_request, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int page: Page number - :param int limit: Maximum number of records returned in a single list - :param int _from: Start timestamp for the query - :param int to: End timestamp for the query, defaults to current time if not specified - :param str borrow_currency: Borrowed currency - :param str collateral_currency: Collateral currency + :param PlaceOrderRequest place_order_request: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -710,7 +577,7 @@ def list_collateral_records_with_http_info(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.CollateralRecord], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.PlaceOrderResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -718,12 +585,7 @@ def list_collateral_records_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ - 'page', - 'limit', - '_from', - 'to', - 'borrow_currency', - 'collateral_currency' + 'place_order_request' ] all_params.extend( [ @@ -738,34 +600,20 @@ def list_collateral_records_with_http_info(self, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_collateral_records" % k + " to method place_alpha_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] + # verify the required parameter 'place_order_request' is set + if self.api_client.client_side_validation and ('place_order_request' not in local_var_params or # noqa: E501 + local_var_params['place_order_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `place_order_request` when calling `place_alpha_order`") # noqa: E501 - if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `page` when calling `list_collateral_records`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_collateral_records`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_collateral_records`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 - query_params.append(('from', local_var_params['_from'])) # noqa: E501 - if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 - query_params.append(('to', local_var_params['to'])) # noqa: E501 - if 'borrow_currency' in local_var_params and local_var_params['borrow_currency'] is not None: # noqa: E501 - query_params.append(('borrow_currency', local_var_params['borrow_currency'])) # noqa: E501 - if 'collateral_currency' in local_var_params and local_var_params['collateral_currency'] is not None: # noqa: E501 - query_params.append(('collateral_currency', local_var_params['collateral_currency'])) # noqa: E501 header_params = {} @@ -773,22 +621,28 @@ def list_collateral_records_with_http_info(self, **kwargs): # noqa: E501 local_var_files = {} body_params = None + if 'place_order_request' in local_var_params: + body_params = local_var_params['place_order_request'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/loan/collateral/collaterals', 'GET', + '/alpha/orders', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[CollateralRecord]', # noqa: E501 + response_type='PlaceOrderResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -796,16 +650,16 @@ def list_collateral_records_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def operate_collateral(self, collateral_align, **kwargs): # noqa: E501 - """Increase or redeem collateral # noqa: E501 + def get_alpha_order(self, order_id, **kwargs): # noqa: E501 + """Alpha Single Order Query API # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.operate_collateral(collateral_align, async_req=True) + >>> thread = api.get_alpha_order(order_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param CollateralAlign collateral_align: (required) + :param str order_id: Order ID (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -813,23 +667,23 @@ def operate_collateral(self, collateral_align, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: None + :rtype: gate_api.OrderResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.operate_collateral_with_http_info(collateral_align, **kwargs) # noqa: E501 + return self.get_alpha_order_with_http_info(order_id, **kwargs) # noqa: E501 - def operate_collateral_with_http_info(self, collateral_align, **kwargs): # noqa: E501 - """Increase or redeem collateral # noqa: E501 + def get_alpha_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Alpha Single Order Query API # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.operate_collateral_with_http_info(collateral_align, async_req=True) + >>> thread = api.get_alpha_order_with_http_info(order_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param CollateralAlign collateral_align: (required) + :param str order_id: Order ID (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -839,7 +693,7 @@ def operate_collateral_with_http_info(self, collateral_align, **kwargs): # noqa number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: None + :rtype: tuple(gate_api.OrderResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -847,7 +701,7 @@ def operate_collateral_with_http_info(self, collateral_align, **kwargs): # noqa local_var_params = locals() all_params = [ - 'collateral_align' + 'order_id' ] all_params.extend( [ @@ -862,20 +716,22 @@ def operate_collateral_with_http_info(self, collateral_align, **kwargs): # noqa if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method operate_collateral" % k + " to method get_alpha_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'collateral_align' is set - if self.api_client.client_side_validation and ('collateral_align' not in local_var_params or # noqa: E501 - local_var_params['collateral_align'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `collateral_align` when calling `operate_collateral`") # noqa: E501 + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `get_alpha_order`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] + if 'order_id' in local_var_params and local_var_params['order_id'] is not None: # noqa: E501 + query_params.append(('order_id', local_var_params['order_id'])) # noqa: E501 header_params = {} @@ -883,24 +739,22 @@ def operate_collateral_with_http_info(self, collateral_align, **kwargs): # noqa local_var_files = {} body_params = None - if 'collateral_align' in local_var_params: - body_params = local_var_params['collateral_align'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/loan/collateral/collaterals', 'POST', + '/alpha/order', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='OrderResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -908,15 +762,19 @@ def operate_collateral_with_http_info(self, collateral_align, **kwargs): # noqa _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_user_total_amount(self, **kwargs): # noqa: E501 - """Query user's total borrowing and collateral amount # noqa: E501 + def list_alpha_currencies(self, **kwargs): # noqa: E501 + """Query currency information # noqa: E501 + When currency is provided, query and return specified currency information; when currency is not provided, return paginated currency list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_total_amount(async_req=True) + >>> thread = api.list_alpha_currencies(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously + :param str currency: Query currency information by currency symbol + :param int limit: Maximum number of records returned in a single list + :param int page: Page number :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -924,22 +782,26 @@ def get_user_total_amount(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.UserTotalAmount + :rtype: list[gate_api.AlphaCurrency] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_user_total_amount_with_http_info(**kwargs) # noqa: E501 + return self.list_alpha_currencies_with_http_info(**kwargs) # noqa: E501 - def get_user_total_amount_with_http_info(self, **kwargs): # noqa: E501 - """Query user's total borrowing and collateral amount # noqa: E501 + def list_alpha_currencies_with_http_info(self, **kwargs): # noqa: E501 + """Query currency information # noqa: E501 + When currency is provided, query and return specified currency information; when currency is not provided, return paginated currency list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_total_amount_with_http_info(async_req=True) + >>> thread = api.list_alpha_currencies_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously + :param str currency: Query currency information by currency symbol + :param int limit: Maximum number of records returned in a single list + :param int page: Page number :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -949,7 +811,7 @@ def get_user_total_amount_with_http_info(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.UserTotalAmount, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.AlphaCurrency], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -957,6 +819,9 @@ def get_user_total_amount_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ + 'currency', + 'limit', + 'page' ] all_params.extend( [ @@ -971,16 +836,28 @@ def get_user_total_amount_with_http_info(self, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_user_total_amount" % k + " to method list_alpha_currencies" % k ) local_var_params[k] = v del local_var_params['kwargs'] + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_alpha_currencies`, must be a value less than or equal to `100`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_alpha_currencies`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page` when calling `list_alpha_currencies`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] + if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 + query_params.append(('currency', local_var_params['currency'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 header_params = {} @@ -993,17 +870,17 @@ def get_user_total_amount_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['apiv4'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/loan/collateral/total_amount', 'GET', + '/alpha/currencies', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='UserTotalAmount', # noqa: E501 + response_type='list[AlphaCurrency]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -1011,17 +888,19 @@ def get_user_total_amount_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_user_ltv_info(self, collateral_currency, borrow_currency, **kwargs): # noqa: E501 - """Query user's collateralization ratio and remaining borrowable currencies # noqa: E501 + def list_alpha_tickers(self, **kwargs): # noqa: E501 + """Query currency ticker # noqa: E501 + When currency is provided, returns ticker information for the specified currency. When currency is not provided, returns paginated ticker list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_ltv_info(collateral_currency, borrow_currency, async_req=True) + >>> thread = api.list_alpha_tickers(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str collateral_currency: Collateral currency (required) - :param str borrow_currency: Borrowed currency (required) + :param str currency: Query by specified currency name + :param int limit: Maximum number of records returned in a single list + :param int page: Page number :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1029,24 +908,26 @@ def get_user_ltv_info(self, collateral_currency, borrow_currency, **kwargs): # number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.UserLtvInfo + :rtype: list[gate_api.AlphaTicker] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_user_ltv_info_with_http_info(collateral_currency, borrow_currency, **kwargs) # noqa: E501 + return self.list_alpha_tickers_with_http_info(**kwargs) # noqa: E501 - def get_user_ltv_info_with_http_info(self, collateral_currency, borrow_currency, **kwargs): # noqa: E501 - """Query user's collateralization ratio and remaining borrowable currencies # noqa: E501 + def list_alpha_tickers_with_http_info(self, **kwargs): # noqa: E501 + """Query currency ticker # noqa: E501 + When currency is provided, returns ticker information for the specified currency. When currency is not provided, returns paginated ticker list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_ltv_info_with_http_info(collateral_currency, borrow_currency, async_req=True) + >>> thread = api.list_alpha_tickers_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str collateral_currency: Collateral currency (required) - :param str borrow_currency: Borrowed currency (required) + :param str currency: Query by specified currency name + :param int limit: Maximum number of records returned in a single list + :param int page: Page number :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1056,7 +937,7 @@ def get_user_ltv_info_with_http_info(self, collateral_currency, borrow_currency, number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.UserLtvInfo, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.AlphaTicker], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -1064,8 +945,9 @@ def get_user_ltv_info_with_http_info(self, collateral_currency, borrow_currency, local_var_params = locals() all_params = [ - 'collateral_currency', - 'borrow_currency' + 'currency', + 'limit', + 'page' ] all_params.extend( [ @@ -1080,28 +962,28 @@ def get_user_ltv_info_with_http_info(self, collateral_currency, borrow_currency, if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_user_ltv_info" % k + " to method list_alpha_tickers" % k ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'collateral_currency' is set - if self.api_client.client_side_validation and ('collateral_currency' not in local_var_params or # noqa: E501 - local_var_params['collateral_currency'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `collateral_currency` when calling `get_user_ltv_info`") # noqa: E501 - # verify the required parameter 'borrow_currency' is set - if self.api_client.client_side_validation and ('borrow_currency' not in local_var_params or # noqa: E501 - local_var_params['borrow_currency'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `borrow_currency` when calling `get_user_ltv_info`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_alpha_tickers`, must be a value less than or equal to `100`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_alpha_tickers`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page` when calling `list_alpha_tickers`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if 'collateral_currency' in local_var_params and local_var_params['collateral_currency'] is not None: # noqa: E501 - query_params.append(('collateral_currency', local_var_params['collateral_currency'])) # noqa: E501 - if 'borrow_currency' in local_var_params and local_var_params['borrow_currency'] is not None: # noqa: E501 - query_params.append(('borrow_currency', local_var_params['borrow_currency'])) # noqa: E501 + if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 + query_params.append(('currency', local_var_params['currency'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 header_params = {} @@ -1114,17 +996,17 @@ def get_user_ltv_info_with_http_info(self, collateral_currency, borrow_currency, ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['apiv4'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/loan/collateral/ltv', 'GET', + '/alpha/tickers', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='UserLtvInfo', # noqa: E501 + response_type='list[AlphaTicker]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -1132,16 +1014,20 @@ def get_user_ltv_info_with_http_info(self, collateral_currency, borrow_currency, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_collateral_currencies(self, **kwargs): # noqa: E501 - """Query supported borrowing and collateral currencies # noqa: E501 + def list_alpha_tokens(self, **kwargs): # noqa: E501 + """Query Token Information # noqa: E501 + Supports passing chain, platform, and address # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_collateral_currencies(async_req=True) + >>> thread = api.list_alpha_tokens(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str loan_currency: Parameter loan_currency. If omitted, returns all supported borrowing currencies; if provided, returns the array of collateral currencies supported for that borrowing currency + :param str chain: Query Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer + :param str launch_platform: Query Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals + :param str address: Query Token List by Contract Address + :param int page: Page number :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1149,23 +1035,27 @@ def list_collateral_currencies(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.CollateralLoanCurrency] + :rtype: list[gate_api.Tokens] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_collateral_currencies_with_http_info(**kwargs) # noqa: E501 + return self.list_alpha_tokens_with_http_info(**kwargs) # noqa: E501 - def list_collateral_currencies_with_http_info(self, **kwargs): # noqa: E501 - """Query supported borrowing and collateral currencies # noqa: E501 + def list_alpha_tokens_with_http_info(self, **kwargs): # noqa: E501 + """Query Token Information # noqa: E501 + Supports passing chain, platform, and address # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_collateral_currencies_with_http_info(async_req=True) + >>> thread = api.list_alpha_tokens_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str loan_currency: Parameter loan_currency. If omitted, returns all supported borrowing currencies; if provided, returns the array of collateral currencies supported for that borrowing currency + :param str chain: Query Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer + :param str launch_platform: Query Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals + :param str address: Query Token List by Contract Address + :param int page: Page number :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1175,7 +1065,7 @@ def list_collateral_currencies_with_http_info(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.CollateralLoanCurrency], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.Tokens], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -1183,7 +1073,10 @@ def list_collateral_currencies_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ - 'loan_currency' + 'chain', + 'launch_platform', + 'address', + 'page' ] all_params.extend( [ @@ -1198,18 +1091,26 @@ def list_collateral_currencies_with_http_info(self, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_collateral_currencies" % k + " to method list_alpha_tokens" % k ) local_var_params[k] = v del local_var_params['kwargs'] + if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page` when calling `list_alpha_tokens`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if 'loan_currency' in local_var_params and local_var_params['loan_currency'] is not None: # noqa: E501 - query_params.append(('loan_currency', local_var_params['loan_currency'])) # noqa: E501 + if 'chain' in local_var_params and local_var_params['chain'] is not None: # noqa: E501 + query_params.append(('chain', local_var_params['chain'])) # noqa: E501 + if 'launch_platform' in local_var_params and local_var_params['launch_platform'] is not None: # noqa: E501 + query_params.append(('launch_platform', local_var_params['launch_platform'])) # noqa: E501 + if 'address' in local_var_params and local_var_params['address'] is not None: # noqa: E501 + query_params.append(('address', local_var_params['address'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 header_params = {} @@ -1225,14 +1126,14 @@ def list_collateral_currencies_with_http_info(self, **kwargs): # noqa: E501 auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/loan/collateral/currencies', 'GET', + '/alpha/tokens', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[CollateralLoanCurrency]', # noqa: E501 + response_type='list[Tokens]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 diff --git a/gate_api/api/assetswap_api.py b/gate_api/api/assetswap_api.py new file mode 100644 index 00000000..0058cac6 --- /dev/null +++ b/gate_api/api/assetswap_api.py @@ -0,0 +1,857 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AssetswapApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def list_asset_swap_assets(self, **kwargs): # noqa: E501 + """Portfolio optimization — currency list # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_asset_swap_assets(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseAssetSwapListAssets + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_asset_swap_assets_with_http_info(**kwargs) # noqa: E501 + + def list_asset_swap_assets_with_http_info(self, **kwargs): # noqa: E501 + """Portfolio optimization — currency list # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_asset_swap_assets_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseAssetSwapListAssets, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_asset_swap_assets" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/asset-swap/asset/list', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseAssetSwapListAssets', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_asset_swap_config(self, **kwargs): # noqa: E501 + """Portfolio optimization — configuration # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_swap_config(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseAssetSwapConfig + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_asset_swap_config_with_http_info(**kwargs) # noqa: E501 + + def get_asset_swap_config_with_http_info(self, **kwargs): # noqa: E501 + """Portfolio optimization — configuration # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_swap_config_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseAssetSwapConfig, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_asset_swap_config" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/asset-swap/config', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseAssetSwapConfig', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def evaluate_asset_swap(self, **kwargs): # noqa: E501 + """Portfolio optimization — valuation # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.evaluate_asset_swap(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int max_evaluate_value: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param str cursor: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int size: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseAssetSwapEvaluate + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.evaluate_asset_swap_with_http_info(**kwargs) # noqa: E501 + + def evaluate_asset_swap_with_http_info(self, **kwargs): # noqa: E501 + """Portfolio optimization — valuation # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.evaluate_asset_swap_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int max_evaluate_value: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param str cursor: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int size: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseAssetSwapEvaluate, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'max_evaluate_value', + 'cursor', + 'size' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method evaluate_asset_swap" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'max_evaluate_value' in local_var_params and local_var_params['max_evaluate_value'] is not None: # noqa: E501 + query_params.append(('max_evaluate_value', local_var_params['max_evaluate_value'])) # noqa: E501 + if 'cursor' in local_var_params and local_var_params['cursor'] is not None: # noqa: E501 + query_params.append(('cursor', local_var_params['cursor'])) # noqa: E501 + if 'size' in local_var_params and local_var_params['size'] is not None: # noqa: E501 + query_params.append(('size', local_var_params['size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/asset-swap/evaluate', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseAssetSwapEvaluate', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_asset_swap_order_v1(self, order_create_v1_req, **kwargs): # noqa: E501 + """Portfolio optimization — place order # noqa: E501 + + Swap several source currencies in the account into the target currency side configuration according to the specified amount. **It is strongly recommended to call** `POST /asset-swap/order/preview` **and `code=0` before placing an official order, and then submit this interface with consistent semantics**. **The request body does not contain `ratio`** - This interface `OrderCreateV1Req` only contains `from` / `to`, and the array elements are all `CreateParam` (**only** `asset` + `amount`). **Do not** pass in `ratio` in the order JSON; the ratio field `ratio` only exists in the preview interface `OrderPreviewV1Req.to` (`PreviewToParam`). **Key differences from the preview interface (error-prone points)** - The `to` array element of this interface is `CreateParam`: **`asset` + `amount` (target side quantity, decimal string)**. - The preview interface `to` is **`asset` + `ratio` (ratio string)**, **the two cannot be mixed**: do not fill in the `ratio` in the preview to the `amount` of the order as it is, and do not use the `amount` of the order as the `ratio` of the preview. **Recommended calling order** 1. `GET /asset-swap/asset/list`: Confirm currency support. 2. `GET /asset-swap/config`: Read `recommend` / `recommend_v2` (such as `schemes` of a strategy under `recommend_v2.market`, use `scheme.name` as the target `asset`, `scheme.ratio` is only used for `to[].ratio` of **preview**). 3. `GET /asset-swap/evaluate` (optional): Refer to the sellable quantity. 4. `POST /asset-swap/order/preview`: `from` and `to` (ratio) construct inquiry. 5. After the preview is successful, map the preview results to the `from`/`to` (**both are amount**) of the order according to the product/server agreement and then call this interface. **Field Convention** - `from`: selling side, each item is `asset` + `amount` (string, decimal, indicating the selling amount of the currency). - `to`: Buy/target side, each item is `asset` + **`amount`** (string, decimal, indicating the amount of the target currency side; the semantics are different from the previewed `ratio`). - This interface only verifies the accuracy and range of the above `amount`; if not satisfied, it returns non-0 `code` and `message`. For the verification rules of `to[].ratio` on the preview side, see the `POST /asset-swap/order/preview` document. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_asset_swap_order_v1(order_create_v1_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OrderCreateV1Req order_create_v1_req: Order request body (`OrderCreateV1Req`). **No `ratio` field**; `from`/`to` items are only `asset` + `amount`. `to` uses the target side **amount** `amount`, which is different from the **ratio** (ratio) semantics of `to` in preview, do not mix them. (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseAssetSwapOrderCreateV1 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_asset_swap_order_v1_with_http_info(order_create_v1_req, **kwargs) # noqa: E501 + + def create_asset_swap_order_v1_with_http_info(self, order_create_v1_req, **kwargs): # noqa: E501 + """Portfolio optimization — place order # noqa: E501 + + Swap several source currencies in the account into the target currency side configuration according to the specified amount. **It is strongly recommended to call** `POST /asset-swap/order/preview` **and `code=0` before placing an official order, and then submit this interface with consistent semantics**. **The request body does not contain `ratio`** - This interface `OrderCreateV1Req` only contains `from` / `to`, and the array elements are all `CreateParam` (**only** `asset` + `amount`). **Do not** pass in `ratio` in the order JSON; the ratio field `ratio` only exists in the preview interface `OrderPreviewV1Req.to` (`PreviewToParam`). **Key differences from the preview interface (error-prone points)** - The `to` array element of this interface is `CreateParam`: **`asset` + `amount` (target side quantity, decimal string)**. - The preview interface `to` is **`asset` + `ratio` (ratio string)**, **the two cannot be mixed**: do not fill in the `ratio` in the preview to the `amount` of the order as it is, and do not use the `amount` of the order as the `ratio` of the preview. **Recommended calling order** 1. `GET /asset-swap/asset/list`: Confirm currency support. 2. `GET /asset-swap/config`: Read `recommend` / `recommend_v2` (such as `schemes` of a strategy under `recommend_v2.market`, use `scheme.name` as the target `asset`, `scheme.ratio` is only used for `to[].ratio` of **preview**). 3. `GET /asset-swap/evaluate` (optional): Refer to the sellable quantity. 4. `POST /asset-swap/order/preview`: `from` and `to` (ratio) construct inquiry. 5. After the preview is successful, map the preview results to the `from`/`to` (**both are amount**) of the order according to the product/server agreement and then call this interface. **Field Convention** - `from`: selling side, each item is `asset` + `amount` (string, decimal, indicating the selling amount of the currency). - `to`: Buy/target side, each item is `asset` + **`amount`** (string, decimal, indicating the amount of the target currency side; the semantics are different from the previewed `ratio`). - This interface only verifies the accuracy and range of the above `amount`; if not satisfied, it returns non-0 `code` and `message`. For the verification rules of `to[].ratio` on the preview side, see the `POST /asset-swap/order/preview` document. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_asset_swap_order_v1_with_http_info(order_create_v1_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OrderCreateV1Req order_create_v1_req: Order request body (`OrderCreateV1Req`). **No `ratio` field**; `from`/`to` items are only `asset` + `amount`. `to` uses the target side **amount** `amount`, which is different from the **ratio** (ratio) semantics of `to` in preview, do not mix them. (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseAssetSwapOrderCreateV1, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_create_v1_req' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_asset_swap_order_v1" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_create_v1_req' is set + if self.api_client.client_side_validation and ('order_create_v1_req' not in local_var_params or # noqa: E501 + local_var_params['order_create_v1_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_create_v1_req` when calling `create_asset_swap_order_v1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'order_create_v1_req' in local_var_params: + body_params = local_var_params['order_create_v1_req'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/asset-swap/order/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseAssetSwapOrderCreateV1', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_asset_swap_orders_v1(self, **kwargs): # noqa: E501 + """Portfolio optimization — order list # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_asset_swap_orders_v1(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int _from: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int to: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int status: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int offset: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int size: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int sort_mode: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int order_by: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseAssetSwapOrderListV1 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_asset_swap_orders_v1_with_http_info(**kwargs) # noqa: E501 + + def list_asset_swap_orders_v1_with_http_info(self, **kwargs): # noqa: E501 + """Portfolio optimization — order list # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_asset_swap_orders_v1_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int _from: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int to: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int status: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int offset: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int size: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int sort_mode: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int order_by: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseAssetSwapOrderListV1, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + '_from', + 'to', + 'status', + 'offset', + 'size', + 'sort_mode', + 'order_by' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_asset_swap_orders_v1" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + query_params.append(('status', local_var_params['status'])) # noqa: E501 + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if 'size' in local_var_params and local_var_params['size'] is not None: # noqa: E501 + query_params.append(('size', local_var_params['size'])) # noqa: E501 + if 'sort_mode' in local_var_params and local_var_params['sort_mode'] is not None: # noqa: E501 + query_params.append(('sort_mode', local_var_params['sort_mode'])) # noqa: E501 + if 'order_by' in local_var_params and local_var_params['order_by'] is not None: # noqa: E501 + query_params.append(('order_by', local_var_params['order_by'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/asset-swap/order/list', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseAssetSwapOrderListV1', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def preview_asset_swap_order_v1(self, order_preview_v1_req, **kwargs): # noqa: E501 + """Portfolio optimization — preview # noqa: E501 + + The transaction and fees are estimated based on the quantity of coins sold and the **target allocation ratio**, and **no orders are written**. When `code=0`, `data` contains estimated `order` and `transaction_fee`. **Key differences from the order interface (error-prone points)** - The `to` array element of this interface is `PreviewToParam`: **`asset` + `ratio` (ratio, decimal string)**, which represents the weight/proportion of the target currency in the portfolio. - The `to` of the order interface `POST /asset-swap/order/create` is **`asset` + `amount` (absolute quantity)**, **not** `ratio`. Callers should never mix the two sets of fields. **How to construct `to`(ratio)** - Prioritize the value from `data.recommend_v2` of `GET /asset-swap/config`: find a certain `RecommendV2Strategy` in the strategy list (such as `name` is `top2`) by grouping key (such as `market`, `faith`, `conservative`), and map its `schemes` to a preview request: - `to[].asset` ← `scheme.name` (target currency symbol) - `to[].ratio` ← `scheme.ratio` (ratio string consistent with configuration) - You can also use the flat map (currency → ratio string) under `recommend` to expand it into a multi-element `to` (one `asset` + `ratio` for each item). - When there are multiple targets, it is recommended that each `ratio` be consistent with the front-end/operation configuration; whether it needs to be summed to 1 is subject to server-side verification. **`from` (sell side)** - Each item is `asset` + `amount` (string, decimal), indicating the amount of the currency participating in the exchange this time. The currency should be within the supported range of `GET /asset-swap/asset/list`; when the magnitude is too small or the market depth is insufficient, a non-0 `code` may be returned (if the price cannot be inquired). **Connection with order placement** - After the preview is successful, convert the preview results allowed by the business into the request body where **`from`/`to` is all amount** required for ordering and then call create (the specific mapping rules are subject to the product documentation or server agreement). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.preview_asset_swap_order_v1(order_preview_v1_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OrderPreviewV1Req order_preview_v1_req: Preview the request body. `to` must be **ratio**; unlike create's **amount** semantics. (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseAssetSwapOrderPreviewV1 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.preview_asset_swap_order_v1_with_http_info(order_preview_v1_req, **kwargs) # noqa: E501 + + def preview_asset_swap_order_v1_with_http_info(self, order_preview_v1_req, **kwargs): # noqa: E501 + """Portfolio optimization — preview # noqa: E501 + + The transaction and fees are estimated based on the quantity of coins sold and the **target allocation ratio**, and **no orders are written**. When `code=0`, `data` contains estimated `order` and `transaction_fee`. **Key differences from the order interface (error-prone points)** - The `to` array element of this interface is `PreviewToParam`: **`asset` + `ratio` (ratio, decimal string)**, which represents the weight/proportion of the target currency in the portfolio. - The `to` of the order interface `POST /asset-swap/order/create` is **`asset` + `amount` (absolute quantity)**, **not** `ratio`. Callers should never mix the two sets of fields. **How to construct `to`(ratio)** - Prioritize the value from `data.recommend_v2` of `GET /asset-swap/config`: find a certain `RecommendV2Strategy` in the strategy list (such as `name` is `top2`) by grouping key (such as `market`, `faith`, `conservative`), and map its `schemes` to a preview request: - `to[].asset` ← `scheme.name` (target currency symbol) - `to[].ratio` ← `scheme.ratio` (ratio string consistent with configuration) - You can also use the flat map (currency → ratio string) under `recommend` to expand it into a multi-element `to` (one `asset` + `ratio` for each item). - When there are multiple targets, it is recommended that each `ratio` be consistent with the front-end/operation configuration; whether it needs to be summed to 1 is subject to server-side verification. **`from` (sell side)** - Each item is `asset` + `amount` (string, decimal), indicating the amount of the currency participating in the exchange this time. The currency should be within the supported range of `GET /asset-swap/asset/list`; when the magnitude is too small or the market depth is insufficient, a non-0 `code` may be returned (if the price cannot be inquired). **Connection with order placement** - After the preview is successful, convert the preview results allowed by the business into the request body where **`from`/`to` is all amount** required for ordering and then call create (the specific mapping rules are subject to the product documentation or server agreement). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.preview_asset_swap_order_v1_with_http_info(order_preview_v1_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OrderPreviewV1Req order_preview_v1_req: Preview the request body. `to` must be **ratio**; unlike create's **amount** semantics. (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseAssetSwapOrderPreviewV1, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_preview_v1_req' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method preview_asset_swap_order_v1" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_preview_v1_req' is set + if self.api_client.client_side_validation and ('order_preview_v1_req' not in local_var_params or # noqa: E501 + local_var_params['order_preview_v1_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_preview_v1_req` when calling `preview_asset_swap_order_v1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'order_preview_v1_req' in local_var_params: + body_params = local_var_params['order_preview_v1_req'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/asset-swap/order/preview', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseAssetSwapOrderPreviewV1', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_asset_swap_order_v1(self, order_id, **kwargs): # noqa: E501 + """Portfolio optimization — query order # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_swap_order_v1(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseAssetSwapOrderQueryV1 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_asset_swap_order_v1_with_http_info(order_id, **kwargs) # noqa: E501 + + def get_asset_swap_order_v1_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Portfolio optimization — query order # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_asset_swap_order_v1_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseAssetSwapOrderQueryV1, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_asset_swap_order_v1" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `get_asset_swap_order_v1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/asset-swap/order/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseAssetSwapOrderQueryV1', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/bot_api.py b/gate_api/api/bot_api.py new file mode 100644 index 00000000..da287ead --- /dev/null +++ b/gate_api/api/bot_api.py @@ -0,0 +1,1469 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class BotApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_ai_hub_strategy_recommend(self, **kwargs): # noqa: E501 + """Get AIHub strategy recommendations # noqa: E501 + + The only formal interface for the discover domain. Support scenarios: - `top1` - `bundle` - `filter` - `refresh` Constraints: - The active recommendation pool only contains `spot_grid`, `futures_grid`, `spot_martingale` - Can return but do not actively recommend `infinite_grid`, `margin_grid` - `contract_martingale`, `smart-position`, `spot-future-arbitrage` must not be returned - When `scene=filter` is used, only filtering by `market`, `backtest_apr_gte`, `max_drawdown_lte` is allowed - `scene=refresh` inherits the refresh context through `refresh_recommendation_id`; the official minimum format only requires `strategy_type|market` - If the upstream directly transmits the previous recommendation `recommendation_id`, the third paragraph `backtest_id` will currently be ignored. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ai_hub_strategy_recommend(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str market: Trading pair, such as `BTC_USDT` + :param str strategy_type: Recommended target policy type; `contract_martingale` not allowed + :param str direction: Market direction + :param str invest_amount: Investment amount, string transparent transmission + :param str scene: Recommended scenario; when empty, bot-service can automatically infer according to the implementation logic. + :param str refresh_recommendation_id: It is recommended to refresh the context. Used when `scene=refresh` is used; when `scene` is empty but the field exists, bot-service will also automatically determine as `refresh`. The official minimum format is `strategy_type|market`; if the `recommendation_id` of the previous recommendation is directly passed through, the third paragraph `backtest_id` will be ignored. + :param int limit: Return quantity; when `scene=filter` is used, the actual results are up to 10 + :param str max_drawdown_lte: Maximum drawdown limit + :param str backtest_apr_gte: Backtest annualized lower limit + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AIHubDiscoverSuccessResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_ai_hub_strategy_recommend_with_http_info(**kwargs) # noqa: E501 + + def get_ai_hub_strategy_recommend_with_http_info(self, **kwargs): # noqa: E501 + """Get AIHub strategy recommendations # noqa: E501 + + The only formal interface for the discover domain. Support scenarios: - `top1` - `bundle` - `filter` - `refresh` Constraints: - The active recommendation pool only contains `spot_grid`, `futures_grid`, `spot_martingale` - Can return but do not actively recommend `infinite_grid`, `margin_grid` - `contract_martingale`, `smart-position`, `spot-future-arbitrage` must not be returned - When `scene=filter` is used, only filtering by `market`, `backtest_apr_gte`, `max_drawdown_lte` is allowed - `scene=refresh` inherits the refresh context through `refresh_recommendation_id`; the official minimum format only requires `strategy_type|market` - If the upstream directly transmits the previous recommendation `recommendation_id`, the third paragraph `backtest_id` will currently be ignored. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ai_hub_strategy_recommend_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str market: Trading pair, such as `BTC_USDT` + :param str strategy_type: Recommended target policy type; `contract_martingale` not allowed + :param str direction: Market direction + :param str invest_amount: Investment amount, string transparent transmission + :param str scene: Recommended scenario; when empty, bot-service can automatically infer according to the implementation logic. + :param str refresh_recommendation_id: It is recommended to refresh the context. Used when `scene=refresh` is used; when `scene` is empty but the field exists, bot-service will also automatically determine as `refresh`. The official minimum format is `strategy_type|market`; if the `recommendation_id` of the previous recommendation is directly passed through, the third paragraph `backtest_id` will be ignored. + :param int limit: Return quantity; when `scene=filter` is used, the actual results are up to 10 + :param str max_drawdown_lte: Maximum drawdown limit + :param str backtest_apr_gte: Backtest annualized lower limit + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AIHubDiscoverSuccessResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'market', + 'strategy_type', + 'direction', + 'invest_amount', + 'scene', + 'refresh_recommendation_id', + 'limit', + 'max_drawdown_lte', + 'backtest_apr_gte', + 'x_gate_service_id', + 'x_gate_app_lang', + 'x_request_id', + 'x_trace_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_ai_hub_strategy_recommend" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `get_ai_hub_strategy_recommend`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'market' in local_var_params and local_var_params['market'] is not None: # noqa: E501 + query_params.append(('market', local_var_params['market'])) # noqa: E501 + if 'strategy_type' in local_var_params and local_var_params['strategy_type'] is not None: # noqa: E501 + query_params.append(('strategy_type', local_var_params['strategy_type'])) # noqa: E501 + if 'direction' in local_var_params and local_var_params['direction'] is not None: # noqa: E501 + query_params.append(('direction', local_var_params['direction'])) # noqa: E501 + if 'invest_amount' in local_var_params and local_var_params['invest_amount'] is not None: # noqa: E501 + query_params.append(('invest_amount', local_var_params['invest_amount'])) # noqa: E501 + if 'scene' in local_var_params and local_var_params['scene'] is not None: # noqa: E501 + query_params.append(('scene', local_var_params['scene'])) # noqa: E501 + if 'refresh_recommendation_id' in local_var_params and local_var_params['refresh_recommendation_id'] is not None: # noqa: E501 + query_params.append(('refresh_recommendation_id', local_var_params['refresh_recommendation_id'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'max_drawdown_lte' in local_var_params and local_var_params['max_drawdown_lte'] is not None: # noqa: E501 + query_params.append(('max_drawdown_lte', local_var_params['max_drawdown_lte'])) # noqa: E501 + if 'backtest_apr_gte' in local_var_params and local_var_params['backtest_apr_gte'] is not None: # noqa: E501 + query_params.append(('backtest_apr_gte', local_var_params['backtest_apr_gte'])) # noqa: E501 + + header_params = {} + if 'x_gate_service_id' in local_var_params: + header_params['X-Gate-Service-Id'] = local_var_params['x_gate_service_id'] # noqa: E501 + if 'x_gate_app_lang' in local_var_params: + header_params['X-Gate-AppLang'] = local_var_params['x_gate_app_lang'] # noqa: E501 + if 'x_request_id' in local_var_params: + header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501 + if 'x_trace_id' in local_var_params: + header_params['X-Trace-Id'] = local_var_params['x_trace_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/bot/strategy/recommend', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AIHubDiscoverSuccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def post_ai_hub_spot_grid_create(self, spot_grid_create_request, **kwargs): # noqa: E501 + """Create spot grid # noqa: E501 + + Create a spot grid strategy based on the incoming parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_spot_grid_create(spot_grid_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SpotGridCreateRequest spot_grid_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AIHubCreateSuccessResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.post_ai_hub_spot_grid_create_with_http_info(spot_grid_create_request, **kwargs) # noqa: E501 + + def post_ai_hub_spot_grid_create_with_http_info(self, spot_grid_create_request, **kwargs): # noqa: E501 + """Create spot grid # noqa: E501 + + Create a spot grid strategy based on the incoming parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_spot_grid_create_with_http_info(spot_grid_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SpotGridCreateRequest spot_grid_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AIHubCreateSuccessResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'spot_grid_create_request', + 'x_gate_service_id', + 'x_gate_app_lang', + 'x_request_id', + 'x_trace_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_ai_hub_spot_grid_create" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'spot_grid_create_request' is set + if self.api_client.client_side_validation and ('spot_grid_create_request' not in local_var_params or # noqa: E501 + local_var_params['spot_grid_create_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `spot_grid_create_request` when calling `post_ai_hub_spot_grid_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_gate_service_id' in local_var_params: + header_params['X-Gate-Service-Id'] = local_var_params['x_gate_service_id'] # noqa: E501 + if 'x_gate_app_lang' in local_var_params: + header_params['X-Gate-AppLang'] = local_var_params['x_gate_app_lang'] # noqa: E501 + if 'x_request_id' in local_var_params: + header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501 + if 'x_trace_id' in local_var_params: + header_params['X-Trace-Id'] = local_var_params['x_trace_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'spot_grid_create_request' in local_var_params: + body_params = local_var_params['spot_grid_create_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/bot/spot-grid/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AIHubCreateSuccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def post_ai_hub_margin_grid_create(self, margin_grid_create_request, **kwargs): # noqa: E501 + """Create a lever grid # noqa: E501 + + Create a leverage grid strategy based on the passed parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_margin_grid_create(margin_grid_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param MarginGridCreateRequest margin_grid_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AIHubCreateSuccessResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.post_ai_hub_margin_grid_create_with_http_info(margin_grid_create_request, **kwargs) # noqa: E501 + + def post_ai_hub_margin_grid_create_with_http_info(self, margin_grid_create_request, **kwargs): # noqa: E501 + """Create a lever grid # noqa: E501 + + Create a leverage grid strategy based on the passed parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_margin_grid_create_with_http_info(margin_grid_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param MarginGridCreateRequest margin_grid_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AIHubCreateSuccessResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'margin_grid_create_request', + 'x_gate_service_id', + 'x_gate_app_lang', + 'x_request_id', + 'x_trace_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_ai_hub_margin_grid_create" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'margin_grid_create_request' is set + if self.api_client.client_side_validation and ('margin_grid_create_request' not in local_var_params or # noqa: E501 + local_var_params['margin_grid_create_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `margin_grid_create_request` when calling `post_ai_hub_margin_grid_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_gate_service_id' in local_var_params: + header_params['X-Gate-Service-Id'] = local_var_params['x_gate_service_id'] # noqa: E501 + if 'x_gate_app_lang' in local_var_params: + header_params['X-Gate-AppLang'] = local_var_params['x_gate_app_lang'] # noqa: E501 + if 'x_request_id' in local_var_params: + header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501 + if 'x_trace_id' in local_var_params: + header_params['X-Trace-Id'] = local_var_params['x_trace_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'margin_grid_create_request' in local_var_params: + body_params = local_var_params['margin_grid_create_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/bot/margin-grid/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AIHubCreateSuccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def post_ai_hub_infinite_grid_create(self, infinite_grid_create_request, **kwargs): # noqa: E501 + """Create infinite grid # noqa: E501 + + Create an infinite grid strategy based on passed parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_infinite_grid_create(infinite_grid_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param InfiniteGridCreateRequest infinite_grid_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AIHubCreateSuccessResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.post_ai_hub_infinite_grid_create_with_http_info(infinite_grid_create_request, **kwargs) # noqa: E501 + + def post_ai_hub_infinite_grid_create_with_http_info(self, infinite_grid_create_request, **kwargs): # noqa: E501 + """Create infinite grid # noqa: E501 + + Create an infinite grid strategy based on passed parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_infinite_grid_create_with_http_info(infinite_grid_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param InfiniteGridCreateRequest infinite_grid_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AIHubCreateSuccessResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'infinite_grid_create_request', + 'x_gate_service_id', + 'x_gate_app_lang', + 'x_request_id', + 'x_trace_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_ai_hub_infinite_grid_create" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'infinite_grid_create_request' is set + if self.api_client.client_side_validation and ('infinite_grid_create_request' not in local_var_params or # noqa: E501 + local_var_params['infinite_grid_create_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `infinite_grid_create_request` when calling `post_ai_hub_infinite_grid_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_gate_service_id' in local_var_params: + header_params['X-Gate-Service-Id'] = local_var_params['x_gate_service_id'] # noqa: E501 + if 'x_gate_app_lang' in local_var_params: + header_params['X-Gate-AppLang'] = local_var_params['x_gate_app_lang'] # noqa: E501 + if 'x_request_id' in local_var_params: + header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501 + if 'x_trace_id' in local_var_params: + header_params['X-Trace-Id'] = local_var_params['x_trace_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'infinite_grid_create_request' in local_var_params: + body_params = local_var_params['infinite_grid_create_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/bot/infinite-grid/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AIHubCreateSuccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def post_ai_hub_futures_grid_create(self, futures_grid_create_request, **kwargs): # noqa: E501 + """Create a contract grid # noqa: E501 + + Create a contract grid strategy based on the incoming parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_futures_grid_create(futures_grid_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FuturesGridCreateRequest futures_grid_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AIHubCreateSuccessResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.post_ai_hub_futures_grid_create_with_http_info(futures_grid_create_request, **kwargs) # noqa: E501 + + def post_ai_hub_futures_grid_create_with_http_info(self, futures_grid_create_request, **kwargs): # noqa: E501 + """Create a contract grid # noqa: E501 + + Create a contract grid strategy based on the incoming parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_futures_grid_create_with_http_info(futures_grid_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FuturesGridCreateRequest futures_grid_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AIHubCreateSuccessResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'futures_grid_create_request', + 'x_gate_service_id', + 'x_gate_app_lang', + 'x_request_id', + 'x_trace_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_ai_hub_futures_grid_create" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'futures_grid_create_request' is set + if self.api_client.client_side_validation and ('futures_grid_create_request' not in local_var_params or # noqa: E501 + local_var_params['futures_grid_create_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `futures_grid_create_request` when calling `post_ai_hub_futures_grid_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_gate_service_id' in local_var_params: + header_params['X-Gate-Service-Id'] = local_var_params['x_gate_service_id'] # noqa: E501 + if 'x_gate_app_lang' in local_var_params: + header_params['X-Gate-AppLang'] = local_var_params['x_gate_app_lang'] # noqa: E501 + if 'x_request_id' in local_var_params: + header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501 + if 'x_trace_id' in local_var_params: + header_params['X-Trace-Id'] = local_var_params['x_trace_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'futures_grid_create_request' in local_var_params: + body_params = local_var_params['futures_grid_create_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/bot/futures-grid/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AIHubCreateSuccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def post_ai_hub_spot_martingale_create(self, spot_martingale_create_request, **kwargs): # noqa: E501 + """Create Spot Martin # noqa: E501 + + Create a spot martingale strategy from the given parameters. Stop-loss semantics match the app / `MartingaleBot`: - Use **`create_params.stop_loss_per_cycle`** (ratio per round as a decimal string) for creation-side stop-loss; **do not** use `stop_loss_price` for creation logic. - Stop-loss prices shown on detail pages are computed per round by the engine; creation accepts optional **`create_params.trigger_price`** (trigger price). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_spot_martingale_create(spot_martingale_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SpotMartingaleCreateRequest spot_martingale_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AIHubCreateSuccessResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.post_ai_hub_spot_martingale_create_with_http_info(spot_martingale_create_request, **kwargs) # noqa: E501 + + def post_ai_hub_spot_martingale_create_with_http_info(self, spot_martingale_create_request, **kwargs): # noqa: E501 + """Create Spot Martin # noqa: E501 + + Create a spot martingale strategy from the given parameters. Stop-loss semantics match the app / `MartingaleBot`: - Use **`create_params.stop_loss_per_cycle`** (ratio per round as a decimal string) for creation-side stop-loss; **do not** use `stop_loss_price` for creation logic. - Stop-loss prices shown on detail pages are computed per round by the engine; creation accepts optional **`create_params.trigger_price`** (trigger price). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_spot_martingale_create_with_http_info(spot_martingale_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SpotMartingaleCreateRequest spot_martingale_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AIHubCreateSuccessResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'spot_martingale_create_request', + 'x_gate_service_id', + 'x_gate_app_lang', + 'x_request_id', + 'x_trace_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_ai_hub_spot_martingale_create" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'spot_martingale_create_request' is set + if self.api_client.client_side_validation and ('spot_martingale_create_request' not in local_var_params or # noqa: E501 + local_var_params['spot_martingale_create_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `spot_martingale_create_request` when calling `post_ai_hub_spot_martingale_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_gate_service_id' in local_var_params: + header_params['X-Gate-Service-Id'] = local_var_params['x_gate_service_id'] # noqa: E501 + if 'x_gate_app_lang' in local_var_params: + header_params['X-Gate-AppLang'] = local_var_params['x_gate_app_lang'] # noqa: E501 + if 'x_request_id' in local_var_params: + header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501 + if 'x_trace_id' in local_var_params: + header_params['X-Trace-Id'] = local_var_params['x_trace_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'spot_martingale_create_request' in local_var_params: + body_params = local_var_params['spot_martingale_create_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/bot/spot-martingale/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AIHubCreateSuccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def post_ai_hub_contract_martingale_create(self, contract_martingale_create_request, **kwargs): # noqa: E501 + """Create contract martin # noqa: E501 + + Create a contract Martin strategy based on the input parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_contract_martingale_create(contract_martingale_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ContractMartingaleCreateRequest contract_martingale_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AIHubCreateSuccessResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.post_ai_hub_contract_martingale_create_with_http_info(contract_martingale_create_request, **kwargs) # noqa: E501 + + def post_ai_hub_contract_martingale_create_with_http_info(self, contract_martingale_create_request, **kwargs): # noqa: E501 + """Create contract martin # noqa: E501 + + Create a contract Martin strategy based on the input parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_contract_martingale_create_with_http_info(contract_martingale_create_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ContractMartingaleCreateRequest contract_martingale_create_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AIHubCreateSuccessResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'contract_martingale_create_request', + 'x_gate_service_id', + 'x_gate_app_lang', + 'x_request_id', + 'x_trace_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_ai_hub_contract_martingale_create" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'contract_martingale_create_request' is set + if self.api_client.client_side_validation and ('contract_martingale_create_request' not in local_var_params or # noqa: E501 + local_var_params['contract_martingale_create_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `contract_martingale_create_request` when calling `post_ai_hub_contract_martingale_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_gate_service_id' in local_var_params: + header_params['X-Gate-Service-Id'] = local_var_params['x_gate_service_id'] # noqa: E501 + if 'x_gate_app_lang' in local_var_params: + header_params['X-Gate-AppLang'] = local_var_params['x_gate_app_lang'] # noqa: E501 + if 'x_request_id' in local_var_params: + header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501 + if 'x_trace_id' in local_var_params: + header_params['X-Trace-Id'] = local_var_params['x_trace_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'contract_martingale_create_request' in local_var_params: + body_params = local_var_params['contract_martingale_create_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/bot/contract-martingale/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AIHubCreateSuccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_ai_hub_portfolio_running(self, **kwargs): # noqa: E501 + """Query the list of running policies # noqa: E501 + + Query the list of AIHub strategies currently running by the user, and support filtering by strategy type, trading pair and paging conditions. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ai_hub_portfolio_running(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str strategy_type: Filter by policy type + :param str market: Filter by trading pair + :param int page: Page number, default 1 + :param int page_size: Paging size, default 20, maximum 50 + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AIHubPortfolioRunningSuccessResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_ai_hub_portfolio_running_with_http_info(**kwargs) # noqa: E501 + + def get_ai_hub_portfolio_running_with_http_info(self, **kwargs): # noqa: E501 + """Query the list of running policies # noqa: E501 + + Query the list of AIHub strategies currently running by the user, and support filtering by strategy type, trading pair and paging conditions. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ai_hub_portfolio_running_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str strategy_type: Filter by policy type + :param str market: Filter by trading pair + :param int page: Page number, default 1 + :param int page_size: Paging size, default 20, maximum 50 + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AIHubPortfolioRunningSuccessResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'strategy_type', + 'market', + 'page', + 'page_size', + 'x_gate_service_id', + 'x_gate_app_lang', + 'x_request_id', + 'x_trace_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_ai_hub_portfolio_running" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page` when calling `get_ai_hub_portfolio_running`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params['page_size'] > 50: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page_size` when calling `get_ai_hub_portfolio_running`, must be a value less than or equal to `50`") # noqa: E501 + if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params['page_size'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page_size` when calling `get_ai_hub_portfolio_running`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'strategy_type' in local_var_params and local_var_params['strategy_type'] is not None: # noqa: E501 + query_params.append(('strategy_type', local_var_params['strategy_type'])) # noqa: E501 + if 'market' in local_var_params and local_var_params['market'] is not None: # noqa: E501 + query_params.append(('market', local_var_params['market'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + + header_params = {} + if 'x_gate_service_id' in local_var_params: + header_params['X-Gate-Service-Id'] = local_var_params['x_gate_service_id'] # noqa: E501 + if 'x_gate_app_lang' in local_var_params: + header_params['X-Gate-AppLang'] = local_var_params['x_gate_app_lang'] # noqa: E501 + if 'x_request_id' in local_var_params: + header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501 + if 'x_trace_id' in local_var_params: + header_params['X-Trace-Id'] = local_var_params['x_trace_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/bot/portfolio/running', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AIHubPortfolioRunningSuccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_ai_hub_portfolio_detail(self, strategy_id, strategy_type, **kwargs): # noqa: E501 + """Query order policy details # noqa: E501 + + Both `strategy_id` and `strategy_type` must be passed in the request, where `strategy_type` is used to distribute to the underlying detailed implementation by strategy type. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ai_hub_portfolio_detail(strategy_id, strategy_type, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str strategy_id: Policy ID (required) + :param str strategy_type: Policy type; used for underlying detail distribution (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AIHubPortfolioDetailSuccessResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_ai_hub_portfolio_detail_with_http_info(strategy_id, strategy_type, **kwargs) # noqa: E501 + + def get_ai_hub_portfolio_detail_with_http_info(self, strategy_id, strategy_type, **kwargs): # noqa: E501 + """Query order policy details # noqa: E501 + + Both `strategy_id` and `strategy_type` must be passed in the request, where `strategy_type` is used to distribute to the underlying detailed implementation by strategy type. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ai_hub_portfolio_detail_with_http_info(strategy_id, strategy_type, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str strategy_id: Policy ID (required) + :param str strategy_type: Policy type; used for underlying detail distribution (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AIHubPortfolioDetailSuccessResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'strategy_id', + 'strategy_type', + 'x_gate_service_id', + 'x_gate_app_lang', + 'x_request_id', + 'x_trace_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_ai_hub_portfolio_detail" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'strategy_id' is set + if self.api_client.client_side_validation and ('strategy_id' not in local_var_params or # noqa: E501 + local_var_params['strategy_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `strategy_id` when calling `get_ai_hub_portfolio_detail`") # noqa: E501 + # verify the required parameter 'strategy_type' is set + if self.api_client.client_side_validation and ('strategy_type' not in local_var_params or # noqa: E501 + local_var_params['strategy_type'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `strategy_type` when calling `get_ai_hub_portfolio_detail`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'strategy_id' in local_var_params and local_var_params['strategy_id'] is not None: # noqa: E501 + query_params.append(('strategy_id', local_var_params['strategy_id'])) # noqa: E501 + if 'strategy_type' in local_var_params and local_var_params['strategy_type'] is not None: # noqa: E501 + query_params.append(('strategy_type', local_var_params['strategy_type'])) # noqa: E501 + + header_params = {} + if 'x_gate_service_id' in local_var_params: + header_params['X-Gate-Service-Id'] = local_var_params['x_gate_service_id'] # noqa: E501 + if 'x_gate_app_lang' in local_var_params: + header_params['X-Gate-AppLang'] = local_var_params['x_gate_app_lang'] # noqa: E501 + if 'x_request_id' in local_var_params: + header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501 + if 'x_trace_id' in local_var_params: + header_params['X-Trace-Id'] = local_var_params['x_trace_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/bot/portfolio/detail', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AIHubPortfolioDetailSuccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def post_ai_hub_portfolio_stop(self, ai_hub_portfolio_stop_request, **kwargs): # noqa: E501 + """Terminate a single running policy # noqa: E501 + + Only one policy is allowed to be terminated per request. Risk warning and secondary confirmation are borne by the upper layer of OpenClaw; this interface is only responsible for executing stop. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_portfolio_stop(ai_hub_portfolio_stop_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AIHubPortfolioStopRequest ai_hub_portfolio_stop_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AIHubPortfolioStopSuccessResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.post_ai_hub_portfolio_stop_with_http_info(ai_hub_portfolio_stop_request, **kwargs) # noqa: E501 + + def post_ai_hub_portfolio_stop_with_http_info(self, ai_hub_portfolio_stop_request, **kwargs): # noqa: E501 + """Terminate a single running policy # noqa: E501 + + Only one policy is allowed to be terminated per request. Risk warning and secondary confirmation are borne by the upper layer of OpenClaw; this interface is only responsible for executing stop. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.post_ai_hub_portfolio_stop_with_http_info(ai_hub_portfolio_stop_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AIHubPortfolioStopRequest ai_hub_portfolio_stop_request: (required) + :param str x_gate_service_id: Call source identifier; injected by APIv4 if necessary + :param str x_gate_app_lang: Language context, such as `zh-CN` / `en-US` + :param str x_request_id: Request link ID; caller can transmit transparently + :param str x_trace_id: trace header; can be generated uniformly by APIv4 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AIHubPortfolioStopSuccessResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'ai_hub_portfolio_stop_request', + 'x_gate_service_id', + 'x_gate_app_lang', + 'x_request_id', + 'x_trace_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_ai_hub_portfolio_stop" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'ai_hub_portfolio_stop_request' is set + if self.api_client.client_side_validation and ('ai_hub_portfolio_stop_request' not in local_var_params or # noqa: E501 + local_var_params['ai_hub_portfolio_stop_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `ai_hub_portfolio_stop_request` when calling `post_ai_hub_portfolio_stop`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_gate_service_id' in local_var_params: + header_params['X-Gate-Service-Id'] = local_var_params['x_gate_service_id'] # noqa: E501 + if 'x_gate_app_lang' in local_var_params: + header_params['X-Gate-AppLang'] = local_var_params['x_gate_app_lang'] # noqa: E501 + if 'x_request_id' in local_var_params: + header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501 + if 'x_trace_id' in local_var_params: + header_params['X-Trace-Id'] = local_var_params['x_trace_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'ai_hub_portfolio_stop_request' in local_var_params: + body_params = local_var_params['ai_hub_portfolio_stop_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/bot/portfolio/stop', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AIHubPortfolioStopSuccessResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/cfd_api.py b/gate_api/api/cfd_api.py new file mode 100644 index 00000000..1137d91a --- /dev/null +++ b/gate_api/api/cfd_api.py @@ -0,0 +1,2452 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CFDApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def query_mt5_account_info(self, **kwargs): # noqa: E501 + """Query MT5 account information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_mt5_account_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.Mt5Account + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_mt5_account_info_with_http_info(**kwargs) # noqa: E501 + + def query_mt5_account_info_with_http_info(self, **kwargs): # noqa: E501 + """Query MT5 account information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_mt5_account_info_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.Mt5Account, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_mt5_account_info" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/users/mt5-account', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Mt5Account', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_categories(self, **kwargs): # noqa: E501 + """Query trading symbol categories # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_categories(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.Categories + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_categories_with_http_info(**kwargs) # noqa: E501 + + def query_categories_with_http_info(self, **kwargs): # noqa: E501 + """Query trading symbol categories # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_categories_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.Categories, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_categories" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/symbols/categories', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Categories', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_symbol_commissions(self, **kwargs): # noqa: E501 + """Query symbol commission rates # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_symbol_commissions(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: List of symbol codes (multiple codes separated by commas). At least one of symbol and category_code is required + :param str category_code: List of category codes (multiple codes separated by commas). When provided together with symbols, filters symbols by category. At least one of symbol and category_code is required + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.SymbolCommissions + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_symbol_commissions_with_http_info(**kwargs) # noqa: E501 + + def query_symbol_commissions_with_http_info(self, **kwargs): # noqa: E501 + """Query symbol commission rates # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_symbol_commissions_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: List of symbol codes (multiple codes separated by commas). At least one of symbol and category_code is required + :param str category_code: List of category codes (multiple codes separated by commas). When provided together with symbols, filters symbols by category. At least one of symbol and category_code is required + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.SymbolCommissions, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbols', + 'category_code' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_symbol_commissions" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbols' in local_var_params and local_var_params['symbols'] is not None: # noqa: E501 + query_params.append(('symbols', local_var_params['symbols'])) # noqa: E501 + if 'category_code' in local_var_params and local_var_params['category_code'] is not None: # noqa: E501 + query_params.append(('category_code', local_var_params['category_code'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/symbols/commissions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SymbolCommissions', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_symbols(self, **kwargs): # noqa: E501 + """Query trading symbol list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_symbols(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.Symbols + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_symbols_with_http_info(**kwargs) # noqa: E501 + + def query_symbols_with_http_info(self, **kwargs): # noqa: E501 + """Query trading symbol list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_symbols_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.Symbols, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_symbols" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/symbols', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Symbols', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_symbol_detail(self, symbols, **kwargs): # noqa: E501 + """Query trading symbol details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_symbol_detail(symbols, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading symbol code list (comma-separated, max 10 symbols) (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ContractDetail + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_symbol_detail_with_http_info(symbols, **kwargs) # noqa: E501 + + def query_symbol_detail_with_http_info(self, symbols, **kwargs): # noqa: E501 + """Query trading symbol details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_symbol_detail_with_http_info(symbols, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading symbol code list (comma-separated, max 10 symbols) (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ContractDetail, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbols' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_symbol_detail" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'symbols' is set + if self.api_client.client_side_validation and ('symbols' not in local_var_params or # noqa: E501 + local_var_params['symbols'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `symbols` when calling `query_symbol_detail`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbols' in local_var_params and local_var_params['symbols'] is not None: # noqa: E501 + query_params.append(('symbols', local_var_params['symbols'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/symbols/detail', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ContractDetail', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_symbol_kline(self, symbol, kline_type, **kwargs): # noqa: E501 + """Query trading symbol klines # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_symbol_kline(symbol, kline_type, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Trading symbol code (required) + :param str kline_type: Kline type (time period) (required) + :param int begin_time: Start time (Unix timestamp in seconds) + :param int end_time: End time (Unix timestamp in seconds) + :param int limit: Kline limit (max 500, error if exceeded) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.Klines + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_symbol_kline_with_http_info(symbol, kline_type, **kwargs) # noqa: E501 + + def query_symbol_kline_with_http_info(self, symbol, kline_type, **kwargs): # noqa: E501 + """Query trading symbol klines # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_symbol_kline_with_http_info(symbol, kline_type, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Trading symbol code (required) + :param str kline_type: Kline type (time period) (required) + :param int begin_time: Start time (Unix timestamp in seconds) + :param int end_time: End time (Unix timestamp in seconds) + :param int limit: Kline limit (max 500, error if exceeded) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.Klines, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol', + 'kline_type', + 'begin_time', + 'end_time', + 'limit' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_symbol_kline" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'symbol' is set + if self.api_client.client_side_validation and ('symbol' not in local_var_params or # noqa: E501 + local_var_params['symbol'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `symbol` when calling `query_symbol_kline`") # noqa: E501 + # verify the required parameter 'kline_type' is set + if self.api_client.client_side_validation and ('kline_type' not in local_var_params or # noqa: E501 + local_var_params['kline_type'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `kline_type` when calling `query_symbol_kline`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 500: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `query_symbol_kline`, must be a value less than or equal to `500`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `query_symbol_kline`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'symbol' in local_var_params: + path_params['symbol'] = local_var_params['symbol'] # noqa: E501 + + query_params = [] + if 'kline_type' in local_var_params and local_var_params['kline_type'] is not None: # noqa: E501 + query_params.append(('kline_type', local_var_params['kline_type'])) # noqa: E501 + if 'begin_time' in local_var_params and local_var_params['begin_time'] is not None: # noqa: E501 + query_params.append(('begin_time', local_var_params['begin_time'])) # noqa: E501 + if 'end_time' in local_var_params and local_var_params['end_time'] is not None: # noqa: E501 + query_params.append(('end_time', local_var_params['end_time'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/symbols/{symbol}/klines', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Klines', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_symbol_ticker(self, symbol, **kwargs): # noqa: E501 + """Query trading symbol ticker # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_symbol_ticker(symbol, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Trading symbol code (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.TradFiTicker + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_symbol_ticker_with_http_info(symbol, **kwargs) # noqa: E501 + + def query_symbol_ticker_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Query trading symbol ticker # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_symbol_ticker_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Trading symbol code (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.TradFiTicker, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_symbol_ticker" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'symbol' is set + if self.api_client.client_side_validation and ('symbol' not in local_var_params or # noqa: E501 + local_var_params['symbol'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `symbol` when calling `query_symbol_ticker`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in local_var_params: + path_params['symbol'] = local_var_params['symbol'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/symbols/{symbol}/tickers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TradFiTicker', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_trad_fi_user(self, **kwargs): # noqa: E501 + """Create CFD user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_trad_fi_user(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CreateUserResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_trad_fi_user_with_http_info(**kwargs) # noqa: E501 + + def create_trad_fi_user_with_http_info(self, **kwargs): # noqa: E501 + """Create CFD user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_trad_fi_user_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CreateUserResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_trad_fi_user" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/users', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateUserResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_user_assets(self, **kwargs): # noqa: E501 + """Query account assets # noqa: E501 + + Query account assets # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_user_assets(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.UserAssetResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_user_assets_with_http_info(**kwargs) # noqa: E501 + + def query_user_assets_with_http_info(self, **kwargs): # noqa: E501 + """Query account assets # noqa: E501 + + Query account assets # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_user_assets_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.UserAssetResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_user_assets" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/users/assets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserAssetResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_transaction(self, **kwargs): # noqa: E501 + """Query Fund Transfer In/Out Records # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_transaction(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int begin_time: Start Time (Second-level Timestamp) + :param int end_time: End Time (Second-level Timestamp) + :param str type: Transaction Type (deposit - transfer in, withdraw - transfer out, dividend - dividend payment, fill_negative - cover negative balance) + :param int page: page number + :param int page_size: Number per page, default 10, maximum 50 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.TransactionList + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_transaction_with_http_info(**kwargs) # noqa: E501 + + def query_transaction_with_http_info(self, **kwargs): # noqa: E501 + """Query Fund Transfer In/Out Records # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_transaction_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int begin_time: Start Time (Second-level Timestamp) + :param int end_time: End Time (Second-level Timestamp) + :param str type: Transaction Type (deposit - transfer in, withdraw - transfer out, dividend - dividend payment, fill_negative - cover negative balance) + :param int page: page number + :param int page_size: Number per page, default 10, maximum 50 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.TransactionList, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'begin_time', + 'end_time', + 'type', + 'page', + 'page_size' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_transaction" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'begin_time' in local_var_params and local_var_params['begin_time'] is not None: # noqa: E501 + query_params.append(('begin_time', local_var_params['begin_time'])) # noqa: E501 + if 'end_time' in local_var_params and local_var_params['end_time'] is not None: # noqa: E501 + query_params.append(('end_time', local_var_params['end_time'])) # noqa: E501 + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/transactions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TransactionList', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_transaction(self, trad_fi_transaction_request, **kwargs): # noqa: E501 + """Fund transfer # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_transaction(trad_fi_transaction_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param TradFiTransactionRequest trad_fi_transaction_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CreateTransaction + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_transaction_with_http_info(trad_fi_transaction_request, **kwargs) # noqa: E501 + + def create_transaction_with_http_info(self, trad_fi_transaction_request, **kwargs): # noqa: E501 + """Fund transfer # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_transaction_with_http_info(trad_fi_transaction_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param TradFiTransactionRequest trad_fi_transaction_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CreateTransaction, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'trad_fi_transaction_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_transaction" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'trad_fi_transaction_request' is set + if self.api_client.client_side_validation and ('trad_fi_transaction_request' not in local_var_params or # noqa: E501 + local_var_params['trad_fi_transaction_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `trad_fi_transaction_request` when calling `create_transaction`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'trad_fi_transaction_request' in local_var_params: + body_params = local_var_params['trad_fi_transaction_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/transactions', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateTransaction', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_order_list(self, **kwargs): # noqa: E501 + """Query active order list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_order_list(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OrderList + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_order_list_with_http_info(**kwargs) # noqa: E501 + + def query_order_list_with_http_info(self, **kwargs): # noqa: E501 + """Query active order list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_order_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OrderList, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_order_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OrderList', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_trad_fi_order(self, trad_fi_order_request, **kwargs): # noqa: E501 + """Create order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_trad_fi_order(trad_fi_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param TradFiOrderRequest trad_fi_order_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CreateOrder2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_trad_fi_order_with_http_info(trad_fi_order_request, **kwargs) # noqa: E501 + + def create_trad_fi_order_with_http_info(self, trad_fi_order_request, **kwargs): # noqa: E501 + """Create order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_trad_fi_order_with_http_info(trad_fi_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param TradFiOrderRequest trad_fi_order_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CreateOrder2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'trad_fi_order_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_trad_fi_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'trad_fi_order_request' is set + if self.api_client.client_side_validation and ('trad_fi_order_request' not in local_var_params or # noqa: E501 + local_var_params['trad_fi_order_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `trad_fi_order_request` when calling `create_trad_fi_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'trad_fi_order_request' in local_var_params: + body_params = local_var_params['trad_fi_order_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateOrder2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_order(self, order_id, trad_fi_order_update_request, **kwargs): # noqa: E501 + """Modify order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_order(order_id, trad_fi_order_update_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID (required) + :param TradFiOrderUpdateRequest trad_fi_order_update_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.UpdateOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_order_with_http_info(order_id, trad_fi_order_update_request, **kwargs) # noqa: E501 + + def update_order_with_http_info(self, order_id, trad_fi_order_update_request, **kwargs): # noqa: E501 + """Modify order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_order_with_http_info(order_id, trad_fi_order_update_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID (required) + :param TradFiOrderUpdateRequest trad_fi_order_update_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.UpdateOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id', + 'trad_fi_order_update_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `update_order`") # noqa: E501 + # verify the required parameter 'trad_fi_order_update_request' is set + if self.api_client.client_side_validation and ('trad_fi_order_update_request' not in local_var_params or # noqa: E501 + local_var_params['trad_fi_order_update_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `trad_fi_order_update_request` when calling `update_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'trad_fi_order_update_request' in local_var_params: + body_params = local_var_params['trad_fi_order_update_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/orders/{order_id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UpdateOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_order(self, order_id, **kwargs): # noqa: E501 + """Cancel order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: object + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Cancel order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/orders/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_order_history_list(self, **kwargs): # noqa: E501 + """Query historical order list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_order_history_list(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int begin_time: Start time (Unix timestamp in seconds), earliest query is one month ago + :param int end_time: End time (Unix timestamp in seconds) + :param str symbol: Currency pair + :param int side: Side (1=sell, 2=buy) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OrderHistoryList + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_order_history_list_with_http_info(**kwargs) # noqa: E501 + + def query_order_history_list_with_http_info(self, **kwargs): # noqa: E501 + """Query historical order list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_order_history_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int begin_time: Start time (Unix timestamp in seconds), earliest query is one month ago + :param int end_time: End time (Unix timestamp in seconds) + :param str symbol: Currency pair + :param int side: Side (1=sell, 2=buy) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OrderHistoryList, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'begin_time', + 'end_time', + 'symbol', + 'side' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_order_history_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'begin_time' in local_var_params and local_var_params['begin_time'] is not None: # noqa: E501 + query_params.append(('begin_time', local_var_params['begin_time'])) # noqa: E501 + if 'end_time' in local_var_params and local_var_params['end_time'] is not None: # noqa: E501 + query_params.append(('end_time', local_var_params['end_time'])) # noqa: E501 + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if 'side' in local_var_params and local_var_params['side'] is not None: # noqa: E501 + query_params.append(('side', local_var_params['side'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/orders/history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OrderHistoryList', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_order_log(self, log_id, **kwargs): # noqa: E501 + """Get order details by log ID # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_order_log(log_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int log_id: log_id returned from the order placement API (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OrderLog + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_order_log_with_http_info(log_id, **kwargs) # noqa: E501 + + def query_order_log_with_http_info(self, log_id, **kwargs): # noqa: E501 + """Get order details by log ID # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_order_log_with_http_info(log_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int log_id: log_id returned from the order placement API (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OrderLog, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'log_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_order_log" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'log_id' is set + if self.api_client.client_side_validation and ('log_id' not in local_var_params or # noqa: E501 + local_var_params['log_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `log_id` when calling `query_order_log`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'log_id' in local_var_params: + path_params['log_id'] = local_var_params['log_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/orders/log/{log_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OrderLog', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_position_list(self, **kwargs): # noqa: E501 + """Query active position list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_position_list(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.PositionList + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_position_list_with_http_info(**kwargs) # noqa: E501 + + def query_position_list_with_http_info(self, **kwargs): # noqa: E501 + """Query active position list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_position_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.PositionList, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_position_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/positions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PositionList', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_position(self, position_id, trad_fi_position_update_request, **kwargs): # noqa: E501 + """Modify position # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_position(position_id, trad_fi_position_update_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int position_id: Position ID (required) + :param TradFiPositionUpdateRequest trad_fi_position_update_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.UpdatePosition + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_position_with_http_info(position_id, trad_fi_position_update_request, **kwargs) # noqa: E501 + + def update_position_with_http_info(self, position_id, trad_fi_position_update_request, **kwargs): # noqa: E501 + """Modify position # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_position_with_http_info(position_id, trad_fi_position_update_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int position_id: Position ID (required) + :param TradFiPositionUpdateRequest trad_fi_position_update_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.UpdatePosition, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'position_id', + 'trad_fi_position_update_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_position" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'position_id' is set + if self.api_client.client_side_validation and ('position_id' not in local_var_params or # noqa: E501 + local_var_params['position_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `position_id` when calling `update_position`") # noqa: E501 + # verify the required parameter 'trad_fi_position_update_request' is set + if self.api_client.client_side_validation and ('trad_fi_position_update_request' not in local_var_params or # noqa: E501 + local_var_params['trad_fi_position_update_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `trad_fi_position_update_request` when calling `update_position`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'position_id' in local_var_params: + path_params['position_id'] = local_var_params['position_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'trad_fi_position_update_request' in local_var_params: + body_params = local_var_params['trad_fi_position_update_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/positions/{position_id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UpdatePosition', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def close_position(self, position_id, trad_fi_close_position_request, **kwargs): # noqa: E501 + """Close position # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.close_position(position_id, trad_fi_close_position_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int position_id: Position ID (required) + :param TradFiClosePositionRequest trad_fi_close_position_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.DeletePosition + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.close_position_with_http_info(position_id, trad_fi_close_position_request, **kwargs) # noqa: E501 + + def close_position_with_http_info(self, position_id, trad_fi_close_position_request, **kwargs): # noqa: E501 + """Close position # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.close_position_with_http_info(position_id, trad_fi_close_position_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int position_id: Position ID (required) + :param TradFiClosePositionRequest trad_fi_close_position_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.DeletePosition, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'position_id', + 'trad_fi_close_position_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method close_position" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'position_id' is set + if self.api_client.client_side_validation and ('position_id' not in local_var_params or # noqa: E501 + local_var_params['position_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `position_id` when calling `close_position`") # noqa: E501 + # verify the required parameter 'trad_fi_close_position_request' is set + if self.api_client.client_side_validation and ('trad_fi_close_position_request' not in local_var_params or # noqa: E501 + local_var_params['trad_fi_close_position_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `trad_fi_close_position_request` when calling `close_position`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'position_id' in local_var_params: + path_params['position_id'] = local_var_params['position_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'trad_fi_close_position_request' in local_var_params: + body_params = local_var_params['trad_fi_close_position_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/positions/{position_id}/close', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeletePosition', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_position_history_list(self, **kwargs): # noqa: E501 + """Query historical position list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_position_history_list(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number; defaults to 1 if omitted. + :param int page_size: Page size; defaults to 10 if omitted. Maximum 100. + :param int begin_time: Start Time (Unix Timestamp, seconds). The earliest queryable time is one month ago + :param int end_time: End time (timestamp in seconds) + :param str symbol: Trading symbol (e.g., EURUSD) + :param str position_dir: Position direction (Long=long position, Short=short position) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.PositionHistoryList + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_position_history_list_with_http_info(**kwargs) # noqa: E501 + + def query_position_history_list_with_http_info(self, **kwargs): # noqa: E501 + """Query historical position list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_position_history_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number; defaults to 1 if omitted. + :param int page_size: Page size; defaults to 10 if omitted. Maximum 100. + :param int begin_time: Start Time (Unix Timestamp, seconds). The earliest queryable time is one month ago + :param int end_time: End time (timestamp in seconds) + :param str symbol: Trading symbol (e.g., EURUSD) + :param str position_dir: Position direction (Long=long position, Short=short position) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.PositionHistoryList, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'page_size', + 'begin_time', + 'end_time', + 'symbol', + 'position_dir' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_position_history_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + if 'begin_time' in local_var_params and local_var_params['begin_time'] is not None: # noqa: E501 + query_params.append(('begin_time', local_var_params['begin_time'])) # noqa: E501 + if 'end_time' in local_var_params and local_var_params['end_time'] is not None: # noqa: E501 + query_params.append(('end_time', local_var_params['end_time'])) # noqa: E501 + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if 'position_dir' in local_var_params and local_var_params['position_dir'] is not None: # noqa: E501 + query_params.append(('position_dir', local_var_params['position_dir'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/tradfi/positions/history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PositionHistoryList', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/coupon_api.py b/gate_api/api/coupon_api.py new file mode 100644 index 00000000..66e7f2a3 --- /dev/null +++ b/gate_api/api/coupon_api.py @@ -0,0 +1,321 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CouponApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def list_user_coupons(self, **kwargs): # noqa: E501 + """Coupon Center list # noqa: E501 + + ## Interface description The general list interface of the card and coupon center returns all the cards and coupons of the currently logged in user (supports paging, filtering type, and valid/invalid switching). --- ## Query Parameters | Parameter name | Type | Required | Default value | Constraints | Description | |--------|------|------|--------|------|------| | `expired` | integer | No | `0` | `0` or `1` | `0` = Query valid cards and coupons; `1` = Check expired/used cards | | `limit` | integer | No | `10` | 1 ~ 20 | The number of cards returned per page | | `last_id` | integer | No | `0` | 1 ~ 1000000000 | Cursor paging: the last record of the previous page `id`, the home page does not transmit | | `expire_time` | integer | no | `0` | 1 ~ 2147483647 | Cursor pagination: with `last_id` Union usage expiration time (Unix timestamp) | | `order_by` | string | no | `latest` | `latest` / `expired` | Sorting method: `latest` = sort by latest receipt; `expired` = sort by expiration time in ascending order | | `type` | string | No | Empty (return all) | See the card type table below | Only return cards of the specified type | | `is_task_coupon` | integer | No | Do not pass (return all) | `0` or `1` | `0` = Only ordinary cards and coupons are returned; `1` = Only mission cards and coupons are returned; both are returned without passing | ### Supported coupon types (`type` parameter enumeration value) The main site (gate.io default site) supports the following types, and different sub-sites (Türkiye, United States, Malta, Australia) have their own whitelist restrictions. | `type` value | Coupon name | Version limit (below this version will not be returned/cannot be transferred) | |-----------|---------|-------------------------------| | `position_voucher` | Position experience coupon | Unlimited | | `tradfi_position_voucher` | TradFi position experience coupon | Android < 7320000 / iOS < 202507320000 does not return | | `contract_bonus` | Contract trial bonus | Unlimited | | `contract_bonus_new` | Contract experience coupon | Unlimited | | `commission_rebate` | Fee rebate coupons | Unlimited | | `hold_bonus` | Financial management trial bonus | Unlimited | | `point` | Point card | Unlimited (main site/Türkiye site only) | | `financial_rate` | Interest rate coupons | Unlimited | | `robot_bonus` | Robot trial bonus | Unlimited | | `loss_protection_copier` | Worry-free money for copying orders | Unlimited | | `vip_card` | VIP experience card | Unlimited | | `interest_voucher` | Leveraged coupons | Unlimited | | `p2p` | P2P transaction coupons | Unlimited | | `cash` | Cash Vouchers | Unlimited | | `crypto_loan_interest` | Mortgage currency interest reduction coupons | Android < 7290000 / iOS < 202507290000 does not return | | `copy_trading` | Trading experience bonus | Android < 7320000 / iOS < 202507320000 No return | | `alpha_voucher` | Alpha Cash Voucher | Android < 7320000 / iOS < 202507320000 Do not return | | `etf_voucher` | ETF trial fund | Android < 7320000 / iOS < 202507320000 No return | --- ##Response ### Outer structure ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": true, \"list\": [ ...array of coupon objects... ] } } ``` | Field | Type | Description | |------|------|------| | `code` | integer | `0` = success | | `message` | string | response message | | `data.next_page` | boolean | Whether there is a next page. `true` = There is more data, the `id` of the last item on this page needs to be `last_id` is passed in for the next request | | `data.list` | array | Array of coupon objects, see below for details | --- ### Public fields of card and coupon objects (included in all types) | Field name | Type | Description | |--------|------|------| | `id` | integer | Card and coupon issuance record ID (`coupon_send_issuing_log.id`), used for paging cursor `last_id` | | `details_id` | integer | The primary key ID of the user card details table (independent tables for each type) | | `coupon_type` | string | Coupon type, see the enumeration table above | | `name` | string | Card display name (i18n translated) | | `amount` | string | Coupon denomination (formatted string, including thousandth sign). Different types have different meanings, see explanation below | | `currency` | string | The denomination unit. Different types have different values, see explanation below | | `rule_new` | string | Use rule text (this field in the list interface always returns the empty string `\"\"`, and only in the detail interface) | | `status` | string | Card status, see status enumeration below | | `jump_url` | object | jump link | | `jump_url.web` | string | Web jump link | | `jump_url.app` | string | App jump link | | `jump_url.mini_app` | string | Mini program jump link (most types are empty strings) | | `help_url` | object | Help center link | | `help_url.web` | string | Web help link | | `help_url.app` | string | App help link | | `expire_time` | integer | Expiration time (Unix timestamp). Note: Some types will be adjusted to the actual expiration time after they have been activated or used | | `expire_time_order_by` | integer | Expiration time for sorting (taken from the original expiration time of the issuance record, not affected by activation) | | `expire_second` | integer | The number of seconds remaining before expiration (expired or point card type returns `0`) | | `has_usage_history` | boolean | Whether there is a usage record (the point card type is fixed to `true`, and the rest are judged based on the type) | | `has_progress` | boolean | Whether to display the progress bar (only `commission_rebate`, `interest_voucher` and task coupons that meet the conditions are `true`) | | `progress_config` | object | Progress bar configuration, when `has_progress` is `false`, each field is an empty string | | `progress_config.total_balance` | string | The total amount to be completed | | `progress_config.current_used` | string | Amount used | | `progress_config.current_achived` | string | Amount achieved | | `progress_config.currency` | string | Progress unit | | `activation_info` | object | Activation information exclusive to each type, see each type description below (types without exclusive information return empty objects `{}`) | | `is_task_coupon` | integer | `0` = ordinary coupon; `1` = task coupon | | `upgrade_toast` | boolean | Whether the user needs to be prompted to upgrade the App (`true` when the version is too old and cannot support the coupon) | | `task_title` | string | Task title (only task coupons have value, ordinary coupons are `\"\"`) | | `task_desc` | string | Task description (only task coupons have value, ordinary coupons are `\"\"`) | | `task_start_at` | integer | Task start timestamp (only `TASK_EXPIRED` status task coupons have value, the rest are `0`) | | `task_expire_at` | integer | Task expiration timestamp (currently fixed to `0`, reserved field) | | `task_completed_at` | integer | Task completion timestamp (currently fixed at `0`, reserved field) | | `extra` | array | Extended field, fixed return empty array `[]` | --- ### `status` status enumeration | Value | Applicable objects | Description | |----|---------|------| | `NOT_ACTIVE` | Ordinary coupons | Pending activation (not yet activated) | | `ACTIVATED` | Ordinary coupons | Activated (activating or after activation) | | `TO_BE_USED` | Ordinary coupons | To be used (valid and not used) | | `EXPIRED` | Ordinary coupons | Expired (expired without being used) | | `RECYCLED` | Ordinary cards and coupons | Recycled (such as contract recharge experience coupons are recycled) | | `INVALID` | Ordinary coupons | Expired | | `USED` | Ordinary coupons | Used/consumed | | `UNKNOWN` | Ordinary coupons | Unknown status | | `LOCKED` | Ordinary cards and coupons (`p2p`) | Locked (P2P transaction in progress, waiting for write-off) | | `TASK_START` | Task coupons | The task has not started (the coupon has been issued and the task is to be started) | | `TASK_WAIT` | Task coupons | Task in progress (to be completed) | | `TASK_DONE` | Task coupons | The task has been completed (receiving is being processed) | | `TASK_EXPIRED` | Task coupon | The task is not completed and has expired | | `TASK_NOT_STARTED_EXPIRED` | Task coupon | The task has expired before it started | | `TASK_RECEIVE_SUCCESS` | Task coupons | Task rewards received successfully | | `TASK_RECEIVE_FAIL` | Task coupons | Failed to receive task rewards | --- ### `amount` / `currency` Description of each type | `coupon_type` | `amount` description | `currency` value | |---------------|--------------|---------------| | `point` | Point card balance (including thousandths) | `\"POINT\"` | | `position_voucher` | `Coupon face amount × leverage multiple` (including thousandths) | Such as `\"USDT\"` | | `tradfi_position_voucher` | `Coupon face amount × leverage multiple` (including thousandths) | `\"USDx\"` | | `financial_rate` | Interest rate increase value + `%`, such as `\"5%\"` | `\"APR\"` | | `vip_card` | VIP level number, such as `\"4\"` | `\"VIP\"` | | `interest_voucher` | Interest rate discount percentage + `%` | Discount logo (Chinese site is `\"discount\"`, other sites are empty) | | `crypto_loan_interest` | Interest rate discount percentage + `%` | `\"\"` | | `alpha_voucher` | Coupon face amount (including thousandths) | Alpha base currency (such as `\"USDT\"` or `\"ETH\"`) | | Other types | Coupon face amount (including thousandths) | Capital currency symbol, such as `\"USDT\"` / `\"GT\"` / `\"BTC\"` | > **Note**: The `point` type additionally returns the `origin_amount` field (the original balance string with the trailing zeros removed), other types do not have this field. --- ### `activation_info` Exclusive fields for each type #### `interest_voucher` (leverage coupon) ```json { \"supported_pairs\": \"BTC/USDT\", \"transaction_type\": \"borrow\" } ``` | Field | Type | Description | |------|------|------| | `supported_pairs` | string | Applicable trading pairs, separated by `/`, such as `\"BTC/USDT\"` | | `transaction_type` | string | Transaction type (such as `borrow`) | #### `contract_bonus_new` (contract experience coupon) ```json { \"received_expired_hour\": 48 } ``` | Field | Type | Description | |------|------|------| | `received_expired_hour` | integer | The number of hours valid after activation (automatic recycling after timeout) | #### `contract_bonus` (Contract experience bonus) ```json { \"check_unified_account_mode\": true, \"received_expired_days\": 7, \"abtest\": false } ``` | Field | Type | Description | |------|------|------| | `check_unified_account_mode` | boolean | Whether to check the unified account mode (fixed `true`) | | `received_expired_days` | integer | Number of days valid after activation | | `abtest` | boolean | AB test flag (currently fixed to `false`) | #### `commission_rebate` (handling fee cashback coupon) ```json { \"market\": \"futures\", \"market_name\": \"Futures\" } ``` | Field | Type | Description | |------|------|------| | `market` | string | Applicable market, enumeration value: `spot` / `margin` / `futures` / `alpha` / `etf` / `tradfi` | | `market_name` | string | Market display name (i18n translated) | #### `robot_bonus` (robot experience bonus) ```json { \"designated_bots\": \"DISABLED\" } ``` | Field | Type | Description | |------|------|------| | `designated_bots` | string | `\"ENABLED\"` = can only be used by specified policies; `\"DISABLED\"` = Unlimited strategy | #### `position_voucher` (position experience coupon) ```json { \"symbols\": \"BTC_USDT\", \"leverage\": \"10\", \"need_user_funds\": 0, \"user_funds_amount\": \"100\", \"position_bonus\": \"500\" } ``` | Field | Type | Description | |------|------|------| | `symbols` | string | Applicable trading pairs (such as `\"BTC_USDT\"`), empty means no limit | | `leverage` | string | Leverage multiple | | `need_user_funds` | integer | `0` = No user-owned funds are required; `1` = Fund allocation is required | | `user_funds_amount` | string | The amount of funds required by the user (meaningful when `need_user_funds=1`) | | `position_bonus` | string | The original amount of the coupon (remove the trailing zero) | #### `tradfi_position_voucher` (TradFi position experience coupon) ```json { \"symbols\": \"AAPL\", \"leverage\": \"5\", \"position_bonus\": \"200\" } ``` | Field | Type | Description | |------|------|------| | `symbols` | string | Applicable to TradFi varieties (such as `\"AAPL\"`), empty means no limit | | `leverage` | string | Leverage multiple | | `position_bonus` | string | The original amount of the coupon (remove the trailing zero) | #### `etf_voucher` (ETF trial bonus) ```json { \"currency_markets\": \"BTC3L_USDT,ETH3L_USDT\", \"amount\": \"50\" } ``` | Field | Type | Description | |------|------|------| | `currency_markets` | string | List of applicable ETF markets (comma separated) | | `amount` | string | The original amount of the coupon (remove the trailing zero) | #### Other types `point` (point card), `hold_bonus` (financial experience fund), `loss_protection_copier` (worry-free money for following orders), `vip_card` (VIP experience card), `p2p` (P2P transaction coupon), `cash` (cash coupon) , `crypto_loan_interest` (interest-reduced coupon for mortgage loan), `copy_trading` (trading experience fee), `alpha_voucher` (Alpha cash coupon), `financial_rate` (interest-increasing coupon) and other types return empty objects: ```json {} ``` --- ## Complete response example ### Ordinary cards and coupons (contract experience money) ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": false, \"list\": [ { \"id\": 1234567, \"details_id\": 890, \"coupon_type\": \"contract_bonus\", \"name\": \"Futures Bonus\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"\", \"status\": \"NOT_ACTIVE\", \"jump_url\": { \"web\": \"/futures/USDT\", \"app\": \"/futures/USDT\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 86400, \"has_usage_history\": false, \"has_progress\": false, \"progress_config\": { \"total_balance\": \"\", \"current_used\": \"\", \"current_achived\": \"\", \"currency\": \"\" }, \"activation_info\": { \"check_unified_account_mode\": true, \"received_expired_days\": 7, \"abtest\": false }, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [] } ] } } ``` ### Task coupons (handling fee cashback coupons) ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": false, \"list\": [ { \"id\": 9876543, \"details_id\": 0, \"coupon_type\": \"commission_rebate\", \"name\": \"10% Futures Commission Rebate\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"\", \"status\": \"TASK_WAIT\", \"jump_url\": { \"web\": \"https://www.gate.io/futures\", \"app\": \"gateio://futures\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 172800, \"has_usage_history\": false, \"has_progress\": true, \"progress_config\": { \"total_balance\": \"1000\", \"current_used\": \"350\", \"current_achived\": \"350\", \"currency\": \"USDT\" }, \"activation_info\": { \"market\": \"futures\", \"market_name\": \"Futures\" }, \"is_task_coupon\": 1, \"upgrade_toast\": false, \"task_title\": \"Trade 1000 USDT to earn commission rebate\", \"task_desc\": \"Complete futures trading volume task to get 100 USDT commission rebate\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [] } ] } } ``` ### Point card (point) ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": false, \"list\": [ { \"id\": 0, \"details_id\": 0, \"coupon_type\": \"point\", \"name\": \"Points\", \"amount\": \"1,234.56\", \"origin_amount\": \"1234.56\", \"currency\": \"POINT\", \"rule_new\": \"...\", \"status\": \"TO_BE_USED\", \"jump_url\": { \"web\": \"/trade/BTC_USDT\", \"app\": \"/trade/BTC_USDT\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 0, \"expire_time_order_by\": 0, \"expire_second\": 0, \"has_usage_history\": true, \"has_progress\": false, \"progress_config\": { \"total_balance\": \"\", \"current_used\": \"\", \"current_achived\": \"\", \"currency\": \"\" }, \"activation_info\": {}, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [] } ] } } ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_user_coupons(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int expired: Coupon status filter. `0` = query valid coupons (default); `1` = query expired/used coupons + :param int limit: Number of coupons returned per page, range 1-20, default 10 + :param int last_id: Cursor-based pagination: the `id` value of the last record from the previous page, omit (or pass 0) for the first page + :param int expire_time: Cursor-based pagination: used together with `last_id`, pass the `expire_time_order_by` value of the last record from the previous page (Unix timestamp), omit for the first page + :param str order_by: Sort order. `latest` = by latest claim time descending (default); `expired` = by expiration time ascending + :param str type: Coupon type filter. If not specified, all supported types are returned. Available values: `position_voucher` (position voucher), `tradfi_position_voucher` (TradFi position voucher), `contract_bonus` (futures bonus), `contract_bonus_new` (futures trial coupon), `commission_rebate` (commission rebate coupon), `hold_bonus` (earn trial bonus), `point` (point card), `financial_rate` (interest rate boost coupon), `robot_bonus` (trading bot bonus), `loss_protection_copier` (copy trading loss protection), `vip_card` (VIP trial card), `interest_voucher` (margin interest discount coupon), `p2p` (P2P trading deduction coupon), `cash` (cash coupon), `crypto_loan_interest` (crypto loan interest discount coupon), `copy_trading` (copy trading bonus), `alpha_voucher` (Alpha cash coupon), `etf_voucher` (ETF trial bonus) + :param int is_task_coupon: Task Coupon Filter. `0` = Return only regular coupons; `1` = Return only task coupons; Omit to return both + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ListUserCouponsResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_user_coupons_with_http_info(**kwargs) # noqa: E501 + + def list_user_coupons_with_http_info(self, **kwargs): # noqa: E501 + """Coupon Center list # noqa: E501 + + ## Interface description The general list interface of the card and coupon center returns all the cards and coupons of the currently logged in user (supports paging, filtering type, and valid/invalid switching). --- ## Query Parameters | Parameter name | Type | Required | Default value | Constraints | Description | |--------|------|------|--------|------|------| | `expired` | integer | No | `0` | `0` or `1` | `0` = Query valid cards and coupons; `1` = Check expired/used cards | | `limit` | integer | No | `10` | 1 ~ 20 | The number of cards returned per page | | `last_id` | integer | No | `0` | 1 ~ 1000000000 | Cursor paging: the last record of the previous page `id`, the home page does not transmit | | `expire_time` | integer | no | `0` | 1 ~ 2147483647 | Cursor pagination: with `last_id` Union usage expiration time (Unix timestamp) | | `order_by` | string | no | `latest` | `latest` / `expired` | Sorting method: `latest` = sort by latest receipt; `expired` = sort by expiration time in ascending order | | `type` | string | No | Empty (return all) | See the card type table below | Only return cards of the specified type | | `is_task_coupon` | integer | No | Do not pass (return all) | `0` or `1` | `0` = Only ordinary cards and coupons are returned; `1` = Only mission cards and coupons are returned; both are returned without passing | ### Supported coupon types (`type` parameter enumeration value) The main site (gate.io default site) supports the following types, and different sub-sites (Türkiye, United States, Malta, Australia) have their own whitelist restrictions. | `type` value | Coupon name | Version limit (below this version will not be returned/cannot be transferred) | |-----------|---------|-------------------------------| | `position_voucher` | Position experience coupon | Unlimited | | `tradfi_position_voucher` | TradFi position experience coupon | Android < 7320000 / iOS < 202507320000 does not return | | `contract_bonus` | Contract trial bonus | Unlimited | | `contract_bonus_new` | Contract experience coupon | Unlimited | | `commission_rebate` | Fee rebate coupons | Unlimited | | `hold_bonus` | Financial management trial bonus | Unlimited | | `point` | Point card | Unlimited (main site/Türkiye site only) | | `financial_rate` | Interest rate coupons | Unlimited | | `robot_bonus` | Robot trial bonus | Unlimited | | `loss_protection_copier` | Worry-free money for copying orders | Unlimited | | `vip_card` | VIP experience card | Unlimited | | `interest_voucher` | Leveraged coupons | Unlimited | | `p2p` | P2P transaction coupons | Unlimited | | `cash` | Cash Vouchers | Unlimited | | `crypto_loan_interest` | Mortgage currency interest reduction coupons | Android < 7290000 / iOS < 202507290000 does not return | | `copy_trading` | Trading experience bonus | Android < 7320000 / iOS < 202507320000 No return | | `alpha_voucher` | Alpha Cash Voucher | Android < 7320000 / iOS < 202507320000 Do not return | | `etf_voucher` | ETF trial fund | Android < 7320000 / iOS < 202507320000 No return | --- ##Response ### Outer structure ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": true, \"list\": [ ...array of coupon objects... ] } } ``` | Field | Type | Description | |------|------|------| | `code` | integer | `0` = success | | `message` | string | response message | | `data.next_page` | boolean | Whether there is a next page. `true` = There is more data, the `id` of the last item on this page needs to be `last_id` is passed in for the next request | | `data.list` | array | Array of coupon objects, see below for details | --- ### Public fields of card and coupon objects (included in all types) | Field name | Type | Description | |--------|------|------| | `id` | integer | Card and coupon issuance record ID (`coupon_send_issuing_log.id`), used for paging cursor `last_id` | | `details_id` | integer | The primary key ID of the user card details table (independent tables for each type) | | `coupon_type` | string | Coupon type, see the enumeration table above | | `name` | string | Card display name (i18n translated) | | `amount` | string | Coupon denomination (formatted string, including thousandth sign). Different types have different meanings, see explanation below | | `currency` | string | The denomination unit. Different types have different values, see explanation below | | `rule_new` | string | Use rule text (this field in the list interface always returns the empty string `\"\"`, and only in the detail interface) | | `status` | string | Card status, see status enumeration below | | `jump_url` | object | jump link | | `jump_url.web` | string | Web jump link | | `jump_url.app` | string | App jump link | | `jump_url.mini_app` | string | Mini program jump link (most types are empty strings) | | `help_url` | object | Help center link | | `help_url.web` | string | Web help link | | `help_url.app` | string | App help link | | `expire_time` | integer | Expiration time (Unix timestamp). Note: Some types will be adjusted to the actual expiration time after they have been activated or used | | `expire_time_order_by` | integer | Expiration time for sorting (taken from the original expiration time of the issuance record, not affected by activation) | | `expire_second` | integer | The number of seconds remaining before expiration (expired or point card type returns `0`) | | `has_usage_history` | boolean | Whether there is a usage record (the point card type is fixed to `true`, and the rest are judged based on the type) | | `has_progress` | boolean | Whether to display the progress bar (only `commission_rebate`, `interest_voucher` and task coupons that meet the conditions are `true`) | | `progress_config` | object | Progress bar configuration, when `has_progress` is `false`, each field is an empty string | | `progress_config.total_balance` | string | The total amount to be completed | | `progress_config.current_used` | string | Amount used | | `progress_config.current_achived` | string | Amount achieved | | `progress_config.currency` | string | Progress unit | | `activation_info` | object | Activation information exclusive to each type, see each type description below (types without exclusive information return empty objects `{}`) | | `is_task_coupon` | integer | `0` = ordinary coupon; `1` = task coupon | | `upgrade_toast` | boolean | Whether the user needs to be prompted to upgrade the App (`true` when the version is too old and cannot support the coupon) | | `task_title` | string | Task title (only task coupons have value, ordinary coupons are `\"\"`) | | `task_desc` | string | Task description (only task coupons have value, ordinary coupons are `\"\"`) | | `task_start_at` | integer | Task start timestamp (only `TASK_EXPIRED` status task coupons have value, the rest are `0`) | | `task_expire_at` | integer | Task expiration timestamp (currently fixed to `0`, reserved field) | | `task_completed_at` | integer | Task completion timestamp (currently fixed at `0`, reserved field) | | `extra` | array | Extended field, fixed return empty array `[]` | --- ### `status` status enumeration | Value | Applicable objects | Description | |----|---------|------| | `NOT_ACTIVE` | Ordinary coupons | Pending activation (not yet activated) | | `ACTIVATED` | Ordinary coupons | Activated (activating or after activation) | | `TO_BE_USED` | Ordinary coupons | To be used (valid and not used) | | `EXPIRED` | Ordinary coupons | Expired (expired without being used) | | `RECYCLED` | Ordinary cards and coupons | Recycled (such as contract recharge experience coupons are recycled) | | `INVALID` | Ordinary coupons | Expired | | `USED` | Ordinary coupons | Used/consumed | | `UNKNOWN` | Ordinary coupons | Unknown status | | `LOCKED` | Ordinary cards and coupons (`p2p`) | Locked (P2P transaction in progress, waiting for write-off) | | `TASK_START` | Task coupons | The task has not started (the coupon has been issued and the task is to be started) | | `TASK_WAIT` | Task coupons | Task in progress (to be completed) | | `TASK_DONE` | Task coupons | The task has been completed (receiving is being processed) | | `TASK_EXPIRED` | Task coupon | The task is not completed and has expired | | `TASK_NOT_STARTED_EXPIRED` | Task coupon | The task has expired before it started | | `TASK_RECEIVE_SUCCESS` | Task coupons | Task rewards received successfully | | `TASK_RECEIVE_FAIL` | Task coupons | Failed to receive task rewards | --- ### `amount` / `currency` Description of each type | `coupon_type` | `amount` description | `currency` value | |---------------|--------------|---------------| | `point` | Point card balance (including thousandths) | `\"POINT\"` | | `position_voucher` | `Coupon face amount × leverage multiple` (including thousandths) | Such as `\"USDT\"` | | `tradfi_position_voucher` | `Coupon face amount × leverage multiple` (including thousandths) | `\"USDx\"` | | `financial_rate` | Interest rate increase value + `%`, such as `\"5%\"` | `\"APR\"` | | `vip_card` | VIP level number, such as `\"4\"` | `\"VIP\"` | | `interest_voucher` | Interest rate discount percentage + `%` | Discount logo (Chinese site is `\"discount\"`, other sites are empty) | | `crypto_loan_interest` | Interest rate discount percentage + `%` | `\"\"` | | `alpha_voucher` | Coupon face amount (including thousandths) | Alpha base currency (such as `\"USDT\"` or `\"ETH\"`) | | Other types | Coupon face amount (including thousandths) | Capital currency symbol, such as `\"USDT\"` / `\"GT\"` / `\"BTC\"` | > **Note**: The `point` type additionally returns the `origin_amount` field (the original balance string with the trailing zeros removed), other types do not have this field. --- ### `activation_info` Exclusive fields for each type #### `interest_voucher` (leverage coupon) ```json { \"supported_pairs\": \"BTC/USDT\", \"transaction_type\": \"borrow\" } ``` | Field | Type | Description | |------|------|------| | `supported_pairs` | string | Applicable trading pairs, separated by `/`, such as `\"BTC/USDT\"` | | `transaction_type` | string | Transaction type (such as `borrow`) | #### `contract_bonus_new` (contract experience coupon) ```json { \"received_expired_hour\": 48 } ``` | Field | Type | Description | |------|------|------| | `received_expired_hour` | integer | The number of hours valid after activation (automatic recycling after timeout) | #### `contract_bonus` (Contract experience bonus) ```json { \"check_unified_account_mode\": true, \"received_expired_days\": 7, \"abtest\": false } ``` | Field | Type | Description | |------|------|------| | `check_unified_account_mode` | boolean | Whether to check the unified account mode (fixed `true`) | | `received_expired_days` | integer | Number of days valid after activation | | `abtest` | boolean | AB test flag (currently fixed to `false`) | #### `commission_rebate` (handling fee cashback coupon) ```json { \"market\": \"futures\", \"market_name\": \"Futures\" } ``` | Field | Type | Description | |------|------|------| | `market` | string | Applicable market, enumeration value: `spot` / `margin` / `futures` / `alpha` / `etf` / `tradfi` | | `market_name` | string | Market display name (i18n translated) | #### `robot_bonus` (robot experience bonus) ```json { \"designated_bots\": \"DISABLED\" } ``` | Field | Type | Description | |------|------|------| | `designated_bots` | string | `\"ENABLED\"` = can only be used by specified policies; `\"DISABLED\"` = Unlimited strategy | #### `position_voucher` (position experience coupon) ```json { \"symbols\": \"BTC_USDT\", \"leverage\": \"10\", \"need_user_funds\": 0, \"user_funds_amount\": \"100\", \"position_bonus\": \"500\" } ``` | Field | Type | Description | |------|------|------| | `symbols` | string | Applicable trading pairs (such as `\"BTC_USDT\"`), empty means no limit | | `leverage` | string | Leverage multiple | | `need_user_funds` | integer | `0` = No user-owned funds are required; `1` = Fund allocation is required | | `user_funds_amount` | string | The amount of funds required by the user (meaningful when `need_user_funds=1`) | | `position_bonus` | string | The original amount of the coupon (remove the trailing zero) | #### `tradfi_position_voucher` (TradFi position experience coupon) ```json { \"symbols\": \"AAPL\", \"leverage\": \"5\", \"position_bonus\": \"200\" } ``` | Field | Type | Description | |------|------|------| | `symbols` | string | Applicable to TradFi varieties (such as `\"AAPL\"`), empty means no limit | | `leverage` | string | Leverage multiple | | `position_bonus` | string | The original amount of the coupon (remove the trailing zero) | #### `etf_voucher` (ETF trial bonus) ```json { \"currency_markets\": \"BTC3L_USDT,ETH3L_USDT\", \"amount\": \"50\" } ``` | Field | Type | Description | |------|------|------| | `currency_markets` | string | List of applicable ETF markets (comma separated) | | `amount` | string | The original amount of the coupon (remove the trailing zero) | #### Other types `point` (point card), `hold_bonus` (financial experience fund), `loss_protection_copier` (worry-free money for following orders), `vip_card` (VIP experience card), `p2p` (P2P transaction coupon), `cash` (cash coupon) , `crypto_loan_interest` (interest-reduced coupon for mortgage loan), `copy_trading` (trading experience fee), `alpha_voucher` (Alpha cash coupon), `financial_rate` (interest-increasing coupon) and other types return empty objects: ```json {} ``` --- ## Complete response example ### Ordinary cards and coupons (contract experience money) ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": false, \"list\": [ { \"id\": 1234567, \"details_id\": 890, \"coupon_type\": \"contract_bonus\", \"name\": \"Futures Bonus\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"\", \"status\": \"NOT_ACTIVE\", \"jump_url\": { \"web\": \"/futures/USDT\", \"app\": \"/futures/USDT\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 86400, \"has_usage_history\": false, \"has_progress\": false, \"progress_config\": { \"total_balance\": \"\", \"current_used\": \"\", \"current_achived\": \"\", \"currency\": \"\" }, \"activation_info\": { \"check_unified_account_mode\": true, \"received_expired_days\": 7, \"abtest\": false }, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [] } ] } } ``` ### Task coupons (handling fee cashback coupons) ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": false, \"list\": [ { \"id\": 9876543, \"details_id\": 0, \"coupon_type\": \"commission_rebate\", \"name\": \"10% Futures Commission Rebate\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"\", \"status\": \"TASK_WAIT\", \"jump_url\": { \"web\": \"https://www.gate.io/futures\", \"app\": \"gateio://futures\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 172800, \"has_usage_history\": false, \"has_progress\": true, \"progress_config\": { \"total_balance\": \"1000\", \"current_used\": \"350\", \"current_achived\": \"350\", \"currency\": \"USDT\" }, \"activation_info\": { \"market\": \"futures\", \"market_name\": \"Futures\" }, \"is_task_coupon\": 1, \"upgrade_toast\": false, \"task_title\": \"Trade 1000 USDT to earn commission rebate\", \"task_desc\": \"Complete futures trading volume task to get 100 USDT commission rebate\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [] } ] } } ``` ### Point card (point) ```json { \"code\": 0, \"message\": \"Success\", \"data\": { \"next_page\": false, \"list\": [ { \"id\": 0, \"details_id\": 0, \"coupon_type\": \"point\", \"name\": \"Points\", \"amount\": \"1,234.56\", \"origin_amount\": \"1234.56\", \"currency\": \"POINT\", \"rule_new\": \"...\", \"status\": \"TO_BE_USED\", \"jump_url\": { \"web\": \"/trade/BTC_USDT\", \"app\": \"/trade/BTC_USDT\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 0, \"expire_time_order_by\": 0, \"expire_second\": 0, \"has_usage_history\": true, \"has_progress\": false, \"progress_config\": { \"total_balance\": \"\", \"current_used\": \"\", \"current_achived\": \"\", \"currency\": \"\" }, \"activation_info\": {}, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [] } ] } } ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_user_coupons_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int expired: Coupon status filter. `0` = query valid coupons (default); `1` = query expired/used coupons + :param int limit: Number of coupons returned per page, range 1-20, default 10 + :param int last_id: Cursor-based pagination: the `id` value of the last record from the previous page, omit (or pass 0) for the first page + :param int expire_time: Cursor-based pagination: used together with `last_id`, pass the `expire_time_order_by` value of the last record from the previous page (Unix timestamp), omit for the first page + :param str order_by: Sort order. `latest` = by latest claim time descending (default); `expired` = by expiration time ascending + :param str type: Coupon type filter. If not specified, all supported types are returned. Available values: `position_voucher` (position voucher), `tradfi_position_voucher` (TradFi position voucher), `contract_bonus` (futures bonus), `contract_bonus_new` (futures trial coupon), `commission_rebate` (commission rebate coupon), `hold_bonus` (earn trial bonus), `point` (point card), `financial_rate` (interest rate boost coupon), `robot_bonus` (trading bot bonus), `loss_protection_copier` (copy trading loss protection), `vip_card` (VIP trial card), `interest_voucher` (margin interest discount coupon), `p2p` (P2P trading deduction coupon), `cash` (cash coupon), `crypto_loan_interest` (crypto loan interest discount coupon), `copy_trading` (copy trading bonus), `alpha_voucher` (Alpha cash coupon), `etf_voucher` (ETF trial bonus) + :param int is_task_coupon: Task Coupon Filter. `0` = Return only regular coupons; `1` = Return only task coupons; Omit to return both + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ListUserCouponsResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'expired', + 'limit', + 'last_id', + 'expire_time', + 'order_by', + 'type', + 'is_task_coupon' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_user_coupons" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 20: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_user_coupons`, must be a value less than or equal to `20`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_user_coupons`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'last_id' in local_var_params and local_var_params['last_id'] > 1000000000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `last_id` when calling `list_user_coupons`, must be a value less than or equal to `1000000000`") # noqa: E501 + if self.api_client.client_side_validation and 'last_id' in local_var_params and local_var_params['last_id'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `last_id` when calling `list_user_coupons`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'expire_time' in local_var_params and local_var_params['expire_time'] > 2147483647: # noqa: E501 + raise ApiValueError("Invalid value for parameter `expire_time` when calling `list_user_coupons`, must be a value less than or equal to `2147483647`") # noqa: E501 + if self.api_client.client_side_validation and 'expire_time' in local_var_params and local_var_params['expire_time'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `expire_time` when calling `list_user_coupons`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'expired' in local_var_params and local_var_params['expired'] is not None: # noqa: E501 + query_params.append(('expired', local_var_params['expired'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'last_id' in local_var_params and local_var_params['last_id'] is not None: # noqa: E501 + query_params.append(('last_id', local_var_params['last_id'])) # noqa: E501 + if 'expire_time' in local_var_params and local_var_params['expire_time'] is not None: # noqa: E501 + query_params.append(('expire_time', local_var_params['expire_time'])) # noqa: E501 + if 'order_by' in local_var_params and local_var_params['order_by'] is not None: # noqa: E501 + query_params.append(('order_by', local_var_params['order_by'])) # noqa: E501 + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + if 'is_task_coupon' in local_var_params and local_var_params['is_task_coupon'] is not None: # noqa: E501 + query_params.append(('is_task_coupon', local_var_params['is_task_coupon'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/coupon/user-coupon-list', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListUserCouponsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_coupon_detail(self, coupon_type, detail_id, **kwargs): # noqa: E501 + """Coupon Center details # noqa: E501 + + ## Interface description The general details interface of the card and coupon center returns the complete detailed information of a single card and coupon. Compared with the list interface, it additionally includes: usage rule text, block-based card and coupon detailed attributes (`extra`), and source completion task information (`from_task`). ## Query Parameters | Parameter name | Type | Required | Constraints | Description | | ---------------- | ------- | --- | --------------------- | ------------------------------------------------- | | `coupon_type` | string | Yes | See coupon type enumeration | Coupon type, the value is the same as `coupon-list` has the same interface | | `detail_id` | integer | Yes | min:1, max:2147483647 | Ordinary card and coupon transfer `details_id`; the `id` of the task card and coupon transfer record (i.e. the `id` field in the list) | | `is_task_coupon` | integer | no | `0` or `1`, default `0` | `0` = Ordinary coupons; `1` = mission coupons | > **Note**: The `detail_id` semantics of ordinary coupons and mission coupons are different. > > - Ordinary cards and coupons: `detail_id` = the primary key of each type of user card and coupon table (`details_id` in the list) > - Task coupon: `detail_id` = primary key of issuance record table (`id` in the list) --- ##Response ### Outer structure ```json { \"code\": 0, \"message\": \"\", \"data\": { ...card details object... } } ``` ### Details object fields The details interface returns the same basic fields as the list interface, with differences in the following fields: rule_new | Field name | Type | Difference from list | Description | | ------------------- | ------- | ----------------- | -------------------------------------------- | | `rule_new` | string | **Value** (the list returns an empty string) | Card and coupon usage rule text (i18n translation) | | `extra` | array | **Value** (list returns `[]`) | For the detailed attributes of the cards and coupons in the partitions, please see the description below | | `from_task` | boolean | **New field** | Ordinary coupons redeemed by completing tasks (sub-coupons automatically issued after the task is completed) | | `task_start_at` | integer | **May have value** | Task coupon: task start timestamp; ordinary coupon (`from_task=true`): start time of the source task | | `task_expire_at` | integer | **May have value** | Task coupons: receive the validity expiration timestamp (`0` means no limit); ordinary cards and coupons are fixed `0` | | `task_completed_at` | integer | **May have value** | Task coupon: task completion timestamp; ordinary coupon (`from_task=true`): completion time of the source task | The remaining basic fields (`id`, `details_id`, `coupon_type`, `name`, `amount`, `currency`, `status`, `jump_url`, `help_url`, `expire_time`, `expire_second`, `has_ progress`, `progress_config`, `activation_info`, `is_task_coupon`, `upgrade_toast`, `task_title`, `task_desc`) are exactly the same as the list interface (`listUserCoupons`). --- ## `extra` field description `extra` is a **two-dimensional array**, composed of several \"blocks\", and the front end displays them separately by blocks. ``` extra = [ [block1_item1, block1_item2, ...], // Block 1: Card name/source/status [block2_item1, block2_item2, ...], // Block 2: Core attributes of cards and coupons [block3_item1, block3_item2, ...], // Block 3: time information ] ``` ### The structure of each item in `extra` | Field | Type | Description | | ------- | ---------------- | --------------- | | `type` | string | Display type, enumeration values ​​are shown in the table below | | `key` | string | Label text (i18n translated) | | `value` | string / integer | Value, type changes with `type` | ### `type` enumeration | `type` value | `value` type | description | | ----------- | ---------- | ------------------------ | | `string` | string | Normal text display | | `timestamp` | integer | Unix timestamp, the front end is responsible for formatting into date and time | | `day` | integer | Number of days (integer) | | `hour` | integer | Number of hours (integer) | | `status` | string | Status enum value (same meaning as `status` field) | | `btn` | string | With jump button, `value` is the button copy | --- ## Block 1 (fixed): Coupon name/source/status All types (except `point`) contain this block, the fixed fields are as follows: | Serial number | `type` | `key` (translation key) | `value` | Remarks | | --- | -------- | ----------------------------- | ------- | --------- | | 1 | `string` | `COUPON_VOUCHER_NAME` (coupon name) | Coupon name text | Required | | 2 | `string` | `COUPON_VOUCHER_SOURCE` (coupon source) | Source activity name | Return this item only if there is a source | | 3 | `status` | `COUPON_STATUS` (coupon status) | Status enumeration value | Required | > `extra` of type `point` (point card) is fixed to an empty array `[]`. --- ## Block 2 + Block 3: Exclusive fields for each type ### `contract_bonus` (contract experience bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | -------------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | --------------------------------- | ---------- | ----- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Required | | `day` | `COUPON_USAGE_DURATION` (duration of use) | Number of days valid after activation | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | activation timestamp | only if activated | --- ### `contract_bonus_new` (contract experience coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------ | ------------------ | ------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | Required | | `string` | `COUPON_MAXIMUM_LEVERAGE` (maximum leverage) | `NX` or `Unlimited` | Required | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair list | When there are limited trading pairs | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | --------------------------------- | ---------- | ---- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Required | | `hour` | `COUPON_USAGE_DURATION` (duration of use) | Number of hours valid after activation | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | Activation timestamp | When activated | --- ### `commission_rebate` (handling fee cashback coupon) **Block 2: Core Attributes** | `type` | `key` | `value` description | condition | | -------- | -------------------------------- | -------------- | --- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | Required | | `string` | `COUPON_REBATE_PERCENTAGE` (cashback ratio) | `N%` | Required | | `string` | `COUPON_BALANCE` (remaining balance) | `amount + space + currency` | Required | | `string` | `COUPON_USED_AMOUNT` (used amount) | `Amount + space + currency` | Required | | `string` | `COUPON_APPLICABLE_MARKET` (applicable market) | Market name | Required | **Block 3: Time Information** | `type` | `key` | `value` Description | Conditions | | ----------- | --------------------------------- | ---------- | --------------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Vouchers that require activation are displayed | | `day` | `COUPON_USAGE_DURATION` (duration of use) | Number of days valid after activation | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | Activation timestamp | When the status is activated/used/expired | --- ### `hold_bonus` (Financial Management Experience Bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | -------------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `financial_rate` (interest rate coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------------ | ----------------------- | --- | | `string` | `COUPON_RATE_UP_CAP` (rate increase cap) | `amount + currency` or `Unlimited` | Required | | `string` | `COUPON_RATE_UP_APR` (rate increase ratio) | `N%APR` | Required | | `string` | `COUPON_RATE_UP_TERM_DAYS` (number of days to increase interest rate) | `N days` or `Unlimited` | Required | | `string` | `COUPON_AVAILABLE_INVESTMENT_TYPE` (available financial management type) | Such as `Lend & Earn` | required | | `string` | `COUPON_AVAILABLE_PRODUCTS` (available products) | List of product names (comma separated) | Required | | `string` | `COUPON_MINIMUM_INVESTMENT_UP` (minimum purchase amount) | `≥ Amount Currency` or interval | required | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `robot_bonus` (robot experience bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------ | ------------------------ | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (coupon amount) | `amount + space + Currency` | Required | | `string` | `COUPON_APPLICABLE_BOTS` (for robots) | such as `Future Grids` | Unlimited robot time | | `string` | `COUPON_MAXIMUM_LEVERAGE` (maximum leverage multiple) | Multiples | Unlimited and with leverage restrictions | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair or `All` | When not limited to robots | | `string` | `COUPON_STOP_LOSS_AMOUNT` (stop loss amount) | `Amount + Currency` | When there is a stop loss amount | | `btn` | `COUPON_DESIGNATED_BOTS` (limited to bots) | `ViewMyaccountLeft` Button copy | When limited to robots | | `day` | `COUPON_RUNTIME_DURATION` (running duration) | Number of days | required | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `loss_protection_copier` (worry-free money for following orders) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ----------------------------------- | ------------------- | ------------ | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | Required | | `string` | `COUPON_APPLICABLE_MARKET` (where applicable) | `Contract` or `Spot` | Required | | `string` | `COUPON_MINIMUM_INVESTMENT` (minimum order amount) | `amount + currency` | When there is a minimum amount limit | | `string` | `COUPON_AVAILABLE_TRADERS` (available traders) | Nickname list | When Partially Available (Designated Trader) | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | use timestamp | when there is use time | --- ### `position_voucher` (position experience coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------ | ----------------- | ------- | | `string` | `COUPON_VOUCHER_AMOUNT` (coupon amount) | `Amount × Leverage + Space + Currency` | Required | | `string` | `COUPON_APPLICABLE_MARKET` (applicable market) | `USDT Perpetual Contract` | Required | | `hour` | `COUPON_POSITION_DURATION` (position duration) | Number of hours | Required | | `string` | `COUPON_LEVERAGE` (leverage multiple) | `NX` | Required | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair, empty means no limit | Required | | `string` | `COUPON_USER_INVESTMENT_QUOTA` (capital quota) | `amount + currency` | When user allocation is required | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `tradfi_position_voucher` (TradFi position experience coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------------ | ----------------- | | `string` | `COUPON_VOUCHER_AMOUNT` (coupon amount) | `Amount × Leverage + Space + Currency` | | `string` | `COUPON_POSITION_DURATION` (position duration) | `N trading days` | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | TradFi varieties | | `string` | `COUPON_LEVERAGE` (leverage multiple) | `Nx` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `vip_card` (VIP experience card) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------- | ---------- | | `string` | `COUPON_VIP_TIER` (VIP level) | `VIPN` | | `day` | `COUPON_BENEFIT_DURATION` (benefits duration) | Number of days | **Block 3: Time information** | `type` | `key` | `value` Description | Conditions | | ----------- | --------------------------------- | ---------- | ----------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Create timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | Activation timestamp | When the status is used or expired | | `timestamp` | `COUPON_EXPIRY_TIME` (expiration time) | Expiration timestamp | When the status is used or expired | --- ### `p2p` (P2P transaction discount coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------- | -------------- | | `string` | `COUPON_DEDUCTION_LIMIT` (deduction limit) | `amount + currency` | | `string` | `COUPON_DEDUCTION_RATIO` (discount ratio) | `N%` | | `string` | `COUPON_USAGE_CONDITIONS` (conditions of use) | `No less than N currencies per transaction` | | `string` | `COUPON_SUPPORTED_FIAT` (for fiat currencies) | Fiat currency list or `all` | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `interest_voucher` (leverage coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | --------------------------------------- | ----------------- | -------- | | `string` | `max_discount_amount` (maximum discount amount) | `amount + currency` | Required | | `string` | `COUPON_APPLICABLE_TRADES` (applicable transactions) | `Isolated Margin` | Required | | `string` | `COUPON_INTEREST_DISCOUNT` (reduction ratio) | `N%` | Required | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair, empty means no limit | Required | | `string` | `COUPON_BALANCE` (remaining balance) | `amount + currency` | Required | | `string` | `COUPON_BORROWING_AMOUNT_LIMIT` (borrowing amount limit) | Borrowing amount range | When there is a limit on the borrowing amount | | `hour` | `COUPON_VALIDITY_PERIOD` (reduction time) | Number of hours | When set | **Block 3: Time Information** | `type` | `key` | `value` Description | Conditions | | ----------- | ------------------------------------- | ---------- | -------------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | When the status is pending or expired | | `timestamp` | `COUPON_EFFECTIVE_TIME` (reduction start time) | Start using timestamp | When the status is invalid/in use/used | | `timestamp` | `COUPON_DISCOUNT_EXPIRY_TIME` (reduction expiry time) | Reduction expiration timestamp | When the status is invalid/in use/used | --- ### `cash` (cash coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + currency` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When there is a redemption time | --- ### `crypto_loan_interest` (Mortgage loan interest coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ---------------------------------------------- | ---------- | -------- | | `string` | `coupon_center_discount_max_amount` (maximum discount amount) | `amount + currency` | Required | | `string` | `COUPON_INTEREST_DISCOUNT` (reduction ratio) | `N%` | Required | | `string` | `coupon_center_loan_min_amount` (minimum loan amount) | `amount + currency` | When there is a minimum amount requirement | | `hour` | `coupon_center_interest_discount_period` (discount duration) | Number of hours | Required | | `string` | `coupon_center_trade_applicable` (applicable transactions) | `demand deposit` | Required | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `copy_trading` (Following experience bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ---------------------------------- | ------------------- | ---- | | `string` | `COUPON_VOUCHER_AMOUNT` (face value) | `amount + currency` | Required | | `string` | `coupon_applicable_traders` (applicable traders) | `all` or `specified traders` | Required | | `string` | `coupon_trade_category` (applicable transaction type) | `Spot` or `Contract` | Required | | `day` | `coupon_usage_days` (the number of days the experience is valid) | Number of days | Required | | `string` | `COUPON_STOP_LOSS_AMOUNT` (stop loss amount) | `amount + currency` | Required | | `string` | `coupon_ineligible_mkts` (cannot experience the market) | Market list | When there are restrictions | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `alpha_voucher` (Alpha cash coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + currency` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When there is a collection time | --- ### `etf_voucher` (ETF trial bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------------ | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + currency` | | `hour` | `coupon_trial_duration` (trial duration) | Number of hours | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | ETF market list | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | use timestamp | when there is use time | --- ### `point` (point card) `extra` always returns `[]` without any blocks. --- ## Complete response example ### Ordinary cards and coupons (handling fee cashback coupons) ```json { \"code\": 0, \"message\": \"\", \"data\": { \"id\": 1234567, \"details_id\": 890, \"coupon_type\": \"commission_rebate\", \"name\": \"10% Futures Commission Rebate\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"Rebate up to 100% of futures trading fee within 30 days.\", \"status\": \"TO_BE_USED\", \"jump_url\": { \"web\": \"/futures/USDT\", \"app\": \"/futures/USDT\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 86400, \"has_usage_history\": false, \"has_progress\": true, \"progress_config\": { \"total_balance\": \"100\", \"current_used\": \"30\", \"current_achived\": \"30\", \"currency\": \"USDT\" }, \"activation_info\": { \"market\": \"futures\", \"market_name\": \"Futures\" }, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"from_task\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [ [ { \"type\": \"string\", \"key\": \"Coupon name\", \"value\": \"10% Futures Commission Rebate\" }, { \"type\": \"string\", \"key\": \"Card and coupon source\", \"value\": \"New user registration activity\" }, { \"type\": \"status\", \"key\": \"Card and coupon status\", \"value\": \"TO_BE_USED\" } ], [ { \"type\": \"string\", \"key\": \"Card coupon amount\", \"value\": \"100 USDT\" }, { \"type\": \"string\", \"key\": \"Cashback ratio\", \"value\": \"10%\" }, { \"type\": \"string\", \"key\": \"Remaining Amount\", \"value\": \"100 USDT\" }, { \"type\": \"string\", \"key\": \"Used quota\", \"value\": \"0 USDT\" }, { \"type\": \"string\", \"key\": \"Applicable markets\", \"value\": \"Futures\" } ], [ { \"type\": \"timestamp\", \"key\": \"Get time\", \"value\": 1757000000 }, { \"type\": \"day\", \"key\": \"duration\", \"value\": 30 } ] ] } } ``` ### Task coupons (position experience coupons) ```json { \"code\": 0, \"message\": \"\", \"data\": { \"id\": 9876543, \"details_id\": 0, \"coupon_type\": \"position_voucher\", \"name\": \"position experience coupon\", \"amount\": \"5,000\", \"currency\": \"USDT\", \"rule_new\": \"Experience the position coupon rules...\", \"status\": \"TASK_WAIT\", \"jump_url\": { \"web\": \"https://www.gate.io/futures\", \"app\": \"gateio://futures\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 172800, \"has_usage_history\": false, \"has_progress\": true, \"progress_config\": { \"total_balance\": \"10000\", \"current_used\": \"3000\", \"current_achived\": \"3000\", \"currency\": \"USDT\" }, \"activation_info\": { \"symbols\": \"BTC_USDT\", \"leverage\": \"10\", \"need_user_funds\": 0, \"user_funds_amount\": \"\", \"position_bonus\": \"500\" }, \"is_task_coupon\": 1, \"upgrade_toast\": false, \"from_task\": false, \"task_title\": \"Complete 10,000 USDT contract trading volume and obtain position experience coupon\", \"task_desc\": \"Complete the specified trading volume task in the perpetual contract\", \"task_start_at\": 1757000000, \"task_expire_at\": 1760000000, \"task_completed_at\": 0, \"extra\": [ [ { \"type\": \"string\", \"key\": \"Card name\", \"value\": \"position experience coupon\" }, { \"type\": \"status\", \"key\": \"Card and coupon status\", \"value\": \"TASK_WAIT\" } ], [ { \"type\": \"string\", \"key\": \"Coupon amount\", \"value\": \"5,000 USDT\" }, { \"type\": \"string\", \"key\": \"Applicable market\", \"value\": \"USDT perpetual contract\" }, { \"type\": \"hour\", \"key\": \"position duration\", \"value\": 24 }, { \"type\": \"string\", \"key\": \"Leverage multiple\", \"value\": \"10X\" }, { \"type\": \"string\", \"key\": \"Limited trading pairs\", \"value\": \"BTCUSDT\" } ], [ { \"type\": \"timestamp\", \"key\": \"Get time\", \"value\": 1757000000 } ] ] } } ``` ### P2P transaction coupon (p2p) ```json { \"code\": 0, \"message\": \"\", \"data\": { \"id\": 5678901, \"details_id\": 234, \"coupon_type\": \"p2p\", \"name\": \"5.5% P2P transaction discount coupon\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"Each P2P transaction can deduct up to 100 USDT in handling fees, with a discount rate of 5.5%, and each transaction is not less than 200 USDT.\", \"status\": \"TO_BE_USED\", \"jump_url\": { \"web\": \"/p2p\", \"app\": \"gateio://p2p\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 2592000, \"has_usage_history\": false, \"has_progress\": false, \"progress_config\": { \"total_balance\": \"\", \"current_used\": \"\", \"current_achived\": \"\", \"currency\": \"\" }, \"activation_info\": {}, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"from_task\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [ [ { \"type\": \"string\", \"key\": \"Coupon name\", \"value\": \"5.5% P2P transaction discount coupon\" }, { \"type\": \"string\", \"key\": \"Card and coupon source\", \"value\": \"New user registration activity\" }, { \"type\": \"status\", \"key\": \"Card and coupon status\", \"value\": \"TO_BE_USED\" } ], [ { \"type\": \"string\", \"key\": \"deduction limit\", \"value\": \"100 USDT\" }, { \"type\": \"string\", \"key\": \"Discount ratio\", \"value\": \"5.5%\" }, { \"type\": \"string\", \"key\": \"Usage conditions\", \"value\": \"Each transaction must not be less than 200 USDT\" }, { \"type\": \"string\", \"key\": \"Applicable legal currency\", \"value\": \"CNY, USD\" } ], [ { \"type\": \"timestamp\", \"key\": \"Get time\", \"value\": 1757000000 }, { \"type\": \"timestamp\", \"key\": \"expiration time\", \"value\": 1760000000 } ] ] } } ``` --- ## Error code | `code` | Description | | -------------------------------------------- | ------------------------- | | `0` | Success | | `10001`(`COUPON_SEND_ISSUING_LOG_NOT_FOUND`) | The card and coupon record does not exist or does not belong to the current user | | `10000` (`PARAMS_INVALID`) | The parameter is invalid (such as the task card is missing coupon_info) | | `50105` (`INVALID_PARAMETERS`) | Input parameter verification failed (such as coupon_type illegal) | # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_coupon_detail(coupon_type, detail_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str coupon_type: Coupon type enum. If not specified, all supported types are returned. Available values: `position_voucher` (position voucher), `tradfi_position_voucher` (TradFi position voucher), `contract_bonus` (futures bonus), `contract_bonus_new` (futures trial coupon), `commission_rebate` (commission rebate coupon), `hold_bonus` (earn trial bonus), `point` (point card), `financial_rate` (interest rate boost coupon), `robot_bonus` (trading bot bonus), `loss_protection_copier` (copy trading loss protection), `vip_card` (VIP trial card), `interest_voucher` (margin interest discount coupon), `p2p` (P2P trading deduction coupon), `cash` (cash coupon), `crypto_loan_interest` (crypto loan interest discount coupon), `copy_trading` (copy trading bonus), `alpha_voucher` (Alpha cash coupon), `etf_voucher` (ETF trial bonus) (required) + :param int detail_id: Coupon ID. **Regular coupon**: pass `details_id` from the list (primary key of each type's user coupon table); **Task coupon**: pass `id` from the list (primary key of the distribution record table) (required) + :param int is_task_coupon: Coupon source type. `0` = regular coupon (default); `1` = task coupon. This parameter determines the query logic for `detail_id` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.GetUserCouponDetailResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_user_coupon_detail_with_http_info(coupon_type, detail_id, **kwargs) # noqa: E501 + + def get_user_coupon_detail_with_http_info(self, coupon_type, detail_id, **kwargs): # noqa: E501 + """Coupon Center details # noqa: E501 + + ## Interface description The general details interface of the card and coupon center returns the complete detailed information of a single card and coupon. Compared with the list interface, it additionally includes: usage rule text, block-based card and coupon detailed attributes (`extra`), and source completion task information (`from_task`). ## Query Parameters | Parameter name | Type | Required | Constraints | Description | | ---------------- | ------- | --- | --------------------- | ------------------------------------------------- | | `coupon_type` | string | Yes | See coupon type enumeration | Coupon type, the value is the same as `coupon-list` has the same interface | | `detail_id` | integer | Yes | min:1, max:2147483647 | Ordinary card and coupon transfer `details_id`; the `id` of the task card and coupon transfer record (i.e. the `id` field in the list) | | `is_task_coupon` | integer | no | `0` or `1`, default `0` | `0` = Ordinary coupons; `1` = mission coupons | > **Note**: The `detail_id` semantics of ordinary coupons and mission coupons are different. > > - Ordinary cards and coupons: `detail_id` = the primary key of each type of user card and coupon table (`details_id` in the list) > - Task coupon: `detail_id` = primary key of issuance record table (`id` in the list) --- ##Response ### Outer structure ```json { \"code\": 0, \"message\": \"\", \"data\": { ...card details object... } } ``` ### Details object fields The details interface returns the same basic fields as the list interface, with differences in the following fields: rule_new | Field name | Type | Difference from list | Description | | ------------------- | ------- | ----------------- | -------------------------------------------- | | `rule_new` | string | **Value** (the list returns an empty string) | Card and coupon usage rule text (i18n translation) | | `extra` | array | **Value** (list returns `[]`) | For the detailed attributes of the cards and coupons in the partitions, please see the description below | | `from_task` | boolean | **New field** | Ordinary coupons redeemed by completing tasks (sub-coupons automatically issued after the task is completed) | | `task_start_at` | integer | **May have value** | Task coupon: task start timestamp; ordinary coupon (`from_task=true`): start time of the source task | | `task_expire_at` | integer | **May have value** | Task coupons: receive the validity expiration timestamp (`0` means no limit); ordinary cards and coupons are fixed `0` | | `task_completed_at` | integer | **May have value** | Task coupon: task completion timestamp; ordinary coupon (`from_task=true`): completion time of the source task | The remaining basic fields (`id`, `details_id`, `coupon_type`, `name`, `amount`, `currency`, `status`, `jump_url`, `help_url`, `expire_time`, `expire_second`, `has_ progress`, `progress_config`, `activation_info`, `is_task_coupon`, `upgrade_toast`, `task_title`, `task_desc`) are exactly the same as the list interface (`listUserCoupons`). --- ## `extra` field description `extra` is a **two-dimensional array**, composed of several \"blocks\", and the front end displays them separately by blocks. ``` extra = [ [block1_item1, block1_item2, ...], // Block 1: Card name/source/status [block2_item1, block2_item2, ...], // Block 2: Core attributes of cards and coupons [block3_item1, block3_item2, ...], // Block 3: time information ] ``` ### The structure of each item in `extra` | Field | Type | Description | | ------- | ---------------- | --------------- | | `type` | string | Display type, enumeration values ​​are shown in the table below | | `key` | string | Label text (i18n translated) | | `value` | string / integer | Value, type changes with `type` | ### `type` enumeration | `type` value | `value` type | description | | ----------- | ---------- | ------------------------ | | `string` | string | Normal text display | | `timestamp` | integer | Unix timestamp, the front end is responsible for formatting into date and time | | `day` | integer | Number of days (integer) | | `hour` | integer | Number of hours (integer) | | `status` | string | Status enum value (same meaning as `status` field) | | `btn` | string | With jump button, `value` is the button copy | --- ## Block 1 (fixed): Coupon name/source/status All types (except `point`) contain this block, the fixed fields are as follows: | Serial number | `type` | `key` (translation key) | `value` | Remarks | | --- | -------- | ----------------------------- | ------- | --------- | | 1 | `string` | `COUPON_VOUCHER_NAME` (coupon name) | Coupon name text | Required | | 2 | `string` | `COUPON_VOUCHER_SOURCE` (coupon source) | Source activity name | Return this item only if there is a source | | 3 | `status` | `COUPON_STATUS` (coupon status) | Status enumeration value | Required | > `extra` of type `point` (point card) is fixed to an empty array `[]`. --- ## Block 2 + Block 3: Exclusive fields for each type ### `contract_bonus` (contract experience bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | -------------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | --------------------------------- | ---------- | ----- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Required | | `day` | `COUPON_USAGE_DURATION` (duration of use) | Number of days valid after activation | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | activation timestamp | only if activated | --- ### `contract_bonus_new` (contract experience coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------ | ------------------ | ------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | Required | | `string` | `COUPON_MAXIMUM_LEVERAGE` (maximum leverage) | `NX` or `Unlimited` | Required | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair list | When there are limited trading pairs | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | --------------------------------- | ---------- | ---- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Required | | `hour` | `COUPON_USAGE_DURATION` (duration of use) | Number of hours valid after activation | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | Activation timestamp | When activated | --- ### `commission_rebate` (handling fee cashback coupon) **Block 2: Core Attributes** | `type` | `key` | `value` description | condition | | -------- | -------------------------------- | -------------- | --- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | Required | | `string` | `COUPON_REBATE_PERCENTAGE` (cashback ratio) | `N%` | Required | | `string` | `COUPON_BALANCE` (remaining balance) | `amount + space + currency` | Required | | `string` | `COUPON_USED_AMOUNT` (used amount) | `Amount + space + currency` | Required | | `string` | `COUPON_APPLICABLE_MARKET` (applicable market) | Market name | Required | **Block 3: Time Information** | `type` | `key` | `value` Description | Conditions | | ----------- | --------------------------------- | ---------- | --------------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Vouchers that require activation are displayed | | `day` | `COUPON_USAGE_DURATION` (duration of use) | Number of days valid after activation | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | Activation timestamp | When the status is activated/used/expired | --- ### `hold_bonus` (Financial Management Experience Bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | -------------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `financial_rate` (interest rate coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------------ | ----------------------- | --- | | `string` | `COUPON_RATE_UP_CAP` (rate increase cap) | `amount + currency` or `Unlimited` | Required | | `string` | `COUPON_RATE_UP_APR` (rate increase ratio) | `N%APR` | Required | | `string` | `COUPON_RATE_UP_TERM_DAYS` (number of days to increase interest rate) | `N days` or `Unlimited` | Required | | `string` | `COUPON_AVAILABLE_INVESTMENT_TYPE` (available financial management type) | Such as `Lend & Earn` | required | | `string` | `COUPON_AVAILABLE_PRODUCTS` (available products) | List of product names (comma separated) | Required | | `string` | `COUPON_MINIMUM_INVESTMENT_UP` (minimum purchase amount) | `≥ Amount Currency` or interval | required | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `robot_bonus` (robot experience bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------ | ------------------------ | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (coupon amount) | `amount + space + Currency` | Required | | `string` | `COUPON_APPLICABLE_BOTS` (for robots) | such as `Future Grids` | Unlimited robot time | | `string` | `COUPON_MAXIMUM_LEVERAGE` (maximum leverage multiple) | Multiples | Unlimited and with leverage restrictions | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair or `All` | When not limited to robots | | `string` | `COUPON_STOP_LOSS_AMOUNT` (stop loss amount) | `Amount + Currency` | When there is a stop loss amount | | `btn` | `COUPON_DESIGNATED_BOTS` (limited to bots) | `ViewMyaccountLeft` Button copy | When limited to robots | | `day` | `COUPON_RUNTIME_DURATION` (running duration) | Number of days | required | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `loss_protection_copier` (worry-free money for following orders) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ----------------------------------- | ------------------- | ------------ | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + space + currency` | Required | | `string` | `COUPON_APPLICABLE_MARKET` (where applicable) | `Contract` or `Spot` | Required | | `string` | `COUPON_MINIMUM_INVESTMENT` (minimum order amount) | `amount + currency` | When there is a minimum amount limit | | `string` | `COUPON_AVAILABLE_TRADERS` (available traders) | Nickname list | When Partially Available (Designated Trader) | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | use timestamp | when there is use time | --- ### `position_voucher` (position experience coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ------------------------------------ | ----------------- | ------- | | `string` | `COUPON_VOUCHER_AMOUNT` (coupon amount) | `Amount × Leverage + Space + Currency` | Required | | `string` | `COUPON_APPLICABLE_MARKET` (applicable market) | `USDT Perpetual Contract` | Required | | `hour` | `COUPON_POSITION_DURATION` (position duration) | Number of hours | Required | | `string` | `COUPON_LEVERAGE` (leverage multiple) | `NX` | Required | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair, empty means no limit | Required | | `string` | `COUPON_USER_INVESTMENT_QUOTA` (capital quota) | `amount + currency` | When user allocation is required | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `tradfi_position_voucher` (TradFi position experience coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------------ | ----------------- | | `string` | `COUPON_VOUCHER_AMOUNT` (coupon amount) | `Amount × Leverage + Space + Currency` | | `string` | `COUPON_POSITION_DURATION` (position duration) | `N trading days` | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | TradFi varieties | | `string` | `COUPON_LEVERAGE` (leverage multiple) | `Nx` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `vip_card` (VIP experience card) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------- | ---------- | | `string` | `COUPON_VIP_TIER` (VIP level) | `VIPN` | | `day` | `COUPON_BENEFIT_DURATION` (benefits duration) | Number of days | **Block 3: Time information** | `type` | `key` | `value` Description | Conditions | | ----------- | --------------------------------- | ---------- | ----------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Create timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_PERIOD` (activation validity period) | Activation expiration timestamp | Required | | `timestamp` | `COUPON_ACTIVATION_TIME` (activation time) | Activation timestamp | When the status is used or expired | | `timestamp` | `COUPON_EXPIRY_TIME` (expiration time) | Expiration timestamp | When the status is used or expired | --- ### `p2p` (P2P transaction discount coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------- | -------------- | | `string` | `COUPON_DEDUCTION_LIMIT` (deduction limit) | `amount + currency` | | `string` | `COUPON_DEDUCTION_RATIO` (discount ratio) | `N%` | | `string` | `COUPON_USAGE_CONDITIONS` (conditions of use) | `No less than N currencies per transaction` | | `string` | `COUPON_SUPPORTED_FIAT` (for fiat currencies) | Fiat currency list or `all` | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `interest_voucher` (leverage coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | --------------------------------------- | ----------------- | -------- | | `string` | `max_discount_amount` (maximum discount amount) | `amount + currency` | Required | | `string` | `COUPON_APPLICABLE_TRADES` (applicable transactions) | `Isolated Margin` | Required | | `string` | `COUPON_INTEREST_DISCOUNT` (reduction ratio) | `N%` | Required | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | Trading pair, empty means no limit | Required | | `string` | `COUPON_BALANCE` (remaining balance) | `amount + currency` | Required | | `string` | `COUPON_BORROWING_AMOUNT_LIMIT` (borrowing amount limit) | Borrowing amount range | When there is a limit on the borrowing amount | | `hour` | `COUPON_VALIDITY_PERIOD` (reduction time) | Number of hours | When set | **Block 3: Time Information** | `type` | `key` | `value` Description | Conditions | | ----------- | ------------------------------------- | ---------- | -------------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | When the status is pending or expired | | `timestamp` | `COUPON_EFFECTIVE_TIME` (reduction start time) | Start using timestamp | When the status is invalid/in use/used | | `timestamp` | `COUPON_DISCOUNT_EXPIRY_TIME` (reduction expiry time) | Reduction expiration timestamp | When the status is invalid/in use/used | --- ### `cash` (cash coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + currency` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When there is a redemption time | --- ### `crypto_loan_interest` (Mortgage loan interest coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ---------------------------------------------- | ---------- | -------- | | `string` | `coupon_center_discount_max_amount` (maximum discount amount) | `amount + currency` | Required | | `string` | `COUPON_INTEREST_DISCOUNT` (reduction ratio) | `N%` | Required | | `string` | `coupon_center_loan_min_amount` (minimum loan amount) | `amount + currency` | When there is a minimum amount requirement | | `hour` | `coupon_center_interest_discount_period` (discount duration) | Number of hours | Required | | `string` | `coupon_center_trade_applicable` (applicable transactions) | `demand deposit` | Required | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `copy_trading` (Following experience bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | Conditions | | -------- | ---------------------------------- | ------------------- | ---- | | `string` | `COUPON_VOUCHER_AMOUNT` (face value) | `amount + currency` | Required | | `string` | `coupon_applicable_traders` (applicable traders) | `all` or `specified traders` | Required | | `string` | `coupon_trade_category` (applicable transaction type) | `Spot` or `Contract` | Required | | `day` | `coupon_usage_days` (the number of days the experience is valid) | Number of days | Required | | `string` | `COUPON_STOP_LOSS_AMOUNT` (stop loss amount) | `amount + currency` | Required | | `string` | `coupon_ineligible_mkts` (cannot experience the market) | Market list | When there are restrictions | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------- | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When the status is used | --- ### `alpha_voucher` (Alpha cash coupon) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ----------------------------- | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + currency` | **Block 3: Time Information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | Use timestamp | When there is a collection time | --- ### `etf_voucher` (ETF trial bonus) **Block 2: Core Attributes** | `type` | `key` | `value` Description | | -------- | ------------------------------------ | ---------- | | `string` | `COUPON_VOUCHER_AMOUNT` (voucher amount) | `amount + currency` | | `hour` | `coupon_trial_duration` (trial duration) | Number of hours | | `string` | `COUPON_LIMITED_TRADING_PAIR` (limited trading pair) | ETF market list | **Block 3: Time information** | `type` | `key` | `value` description | condition | | ----------- | -------------------------- | ---------- | ------ | | `timestamp` | `COUPON_OBTAINED_AT` (get time) | Get timestamp | Required | | `timestamp` | `COUPON_VALID_UNTIL` (expiration time) | Expiration timestamp | Required | | `timestamp` | `COUPON_USED_AT` (use time) | use timestamp | when there is use time | --- ### `point` (point card) `extra` always returns `[]` without any blocks. --- ## Complete response example ### Ordinary cards and coupons (handling fee cashback coupons) ```json { \"code\": 0, \"message\": \"\", \"data\": { \"id\": 1234567, \"details_id\": 890, \"coupon_type\": \"commission_rebate\", \"name\": \"10% Futures Commission Rebate\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"Rebate up to 100% of futures trading fee within 30 days.\", \"status\": \"TO_BE_USED\", \"jump_url\": { \"web\": \"/futures/USDT\", \"app\": \"/futures/USDT\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 86400, \"has_usage_history\": false, \"has_progress\": true, \"progress_config\": { \"total_balance\": \"100\", \"current_used\": \"30\", \"current_achived\": \"30\", \"currency\": \"USDT\" }, \"activation_info\": { \"market\": \"futures\", \"market_name\": \"Futures\" }, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"from_task\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [ [ { \"type\": \"string\", \"key\": \"Coupon name\", \"value\": \"10% Futures Commission Rebate\" }, { \"type\": \"string\", \"key\": \"Card and coupon source\", \"value\": \"New user registration activity\" }, { \"type\": \"status\", \"key\": \"Card and coupon status\", \"value\": \"TO_BE_USED\" } ], [ { \"type\": \"string\", \"key\": \"Card coupon amount\", \"value\": \"100 USDT\" }, { \"type\": \"string\", \"key\": \"Cashback ratio\", \"value\": \"10%\" }, { \"type\": \"string\", \"key\": \"Remaining Amount\", \"value\": \"100 USDT\" }, { \"type\": \"string\", \"key\": \"Used quota\", \"value\": \"0 USDT\" }, { \"type\": \"string\", \"key\": \"Applicable markets\", \"value\": \"Futures\" } ], [ { \"type\": \"timestamp\", \"key\": \"Get time\", \"value\": 1757000000 }, { \"type\": \"day\", \"key\": \"duration\", \"value\": 30 } ] ] } } ``` ### Task coupons (position experience coupons) ```json { \"code\": 0, \"message\": \"\", \"data\": { \"id\": 9876543, \"details_id\": 0, \"coupon_type\": \"position_voucher\", \"name\": \"position experience coupon\", \"amount\": \"5,000\", \"currency\": \"USDT\", \"rule_new\": \"Experience the position coupon rules...\", \"status\": \"TASK_WAIT\", \"jump_url\": { \"web\": \"https://www.gate.io/futures\", \"app\": \"gateio://futures\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 172800, \"has_usage_history\": false, \"has_progress\": true, \"progress_config\": { \"total_balance\": \"10000\", \"current_used\": \"3000\", \"current_achived\": \"3000\", \"currency\": \"USDT\" }, \"activation_info\": { \"symbols\": \"BTC_USDT\", \"leverage\": \"10\", \"need_user_funds\": 0, \"user_funds_amount\": \"\", \"position_bonus\": \"500\" }, \"is_task_coupon\": 1, \"upgrade_toast\": false, \"from_task\": false, \"task_title\": \"Complete 10,000 USDT contract trading volume and obtain position experience coupon\", \"task_desc\": \"Complete the specified trading volume task in the perpetual contract\", \"task_start_at\": 1757000000, \"task_expire_at\": 1760000000, \"task_completed_at\": 0, \"extra\": [ [ { \"type\": \"string\", \"key\": \"Card name\", \"value\": \"position experience coupon\" }, { \"type\": \"status\", \"key\": \"Card and coupon status\", \"value\": \"TASK_WAIT\" } ], [ { \"type\": \"string\", \"key\": \"Coupon amount\", \"value\": \"5,000 USDT\" }, { \"type\": \"string\", \"key\": \"Applicable market\", \"value\": \"USDT perpetual contract\" }, { \"type\": \"hour\", \"key\": \"position duration\", \"value\": 24 }, { \"type\": \"string\", \"key\": \"Leverage multiple\", \"value\": \"10X\" }, { \"type\": \"string\", \"key\": \"Limited trading pairs\", \"value\": \"BTCUSDT\" } ], [ { \"type\": \"timestamp\", \"key\": \"Get time\", \"value\": 1757000000 } ] ] } } ``` ### P2P transaction coupon (p2p) ```json { \"code\": 0, \"message\": \"\", \"data\": { \"id\": 5678901, \"details_id\": 234, \"coupon_type\": \"p2p\", \"name\": \"5.5% P2P transaction discount coupon\", \"amount\": \"100\", \"currency\": \"USDT\", \"rule_new\": \"Each P2P transaction can deduct up to 100 USDT in handling fees, with a discount rate of 5.5%, and each transaction is not less than 200 USDT.\", \"status\": \"TO_BE_USED\", \"jump_url\": { \"web\": \"/p2p\", \"app\": \"gateio://p2p\", \"mini_app\": \"\" }, \"help_url\": { \"web\": \"\", \"app\": \"\" }, \"expire_time\": 1760000000, \"expire_time_order_by\": 1760000000, \"expire_second\": 2592000, \"has_usage_history\": false, \"has_progress\": false, \"progress_config\": { \"total_balance\": \"\", \"current_used\": \"\", \"current_achived\": \"\", \"currency\": \"\" }, \"activation_info\": {}, \"is_task_coupon\": 0, \"upgrade_toast\": false, \"from_task\": false, \"task_title\": \"\", \"task_desc\": \"\", \"task_start_at\": 0, \"task_expire_at\": 0, \"task_completed_at\": 0, \"extra\": [ [ { \"type\": \"string\", \"key\": \"Coupon name\", \"value\": \"5.5% P2P transaction discount coupon\" }, { \"type\": \"string\", \"key\": \"Card and coupon source\", \"value\": \"New user registration activity\" }, { \"type\": \"status\", \"key\": \"Card and coupon status\", \"value\": \"TO_BE_USED\" } ], [ { \"type\": \"string\", \"key\": \"deduction limit\", \"value\": \"100 USDT\" }, { \"type\": \"string\", \"key\": \"Discount ratio\", \"value\": \"5.5%\" }, { \"type\": \"string\", \"key\": \"Usage conditions\", \"value\": \"Each transaction must not be less than 200 USDT\" }, { \"type\": \"string\", \"key\": \"Applicable legal currency\", \"value\": \"CNY, USD\" } ], [ { \"type\": \"timestamp\", \"key\": \"Get time\", \"value\": 1757000000 }, { \"type\": \"timestamp\", \"key\": \"expiration time\", \"value\": 1760000000 } ] ] } } ``` --- ## Error code | `code` | Description | | -------------------------------------------- | ------------------------- | | `0` | Success | | `10001`(`COUPON_SEND_ISSUING_LOG_NOT_FOUND`) | The card and coupon record does not exist or does not belong to the current user | | `10000` (`PARAMS_INVALID`) | The parameter is invalid (such as the task card is missing coupon_info) | | `50105` (`INVALID_PARAMETERS`) | Input parameter verification failed (such as coupon_type illegal) | # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_coupon_detail_with_http_info(coupon_type, detail_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str coupon_type: Coupon type enum. If not specified, all supported types are returned. Available values: `position_voucher` (position voucher), `tradfi_position_voucher` (TradFi position voucher), `contract_bonus` (futures bonus), `contract_bonus_new` (futures trial coupon), `commission_rebate` (commission rebate coupon), `hold_bonus` (earn trial bonus), `point` (point card), `financial_rate` (interest rate boost coupon), `robot_bonus` (trading bot bonus), `loss_protection_copier` (copy trading loss protection), `vip_card` (VIP trial card), `interest_voucher` (margin interest discount coupon), `p2p` (P2P trading deduction coupon), `cash` (cash coupon), `crypto_loan_interest` (crypto loan interest discount coupon), `copy_trading` (copy trading bonus), `alpha_voucher` (Alpha cash coupon), `etf_voucher` (ETF trial bonus) (required) + :param int detail_id: Coupon ID. **Regular coupon**: pass `details_id` from the list (primary key of each type's user coupon table); **Task coupon**: pass `id` from the list (primary key of the distribution record table) (required) + :param int is_task_coupon: Coupon source type. `0` = regular coupon (default); `1` = task coupon. This parameter determines the query logic for `detail_id` + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.GetUserCouponDetailResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'coupon_type', + 'detail_id', + 'is_task_coupon' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_coupon_detail" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'coupon_type' is set + if self.api_client.client_side_validation and ('coupon_type' not in local_var_params or # noqa: E501 + local_var_params['coupon_type'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `coupon_type` when calling `get_user_coupon_detail`") # noqa: E501 + # verify the required parameter 'detail_id' is set + if self.api_client.client_side_validation and ('detail_id' not in local_var_params or # noqa: E501 + local_var_params['detail_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `detail_id` when calling `get_user_coupon_detail`") # noqa: E501 + + if self.api_client.client_side_validation and 'detail_id' in local_var_params and local_var_params['detail_id'] > 2147483647: # noqa: E501 + raise ApiValueError("Invalid value for parameter `detail_id` when calling `get_user_coupon_detail`, must be a value less than or equal to `2147483647`") # noqa: E501 + if self.api_client.client_side_validation and 'detail_id' in local_var_params and local_var_params['detail_id'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `detail_id` when calling `get_user_coupon_detail`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'coupon_type' in local_var_params and local_var_params['coupon_type'] is not None: # noqa: E501 + query_params.append(('coupon_type', local_var_params['coupon_type'])) # noqa: E501 + if 'detail_id' in local_var_params and local_var_params['detail_id'] is not None: # noqa: E501 + query_params.append(('detail_id', local_var_params['detail_id'])) # noqa: E501 + if 'is_task_coupon' in local_var_params and local_var_params['is_task_coupon'] is not None: # noqa: E501 + query_params.append(('is_task_coupon', local_var_params['is_task_coupon'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/coupon/user-coupon-detail', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetUserCouponDetailResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/cross_ex_api.py b/gate_api/api/cross_ex_api.py new file mode 100644 index 00000000..a4c262c6 --- /dev/null +++ b/gate_api/api/cross_ex_api.py @@ -0,0 +1,4373 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CrossExApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def list_crossex_rule_symbols(self, **kwargs): # noqa: E501 + """Query symbol information # noqa: E501 + + Query Trading Pair Information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_rule_symbols(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: List of trading pairs, comma-separated. Example: BINANCE_FUTURE_ADA_USDT,OKX_FUTURE_ADA_USDT + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.Symbol] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_rule_symbols_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_rule_symbols_with_http_info(self, **kwargs): # noqa: E501 + """Query symbol information # noqa: E501 + + Query Trading Pair Information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_rule_symbols_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: List of trading pairs, comma-separated. Example: BINANCE_FUTURE_ADA_USDT,OKX_FUTURE_ADA_USDT + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.Symbol], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbols' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_rule_symbols" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbols' in local_var_params and local_var_params['symbols'] is not None: # noqa: E501 + query_params.append(('symbols', local_var_params['symbols'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/crossex/rule/symbols', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Symbol]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_rule_risk_limits(self, symbols, **kwargs): # noqa: E501 + """Query risk limit information # noqa: E501 + + Query risk limit information for futures/margin trading pairs # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_rule_risk_limits(symbols, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading Pair List, multiple separated by commas Example values: BINANCE_FUTURE_ADA_USDT,GATE_MARGIN_ADA_USDT (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexRiskLimit] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_rule_risk_limits_with_http_info(symbols, **kwargs) # noqa: E501 + + def list_crossex_rule_risk_limits_with_http_info(self, symbols, **kwargs): # noqa: E501 + """Query risk limit information # noqa: E501 + + Query risk limit information for futures/margin trading pairs # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_rule_risk_limits_with_http_info(symbols, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading Pair List, multiple separated by commas Example values: BINANCE_FUTURE_ADA_USDT,GATE_MARGIN_ADA_USDT (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexRiskLimit], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbols' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_rule_risk_limits" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'symbols' is set + if self.api_client.client_side_validation and ('symbols' not in local_var_params or # noqa: E501 + local_var_params['symbols'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `symbols` when calling `list_crossex_rule_risk_limits`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbols' in local_var_params and local_var_params['symbols'] is not None: # noqa: E501 + query_params.append(('symbols', local_var_params['symbols'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/crossex/rule/risk_limits', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexRiskLimit]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_transfer_coins(self, **kwargs): # noqa: E501 + """Query supported transfer currencies # noqa: E501 + + `est_fee`: On-chain withdrawal fee. When a fund transfer involves an on-chain withdrawal, the exchange charges this fee. This value is for reference only; the actual fee charged by the exchange applies # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_transfer_coins(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str coin: Query by specified currency name + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexTransferCoin] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_transfer_coins_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_transfer_coins_with_http_info(self, **kwargs): # noqa: E501 + """Query supported transfer currencies # noqa: E501 + + `est_fee`: On-chain withdrawal fee. When a fund transfer involves an on-chain withdrawal, the exchange charges this fee. This value is for reference only; the actual fee charged by the exchange applies # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_transfer_coins_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str coin: Query by specified currency name + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexTransferCoin], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'coin' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_transfer_coins" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'coin' in local_var_params and local_var_params['coin'] is not None: # noqa: E501 + query_params.append(('coin', local_var_params['coin'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/crossex/transfers/coin', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexTransferCoin]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_transfers(self, **kwargs): # noqa: E501 + """Query Fund Transfer History # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_transfers(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str coin: Query by specified currency name + :param str order_id: Supports querying by the order ID returned when creating an order (tx_id), as well as a user-defined custom ID specified at creation (text) + :param int _from: Start timestamp for the query + :param int to: End timestamp for the query, defaults to current time if not specified + :param int page: Page number + :param int limit: Maximum number returned by list, max 1000 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexTransferRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_transfers_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_transfers_with_http_info(self, **kwargs): # noqa: E501 + """Query Fund Transfer History # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_transfers_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str coin: Query by specified currency name + :param str order_id: Supports querying by the order ID returned when creating an order (tx_id), as well as a user-defined custom ID specified at creation (text) + :param int _from: Start timestamp for the query + :param int to: End timestamp for the query, defaults to current time if not specified + :param int page: Page number + :param int limit: Maximum number returned by list, max 1000 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexTransferRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'coin', + 'order_id', + '_from', + 'to', + 'page', + 'limit' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_transfers" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'coin' in local_var_params and local_var_params['coin'] is not None: # noqa: E501 + query_params.append(('coin', local_var_params['coin'])) # noqa: E501 + if 'order_id' in local_var_params and local_var_params['order_id'] is not None: # noqa: E501 + query_params.append(('order_id', local_var_params['order_id'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/transfers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexTransferRecord]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_crossex_transfer(self, **kwargs): # noqa: E501 + """Fund Transfer # noqa: E501 + + Rate limit: 10 requests per 10 seconds - In cross-exchange mode, when transferring USDT, either `from` or `to` must be `SPOT`, and the other side must be `CROSSEX`. If `CROSSEX_${exchange_type}` (e.g. `CROSSEX_GATE`) is provided, it will be automatically treated as `CROSSEX`. - In isolated exchange mode, when transferring USDT, either `from` or `to` must be `CROSSEX_${exchange_type}`, and the other side must be `SPOT` or `CROSSEX_${exchange_type}`. If `CROSSEX` is provided, it will be automatically treated as `CROSSEX_GATE`. - When transferring non-USDT assets to or from CrossEx, neither `from` nor `to` can be `CROSSEX`; `CROSSEX_${exchange_type}` must be explicitly specified. - When transferring non-USDT assets, transfers between `CROSSEX_{exchange_type}` accounts are supported, for example: from = `CROSSEX_BINANCE`, to = `CROSSEX_GATE` - When either side of the transfer is `CROSSEX_KRAKEN`, only USDT is supported for now. - When either side of the transfer is `CROSSEX_HYPERLIQUID`, the other side must be `SPOT`, and only USDC is supported. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_crossex_transfer(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexTransferRequest crossex_transfer_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexTransferResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_crossex_transfer_with_http_info(**kwargs) # noqa: E501 + + def create_crossex_transfer_with_http_info(self, **kwargs): # noqa: E501 + """Fund Transfer # noqa: E501 + + Rate limit: 10 requests per 10 seconds - In cross-exchange mode, when transferring USDT, either `from` or `to` must be `SPOT`, and the other side must be `CROSSEX`. If `CROSSEX_${exchange_type}` (e.g. `CROSSEX_GATE`) is provided, it will be automatically treated as `CROSSEX`. - In isolated exchange mode, when transferring USDT, either `from` or `to` must be `CROSSEX_${exchange_type}`, and the other side must be `SPOT` or `CROSSEX_${exchange_type}`. If `CROSSEX` is provided, it will be automatically treated as `CROSSEX_GATE`. - When transferring non-USDT assets to or from CrossEx, neither `from` nor `to` can be `CROSSEX`; `CROSSEX_${exchange_type}` must be explicitly specified. - When transferring non-USDT assets, transfers between `CROSSEX_{exchange_type}` accounts are supported, for example: from = `CROSSEX_BINANCE`, to = `CROSSEX_GATE` - When either side of the transfer is `CROSSEX_KRAKEN`, only USDT is supported for now. - When either side of the transfer is `CROSSEX_HYPERLIQUID`, the other side must be `SPOT`, and only USDC is supported. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_crossex_transfer_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexTransferRequest crossex_transfer_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexTransferResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_transfer_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_crossex_transfer" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_transfer_request' in local_var_params: + body_params = local_var_params['crossex_transfer_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/transfers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexTransferResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_crossex_order(self, **kwargs): # noqa: E501 + """Create order # noqa: E501 + + Rate Limit: 100 requests per 10 seconds, maximum 1,000 open orders per user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_crossex_order(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexOrderRequest crossex_order_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexOrderActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_crossex_order_with_http_info(**kwargs) # noqa: E501 + + def create_crossex_order_with_http_info(self, **kwargs): # noqa: E501 + """Create order # noqa: E501 + + Rate Limit: 100 requests per 10 seconds, maximum 1,000 open orders per user # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_crossex_order_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexOrderRequest crossex_order_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexOrderActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_order_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_crossex_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_order_request' in local_var_params: + body_params = local_var_params['crossex_order_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexOrderActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def cancel_batch_crossex_orders(self, crossex_batch_cancel_order_request, **kwargs): # noqa: E501 + """Batch cancel orders # noqa: E501 + + Cancel multiple specified orders. Either order_id or text is required; if both are provided, order_id takes precedence. Rate limit: 100 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_batch_crossex_orders(crossex_batch_cancel_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param list[CrossexBatchCancelOrderRequest] crossex_batch_cancel_order_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexBatchCancelOrderResponse] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_batch_crossex_orders_with_http_info(crossex_batch_cancel_order_request, **kwargs) # noqa: E501 + + def cancel_batch_crossex_orders_with_http_info(self, crossex_batch_cancel_order_request, **kwargs): # noqa: E501 + """Batch cancel orders # noqa: E501 + + Cancel multiple specified orders. Either order_id or text is required; if both are provided, order_id takes precedence. Rate limit: 100 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_batch_crossex_orders_with_http_info(crossex_batch_cancel_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param list[CrossexBatchCancelOrderRequest] crossex_batch_cancel_order_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexBatchCancelOrderResponse], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_batch_cancel_order_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_batch_crossex_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'crossex_batch_cancel_order_request' is set + if self.api_client.client_side_validation and ('crossex_batch_cancel_order_request' not in local_var_params or # noqa: E501 + local_var_params['crossex_batch_cancel_order_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `crossex_batch_cancel_order_request` when calling `cancel_batch_crossex_orders`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_batch_cancel_order_request' in local_var_params: + body_params = local_var_params['crossex_batch_cancel_order_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/batch_cancel_orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexBatchCancelOrderResponse]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_crossex_order(self, order_id, **kwargs): # noqa: E501 + """Query order details # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_order(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: 1. Supports querying order IDs returned when creating orders 2. Supports custom IDs specified by users when creating orders (i.e., the text field) (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_crossex_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def get_crossex_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Query order details # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: 1. Supports querying order IDs returned when creating orders 2. Supports custom IDs specified by users when creating orders (i.e., the text field) (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_crossex_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `get_crossex_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/orders/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_crossex_order(self, order_id, **kwargs): # noqa: E501 + """Modify Order # noqa: E501 + + Rate Limit: 100 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_order(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Support Order ID or Text for Modify Order (required) + :param CrossexOrderUpdateRequest crossex_order_update_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexOrderActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_crossex_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def update_crossex_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Modify Order # noqa: E501 + + Rate Limit: 100 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Support Order ID or Text for Modify Order (required) + :param CrossexOrderUpdateRequest crossex_order_update_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexOrderActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id', + 'crossex_order_update_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_crossex_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `update_crossex_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_order_update_request' in local_var_params: + body_params = local_var_params['crossex_order_update_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/orders/{order_id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexOrderActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def cancel_crossex_order(self, order_id, **kwargs): # noqa: E501 + """Cancel Order # noqa: E501 + + Rate Limit: 100 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_crossex_order(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Support Order ID or Text for Cancel Order (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexOrderActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_crossex_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def cancel_crossex_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Cancel Order # noqa: E501 + + Rate Limit: 100 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_crossex_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Support Order ID or Text for Cancel Order (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexOrderActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_crossex_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `cancel_crossex_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/orders/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexOrderActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_crossex_convert_quote(self, **kwargs): # noqa: E501 + """Flash Swap Inquiry # noqa: E501 + + Rate limit: 100 requests per day For HYPERLIQUID, swaps between `HYPERLIQUID_USDC` and `CROSSEX_USDT` are supported. Flash Swap in isolated exchange mode is not currently supported for HYPERLIQUID # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_crossex_convert_quote(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexConvertQuoteRequest crossex_convert_quote_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexConvertQuoteResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_crossex_convert_quote_with_http_info(**kwargs) # noqa: E501 + + def create_crossex_convert_quote_with_http_info(self, **kwargs): # noqa: E501 + """Flash Swap Inquiry # noqa: E501 + + Rate limit: 100 requests per day For HYPERLIQUID, swaps between `HYPERLIQUID_USDC` and `CROSSEX_USDT` are supported. Flash Swap in isolated exchange mode is not currently supported for HYPERLIQUID # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_crossex_convert_quote_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexConvertQuoteRequest crossex_convert_quote_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexConvertQuoteResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_convert_quote_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_crossex_convert_quote" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_convert_quote_request' in local_var_params: + body_params = local_var_params['crossex_convert_quote_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/convert/quote', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexConvertQuoteResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_crossex_convert_order(self, **kwargs): # noqa: E501 + """Flash Swap Transaction # noqa: E501 + + Rate limit: 10 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_crossex_convert_order(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexConvertOrderRequest crossex_convert_order_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexConvertOrderResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_crossex_convert_order_with_http_info(**kwargs) # noqa: E501 + + def create_crossex_convert_order_with_http_info(self, **kwargs): # noqa: E501 + """Flash Swap Transaction # noqa: E501 + + Rate limit: 10 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_crossex_convert_order_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexConvertOrderRequest crossex_convert_order_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexConvertOrderResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_convert_order_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_crossex_convert_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_convert_order_request' in local_var_params: + body_params = local_var_params['crossex_convert_order_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/convert/orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexConvertOrderResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_crossex_account(self, **kwargs): # noqa: E501 + """Query Account Assets # noqa: E501 + + Rate Limit: 200 requests per 10 seconds If 100% ≤ initial_margin_rate < 110%, transferring out the margin currency is prohibited. If initial_margin_rate < 100%, the system will automatically cancel orders; only closing positions is allowed, not opening new ones. If maintenance_margin_rate ≤ 100%, the system will force liquidation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_account(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str exchange_type: Trading venue identifier. Omit in cross-exchange mode; required in isolated-per-venue mode (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT`). + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexAccount + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_crossex_account_with_http_info(**kwargs) # noqa: E501 + + def get_crossex_account_with_http_info(self, **kwargs): # noqa: E501 + """Query Account Assets # noqa: E501 + + Rate Limit: 200 requests per 10 seconds If 100% ≤ initial_margin_rate < 110%, transferring out the margin currency is prohibited. If initial_margin_rate < 100%, the system will automatically cancel orders; only closing positions is allowed, not opening new ones. If maintenance_margin_rate ≤ 100%, the system will force liquidation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_account_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str exchange_type: Trading venue identifier. Omit in cross-exchange mode; required in isolated-per-venue mode (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT`). + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexAccount, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'exchange_type' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_crossex_account" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'exchange_type' in local_var_params and local_var_params['exchange_type'] is not None: # noqa: E501 + query_params.append(('exchange_type', local_var_params['exchange_type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/accounts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexAccount', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_crossex_account(self, **kwargs): # noqa: E501 + """Modify Account Contract Position Mode and Account Mode # noqa: E501 + + Rate Limit: 100 requests per 60 seconds. position_mode+exchange_type modifies contract position mode (exchange_type is required when the user's account mode is split exchange); account_mode modifies the user's account mode. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_account(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexAccountUpdateRequest crossex_account_update_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexAccountUpdateResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_crossex_account_with_http_info(**kwargs) # noqa: E501 + + def update_crossex_account_with_http_info(self, **kwargs): # noqa: E501 + """Modify Account Contract Position Mode and Account Mode # noqa: E501 + + Rate Limit: 100 requests per 60 seconds. position_mode+exchange_type modifies contract position mode (exchange_type is required when the user's account mode is split exchange); account_mode modifies the user's account mode. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_account_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexAccountUpdateRequest crossex_account_update_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexAccountUpdateResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_account_update_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_crossex_account" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_account_update_request' in local_var_params: + body_params = local_var_params['crossex_account_update_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/accounts', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexAccountUpdateResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_crossex_positions_leverage(self, **kwargs): # noqa: E501 + """Query Contract Trading Pair Leverage Multiplier # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_positions_leverage(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading Pair List, multiple separated by commas + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: dict(str, str) + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_crossex_positions_leverage_with_http_info(**kwargs) # noqa: E501 + + def get_crossex_positions_leverage_with_http_info(self, **kwargs): # noqa: E501 + """Query Contract Trading Pair Leverage Multiplier # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_positions_leverage_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading Pair List, multiple separated by commas + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(dict(str, str), status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbols' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_crossex_positions_leverage" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbols' in local_var_params and local_var_params['symbols'] is not None: # noqa: E501 + query_params.append(('symbols', local_var_params['symbols'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/positions/leverage', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, str)', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_crossex_positions_leverage(self, **kwargs): # noqa: E501 + """Modify Contract Trading Pair Leverage Multiplier # noqa: E501 + + Rate Limit: 100 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_positions_leverage(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexLeverageRequest crossex_leverage_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexLeverageResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_crossex_positions_leverage_with_http_info(**kwargs) # noqa: E501 + + def update_crossex_positions_leverage_with_http_info(self, **kwargs): # noqa: E501 + """Modify Contract Trading Pair Leverage Multiplier # noqa: E501 + + Rate Limit: 100 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_positions_leverage_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexLeverageRequest crossex_leverage_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexLeverageResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_leverage_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_crossex_positions_leverage" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_leverage_request' in local_var_params: + body_params = local_var_params['crossex_leverage_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/positions/leverage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexLeverageResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_crossex_margin_positions_leverage(self, **kwargs): # noqa: E501 + """Query Leveraged Trading Pair Leverage Multiplier # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_margin_positions_leverage(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading Pair List, multiple separated by commas + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: dict(str, str) + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_crossex_margin_positions_leverage_with_http_info(**kwargs) # noqa: E501 + + def get_crossex_margin_positions_leverage_with_http_info(self, **kwargs): # noqa: E501 + """Query Leveraged Trading Pair Leverage Multiplier # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_margin_positions_leverage_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading Pair List, multiple separated by commas + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(dict(str, str), status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbols' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_crossex_margin_positions_leverage" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbols' in local_var_params and local_var_params['symbols'] is not None: # noqa: E501 + query_params.append(('symbols', local_var_params['symbols'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/margin_positions/leverage', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, str)', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_crossex_margin_positions_leverage(self, **kwargs): # noqa: E501 + """Modify Leveraged Trading Pair Leverage Multiplier # noqa: E501 + + Rate Limit: 100 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_margin_positions_leverage(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexLeverageRequest crossex_leverage_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexLeverageResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_crossex_margin_positions_leverage_with_http_info(**kwargs) # noqa: E501 + + def update_crossex_margin_positions_leverage_with_http_info(self, **kwargs): # noqa: E501 + """Modify Leveraged Trading Pair Leverage Multiplier # noqa: E501 + + Rate Limit: 100 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_margin_positions_leverage_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexLeverageRequest crossex_leverage_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexLeverageResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_leverage_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_crossex_margin_positions_leverage" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_leverage_request' in local_var_params: + body_params = local_var_params['crossex_leverage_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/margin_positions/leverage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexLeverageResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def close_crossex_position(self, **kwargs): # noqa: E501 + """Full Close Position # noqa: E501 + + Rate limit: 100 requests per day. Automatic position-closing rules. FUTURE and MARGIN positions are supported. Before using this endpoint, ensure that the following prerequisite is met: - There are no open orders for the symbol in the current account. - Once the prerequisite is met, the system checks whether the position meets either of the following conditions: - Less than the minimum notional amount (minNotional) - Less than the minimum order size (minSize) When either condition is met, the system automatically creates a closing order and immediately closes the entire position. This endpoint prevents positions that are too small to be submitted to an exchange from becoming stranded and ensures that small positions can be closed when they fall below the threshold. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.close_crossex_position(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexClosePositionRequest crossex_close_position_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexOrderActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.close_crossex_position_with_http_info(**kwargs) # noqa: E501 + + def close_crossex_position_with_http_info(self, **kwargs): # noqa: E501 + """Full Close Position # noqa: E501 + + Rate limit: 100 requests per day. Automatic position-closing rules. FUTURE and MARGIN positions are supported. Before using this endpoint, ensure that the following prerequisite is met: - There are no open orders for the symbol in the current account. - Once the prerequisite is met, the system checks whether the position meets either of the following conditions: - Less than the minimum notional amount (minNotional) - Less than the minimum order size (minSize) When either condition is met, the system automatically creates a closing order and immediately closes the entire position. This endpoint prevents positions that are too small to be submitted to an exchange from becoming stranded and ensures that small positions can be closed when they fall below the threshold. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.close_crossex_position_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexClosePositionRequest crossex_close_position_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexOrderActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_close_position_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method close_crossex_position" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_close_position_request' in local_var_params: + body_params = local_var_params['crossex_close_position_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/position', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexOrderActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_crossex_positions_margin_mode(self, symbol, **kwargs): # noqa: E501 + """Get futures position margin mode # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_positions_margin_mode(symbol, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Futures trading pair (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexMarginModeResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_crossex_positions_margin_mode_with_http_info(symbol, **kwargs) # noqa: E501 + + def get_crossex_positions_margin_mode_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Get futures position margin mode # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_positions_margin_mode_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Futures trading pair (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexMarginModeResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_crossex_positions_margin_mode" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'symbol' is set + if self.api_client.client_side_validation and ('symbol' not in local_var_params or # noqa: E501 + local_var_params['symbol'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `symbol` when calling `get_crossex_positions_margin_mode`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/positions/margin_mode', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexMarginModeResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_crossex_positions_margin_mode(self, **kwargs): # noqa: E501 + """Update futures position margin mode # noqa: E501 + + Rate limit: 100 requests per 10 seconds. Only Hyperliquid futures trading pairs are supported. The margin mode cannot be changed while open orders or positions exist # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_positions_margin_mode(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexMarginModeRequest crossex_margin_mode_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexMarginModeResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_crossex_positions_margin_mode_with_http_info(**kwargs) # noqa: E501 + + def update_crossex_positions_margin_mode_with_http_info(self, **kwargs): # noqa: E501 + """Update futures position margin mode # noqa: E501 + + Rate limit: 100 requests per 10 seconds. Only Hyperliquid futures trading pairs are supported. The margin mode cannot be changed while open orders or positions exist # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_positions_margin_mode_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexMarginModeRequest crossex_margin_mode_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexMarginModeResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_margin_mode_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_crossex_positions_margin_mode" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_margin_mode_request' in local_var_params: + body_params = local_var_params['crossex_margin_mode_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/positions/margin_mode', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexMarginModeResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_crossex_positions_margin(self, **kwargs): # noqa: E501 + """Increase or decrease isolated margin # noqa: E501 + + Rate limit: 100 requests per 10 seconds. Only Hyperliquid isolated futures positions are supported. Positive values increase margin, while negative values decrease margin # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_positions_margin(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexIsolatedMarginRequest crossex_isolated_margin_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexIsolatedMarginResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_crossex_positions_margin_with_http_info(**kwargs) # noqa: E501 + + def update_crossex_positions_margin_with_http_info(self, **kwargs): # noqa: E501 + """Increase or decrease isolated margin # noqa: E501 + + Rate limit: 100 requests per 10 seconds. Only Hyperliquid isolated futures positions are supported. Positive values increase margin, while negative values decrease margin # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_crossex_positions_margin_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CrossexIsolatedMarginRequest crossex_isolated_margin_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexIsolatedMarginResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'crossex_isolated_margin_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_crossex_positions_margin" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'crossex_isolated_margin_request' in local_var_params: + body_params = local_var_params['crossex_isolated_margin_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/positions/margin', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexIsolatedMarginResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_crossex_interest_rate(self, **kwargs): # noqa: E501 + """Query margin asset interest rates # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_interest_rate(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str coin: Query by specified currency name + :param str exchange_type: Exchange + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexInterestRate] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_crossex_interest_rate_with_http_info(**kwargs) # noqa: E501 + + def get_crossex_interest_rate_with_http_info(self, **kwargs): # noqa: E501 + """Query margin asset interest rates # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_interest_rate_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str coin: Query by specified currency name + :param str exchange_type: Exchange + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexInterestRate], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'coin', + 'exchange_type' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_crossex_interest_rate" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'coin' in local_var_params and local_var_params['coin'] is not None: # noqa: E501 + query_params.append(('coin', local_var_params['coin'])) # noqa: E501 + if 'exchange_type' in local_var_params and local_var_params['exchange_type'] is not None: # noqa: E501 + query_params.append(('exchange_type', local_var_params['exchange_type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/interest_rate', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexInterestRate]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_crossex_fee(self, **kwargs): # noqa: E501 + """Query User Fee Rates # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_fee(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.InlineResponse200] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_crossex_fee_with_http_info(**kwargs) # noqa: E501 + + def get_crossex_fee_with_http_info(self, **kwargs): # noqa: E501 + """Query User Fee Rates # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_crossex_fee_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.InlineResponse200], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_crossex_fee" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/fee', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[InlineResponse200]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_positions(self, **kwargs): # noqa: E501 + """Query Contract Positions # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_positions(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Trading Pair + :param str exchange_type: Exchange + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexPosition] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_positions_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_positions_with_http_info(self, **kwargs): # noqa: E501 + """Query Contract Positions # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_positions_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Trading Pair + :param str exchange_type: Exchange + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexPosition], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol', + 'exchange_type' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_positions" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if 'exchange_type' in local_var_params and local_var_params['exchange_type'] is not None: # noqa: E501 + query_params.append(('exchange_type', local_var_params['exchange_type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/positions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexPosition]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_margin_positions(self, **kwargs): # noqa: E501 + """Query Leveraged Positions # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_margin_positions(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Currency pair + :param str exchange_type: Exchange + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexMarginPosition] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_margin_positions_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_margin_positions_with_http_info(self, **kwargs): # noqa: E501 + """Query Leveraged Positions # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_margin_positions_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Currency pair + :param str exchange_type: Exchange + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexMarginPosition], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol', + 'exchange_type' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_margin_positions" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if 'exchange_type' in local_var_params and local_var_params['exchange_type'] is not None: # noqa: E501 + query_params.append(('exchange_type', local_var_params['exchange_type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/margin_positions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexMarginPosition]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_adl_rank(self, symbol, **kwargs): # noqa: E501 + """Query ADL Position Reduction Ranking # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_adl_rank(symbol, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Trading Pair (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CrossexAdlRank + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_adl_rank_with_http_info(symbol, **kwargs) # noqa: E501 + + def list_crossex_adl_rank_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Query ADL Position Reduction Ranking # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_adl_rank_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Trading Pair (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CrossexAdlRank, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_adl_rank" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'symbol' is set + if self.api_client.client_side_validation and ('symbol' not in local_var_params or # noqa: E501 + local_var_params['symbol'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `symbol` when calling `list_crossex_adl_rank`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/adl_rank', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CrossexAdlRank', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_open_orders(self, **kwargs): # noqa: E501 + """Query All Current Open Orders # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_open_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Trading Pair + :param str exchange_type: Exchange + :param str business_type: Business Type + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_open_orders_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_open_orders_with_http_info(self, **kwargs): # noqa: E501 + """Query All Current Open Orders # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_open_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Trading Pair + :param str exchange_type: Exchange + :param str business_type: Business Type + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol', + 'exchange_type', + 'business_type' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_open_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if 'exchange_type' in local_var_params and local_var_params['exchange_type'] is not None: # noqa: E501 + query_params.append(('exchange_type', local_var_params['exchange_type'])) # noqa: E501 + if 'business_type' in local_var_params and local_var_params['business_type'] is not None: # noqa: E501 + query_params.append(('business_type', local_var_params['business_type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/open_orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexOrder]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_history_orders(self, **kwargs): # noqa: E501 + """Query order history # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_history_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number + :param int limit: Maximum number of records returned in a single list + :param str symbol: Currency pair + :param int _from: Start Millisecond Timestamp + :param int to: End Millisecond Timestamp + :param str attributes: Order attributes (`COMMON` normal / `LIQ` liquidation takeover / `REDUCE` liquidation reduction / `ADL` auto-deleverage / `SETTLEMENT` delisting settlement). Multiple values, comma-separated. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_history_orders_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_history_orders_with_http_info(self, **kwargs): # noqa: E501 + """Query order history # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_history_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number + :param int limit: Maximum number of records returned in a single list + :param str symbol: Currency pair + :param int _from: Start Millisecond Timestamp + :param int to: End Millisecond Timestamp + :param str attributes: Order attributes (`COMMON` normal / `LIQ` liquidation takeover / `REDUCE` liquidation reduction / `ADL` auto-deleverage / `SETTLEMENT` delisting settlement). Multiple values, comma-separated. + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'limit', + 'symbol', + '_from', + 'to', + 'attributes' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_history_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'attributes' in local_var_params and local_var_params['attributes'] is not None: # noqa: E501 + query_params.append(('attributes', local_var_params['attributes'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/history_orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexOrder]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_history_positions(self, **kwargs): # noqa: E501 + """Query Contract Position History # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_history_positions(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number + :param int limit: Maximum number returned by list, max 1000 + :param str symbol: Currency pair + :param int _from: Start Millisecond Timestamp + :param int to: End Millisecond Timestamp + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexHistoricalPosition] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_history_positions_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_history_positions_with_http_info(self, **kwargs): # noqa: E501 + """Query Contract Position History # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_history_positions_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number + :param int limit: Maximum number returned by list, max 1000 + :param str symbol: Currency pair + :param int _from: Start Millisecond Timestamp + :param int to: End Millisecond Timestamp + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexHistoricalPosition], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'limit', + 'symbol', + '_from', + 'to' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_history_positions" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/history_positions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexHistoricalPosition]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_history_margin_positions(self, **kwargs): # noqa: E501 + """Query Leveraged Position History # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_history_margin_positions(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number + :param int limit: Maximum number returned by list, max 1000 + :param str symbol: Currency pair + :param int _from: Start Millisecond Timestamp + :param int to: End Millisecond Timestamp + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexHistoricalMarginPosition] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_history_margin_positions_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_history_margin_positions_with_http_info(self, **kwargs): # noqa: E501 + """Query Leveraged Position History # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_history_margin_positions_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number + :param int limit: Maximum number returned by list, max 1000 + :param str symbol: Currency pair + :param int _from: Start Millisecond Timestamp + :param int to: End Millisecond Timestamp + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexHistoricalMarginPosition], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'limit', + 'symbol', + '_from', + 'to' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_history_margin_positions" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/history_margin_positions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexHistoricalMarginPosition]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_history_margin_interests(self, **kwargs): # noqa: E501 + """Query Leveraged Interest Deduction History # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_history_margin_interests(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Currency pair + :param int _from: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int to: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int page: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int limit: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param str exchange_type: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexMarginInterestRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_history_margin_interests_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_history_margin_interests_with_http_info(self, **kwargs): # noqa: E501 + """Query Leveraged Interest Deduction History # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_history_margin_interests_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Currency pair + :param int _from: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int to: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int page: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param int limit: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param str exchange_type: Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexMarginInterestRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol', + '_from', + 'to', + 'page', + 'limit', + 'exchange_type' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_history_margin_interests" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'exchange_type' in local_var_params and local_var_params['exchange_type'] is not None: # noqa: E501 + query_params.append(('exchange_type', local_var_params['exchange_type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/history_margin_interests', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexMarginInterestRecord]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_history_trades(self, **kwargs): # noqa: E501 + """Query filled history # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_history_trades(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number + :param int limit: Maximum number returned by list, max 1000 + :param str symbol: Currency pair + :param int _from: Start Millisecond Timestamp + :param int to: End Millisecond Timestamp + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexTrade] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_history_trades_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_history_trades_with_http_info(self, **kwargs): # noqa: E501 + """Query filled history # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_history_trades_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number + :param int limit: Maximum number returned by list, max 1000 + :param str symbol: Currency pair + :param int _from: Start Millisecond Timestamp + :param int to: End Millisecond Timestamp + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexTrade], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'limit', + 'symbol', + '_from', + 'to' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_history_trades" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/history_trades', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexTrade]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_account_book(self, **kwargs): # noqa: E501 + """Query Account Asset Change History # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_account_book(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number + :param int limit: Maximum number returned by list, max 1000 + :param str coin: Query by specified currency name + :param str statement_type: Bill entry type. The filter accepts the same values returned in the response. + :param int _from: Start Millisecond Timestamp + :param int to: End Millisecond Timestamp + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexAccountBookRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_account_book_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_account_book_with_http_info(self, **kwargs): # noqa: E501 + """Query Account Asset Change History # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_account_book_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number + :param int limit: Maximum number returned by list, max 1000 + :param str coin: Query by specified currency name + :param str statement_type: Bill entry type. The filter accepts the same values returned in the response. + :param int _from: Start Millisecond Timestamp + :param int to: End Millisecond Timestamp + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexAccountBookRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'limit', + 'coin', + 'statement_type', + '_from', + 'to' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_account_book" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'coin' in local_var_params and local_var_params['coin'] is not None: # noqa: E501 + query_params.append(('coin', local_var_params['coin'])) # noqa: E501 + if 'statement_type' in local_var_params and local_var_params['statement_type'] is not None: # noqa: E501 + query_params.append(('statement_type', local_var_params['statement_type'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/account_book', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexAccountBookRecord]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_coin_discount_rate(self, **kwargs): # noqa: E501 + """Query Currency Discount Rate # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_coin_discount_rate(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str coin: Query by specified currency name + :param str exchange_type: OKX/GATE/BINANCE/BYBIT/KRAKEN/HYPERLIQUID/DERIBIT + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.CrossexCoinDiscountRate] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_coin_discount_rate_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_coin_discount_rate_with_http_info(self, **kwargs): # noqa: E501 + """Query Currency Discount Rate # noqa: E501 + + Rate Limit: 200 requests per 10 seconds # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_coin_discount_rate_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str coin: Query by specified currency name + :param str exchange_type: OKX/GATE/BINANCE/BYBIT/KRAKEN/HYPERLIQUID/DERIBIT + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.CrossexCoinDiscountRate], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'coin', + 'exchange_type' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_coin_discount_rate" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'coin' in local_var_params and local_var_params['coin'] is not None: # noqa: E501 + query_params.append(('coin', local_var_params['coin'])) # noqa: E501 + if 'exchange_type' in local_var_params and local_var_params['exchange_type'] is not None: # noqa: E501 + query_params.append(('exchange_type', local_var_params['exchange_type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/coin_discount_rate', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CrossexCoinDiscountRate]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_market_tickers(self, **kwargs): # noqa: E501 + """Get exchange tickers # noqa: E501 + + Rate limit: 1 request per second - Margin trading pairs cannot be passed directly as parameters. For example, `GATE_MARGIN_BTC_USDT` is invalid. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_market_tickers(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading Pair List, multiple separated by commas + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.InlineResponse2001] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_market_tickers_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_market_tickers_with_http_info(self, **kwargs): # noqa: E501 + """Get exchange tickers # noqa: E501 + + Rate limit: 1 request per second - Margin trading pairs cannot be passed directly as parameters. For example, `GATE_MARGIN_BTC_USDT` is invalid. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_market_tickers_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading Pair List, multiple separated by commas + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.InlineResponse2001], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbols' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_market_tickers" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbols' in local_var_params and local_var_params['symbols'] is not None: # noqa: E501 + query_params.append(('symbols', local_var_params['symbols'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/market/tickers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[InlineResponse2001]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_crossex_market_funding_info(self, **kwargs): # noqa: E501 + """Get exchange futures funding rate information # noqa: E501 + + Rate limit: 1 request per second - For `Deribit`, `funding_rate` is the current real-time rate calculated over an 8-hour period. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_market_funding_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading Pair List, multiple separated by commas + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.InlineResponse2002] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_crossex_market_funding_info_with_http_info(**kwargs) # noqa: E501 + + def list_crossex_market_funding_info_with_http_info(self, **kwargs): # noqa: E501 + """Get exchange futures funding rate information # noqa: E501 + + Rate limit: 1 request per second - For `Deribit`, `funding_rate` is the current real-time rate calculated over an 8-hour period. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_crossex_market_funding_info_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Trading Pair List, multiple separated by commas + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.InlineResponse2002], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbols' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_crossex_market_funding_info" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbols' in local_var_params and local_var_params['symbols'] is not None: # noqa: E501 + query_params.append(('symbols', local_var_params['symbols'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/crossex/market/funding_info', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[InlineResponse2002]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/delivery_api.py b/gate_api/api/delivery_api.py index 3cec2109..80b556c0 100644 --- a/gate_api/api/delivery_api.py +++ b/gate_api/api/delivery_api.py @@ -281,7 +281,7 @@ def list_delivery_order_book(self, settle, contract, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param str interval: Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 :param int limit: Number of depth levels :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time the depth changes :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -310,7 +310,7 @@ def list_delivery_order_book_with_http_info(self, settle, contract, **kwargs): :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param str interval: Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 :param int limit: Number of depth levels :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time the depth changes :param _return_http_data_only: response data without head status code diff --git a/gate_api/api/earn_api.py b/gate_api/api/earn_api.py index 3b8df9f7..628171a4 100644 --- a/gate_api/api/earn_api.py +++ b/gate_api/api/earn_api.py @@ -36,16 +36,22 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def swap_eth2(self, eth2_swap, **kwargs): # noqa: E501 - """ETH swap # noqa: E501 + def list_dual_investment_plans(self, **kwargs): # noqa: E501 + """Dual Investment product list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.swap_eth2(eth2_swap, async_req=True) + >>> thread = api.list_dual_investment_plans(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param Eth2Swap eth2_swap: (required) + :param int plan_id: Financial project ID + :param str coin: Investment Token + :param str type: Type enum: `put` — buy low; `call` — sell high + :param str quote_currency: Settlement currency enum: defaults to USDT; GUSD optional + :param str sort: Sort field enum: `apy` — highest APY first `short-period` — shortest tenor first `multiple` — highest premium first + :param int page: page number + :param int page_size: Items per page :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -53,23 +59,29 @@ def swap_eth2(self, eth2_swap, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: None + :rtype: list[gate_api.DualGetPlans] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.swap_eth2_with_http_info(eth2_swap, **kwargs) # noqa: E501 + return self.list_dual_investment_plans_with_http_info(**kwargs) # noqa: E501 - def swap_eth2_with_http_info(self, eth2_swap, **kwargs): # noqa: E501 - """ETH swap # noqa: E501 + def list_dual_investment_plans_with_http_info(self, **kwargs): # noqa: E501 + """Dual Investment product list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.swap_eth2_with_http_info(eth2_swap, async_req=True) + >>> thread = api.list_dual_investment_plans_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param Eth2Swap eth2_swap: (required) + :param int plan_id: Financial project ID + :param str coin: Investment Token + :param str type: Type enum: `put` — buy low; `call` — sell high + :param str quote_currency: Settlement currency enum: defaults to USDT; GUSD optional + :param str sort: Sort field enum: `apy` — highest APY first `short-period` — shortest tenor first `multiple` — highest premium first + :param int page: page number + :param int page_size: Items per page :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -79,7 +91,7 @@ def swap_eth2_with_http_info(self, eth2_swap, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: None + :rtype: tuple(list[gate_api.DualGetPlans], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -87,7 +99,13 @@ def swap_eth2_with_http_info(self, eth2_swap, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ - 'eth2_swap' + 'plan_id', + 'coin', + 'type', + 'quote_currency', + 'sort', + 'page', + 'page_size' ] all_params.extend( [ @@ -102,20 +120,30 @@ def swap_eth2_with_http_info(self, eth2_swap, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method swap_eth2" % k + " to method list_dual_investment_plans" % k ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'eth2_swap' is set - if self.api_client.client_side_validation and ('eth2_swap' not in local_var_params or # noqa: E501 - local_var_params['eth2_swap'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `eth2_swap` when calling `swap_eth2`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] + if 'plan_id' in local_var_params and local_var_params['plan_id'] is not None: # noqa: E501 + query_params.append(('plan_id', local_var_params['plan_id'])) # noqa: E501 + if 'coin' in local_var_params and local_var_params['coin'] is not None: # noqa: E501 + query_params.append(('coin', local_var_params['coin'])) # noqa: E501 + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + if 'quote_currency' in local_var_params and local_var_params['quote_currency'] is not None: # noqa: E501 + query_params.append(('quote_currency', local_var_params['quote_currency'])) # noqa: E501 + if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 + query_params.append(('sort', local_var_params['sort'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 header_params = {} @@ -123,24 +151,22 @@ def swap_eth2_with_http_info(self, eth2_swap, **kwargs): # noqa: E501 local_var_files = {} body_params = None - if 'eth2_swap' in local_var_params: - body_params = local_var_params['eth2_swap'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['apiv4'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/earn/staking/eth2/swap', 'POST', + '/earn/dual/investment_plan', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='list[DualGetPlans]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -148,16 +174,22 @@ def swap_eth2_with_http_info(self, eth2_swap, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def rate_list_eth2(self, **kwargs): # noqa: E501 - """GTETH historical return rate query # noqa: E501 + def list_dual_orders(self, **kwargs): # noqa: E501 + """Dual Investment order list # noqa: E501 - Query ETH earnings rate records for the last 31 days # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.rate_list_eth2(async_req=True) + >>> thread = api.list_dual_orders(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously + :param int _from: Start settlement time + :param int to: End settlement time + :param str type: Type enum: `put` — buy low; `call` — sell high + :param str status: Order status enum: `HOLD` — open position `REPAY` — historical position `PROCESSING` — position active `SETTLEMENT_PROCESSING` — settlement in progress `ALL` — all + :param str coin: Investment Token + :param int page: Page number + :param int limit: Maximum number of records returned in a single list :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -165,23 +197,29 @@ def rate_list_eth2(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.Eth2RateList] + :rtype: list[gate_api.DualGetOrders] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.rate_list_eth2_with_http_info(**kwargs) # noqa: E501 + return self.list_dual_orders_with_http_info(**kwargs) # noqa: E501 - def rate_list_eth2_with_http_info(self, **kwargs): # noqa: E501 - """GTETH historical return rate query # noqa: E501 + def list_dual_orders_with_http_info(self, **kwargs): # noqa: E501 + """Dual Investment order list # noqa: E501 - Query ETH earnings rate records for the last 31 days # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.rate_list_eth2_with_http_info(async_req=True) + >>> thread = api.list_dual_orders_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously + :param int _from: Start settlement time + :param int to: End settlement time + :param str type: Type enum: `put` — buy low; `call` — sell high + :param str status: Order status enum: `HOLD` — open position `REPAY` — historical position `PROCESSING` — position active `SETTLEMENT_PROCESSING` — settlement in progress `ALL` — all + :param str coin: Investment Token + :param int page: Page number + :param int limit: Maximum number of records returned in a single list :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -191,7 +229,7 @@ def rate_list_eth2_with_http_info(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.Eth2RateList], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.DualGetOrders], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -199,6 +237,13 @@ def rate_list_eth2_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ + '_from', + 'to', + 'type', + 'status', + 'coin', + 'page', + 'limit' ] all_params.extend( [ @@ -213,16 +258,36 @@ def rate_list_eth2_with_http_info(self, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method rate_list_eth2" % k + " to method list_dual_orders" % k ) local_var_params[k] = v del local_var_params['kwargs'] + if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page` when calling `list_dual_orders`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_dual_orders`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_dual_orders`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + query_params.append(('status', local_var_params['status'])) # noqa: E501 + if 'coin' in local_var_params and local_var_params['coin'] is not None: # noqa: E501 + query_params.append(('coin', local_var_params['coin'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 header_params = {} @@ -238,14 +303,14 @@ def rate_list_eth2_with_http_info(self, **kwargs): # noqa: E501 auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/earn/staking/eth2/rate_records', 'GET', + '/earn/dual/orders', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Eth2RateList]', # noqa: E501 + response_type='list[DualGetOrders]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -253,16 +318,16 @@ def rate_list_eth2_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_dual_investment_plans(self, **kwargs): # noqa: E501 - """Dual Investment product list # noqa: E501 + def place_dual_order(self, place_dual_investment_order_params, **kwargs): # noqa: E501 + """Place Dual Investment order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_dual_investment_plans(async_req=True) + >>> thread = api.place_dual_order(place_dual_investment_order_params, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int plan_id: Financial project ID + :param PlaceDualInvestmentOrderParams place_dual_investment_order_params: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -270,23 +335,23 @@ def list_dual_investment_plans(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.DualGetPlans] + :rtype: gate_api.PlaceDualInvestmentOrder :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_dual_investment_plans_with_http_info(**kwargs) # noqa: E501 + return self.place_dual_order_with_http_info(place_dual_investment_order_params, **kwargs) # noqa: E501 - def list_dual_investment_plans_with_http_info(self, **kwargs): # noqa: E501 - """Dual Investment product list # noqa: E501 + def place_dual_order_with_http_info(self, place_dual_investment_order_params, **kwargs): # noqa: E501 + """Place Dual Investment order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_dual_investment_plans_with_http_info(async_req=True) + >>> thread = api.place_dual_order_with_http_info(place_dual_investment_order_params, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int plan_id: Financial project ID + :param PlaceDualInvestmentOrderParams place_dual_investment_order_params: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -296,7 +361,7 @@ def list_dual_investment_plans_with_http_info(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.DualGetPlans], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.PlaceDualInvestmentOrder, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -304,7 +369,7 @@ def list_dual_investment_plans_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ - 'plan_id' + 'place_dual_investment_order_params' ] all_params.extend( [ @@ -319,18 +384,20 @@ def list_dual_investment_plans_with_http_info(self, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_dual_investment_plans" % k + " to method place_dual_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] + # verify the required parameter 'place_dual_investment_order_params' is set + if self.api_client.client_side_validation and ('place_dual_investment_order_params' not in local_var_params or # noqa: E501 + local_var_params['place_dual_investment_order_params'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `place_dual_investment_order_params` when calling `place_dual_order`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if 'plan_id' in local_var_params and local_var_params['plan_id'] is not None: # noqa: E501 - query_params.append(('plan_id', local_var_params['plan_id'])) # noqa: E501 header_params = {} @@ -338,22 +405,28 @@ def list_dual_investment_plans_with_http_info(self, **kwargs): # noqa: E501 local_var_files = {} body_params = None + if 'place_dual_investment_order_params' in local_var_params: + body_params = local_var_params['place_dual_investment_order_params'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/earn/dual/investment_plan', 'GET', + '/earn/dual/orders', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[DualGetPlans]', # noqa: E501 + response_type='PlaceDualInvestmentOrder', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -361,19 +434,15 @@ def list_dual_investment_plans_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_dual_orders(self, **kwargs): # noqa: E501 - """Dual Investment order list # noqa: E501 + def list_dual_balance(self, **kwargs): # noqa: E501 + """Dual-Currency Earning Assets # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_dual_orders(async_req=True) + >>> thread = api.list_dual_balance(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int _from: Start settlement time - :param int to: End settlement time - :param int page: Page number - :param int limit: Maximum number of records returned in a single list :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -381,26 +450,22 @@ def list_dual_orders(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.DualGetOrders] + :rtype: gate_api.DualGetBalance :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_dual_orders_with_http_info(**kwargs) # noqa: E501 + return self.list_dual_balance_with_http_info(**kwargs) # noqa: E501 - def list_dual_orders_with_http_info(self, **kwargs): # noqa: E501 - """Dual Investment order list # noqa: E501 + def list_dual_balance_with_http_info(self, **kwargs): # noqa: E501 + """Dual-Currency Earning Assets # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_dual_orders_with_http_info(async_req=True) + >>> thread = api.list_dual_balance_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int _from: Start settlement time - :param int to: End settlement time - :param int page: Page number - :param int limit: Maximum number of records returned in a single list :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -410,7 +475,7 @@ def list_dual_orders_with_http_info(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.DualGetOrders], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.DualGetBalance, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -418,10 +483,6 @@ def list_dual_orders_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ - '_from', - 'to', - 'page', - 'limit' ] all_params.extend( [ @@ -436,30 +497,16 @@ def list_dual_orders_with_http_info(self, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_dual_orders" % k + " to method list_dual_balance" % k ) local_var_params[k] = v del local_var_params['kwargs'] - if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `page` when calling `list_dual_orders`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_dual_orders`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_dual_orders`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 - query_params.append(('from', local_var_params['_from'])) # noqa: E501 - if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 - query_params.append(('to', local_var_params['to'])) # noqa: E501 - if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 header_params = {} @@ -475,14 +522,14 @@ def list_dual_orders_with_http_info(self, **kwargs): # noqa: E501 auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/earn/dual/orders', 'GET', + '/earn/dual/balance', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[DualGetOrders]', # noqa: E501 + response_type='DualGetBalance', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -490,16 +537,16 @@ def list_dual_orders_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def place_dual_order(self, place_dual_investment_order, **kwargs): # noqa: E501 - """Place Dual Investment order # noqa: E501 + def get_dual_order_refund_preview(self, order_id, **kwargs): # noqa: E501 + """Dual-currency early redemption preview # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.place_dual_order(place_dual_investment_order, async_req=True) + >>> thread = api.get_dual_order_refund_preview(order_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param PlaceDualInvestmentOrder place_dual_investment_order: (required) + :param str order_id: Order ID (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -507,23 +554,23 @@ def place_dual_order(self, place_dual_investment_order, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: None + :rtype: gate_api.DualOrderRefundPreview :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.place_dual_order_with_http_info(place_dual_investment_order, **kwargs) # noqa: E501 + return self.get_dual_order_refund_preview_with_http_info(order_id, **kwargs) # noqa: E501 - def place_dual_order_with_http_info(self, place_dual_investment_order, **kwargs): # noqa: E501 - """Place Dual Investment order # noqa: E501 + def get_dual_order_refund_preview_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Dual-currency early redemption preview # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.place_dual_order_with_http_info(place_dual_investment_order, async_req=True) + >>> thread = api.get_dual_order_refund_preview_with_http_info(order_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param PlaceDualInvestmentOrder place_dual_investment_order: (required) + :param str order_id: Order ID (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -533,7 +580,7 @@ def place_dual_order_with_http_info(self, place_dual_investment_order, **kwargs) number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: None + :rtype: tuple(gate_api.DualOrderRefundPreview, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -541,7 +588,7 @@ def place_dual_order_with_http_info(self, place_dual_investment_order, **kwargs) local_var_params = locals() all_params = [ - 'place_dual_investment_order' + 'order_id' ] all_params.extend( [ @@ -556,20 +603,22 @@ def place_dual_order_with_http_info(self, place_dual_investment_order, **kwargs) if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method place_dual_order" % k + " to method get_dual_order_refund_preview" % k ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'place_dual_investment_order' is set - if self.api_client.client_side_validation and ('place_dual_investment_order' not in local_var_params or # noqa: E501 - local_var_params['place_dual_investment_order'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `place_dual_investment_order` when calling `place_dual_order`") # noqa: E501 + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `get_dual_order_refund_preview`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] + if 'order_id' in local_var_params and local_var_params['order_id'] is not None: # noqa: E501 + query_params.append(('order_id', local_var_params['order_id'])) # noqa: E501 header_params = {} @@ -577,24 +626,22 @@ def place_dual_order_with_http_info(self, place_dual_investment_order, **kwargs) local_var_files = {} body_params = None - if 'place_dual_investment_order' in local_var_params: - body_params = local_var_params['place_dual_investment_order'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/earn/dual/orders', 'POST', + '/earn/dual/order-refund-preview', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='DualOrderRefundPreview', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -602,19 +649,16 @@ def place_dual_order_with_http_info(self, place_dual_investment_order, **kwargs) _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_structured_products(self, status, **kwargs): # noqa: E501 - """Structured Product List # noqa: E501 + def place_dual_order_refund(self, dual_order_refund_params, **kwargs): # noqa: E501 + """Dual-currency order early redemption # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_structured_products(status, async_req=True) + >>> thread = api.place_dual_order_refund(dual_order_refund_params, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str status: Status (Default empty to query all) `in_process`-In progress `will_begin`-Not started `wait_settlement`-Pending settlement `done`-Completed (required) - :param str type: Product Type (Default empty to query all) `SharkFin2.0`-Shark Fin `BullishSharkFin`-Bullish Treasure `BearishSharkFin`-Bearish Treasure `DoubleNoTouch`-Volatility Treasure `RangeAccrual`-Range Smart Yield `SnowBall`-Snowball - :param int page: Page number - :param int limit: Maximum number of records returned in a single list + :param DualOrderRefundParams dual_order_refund_params: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -622,26 +666,23 @@ def list_structured_products(self, status, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.StructuredGetProjectList] + :rtype: None :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_structured_products_with_http_info(status, **kwargs) # noqa: E501 + return self.place_dual_order_refund_with_http_info(dual_order_refund_params, **kwargs) # noqa: E501 - def list_structured_products_with_http_info(self, status, **kwargs): # noqa: E501 - """Structured Product List # noqa: E501 + def place_dual_order_refund_with_http_info(self, dual_order_refund_params, **kwargs): # noqa: E501 + """Dual-currency order early redemption # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_structured_products_with_http_info(status, async_req=True) + >>> thread = api.place_dual_order_refund_with_http_info(dual_order_refund_params, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str status: Status (Default empty to query all) `in_process`-In progress `will_begin`-Not started `wait_settlement`-Pending settlement `done`-Completed (required) - :param str type: Product Type (Default empty to query all) `SharkFin2.0`-Shark Fin `BullishSharkFin`-Bullish Treasure `BearishSharkFin`-Bearish Treasure `DoubleNoTouch`-Volatility Treasure `RangeAccrual`-Range Smart Yield `SnowBall`-Snowball - :param int page: Page number - :param int limit: Maximum number of records returned in a single list + :param DualOrderRefundParams dual_order_refund_params: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -651,7 +692,7 @@ def list_structured_products_with_http_info(self, status, **kwargs): # noqa: E5 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.StructuredGetProjectList], status_code(int), headers(HTTPHeaderDict)) + :rtype: None :return: If the method is called asynchronously, returns the request thread. """ @@ -659,10 +700,7 @@ def list_structured_products_with_http_info(self, status, **kwargs): # noqa: E5 local_var_params = locals() all_params = [ - 'status', - 'type', - 'page', - 'limit' + 'dual_order_refund_params' ] all_params.extend( [ @@ -677,34 +715,20 @@ def list_structured_products_with_http_info(self, status, **kwargs): # noqa: E5 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_structured_products" % k + " to method place_dual_order_refund" % k ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'status' is set - if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 - local_var_params['status'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `status` when calling `list_structured_products`") # noqa: E501 + # verify the required parameter 'dual_order_refund_params' is set + if self.api_client.client_side_validation and ('dual_order_refund_params' not in local_var_params or # noqa: E501 + local_var_params['dual_order_refund_params'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `dual_order_refund_params` when calling `place_dual_order_refund`") # noqa: E501 - if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `page` when calling `list_structured_products`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_structured_products`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_structured_products`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 - query_params.append(('type', local_var_params['type'])) # noqa: E501 - if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 - query_params.append(('status', local_var_params['status'])) # noqa: E501 - if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 header_params = {} @@ -712,22 +736,24 @@ def list_structured_products_with_http_info(self, status, **kwargs): # noqa: E5 local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( + if 'dual_order_refund_params' in local_var_params: + body_params = local_var_params['dual_order_refund_params'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/earn/structured/products', 'GET', + '/earn/dual/order-refund', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[StructuredGetProjectList]', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -735,19 +761,16 @@ def list_structured_products_with_http_info(self, status, **kwargs): # noqa: E5 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_structured_orders(self, **kwargs): # noqa: E501 - """Structured Product Order List # noqa: E501 + def modify_dual_order_reinvest(self, dual_modify_order_reinvest_params, **kwargs): # noqa: E501 + """Modify dual-currency order reinvest # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_structured_orders(async_req=True) + >>> thread = api.modify_dual_order_reinvest(dual_modify_order_reinvest_params, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param int page: Page number - :param int limit: Maximum number of records returned in a single list + :param DualModifyOrderReinvestParams dual_modify_order_reinvest_params: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -755,26 +778,23 @@ def list_structured_orders(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.StructuredOrderList] + :rtype: None :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_structured_orders_with_http_info(**kwargs) # noqa: E501 + return self.modify_dual_order_reinvest_with_http_info(dual_modify_order_reinvest_params, **kwargs) # noqa: E501 - def list_structured_orders_with_http_info(self, **kwargs): # noqa: E501 - """Structured Product Order List # noqa: E501 + def modify_dual_order_reinvest_with_http_info(self, dual_modify_order_reinvest_params, **kwargs): # noqa: E501 + """Modify dual-currency order reinvest # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_structured_orders_with_http_info(async_req=True) + >>> thread = api.modify_dual_order_reinvest_with_http_info(dual_modify_order_reinvest_params, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param int page: Page number - :param int limit: Maximum number of records returned in a single list + :param DualModifyOrderReinvestParams dual_modify_order_reinvest_params: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -784,7 +804,7 @@ def list_structured_orders_with_http_info(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.StructuredOrderList], status_code(int), headers(HTTPHeaderDict)) + :rtype: None :return: If the method is called asynchronously, returns the request thread. """ @@ -792,10 +812,7 @@ def list_structured_orders_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ - '_from', - 'to', - 'page', - 'limit' + 'dual_modify_order_reinvest_params' ] all_params.extend( [ @@ -810,30 +827,20 @@ def list_structured_orders_with_http_info(self, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_structured_orders" % k + " to method modify_dual_order_reinvest" % k ) local_var_params[k] = v del local_var_params['kwargs'] + # verify the required parameter 'dual_modify_order_reinvest_params' is set + if self.api_client.client_side_validation and ('dual_modify_order_reinvest_params' not in local_var_params or # noqa: E501 + local_var_params['dual_modify_order_reinvest_params'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `dual_modify_order_reinvest_params` when calling `modify_dual_order_reinvest`") # noqa: E501 - if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `page` when calling `list_structured_orders`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_structured_orders`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_structured_orders`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 - query_params.append(('from', local_var_params['_from'])) # noqa: E501 - if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 - query_params.append(('to', local_var_params['to'])) # noqa: E501 - if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 header_params = {} @@ -841,22 +848,24 @@ def list_structured_orders_with_http_info(self, **kwargs): # noqa: E501 local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( + if 'dual_modify_order_reinvest_params' in local_var_params: + body_params = local_var_params['dual_modify_order_reinvest_params'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/earn/structured/orders', 'GET', + '/earn/dual/modify-order-reinvest', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[StructuredOrderList]', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -864,16 +873,19 @@ def list_structured_orders_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def place_structured_order(self, structured_buy, **kwargs): # noqa: E501 - """Place Structured Product Order # noqa: E501 + def get_dual_project_recommend(self, **kwargs): # noqa: E501 + """Dual-currency recommended projects # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.place_structured_order(structured_buy, async_req=True) + >>> thread = api.get_dual_project_recommend(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param StructuredBuy structured_buy: (required) + :param str mode: Sort mode; default `normal`: `senior` — curated picks (APR/tenor) `apy_up` — APY ascending `ep_down` — target price descending `ep_up` — target price ascending `dt_down` — maturity time descending `dt_up` — maturity time ascending + :param str coin: Investment Token + :param str type: `call`: sell high; `put`: buy low + :param str history_pids: Comma-separated project IDs to exclude already recommended items :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -881,23 +893,26 @@ def place_structured_order(self, structured_buy, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: None + :rtype: list[gate_api.DualProjectRecommend] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.place_structured_order_with_http_info(structured_buy, **kwargs) # noqa: E501 + return self.get_dual_project_recommend_with_http_info(**kwargs) # noqa: E501 - def place_structured_order_with_http_info(self, structured_buy, **kwargs): # noqa: E501 - """Place Structured Product Order # noqa: E501 + def get_dual_project_recommend_with_http_info(self, **kwargs): # noqa: E501 + """Dual-currency recommended projects # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.place_structured_order_with_http_info(structured_buy, async_req=True) + >>> thread = api.get_dual_project_recommend_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param StructuredBuy structured_buy: (required) + :param str mode: Sort mode; default `normal`: `senior` — curated picks (APR/tenor) `apy_up` — APY ascending `ep_down` — target price descending `ep_up` — target price ascending `dt_down` — maturity time descending `dt_up` — maturity time ascending + :param str coin: Investment Token + :param str type: `call`: sell high; `put`: buy low + :param str history_pids: Comma-separated project IDs to exclude already recommended items :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -907,7 +922,7 @@ def place_structured_order_with_http_info(self, structured_buy, **kwargs): # no number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: None + :rtype: tuple(list[gate_api.DualProjectRecommend], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -915,7 +930,10 @@ def place_structured_order_with_http_info(self, structured_buy, **kwargs): # no local_var_params = locals() all_params = [ - 'structured_buy' + 'mode', + 'coin', + 'type', + 'history_pids' ] all_params.extend( [ @@ -930,20 +948,24 @@ def place_structured_order_with_http_info(self, structured_buy, **kwargs): # no if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method place_structured_order" % k + " to method get_dual_project_recommend" % k ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'structured_buy' is set - if self.api_client.client_side_validation and ('structured_buy' not in local_var_params or # noqa: E501 - local_var_params['structured_buy'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `structured_buy` when calling `place_structured_order`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] + if 'mode' in local_var_params and local_var_params['mode'] is not None: # noqa: E501 + query_params.append(('mode', local_var_params['mode'])) # noqa: E501 + if 'coin' in local_var_params and local_var_params['coin'] is not None: # noqa: E501 + query_params.append(('coin', local_var_params['coin'])) # noqa: E501 + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + if 'history_pids' in local_var_params and local_var_params['history_pids'] is not None: # noqa: E501 + query_params.append(('history_pids', local_var_params['history_pids'])) # noqa: E501 header_params = {} @@ -951,24 +973,22 @@ def place_structured_order_with_http_info(self, structured_buy, **kwargs): # no local_var_files = {} body_params = None - if 'structured_buy' in local_var_params: - body_params = local_var_params['structured_buy'] - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/earn/structured/orders', 'POST', + '/earn/dual/project-recommend', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='list[DualProjectRecommend]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -976,16 +996,16 @@ def place_structured_order_with_http_info(self, structured_buy, **kwargs): # no _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def find_coin(self, find_coin, **kwargs): # noqa: E501 + def find_coin(self, **kwargs): # noqa: E501 """Staking coins # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_coin(find_coin, async_req=True) + >>> thread = api.find_coin(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param FindCoin find_coin: (required) + :param str cointype: Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -998,18 +1018,18 @@ def find_coin(self, find_coin, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.find_coin_with_http_info(find_coin, **kwargs) # noqa: E501 + return self.find_coin_with_http_info(**kwargs) # noqa: E501 - def find_coin_with_http_info(self, find_coin, **kwargs): # noqa: E501 + def find_coin_with_http_info(self, **kwargs): # noqa: E501 """Staking coins # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_coin_with_http_info(find_coin, async_req=True) + >>> thread = api.find_coin_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param FindCoin find_coin: (required) + :param str cointype: Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1027,7 +1047,7 @@ def find_coin_with_http_info(self, find_coin, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ - 'find_coin' + 'cointype' ] all_params.extend( [ @@ -1046,16 +1066,14 @@ def find_coin_with_http_info(self, find_coin, **kwargs): # noqa: E501 ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'find_coin' is set - if self.api_client.client_side_validation and ('find_coin' not in local_var_params or # noqa: E501 - local_var_params['find_coin'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `find_coin` when calling `find_coin`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] + if 'cointype' in local_var_params and local_var_params['cointype'] is not None: # noqa: E501 + query_params.append(('cointype', local_var_params['cointype'])) # noqa: E501 header_params = {} @@ -1063,16 +1081,10 @@ def find_coin_with_http_info(self, find_coin, **kwargs): # noqa: E501 local_var_files = {} body_params = None - if 'find_coin' in local_var_params: - body_params = local_var_params['find_coin'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['apiv4'] # noqa: E501 @@ -1560,3 +1572,2063 @@ def asset_list_with_http_info(self, **kwargs): # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def create_auto_invest_plan(self, auto_invest_plan_create, **kwargs): # noqa: E501 + """Create auto invest plan # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_auto_invest_plan(auto_invest_plan_create, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AutoInvestPlanCreate auto_invest_plan_create: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AutoInvestPlanCreateResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_auto_invest_plan_with_http_info(auto_invest_plan_create, **kwargs) # noqa: E501 + + def create_auto_invest_plan_with_http_info(self, auto_invest_plan_create, **kwargs): # noqa: E501 + """Create auto invest plan # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_auto_invest_plan_with_http_info(auto_invest_plan_create, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AutoInvestPlanCreate auto_invest_plan_create: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AutoInvestPlanCreateResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'auto_invest_plan_create' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_auto_invest_plan" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'auto_invest_plan_create' is set + if self.api_client.client_side_validation and ('auto_invest_plan_create' not in local_var_params or # noqa: E501 + local_var_params['auto_invest_plan_create'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `auto_invest_plan_create` when calling `create_auto_invest_plan`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'auto_invest_plan_create' in local_var_params: + body_params = local_var_params['auto_invest_plan_create'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/plans/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutoInvestPlanCreateResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_auto_invest_plan(self, auto_invest_plan_update, **kwargs): # noqa: E501 + """UpdateAuto invest plan # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_auto_invest_plan(auto_invest_plan_update, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AutoInvestPlanUpdate auto_invest_plan_update: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_auto_invest_plan_with_http_info(auto_invest_plan_update, **kwargs) # noqa: E501 + + def update_auto_invest_plan_with_http_info(self, auto_invest_plan_update, **kwargs): # noqa: E501 + """UpdateAuto invest plan # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_auto_invest_plan_with_http_info(auto_invest_plan_update, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AutoInvestPlanUpdate auto_invest_plan_update: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'auto_invest_plan_update' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_auto_invest_plan" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'auto_invest_plan_update' is set + if self.api_client.client_side_validation and ('auto_invest_plan_update' not in local_var_params or # noqa: E501 + local_var_params['auto_invest_plan_update'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `auto_invest_plan_update` when calling `update_auto_invest_plan`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'auto_invest_plan_update' in local_var_params: + body_params = local_var_params['auto_invest_plan_update'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/plans/update', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def stop_auto_invest_plan(self, auto_invest_plan_stop, **kwargs): # noqa: E501 + """StopAuto invest plan # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.stop_auto_invest_plan(auto_invest_plan_stop, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AutoInvestPlanStop auto_invest_plan_stop: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.stop_auto_invest_plan_with_http_info(auto_invest_plan_stop, **kwargs) # noqa: E501 + + def stop_auto_invest_plan_with_http_info(self, auto_invest_plan_stop, **kwargs): # noqa: E501 + """StopAuto invest plan # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.stop_auto_invest_plan_with_http_info(auto_invest_plan_stop, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AutoInvestPlanStop auto_invest_plan_stop: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'auto_invest_plan_stop' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method stop_auto_invest_plan" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'auto_invest_plan_stop' is set + if self.api_client.client_side_validation and ('auto_invest_plan_stop' not in local_var_params or # noqa: E501 + local_var_params['auto_invest_plan_stop'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `auto_invest_plan_stop` when calling `stop_auto_invest_plan`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'auto_invest_plan_stop' in local_var_params: + body_params = local_var_params['auto_invest_plan_stop'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/plans/stop', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def add_position_auto_invest_plan(self, auto_invest_plan_add_position, **kwargs): # noqa: E501 + """Add position immediately # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_position_auto_invest_plan(auto_invest_plan_add_position, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AutoInvestPlanAddPosition auto_invest_plan_add_position: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.add_position_auto_invest_plan_with_http_info(auto_invest_plan_add_position, **kwargs) # noqa: E501 + + def add_position_auto_invest_plan_with_http_info(self, auto_invest_plan_add_position, **kwargs): # noqa: E501 + """Add position immediately # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_position_auto_invest_plan_with_http_info(auto_invest_plan_add_position, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AutoInvestPlanAddPosition auto_invest_plan_add_position: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'auto_invest_plan_add_position' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method add_position_auto_invest_plan" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'auto_invest_plan_add_position' is set + if self.api_client.client_side_validation and ('auto_invest_plan_add_position' not in local_var_params or # noqa: E501 + local_var_params['auto_invest_plan_add_position'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `auto_invest_plan_add_position` when calling `add_position_auto_invest_plan`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'auto_invest_plan_add_position' in local_var_params: + body_params = local_var_params['auto_invest_plan_add_position'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/plans/add_position', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_auto_invest_coins(self, **kwargs): # noqa: E501 + """QueryCurrencies supporting auto invest # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_invest_coins(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str plan_money: Pricing currency,Optional: USDT or BTC,Default: USDT + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.AutoInvestCoinsItem] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_auto_invest_coins_with_http_info(**kwargs) # noqa: E501 + + def list_auto_invest_coins_with_http_info(self, **kwargs): # noqa: E501 + """QueryCurrencies supporting auto invest # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_invest_coins_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str plan_money: Pricing currency,Optional: USDT or BTC,Default: USDT + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.AutoInvestCoinsItem], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'plan_money' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_auto_invest_coins" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'plan_money' in local_var_params and local_var_params['plan_money'] is not None: # noqa: E501 + query_params.append(('plan_money', local_var_params['plan_money'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/coins', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AutoInvestCoinsItem]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_auto_invest_min_amount(self, auto_invest_min_invest_amount, **kwargs): # noqa: E501 + """Get minimum investment amount # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_auto_invest_min_amount(auto_invest_min_invest_amount, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AutoInvestMinInvestAmount auto_invest_min_invest_amount: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AutoInvestMinInvestAmountResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_auto_invest_min_amount_with_http_info(auto_invest_min_invest_amount, **kwargs) # noqa: E501 + + def get_auto_invest_min_amount_with_http_info(self, auto_invest_min_invest_amount, **kwargs): # noqa: E501 + """Get minimum investment amount # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_auto_invest_min_amount_with_http_info(auto_invest_min_invest_amount, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AutoInvestMinInvestAmount auto_invest_min_invest_amount: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AutoInvestMinInvestAmountResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'auto_invest_min_invest_amount' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_auto_invest_min_amount" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'auto_invest_min_invest_amount' is set + if self.api_client.client_side_validation and ('auto_invest_min_invest_amount' not in local_var_params or # noqa: E501 + local_var_params['auto_invest_min_invest_amount'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `auto_invest_min_invest_amount` when calling `get_auto_invest_min_amount`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'auto_invest_min_invest_amount' in local_var_params: + body_params = local_var_params['auto_invest_min_invest_amount'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/min_invest_amount', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutoInvestMinInvestAmountResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_auto_invest_plan_records(self, plan_id, **kwargs): # noqa: E501 + """List plan execution records # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_invest_plan_records(plan_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int plan_id: Plan ID (required) + :param int page: page number + :param int page_size: Items per page,Maximum 100 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AutoInvestPlanRecordsResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_auto_invest_plan_records_with_http_info(plan_id, **kwargs) # noqa: E501 + + def list_auto_invest_plan_records_with_http_info(self, plan_id, **kwargs): # noqa: E501 + """List plan execution records # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_invest_plan_records_with_http_info(plan_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int plan_id: Plan ID (required) + :param int page: page number + :param int page_size: Items per page,Maximum 100 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AutoInvestPlanRecordsResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'plan_id', + 'page', + 'page_size' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_auto_invest_plan_records" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'plan_id' is set + if self.api_client.client_side_validation and ('plan_id' not in local_var_params or # noqa: E501 + local_var_params['plan_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `plan_id` when calling `list_auto_invest_plan_records`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'plan_id' in local_var_params and local_var_params['plan_id'] is not None: # noqa: E501 + query_params.append(('plan_id', local_var_params['plan_id'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/plans/records', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutoInvestPlanRecordsResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_auto_invest_orders(self, plan_id, record_id, **kwargs): # noqa: E501 + """List plan execution recordsDetails(OrderDetails) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_invest_orders(plan_id, record_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int plan_id: Plan ID (required) + :param int record_id: Record ID (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.AutoInvestOrderItem] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_auto_invest_orders_with_http_info(plan_id, record_id, **kwargs) # noqa: E501 + + def list_auto_invest_orders_with_http_info(self, plan_id, record_id, **kwargs): # noqa: E501 + """List plan execution recordsDetails(OrderDetails) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_invest_orders_with_http_info(plan_id, record_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int plan_id: Plan ID (required) + :param int record_id: Record ID (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.AutoInvestOrderItem], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'plan_id', + 'record_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_auto_invest_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'plan_id' is set + if self.api_client.client_side_validation and ('plan_id' not in local_var_params or # noqa: E501 + local_var_params['plan_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `plan_id` when calling `list_auto_invest_orders`") # noqa: E501 + # verify the required parameter 'record_id' is set + if self.api_client.client_side_validation and ('record_id' not in local_var_params or # noqa: E501 + local_var_params['record_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `record_id` when calling `list_auto_invest_orders`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'plan_id' in local_var_params and local_var_params['plan_id'] is not None: # noqa: E501 + query_params.append(('plan_id', local_var_params['plan_id'])) # noqa: E501 + if 'record_id' in local_var_params and local_var_params['record_id'] is not None: # noqa: E501 + query_params.append(('record_id', local_var_params['record_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AutoInvestOrderItem]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_auto_invest_config(self, **kwargs): # noqa: E501 + """List investment currency configuration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_invest_config(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.AutoInvestConfigItem] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_auto_invest_config_with_http_info(**kwargs) # noqa: E501 + + def list_auto_invest_config_with_http_info(self, **kwargs): # noqa: E501 + """List investment currency configuration # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_invest_config_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.AutoInvestConfigItem], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_auto_invest_config" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/config', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AutoInvestConfigItem]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_auto_invest_plan_detail(self, plan_id, **kwargs): # noqa: E501 + """QueryAuto invest planDetails # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_auto_invest_plan_detail(plan_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int plan_id: Plan ID (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AutoInvestPlanDetail + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_auto_invest_plan_detail_with_http_info(plan_id, **kwargs) # noqa: E501 + + def get_auto_invest_plan_detail_with_http_info(self, plan_id, **kwargs): # noqa: E501 + """QueryAuto invest planDetails # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_auto_invest_plan_detail_with_http_info(plan_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int plan_id: Plan ID (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AutoInvestPlanDetail, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'plan_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_auto_invest_plan_detail" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'plan_id' is set + if self.api_client.client_side_validation and ('plan_id' not in local_var_params or # noqa: E501 + local_var_params['plan_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `plan_id` when calling `get_auto_invest_plan_detail`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'plan_id' in local_var_params and local_var_params['plan_id'] is not None: # noqa: E501 + query_params.append(('plan_id', local_var_params['plan_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/plans/detail', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutoInvestPlanDetail', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_auto_invest_plans(self, status, **kwargs): # noqa: E501 + """QueryAuto invest planList # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_invest_plans(status, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str status: Plan status,History history,Active active (required) + :param int page: page number + :param int page_size: Items per page,Maximum 100 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AutoInvestPlanListInfoResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_auto_invest_plans_with_http_info(status, **kwargs) # noqa: E501 + + def list_auto_invest_plans_with_http_info(self, status, **kwargs): # noqa: E501 + """QueryAuto invest planList # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_invest_plans_with_http_info(status, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str status: Plan status,History history,Active active (required) + :param int page: page number + :param int page_size: Items per page,Maximum 100 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AutoInvestPlanListInfoResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'status', + 'page', + 'page_size' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_auto_invest_plans" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'status' is set + if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 + local_var_params['status'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `status` when calling `list_auto_invest_plans`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + query_params.append(('status', local_var_params['status'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/autoinvest/plans/list_info', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutoInvestPlanListInfoResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_earn_fixed_term_products(self, page, limit, **kwargs): # noqa: E501 + """Get product list # noqa: E501 + + Query fixed-term earn product list. Supports filtering by currency, product type, status, etc. Returns product interest rate, lock-up period, quota, and reward campaign information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_earn_fixed_term_products(page, limit, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number (required) + :param int limit: Page size (required) + :param str asset: Currency + :param int type: Product type: 1 for regular, 2 for VIP + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ListEarnFixedTermProductsResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_earn_fixed_term_products_with_http_info(page, limit, **kwargs) # noqa: E501 + + def list_earn_fixed_term_products_with_http_info(self, page, limit, **kwargs): # noqa: E501 + """Get product list # noqa: E501 + + Query fixed-term earn product list. Supports filtering by currency, product type, status, etc. Returns product interest rate, lock-up period, quota, and reward campaign information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_earn_fixed_term_products_with_http_info(page, limit, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int page: Page number (required) + :param int limit: Page size (required) + :param str asset: Currency + :param int type: Product type: 1 for regular, 2 for VIP + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ListEarnFixedTermProductsResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page', + 'limit', + 'asset', + 'type' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_earn_fixed_term_products" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'page' is set + if self.api_client.client_side_validation and ('page' not in local_var_params or # noqa: E501 + local_var_params['page'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `page` when calling `list_earn_fixed_term_products`") # noqa: E501 + # verify the required parameter 'limit' is set + if self.api_client.client_side_validation and ('limit' not in local_var_params or # noqa: E501 + local_var_params['limit'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `limit` when calling `list_earn_fixed_term_products`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'asset' in local_var_params and local_var_params['asset'] is not None: # noqa: E501 + query_params.append(('asset', local_var_params['asset'])) # noqa: E501 + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/earn/fixed-term/product', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListEarnFixedTermProductsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_earn_fixed_term_products_by_asset(self, asset, **kwargs): # noqa: E501 + """Get product list by single currency # noqa: E501 + + Sort by product term in ascending order # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_earn_fixed_term_products_by_asset(asset, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str asset: Currency name, e.g., USDT, BTC (required) + :param str type: Product type: \"\" or 1 for regular product list, 2 for VIP product list, 0 for all products + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ListEarnFixedTermProductsByAssetResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_earn_fixed_term_products_by_asset_with_http_info(asset, **kwargs) # noqa: E501 + + def list_earn_fixed_term_products_by_asset_with_http_info(self, asset, **kwargs): # noqa: E501 + """Get product list by single currency # noqa: E501 + + Sort by product term in ascending order # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_earn_fixed_term_products_by_asset_with_http_info(asset, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str asset: Currency name, e.g., USDT, BTC (required) + :param str type: Product type: \"\" or 1 for regular product list, 2 for VIP product list, 0 for all products + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ListEarnFixedTermProductsByAssetResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'asset', + 'type' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_earn_fixed_term_products_by_asset" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'asset' is set + if self.api_client.client_side_validation and ('asset' not in local_var_params or # noqa: E501 + local_var_params['asset'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `asset` when calling `list_earn_fixed_term_products_by_asset`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'asset' in local_var_params: + path_params['asset'] = local_var_params['asset'] # noqa: E501 + + query_params = [] + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/earn/fixed-term/product/{asset}/list', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListEarnFixedTermProductsByAssetResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_earn_fixed_term_lends(self, order_type, page, limit, **kwargs): # noqa: E501 + """Subscription list # noqa: E501 + + Query the user's fixed-term earn subscription order list. Supports filtering by product, currency, order type, etc. Returns order details, earnings, rewards, and interest rate boost coupon information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_earn_fixed_term_lends(order_type, page, limit, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_type: Order type: 1 for current orders, 2 for historical orders (required) + :param int page: Page number (required) + :param int limit: Page size (required) + :param int product_id: Product ID + :param int order_id: Order ID + :param str asset: Currency + :param int sub_business: Sub-business + :param str business_filter: Business filter conditions, JSON array format, e.g., [{\"business\":1, \"sub_business\": 0}]. business: 1 for regular, 2 for VIP + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ListEarnFixedTermLendsResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_earn_fixed_term_lends_with_http_info(order_type, page, limit, **kwargs) # noqa: E501 + + def list_earn_fixed_term_lends_with_http_info(self, order_type, page, limit, **kwargs): # noqa: E501 + """Subscription list # noqa: E501 + + Query the user's fixed-term earn subscription order list. Supports filtering by product, currency, order type, etc. Returns order details, earnings, rewards, and interest rate boost coupon information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_earn_fixed_term_lends_with_http_info(order_type, page, limit, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_type: Order type: 1 for current orders, 2 for historical orders (required) + :param int page: Page number (required) + :param int limit: Page size (required) + :param int product_id: Product ID + :param int order_id: Order ID + :param str asset: Currency + :param int sub_business: Sub-business + :param str business_filter: Business filter conditions, JSON array format, e.g., [{\"business\":1, \"sub_business\": 0}]. business: 1 for regular, 2 for VIP + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ListEarnFixedTermLendsResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_type', + 'page', + 'limit', + 'product_id', + 'order_id', + 'asset', + 'sub_business', + 'business_filter' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_earn_fixed_term_lends" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_type' is set + if self.api_client.client_side_validation and ('order_type' not in local_var_params or # noqa: E501 + local_var_params['order_type'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_type` when calling `list_earn_fixed_term_lends`") # noqa: E501 + # verify the required parameter 'page' is set + if self.api_client.client_side_validation and ('page' not in local_var_params or # noqa: E501 + local_var_params['page'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `page` when calling `list_earn_fixed_term_lends`") # noqa: E501 + # verify the required parameter 'limit' is set + if self.api_client.client_side_validation and ('limit' not in local_var_params or # noqa: E501 + local_var_params['limit'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `limit` when calling `list_earn_fixed_term_lends`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'product_id' in local_var_params and local_var_params['product_id'] is not None: # noqa: E501 + query_params.append(('product_id', local_var_params['product_id'])) # noqa: E501 + if 'order_id' in local_var_params and local_var_params['order_id'] is not None: # noqa: E501 + query_params.append(('order_id', local_var_params['order_id'])) # noqa: E501 + if 'asset' in local_var_params and local_var_params['asset'] is not None: # noqa: E501 + query_params.append(('asset', local_var_params['asset'])) # noqa: E501 + if 'order_type' in local_var_params and local_var_params['order_type'] is not None: # noqa: E501 + query_params.append(('order_type', local_var_params['order_type'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'sub_business' in local_var_params and local_var_params['sub_business'] is not None: # noqa: E501 + query_params.append(('sub_business', local_var_params['sub_business'])) # noqa: E501 + if 'business_filter' in local_var_params and local_var_params['business_filter'] is not None: # noqa: E501 + query_params.append(('business_filter', local_var_params['business_filter'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/fixed-term/user/lend', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListEarnFixedTermLendsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_earn_fixed_term_lend(self, **kwargs): # noqa: E501 + """Subscription # noqa: E501 + + Subscribe to a fixed-term earn product by specifying the product ID and subscription amount. Optionally enable auto-renewal and apply an interest rate boost coupon # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_earn_fixed_term_lend(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FixedTermLendRequest fixed_term_lend_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CreateEarnFixedTermLendResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_earn_fixed_term_lend_with_http_info(**kwargs) # noqa: E501 + + def create_earn_fixed_term_lend_with_http_info(self, **kwargs): # noqa: E501 + """Subscription # noqa: E501 + + Subscribe to a fixed-term earn product by specifying the product ID and subscription amount. Optionally enable auto-renewal and apply an interest rate boost coupon # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_earn_fixed_term_lend_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FixedTermLendRequest fixed_term_lend_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CreateEarnFixedTermLendResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'fixed_term_lend_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_earn_fixed_term_lend" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'fixed_term_lend_request' in local_var_params: + body_params = local_var_params['fixed_term_lend_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/fixed-term/user/lend', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateEarnFixedTermLendResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_earn_fixed_term_pre_redeem(self, **kwargs): # noqa: E501 + """Redeem # noqa: E501 + + Early redemption of a fixed-term earn order, order ID is required # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_earn_fixed_term_pre_redeem(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param EarnFixedTermPreRedeemRequest earn_fixed_term_pre_redeem_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CreateEarnFixedTermPreRedeemResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_earn_fixed_term_pre_redeem_with_http_info(**kwargs) # noqa: E501 + + def create_earn_fixed_term_pre_redeem_with_http_info(self, **kwargs): # noqa: E501 + """Redeem # noqa: E501 + + Early redemption of a fixed-term earn order, order ID is required # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_earn_fixed_term_pre_redeem_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param EarnFixedTermPreRedeemRequest earn_fixed_term_pre_redeem_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CreateEarnFixedTermPreRedeemResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'earn_fixed_term_pre_redeem_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_earn_fixed_term_pre_redeem" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'earn_fixed_term_pre_redeem_request' in local_var_params: + body_params = local_var_params['earn_fixed_term_pre_redeem_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/fixed-term/user/pre-redeem', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateEarnFixedTermPreRedeemResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_earn_fixed_term_history(self, type, page, limit, **kwargs): # noqa: E501 + """Subscription history # noqa: E501 + + Query the user's fixed-term earn history records. Supports filtering by type (subscription, redemption, interest, bonus rewards) and time range # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_earn_fixed_term_history(type, page, limit, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: 1 for subscription, 2 for redemption, 3 for interest, 4 for bonus reward (required) + :param int page: Page number (required) + :param int limit: Page size (required) + :param int product_id: Product ID + :param str order_id: Order ID + :param str asset: Currency + :param int start_at: Start timestamp + :param int end_at: End Timestamp + :param int sub_business: Sub-business + :param str business_filter: Business filter conditions, JSON array format, e.g., [{\"business\":1, \"sub_business\": 0}]. business: 1 for regular, 2 for VIP + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ListEarnFixedTermHistoryResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_earn_fixed_term_history_with_http_info(type, page, limit, **kwargs) # noqa: E501 + + def list_earn_fixed_term_history_with_http_info(self, type, page, limit, **kwargs): # noqa: E501 + """Subscription history # noqa: E501 + + Query the user's fixed-term earn history records. Supports filtering by type (subscription, redemption, interest, bonus rewards) and time range # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_earn_fixed_term_history_with_http_info(type, page, limit, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: 1 for subscription, 2 for redemption, 3 for interest, 4 for bonus reward (required) + :param int page: Page number (required) + :param int limit: Page size (required) + :param int product_id: Product ID + :param str order_id: Order ID + :param str asset: Currency + :param int start_at: Start timestamp + :param int end_at: End Timestamp + :param int sub_business: Sub-business + :param str business_filter: Business filter conditions, JSON array format, e.g., [{\"business\":1, \"sub_business\": 0}]. business: 1 for regular, 2 for VIP + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ListEarnFixedTermHistoryResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'type', + 'page', + 'limit', + 'product_id', + 'order_id', + 'asset', + 'start_at', + 'end_at', + 'sub_business', + 'business_filter' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_earn_fixed_term_history" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'type' is set + if self.api_client.client_side_validation and ('type' not in local_var_params or # noqa: E501 + local_var_params['type'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `type` when calling `list_earn_fixed_term_history`") # noqa: E501 + # verify the required parameter 'page' is set + if self.api_client.client_side_validation and ('page' not in local_var_params or # noqa: E501 + local_var_params['page'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `page` when calling `list_earn_fixed_term_history`") # noqa: E501 + # verify the required parameter 'limit' is set + if self.api_client.client_side_validation and ('limit' not in local_var_params or # noqa: E501 + local_var_params['limit'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `limit` when calling `list_earn_fixed_term_history`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'product_id' in local_var_params and local_var_params['product_id'] is not None: # noqa: E501 + query_params.append(('product_id', local_var_params['product_id'])) # noqa: E501 + if 'order_id' in local_var_params and local_var_params['order_id'] is not None: # noqa: E501 + query_params.append(('order_id', local_var_params['order_id'])) # noqa: E501 + if 'asset' in local_var_params and local_var_params['asset'] is not None: # noqa: E501 + query_params.append(('asset', local_var_params['asset'])) # noqa: E501 + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'start_at' in local_var_params and local_var_params['start_at'] is not None: # noqa: E501 + query_params.append(('start_at', local_var_params['start_at'])) # noqa: E501 + if 'end_at' in local_var_params and local_var_params['end_at'] is not None: # noqa: E501 + query_params.append(('end_at', local_var_params['end_at'])) # noqa: E501 + if 'sub_business' in local_var_params and local_var_params['sub_business'] is not None: # noqa: E501 + query_params.append(('sub_business', local_var_params['sub_business'])) # noqa: E501 + if 'business_filter' in local_var_params and local_var_params['business_filter'] is not None: # noqa: E501 + query_params.append(('business_filter', local_var_params['business_filter'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/fixed-term/user/history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListEarnFixedTermHistoryResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/earn_uni_api.py b/gate_api/api/earn_uni_api.py index 98068e49..75f144df 100644 --- a/gate_api/api/earn_uni_api.py +++ b/gate_api/api/earn_uni_api.py @@ -1119,7 +1119,7 @@ def list_uni_chart(self, _from, to, asset, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.InlineResponse200] + :rtype: list[gate_api.UniChartPoint] :return: If the method is called asynchronously, returns the request thread. """ @@ -1147,7 +1147,7 @@ def list_uni_chart_with_http_info(self, _from, to, asset, **kwargs): # noqa: E5 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.InlineResponse200], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.UniChartPoint], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -1222,7 +1222,7 @@ def list_uni_chart_with_http_info(self, _from, to, asset, **kwargs): # noqa: E5 body=body_params, post_params=form_params, files=local_var_files, - response_type='list[InlineResponse200]', # noqa: E501 + response_type='list[UniChartPoint]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -1246,7 +1246,7 @@ def list_uni_rate(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.InlineResponse2001] + :rtype: list[gate_api.UniEstimatedRate] :return: If the method is called asynchronously, returns the request thread. """ @@ -1271,7 +1271,7 @@ def list_uni_rate_with_http_info(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.InlineResponse2001], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.UniEstimatedRate], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -1325,7 +1325,7 @@ def list_uni_rate_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='list[InlineResponse2001]', # noqa: E501 + response_type='list[UniEstimatedRate]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 diff --git a/gate_api/api/flash_swap_api.py b/gate_api/api/flash_swap_api.py index ffbba85f..23e2b5de 100644 --- a/gate_api/api/flash_swap_api.py +++ b/gate_api/api/flash_swap_api.py @@ -646,3 +646,726 @@ def preview_flash_swap_order_with_http_info(self, flash_swap_preview_request, ** _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def create_flash_swap_multi_currency_many_to_one_order(self, flash_swap_multi_currency_many_to_one_order_create_req, **kwargs): # noqa: E501 + """Flash Swap - Multi-currency exchange - Place order (many-to-one) # noqa: E501 + + Create a multi-currency to single target currency exchange order # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_flash_swap_multi_currency_many_to_one_order(flash_swap_multi_currency_many_to_one_order_create_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapMultiCurrencyManyToOneOrderCreateReq flash_swap_multi_currency_many_to_one_order_create_req: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FlashSwapMultiCurrencyManyToOneOrderCreateResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_flash_swap_multi_currency_many_to_one_order_with_http_info(flash_swap_multi_currency_many_to_one_order_create_req, **kwargs) # noqa: E501 + + def create_flash_swap_multi_currency_many_to_one_order_with_http_info(self, flash_swap_multi_currency_many_to_one_order_create_req, **kwargs): # noqa: E501 + """Flash Swap - Multi-currency exchange - Place order (many-to-one) # noqa: E501 + + Create a multi-currency to single target currency exchange order # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_flash_swap_multi_currency_many_to_one_order_with_http_info(flash_swap_multi_currency_many_to_one_order_create_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapMultiCurrencyManyToOneOrderCreateReq flash_swap_multi_currency_many_to_one_order_create_req: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FlashSwapMultiCurrencyManyToOneOrderCreateResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'flash_swap_multi_currency_many_to_one_order_create_req' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_flash_swap_multi_currency_many_to_one_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'flash_swap_multi_currency_many_to_one_order_create_req' is set + if self.api_client.client_side_validation and ('flash_swap_multi_currency_many_to_one_order_create_req' not in local_var_params or # noqa: E501 + local_var_params['flash_swap_multi_currency_many_to_one_order_create_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `flash_swap_multi_currency_many_to_one_order_create_req` when calling `create_flash_swap_multi_currency_many_to_one_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'flash_swap_multi_currency_many_to_one_order_create_req' in local_var_params: + body_params = local_var_params['flash_swap_multi_currency_many_to_one_order_create_req'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/flash_swap/multi-currency/many-to-one/order/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FlashSwapMultiCurrencyManyToOneOrderCreateResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def preview_flash_swap_multi_currency_many_to_one_order(self, flash_swap_multi_currency_many_to_one_order_preview_req, **kwargs): # noqa: E501 + """Flash Swap - Multi-currency exchange - Preview (many-to-one) # noqa: E501 + + Preview quote for multi-currency to single target currency exchange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.preview_flash_swap_multi_currency_many_to_one_order(flash_swap_multi_currency_many_to_one_order_preview_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapMultiCurrencyManyToOneOrderPreviewReq flash_swap_multi_currency_many_to_one_order_preview_req: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FlashSwapMultiCurrencyManyToOneOrderPreviewResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.preview_flash_swap_multi_currency_many_to_one_order_with_http_info(flash_swap_multi_currency_many_to_one_order_preview_req, **kwargs) # noqa: E501 + + def preview_flash_swap_multi_currency_many_to_one_order_with_http_info(self, flash_swap_multi_currency_many_to_one_order_preview_req, **kwargs): # noqa: E501 + """Flash Swap - Multi-currency exchange - Preview (many-to-one) # noqa: E501 + + Preview quote for multi-currency to single target currency exchange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.preview_flash_swap_multi_currency_many_to_one_order_with_http_info(flash_swap_multi_currency_many_to_one_order_preview_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapMultiCurrencyManyToOneOrderPreviewReq flash_swap_multi_currency_many_to_one_order_preview_req: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FlashSwapMultiCurrencyManyToOneOrderPreviewResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'flash_swap_multi_currency_many_to_one_order_preview_req' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method preview_flash_swap_multi_currency_many_to_one_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'flash_swap_multi_currency_many_to_one_order_preview_req' is set + if self.api_client.client_side_validation and ('flash_swap_multi_currency_many_to_one_order_preview_req' not in local_var_params or # noqa: E501 + local_var_params['flash_swap_multi_currency_many_to_one_order_preview_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `flash_swap_multi_currency_many_to_one_order_preview_req` when calling `preview_flash_swap_multi_currency_many_to_one_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'flash_swap_multi_currency_many_to_one_order_preview_req' in local_var_params: + body_params = local_var_params['flash_swap_multi_currency_many_to_one_order_preview_req'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/flash_swap/multi-currency/many-to-one/order/preview', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FlashSwapMultiCurrencyManyToOneOrderPreviewResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_flash_swap_order_v1(self, flash_swap_order_create_req, **kwargs): # noqa: E501 + """Flash Swap - Place order (one-to-one) # noqa: E501 + + Submit a one-to-one flash swap order. A quote_id must be obtained from the preview endpoint first # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_flash_swap_order_v1(flash_swap_order_create_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapOrderCreateReq flash_swap_order_create_req: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FlashSwapOrderCreateResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_flash_swap_order_v1_with_http_info(flash_swap_order_create_req, **kwargs) # noqa: E501 + + def create_flash_swap_order_v1_with_http_info(self, flash_swap_order_create_req, **kwargs): # noqa: E501 + """Flash Swap - Place order (one-to-one) # noqa: E501 + + Submit a one-to-one flash swap order. A quote_id must be obtained from the preview endpoint first # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_flash_swap_order_v1_with_http_info(flash_swap_order_create_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapOrderCreateReq flash_swap_order_create_req: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FlashSwapOrderCreateResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'flash_swap_order_create_req' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_flash_swap_order_v1" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'flash_swap_order_create_req' is set + if self.api_client.client_side_validation and ('flash_swap_order_create_req' not in local_var_params or # noqa: E501 + local_var_params['flash_swap_order_create_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `flash_swap_order_create_req` when calling `create_flash_swap_order_v1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'flash_swap_order_create_req' in local_var_params: + body_params = local_var_params['flash_swap_order_create_req'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/flash_swap/order/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FlashSwapOrderCreateResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_flash_swap_multi_currency_one_to_many_order(self, flash_swap_multi_currency_one_to_many_order_create_req, **kwargs): # noqa: E501 + """Flash Swap - Multi-currency exchange - Place order (one-to-many) # noqa: E501 + + Create a single currency to multiple target currencies exchange order # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_flash_swap_multi_currency_one_to_many_order(flash_swap_multi_currency_one_to_many_order_create_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapMultiCurrencyOneToManyOrderCreateReq flash_swap_multi_currency_one_to_many_order_create_req: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FlashSwapMultiCurrencyOneToManyOrderCreateResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_flash_swap_multi_currency_one_to_many_order_with_http_info(flash_swap_multi_currency_one_to_many_order_create_req, **kwargs) # noqa: E501 + + def create_flash_swap_multi_currency_one_to_many_order_with_http_info(self, flash_swap_multi_currency_one_to_many_order_create_req, **kwargs): # noqa: E501 + """Flash Swap - Multi-currency exchange - Place order (one-to-many) # noqa: E501 + + Create a single currency to multiple target currencies exchange order # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_flash_swap_multi_currency_one_to_many_order_with_http_info(flash_swap_multi_currency_one_to_many_order_create_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapMultiCurrencyOneToManyOrderCreateReq flash_swap_multi_currency_one_to_many_order_create_req: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FlashSwapMultiCurrencyOneToManyOrderCreateResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'flash_swap_multi_currency_one_to_many_order_create_req' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_flash_swap_multi_currency_one_to_many_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'flash_swap_multi_currency_one_to_many_order_create_req' is set + if self.api_client.client_side_validation and ('flash_swap_multi_currency_one_to_many_order_create_req' not in local_var_params or # noqa: E501 + local_var_params['flash_swap_multi_currency_one_to_many_order_create_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `flash_swap_multi_currency_one_to_many_order_create_req` when calling `create_flash_swap_multi_currency_one_to_many_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'flash_swap_multi_currency_one_to_many_order_create_req' in local_var_params: + body_params = local_var_params['flash_swap_multi_currency_one_to_many_order_create_req'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/flash_swap/multi-currency/one-to-many/order/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FlashSwapMultiCurrencyOneToManyOrderCreateResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def preview_flash_swap_multi_currency_one_to_many_order(self, flash_swap_multi_currency_one_to_many_order_preview_req, **kwargs): # noqa: E501 + """Flash Swap - Multi-currency exchange - Preview (one-to-many) # noqa: E501 + + Preview quote for single currency to multiple target currencies exchange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.preview_flash_swap_multi_currency_one_to_many_order(flash_swap_multi_currency_one_to_many_order_preview_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapMultiCurrencyOneToManyOrderPreviewReq flash_swap_multi_currency_one_to_many_order_preview_req: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FlashSwapMultiCurrencyOneToManyOrderPreviewResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.preview_flash_swap_multi_currency_one_to_many_order_with_http_info(flash_swap_multi_currency_one_to_many_order_preview_req, **kwargs) # noqa: E501 + + def preview_flash_swap_multi_currency_one_to_many_order_with_http_info(self, flash_swap_multi_currency_one_to_many_order_preview_req, **kwargs): # noqa: E501 + """Flash Swap - Multi-currency exchange - Preview (one-to-many) # noqa: E501 + + Preview quote for single currency to multiple target currencies exchange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.preview_flash_swap_multi_currency_one_to_many_order_with_http_info(flash_swap_multi_currency_one_to_many_order_preview_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param FlashSwapMultiCurrencyOneToManyOrderPreviewReq flash_swap_multi_currency_one_to_many_order_preview_req: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FlashSwapMultiCurrencyOneToManyOrderPreviewResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'flash_swap_multi_currency_one_to_many_order_preview_req' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method preview_flash_swap_multi_currency_one_to_many_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'flash_swap_multi_currency_one_to_many_order_preview_req' is set + if self.api_client.client_side_validation and ('flash_swap_multi_currency_one_to_many_order_preview_req' not in local_var_params or # noqa: E501 + local_var_params['flash_swap_multi_currency_one_to_many_order_preview_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `flash_swap_multi_currency_one_to_many_order_preview_req` when calling `preview_flash_swap_multi_currency_one_to_many_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'flash_swap_multi_currency_one_to_many_order_preview_req' in local_var_params: + body_params = local_var_params['flash_swap_multi_currency_one_to_many_order_preview_req'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/flash_swap/multi-currency/one-to-many/order/preview', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FlashSwapMultiCurrencyOneToManyOrderPreviewResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def preview_flash_swap_order_v1(self, sell_asset, buy_asset, **kwargs): # noqa: E501 + """Flash Swap - Preview (one-to-one) # noqa: E501 + + Get one-to-one flash swap quote. Either sell_amount or buy_amount must be specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.preview_flash_swap_order_v1(sell_asset, buy_asset, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str sell_asset: Currency to sell (required) + :param str buy_asset: Currency to buy (required) + :param str sell_amount: Sell amount, either this or buy_amount must be specified + :param str buy_amount: Buy amount, either this or sell_amount must be specified + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FlashSwapOrderPreviewResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.preview_flash_swap_order_v1_with_http_info(sell_asset, buy_asset, **kwargs) # noqa: E501 + + def preview_flash_swap_order_v1_with_http_info(self, sell_asset, buy_asset, **kwargs): # noqa: E501 + """Flash Swap - Preview (one-to-one) # noqa: E501 + + Get one-to-one flash swap quote. Either sell_amount or buy_amount must be specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.preview_flash_swap_order_v1_with_http_info(sell_asset, buy_asset, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str sell_asset: Currency to sell (required) + :param str buy_asset: Currency to buy (required) + :param str sell_amount: Sell amount, either this or buy_amount must be specified + :param str buy_amount: Buy amount, either this or sell_amount must be specified + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FlashSwapOrderPreviewResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'sell_asset', + 'buy_asset', + 'sell_amount', + 'buy_amount' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method preview_flash_swap_order_v1" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'sell_asset' is set + if self.api_client.client_side_validation and ('sell_asset' not in local_var_params or # noqa: E501 + local_var_params['sell_asset'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `sell_asset` when calling `preview_flash_swap_order_v1`") # noqa: E501 + # verify the required parameter 'buy_asset' is set + if self.api_client.client_side_validation and ('buy_asset' not in local_var_params or # noqa: E501 + local_var_params['buy_asset'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `buy_asset` when calling `preview_flash_swap_order_v1`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'sell_asset' in local_var_params and local_var_params['sell_asset'] is not None: # noqa: E501 + query_params.append(('sell_asset', local_var_params['sell_asset'])) # noqa: E501 + if 'sell_amount' in local_var_params and local_var_params['sell_amount'] is not None: # noqa: E501 + query_params.append(('sell_amount', local_var_params['sell_amount'])) # noqa: E501 + if 'buy_asset' in local_var_params and local_var_params['buy_asset'] is not None: # noqa: E501 + query_params.append(('buy_asset', local_var_params['buy_asset'])) # noqa: E501 + if 'buy_amount' in local_var_params and local_var_params['buy_amount'] is not None: # noqa: E501 + query_params.append(('buy_amount', local_var_params['buy_amount'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/flash_swap/order/preview', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FlashSwapOrderPreviewResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/futures_api.py b/gate_api/api/futures_api.py index 30478eac..ab61a937 100644 --- a/gate_api/api/futures_api.py +++ b/gate_api/api/futures_api.py @@ -164,6 +164,134 @@ def list_futures_contracts_with_http_info(self, settle, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + def list_futures_contracts_all(self, settle, **kwargs): # noqa: E501 + """Query all contract information (including delisted) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_futures_contracts_all(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.Contract] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_futures_contracts_all_with_http_info(settle, **kwargs) # noqa: E501 + + def list_futures_contracts_all_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query all contract information (including delisted) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_futures_contracts_all_with_http_info(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.Contract], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'limit', + 'offset' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_futures_contracts_all" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `list_futures_contracts_all`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_futures_contracts_all`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_futures_contracts_all`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ApiValueError("Invalid value for parameter `offset` when calling `list_futures_contracts_all`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/contracts_all', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Contract]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + def get_futures_contract(self, settle, contract, **kwargs): # noqa: E501 """Query single contract information # noqa: E501 @@ -297,7 +425,7 @@ def list_futures_order_book(self, settle, contract, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param str interval: Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 :param int limit: Number of depth levels :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time the depth changes :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -326,7 +454,7 @@ def list_futures_order_book_with_http_info(self, settle, contract, **kwargs): # :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param str interval: Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 :param int limit: Number of depth levels :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time the depth changes :param _return_http_data_only: response data without head status code @@ -594,7 +722,7 @@ def list_futures_candlesticks(self, settle, contract, **kwargs): # noqa: E501 :param int _from: Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified :param int to: Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision :param int limit: Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected. - :param str interval: Interval time between data points. Note that `1w` means natural week(Mon-Sun), while `7d` means every 7d since unix 0. 30d represents a natural month, not 30 days + :param str interval: Time interval for data points. Note: 1w represents a natural week, 7d is aligned with Unix epoch time, 30d represents a natural month :param str timezone: Time zone: all/utc0/utc8, default utc0 :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response @@ -625,7 +753,7 @@ def list_futures_candlesticks_with_http_info(self, settle, contract, **kwargs): :param int _from: Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified :param int to: Specify the end time of the K-line chart, defaults to current time if not specified, note that the time format is Unix timestamp with second precision :param int limit: Maximum number of recent data points to return. `limit` conflicts with `from` and `to`. If either `from` or `to` is specified, request will be rejected. - :param str interval: Interval time between data points. Note that `1w` means natural week(Mon-Sun), while `7d` means every 7d since unix 0. 30d represents a natural month, not 30 days + :param str interval: Time interval for data points. Note: 1w represents a natural week, 7d is aligned with Unix epoch time, 30d represents a natural month :param str timezone: Time zone: all/utc0/utc8, default utc0 :param _return_http_data_only: response data without head status code and headers @@ -732,7 +860,7 @@ def list_futures_candlesticks_with_http_info(self, settle, contract, **kwargs): def list_futures_premium_index(self, settle, contract, **kwargs): # noqa: E501 """Premium Index K-line chart # noqa: E501 - Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval # noqa: E501 + K-line chart data returns a maximum of 1000 points per request. When specifying from, to, and interval, ensure the number of points is not excessive # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_futures_premium_index(settle, contract, async_req=True) @@ -762,7 +890,7 @@ def list_futures_premium_index(self, settle, contract, **kwargs): # noqa: E501 def list_futures_premium_index_with_http_info(self, settle, contract, **kwargs): # noqa: E501 """Premium Index K-line chart # noqa: E501 - Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval # noqa: E501 + K-line chart data returns a maximum of 1000 points per request. When specifying from, to, and interval, ensure the number of points is not excessive # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_futures_premium_index_with_http_info(settle, contract, async_req=True) @@ -1131,6 +1259,131 @@ def list_futures_funding_rate_history_with_http_info(self, settle, contract, **k _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + def list_batch_futures_funding_rates(self, settle, batch_funding_rates_request, **kwargs): # noqa: E501 + """Batch Query Historical Funding Rate Data for Perpetual Contracts # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_batch_futures_funding_rates(settle, batch_funding_rates_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param BatchFundingRatesRequest batch_funding_rates_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.BatchFundingRatesResponse] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_batch_futures_funding_rates_with_http_info(settle, batch_funding_rates_request, **kwargs) # noqa: E501 + + def list_batch_futures_funding_rates_with_http_info(self, settle, batch_funding_rates_request, **kwargs): # noqa: E501 + """Batch Query Historical Funding Rate Data for Perpetual Contracts # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_batch_futures_funding_rates_with_http_info(settle, batch_funding_rates_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param BatchFundingRatesRequest batch_funding_rates_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.BatchFundingRatesResponse], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'batch_funding_rates_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_batch_futures_funding_rates" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `list_batch_futures_funding_rates`") # noqa: E501 + # verify the required parameter 'batch_funding_rates_request' is set + if self.api_client.client_side_validation and ('batch_funding_rates_request' not in local_var_params or # noqa: E501 + local_var_params['batch_funding_rates_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_funding_rates_request` when calling `list_batch_futures_funding_rates`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'batch_funding_rates_request' in local_var_params: + body_params = local_var_params['batch_funding_rates_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/funding_rates', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[BatchFundingRatesResponse]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + def list_futures_insurance_ledger(self, settle, **kwargs): # noqa: E501 """Futures market insurance fund history # noqa: E501 @@ -2061,7 +2314,7 @@ def list_positions(self, settle, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param bool holding: Return only real positions - true, return all - false - :param int limit: Maximum number of records returned in a single list + :param int limit: Maximum number of positions returned. If omitted, all current positions are returned by default; if provided, the value must be within [1,100]. :param int offset: List offset, starting from 0 :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response @@ -2088,7 +2341,7 @@ def list_positions_with_http_info(self, settle, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param bool holding: Return only real positions - true, return all - false - :param int limit: Maximum number of records returned in a single list + :param int limit: Maximum number of positions returned. If omitted, all current positions are returned by default; if provided, the value must be within [1,100]. :param int offset: List offset, starting from 0 :param _return_http_data_only: response data without head status code and headers @@ -2134,8 +2387,8 @@ def list_positions_with_http_info(self, settle, **kwargs): # noqa: E501 local_var_params['settle'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `settle` when calling `list_positions`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_positions`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_positions`, must be a value less than or equal to `100`") # noqa: E501 if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_positions`, must be a value greater than or equal to `1`") # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 @@ -2183,18 +2436,21 @@ def list_positions_with_http_info(self, settle, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_position(self, settle, contract, **kwargs): # noqa: E501 - """Get single position information # noqa: E501 + def list_positions_timerange(self, settle, contract, **kwargs): # noqa: E501 + """Get user's historical position information list by time # noqa: E501 - Get single position information from a contract. If you hold two postions in one contract market, please use this API: /futures/{settle}/dual_comp/positions/{contract} # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_position(settle, contract, async_req=True) + >>> thread = api.list_positions_timerange(settle, contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2202,25 +2458,28 @@ def get_position(self, settle, contract, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.Position + :rtype: list[gate_api.PositionTimerange] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_position_with_http_info(settle, contract, **kwargs) # noqa: E501 + return self.list_positions_timerange_with_http_info(settle, contract, **kwargs) # noqa: E501 - def get_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Get single position information # noqa: E501 + def list_positions_timerange_with_http_info(self, settle, contract, **kwargs): # noqa: E501 + """Get user's historical position information list by time # noqa: E501 - Get single position information from a contract. If you hold two postions in one contract market, please use this API: /futures/{settle}/dual_comp/positions/{contract} # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_position_with_http_info(settle, contract, async_req=True) + >>> thread = api.list_positions_timerange_with_http_info(settle, contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2230,7 +2489,7 @@ def get_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.Position, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.PositionTimerange], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -2239,7 +2498,11 @@ def get_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 all_params = [ 'settle', - 'contract' + 'contract', + '_from', + 'to', + 'limit', + 'offset' ] all_params.extend( [ @@ -2254,29 +2517,43 @@ def get_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_position" % k + " to method list_positions_timerange" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `get_position`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `list_positions_timerange`") # noqa: E501 # verify the required parameter 'contract' is set if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 local_var_params['contract'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `contract` when calling `get_position`") # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `list_positions_timerange`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_positions_timerange`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_positions_timerange`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ApiValueError("Invalid value for parameter `offset` when calling `list_positions_timerange`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 - if 'contract' in local_var_params: - path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] - + if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 + query_params.append(('contract', local_var_params['contract'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + header_params = {} form_params = [] @@ -2291,14 +2568,14 @@ def get_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/positions/{contract}', 'GET', + '/futures/{settle}/positions_timerange', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Position', # noqa: E501 + response_type='list[PositionTimerange]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -2306,19 +2583,18 @@ def get_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def update_position_margin(self, settle, contract, change, **kwargs): # noqa: E501 - """Update position margin # noqa: E501 + def get_position(self, settle, contract, **kwargs): # noqa: E501 + """Get single position information # noqa: E501 - Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 + Get single position information from a contract. If you hold two postions in one contract market, please use this API: /futures/{settle}/dual_comp/positions/{contract} # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_position_margin(settle, contract, change, async_req=True) + >>> thread = api.get_position(settle, contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str change: Margin change amount, positive number increases, negative number decreases (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2331,21 +2607,20 @@ def update_position_margin(self, settle, contract, change, **kwargs): # noqa: E returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.update_position_margin_with_http_info(settle, contract, change, **kwargs) # noqa: E501 + return self.get_position_with_http_info(settle, contract, **kwargs) # noqa: E501 - def update_position_margin_with_http_info(self, settle, contract, change, **kwargs): # noqa: E501 - """Update position margin # noqa: E501 + def get_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 + """Get single position information # noqa: E501 - Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 + Get single position information from a contract. If you hold two postions in one contract market, please use this API: /futures/{settle}/dual_comp/positions/{contract} # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_position_margin_with_http_info(settle, contract, change, async_req=True) + >>> thread = api.get_position_with_http_info(settle, contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str change: Margin change amount, positive number increases, negative number decreases (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2364,8 +2639,7 @@ def update_position_margin_with_http_info(self, settle, contract, change, **kwar all_params = [ 'settle', - 'contract', - 'change' + 'contract' ] all_params.extend( [ @@ -2380,22 +2654,18 @@ def update_position_margin_with_http_info(self, settle, contract, change, **kwar if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method update_position_margin" % k + " to method get_position" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `update_position_margin`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_position`") # noqa: E501 # verify the required parameter 'contract' is set if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 local_var_params['contract'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `contract` when calling `update_position_margin`") # noqa: E501 - # verify the required parameter 'change' is set - if self.api_client.client_side_validation and ('change' not in local_var_params or # noqa: E501 - local_var_params['change'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `change` when calling `update_position_margin`") # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `get_position`") # noqa: E501 collection_formats = {} @@ -2406,8 +2676,6 @@ def update_position_margin_with_http_info(self, settle, contract, change, **kwar path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] - if 'change' in local_var_params and local_var_params['change'] is not None: # noqa: E501 - query_params.append(('change', local_var_params['change'])) # noqa: E501 header_params = {} @@ -2423,7 +2691,7 @@ def update_position_margin_with_http_info(self, settle, contract, change, **kwar auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/positions/{contract}/margin', 'POST', + '/futures/{settle}/positions/{contract}', 'GET', path_params, query_params, header_params, @@ -2438,21 +2706,20 @@ def update_position_margin_with_http_info(self, settle, contract, change, **kwar _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def update_position_leverage(self, settle, contract, leverage, **kwargs): # noqa: E501 - """Update position leverage # noqa: E501 + def get_leverage(self, settle, contract, pos_margin_mode, dual_side, **kwargs): # noqa: E501 + """Get Leverage Information for Specified Mode # noqa: E501 - ⚠️ Position Mode Switching Rules: - leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored) - leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple) Examples: - Set isolated margin with 10x leverage: leverage=10 - Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10 - leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored) ⚠️ Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management. # noqa: E501 + Get Leverage Information for Specified Mode # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_position_leverage(settle, contract, leverage, async_req=True) + >>> thread = api.get_leverage(settle, contract, pos_margin_mode, dual_side, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str leverage: Set the leverage for isolated margin. When setting isolated margin leverage, the `cross_leverage_limit` must be empty. (required) - :param str cross_leverage_limit: Set the leverage for cross margin. When setting cross margin leverage, the `leverage` must be set to 0. - :param int pid: Product ID + :param str pos_margin_mode: Position Margin Mode, required for split position mode, values: isolated/cross. (required) + :param str dual_side: dual_long - Long, dual_short - Short (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2460,28 +2727,27 @@ def update_position_leverage(self, settle, contract, leverage, **kwargs): # noq number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.Position + :rtype: gate_api.FuturesLeverage :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.update_position_leverage_with_http_info(settle, contract, leverage, **kwargs) # noqa: E501 + return self.get_leverage_with_http_info(settle, contract, pos_margin_mode, dual_side, **kwargs) # noqa: E501 - def update_position_leverage_with_http_info(self, settle, contract, leverage, **kwargs): # noqa: E501 - """Update position leverage # noqa: E501 + def get_leverage_with_http_info(self, settle, contract, pos_margin_mode, dual_side, **kwargs): # noqa: E501 + """Get Leverage Information for Specified Mode # noqa: E501 - ⚠️ Position Mode Switching Rules: - leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored) - leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple) Examples: - Set isolated margin with 10x leverage: leverage=10 - Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10 - leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored) ⚠️ Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management. # noqa: E501 + Get Leverage Information for Specified Mode # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_position_leverage_with_http_info(settle, contract, leverage, async_req=True) + >>> thread = api.get_leverage_with_http_info(settle, contract, pos_margin_mode, dual_side, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str leverage: Set the leverage for isolated margin. When setting isolated margin leverage, the `cross_leverage_limit` must be empty. (required) - :param str cross_leverage_limit: Set the leverage for cross margin. When setting cross margin leverage, the `leverage` must be set to 0. - :param int pid: Product ID + :param str pos_margin_mode: Position Margin Mode, required for split position mode, values: isolated/cross. (required) + :param str dual_side: dual_long - Long, dual_short - Short (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2491,7 +2757,7 @@ def update_position_leverage_with_http_info(self, settle, contract, leverage, ** number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.Position, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.FuturesLeverage, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -2501,9 +2767,8 @@ def update_position_leverage_with_http_info(self, settle, contract, leverage, ** all_params = [ 'settle', 'contract', - 'leverage', - 'cross_leverage_limit', - 'pid' + 'pos_margin_mode', + 'dual_side' ] all_params.extend( [ @@ -2518,22 +2783,26 @@ def update_position_leverage_with_http_info(self, settle, contract, leverage, ** if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method update_position_leverage" % k + " to method get_leverage" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `update_position_leverage`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_leverage`") # noqa: E501 # verify the required parameter 'contract' is set if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 local_var_params['contract'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `contract` when calling `update_position_leverage`") # noqa: E501 - # verify the required parameter 'leverage' is set - if self.api_client.client_side_validation and ('leverage' not in local_var_params or # noqa: E501 - local_var_params['leverage'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `leverage` when calling `update_position_leverage`") # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `get_leverage`") # noqa: E501 + # verify the required parameter 'pos_margin_mode' is set + if self.api_client.client_side_validation and ('pos_margin_mode' not in local_var_params or # noqa: E501 + local_var_params['pos_margin_mode'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `pos_margin_mode` when calling `get_leverage`") # noqa: E501 + # verify the required parameter 'dual_side' is set + if self.api_client.client_side_validation and ('dual_side' not in local_var_params or # noqa: E501 + local_var_params['dual_side'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `dual_side` when calling `get_leverage`") # noqa: E501 collection_formats = {} @@ -2544,12 +2813,10 @@ def update_position_leverage_with_http_info(self, settle, contract, leverage, ** path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] - if 'leverage' in local_var_params and local_var_params['leverage'] is not None: # noqa: E501 - query_params.append(('leverage', local_var_params['leverage'])) # noqa: E501 - if 'cross_leverage_limit' in local_var_params and local_var_params['cross_leverage_limit'] is not None: # noqa: E501 - query_params.append(('cross_leverage_limit', local_var_params['cross_leverage_limit'])) # noqa: E501 - if 'pid' in local_var_params and local_var_params['pid'] is not None: # noqa: E501 - query_params.append(('pid', local_var_params['pid'])) # noqa: E501 + if 'pos_margin_mode' in local_var_params and local_var_params['pos_margin_mode'] is not None: # noqa: E501 + query_params.append(('pos_margin_mode', local_var_params['pos_margin_mode'])) # noqa: E501 + if 'dual_side' in local_var_params and local_var_params['dual_side'] is not None: # noqa: E501 + query_params.append(('dual_side', local_var_params['dual_side'])) # noqa: E501 header_params = {} @@ -2565,14 +2832,14 @@ def update_position_leverage_with_http_info(self, settle, contract, leverage, ** auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/positions/{contract}/leverage', 'POST', + '/futures/{settle}/get_leverage/{contract}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Position', # noqa: E501 + response_type='FuturesLeverage', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -2580,17 +2847,19 @@ def update_position_leverage_with_http_info(self, settle, contract, leverage, ** _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def update_position_cross_mode(self, settle, futures_position_cross_mode, **kwargs): # noqa: E501 - """Switch Position Margin Mode # noqa: E501 + def update_position_margin(self, settle, contract, change, **kwargs): # noqa: E501 + """Update position margin # noqa: E501 + Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_position_cross_mode(settle, futures_position_cross_mode, async_req=True) + >>> thread = api.update_position_margin(settle, contract, change, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param FuturesPositionCrossMode futures_position_cross_mode: (required) + :param str contract: Futures contract (required) + :param str change: Margin change amount, positive number increases, negative number decreases (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2603,19 +2872,21 @@ def update_position_cross_mode(self, settle, futures_position_cross_mode, **kwar returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.update_position_cross_mode_with_http_info(settle, futures_position_cross_mode, **kwargs) # noqa: E501 + return self.update_position_margin_with_http_info(settle, contract, change, **kwargs) # noqa: E501 - def update_position_cross_mode_with_http_info(self, settle, futures_position_cross_mode, **kwargs): # noqa: E501 - """Switch Position Margin Mode # noqa: E501 + def update_position_margin_with_http_info(self, settle, contract, change, **kwargs): # noqa: E501 + """Update position margin # noqa: E501 + Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_position_cross_mode_with_http_info(settle, futures_position_cross_mode, async_req=True) + >>> thread = api.update_position_margin_with_http_info(settle, contract, change, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param FuturesPositionCrossMode futures_position_cross_mode: (required) + :param str contract: Futures contract (required) + :param str change: Margin change amount, positive number increases, negative number decreases (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2634,7 +2905,8 @@ def update_position_cross_mode_with_http_info(self, settle, futures_position_cro all_params = [ 'settle', - 'futures_position_cross_mode' + 'contract', + 'change' ] all_params.extend( [ @@ -2649,26 +2921,34 @@ def update_position_cross_mode_with_http_info(self, settle, futures_position_cro if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method update_position_cross_mode" % k + " to method update_position_margin" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `update_position_cross_mode`") # noqa: E501 - # verify the required parameter 'futures_position_cross_mode' is set - if self.api_client.client_side_validation and ('futures_position_cross_mode' not in local_var_params or # noqa: E501 - local_var_params['futures_position_cross_mode'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `futures_position_cross_mode` when calling `update_position_cross_mode`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_position_margin`") # noqa: E501 + # verify the required parameter 'contract' is set + if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 + local_var_params['contract'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `update_position_margin`") # noqa: E501 + # verify the required parameter 'change' is set + if self.api_client.client_side_validation and ('change' not in local_var_params or # noqa: E501 + local_var_params['change'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `change` when calling `update_position_margin`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 + if 'contract' in local_var_params: + path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] + if 'change' in local_var_params and local_var_params['change'] is not None: # noqa: E501 + query_params.append(('change', local_var_params['change'])) # noqa: E501 header_params = {} @@ -2676,21 +2956,15 @@ def update_position_cross_mode_with_http_info(self, settle, futures_position_cro local_var_files = {} body_params = None - if 'futures_position_cross_mode' in local_var_params: - body_params = local_var_params['futures_position_cross_mode'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/positions/cross_mode', 'POST', + '/futures/{settle}/positions/{contract}/margin', 'POST', path_params, query_params, header_params, @@ -2705,17 +2979,21 @@ def update_position_cross_mode_with_http_info(self, settle, futures_position_cro _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def update_dual_comp_position_cross_mode(self, settle, inline_object, **kwargs): # noqa: E501 - """Switch Between Cross and Isolated Margin Modes Under Hedge Mode # noqa: E501 + def update_position_leverage(self, settle, contract, leverage, **kwargs): # noqa: E501 + """Update position leverage # noqa: E501 + ⚠️ Position Mode Switching Rules: - leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored) - leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple) Examples: - Set isolated margin with 10x leverage: leverage=10 - Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10 - leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored) ⚠️ Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_dual_comp_position_cross_mode(settle, inline_object, async_req=True) + >>> thread = api.update_position_leverage(settle, contract, leverage, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param InlineObject inline_object: (required) + :param str contract: Futures contract (required) + :param str leverage: Set the leverage for isolated margin. When setting isolated margin leverage, the `cross_leverage_limit` must be empty. (required) + :param str cross_leverage_limit: Set the leverage for cross margin. When setting cross margin leverage, the `leverage` must be set to 0. + :param int pid: Product ID :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2723,24 +3001,28 @@ def update_dual_comp_position_cross_mode(self, settle, inline_object, **kwargs): number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.Position] + :rtype: gate_api.Position :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.update_dual_comp_position_cross_mode_with_http_info(settle, inline_object, **kwargs) # noqa: E501 + return self.update_position_leverage_with_http_info(settle, contract, leverage, **kwargs) # noqa: E501 - def update_dual_comp_position_cross_mode_with_http_info(self, settle, inline_object, **kwargs): # noqa: E501 - """Switch Between Cross and Isolated Margin Modes Under Hedge Mode # noqa: E501 + def update_position_leverage_with_http_info(self, settle, contract, leverage, **kwargs): # noqa: E501 + """Update position leverage # noqa: E501 + ⚠️ Position Mode Switching Rules: - leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored) - leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple) Examples: - Set isolated margin with 10x leverage: leverage=10 - Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10 - leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored) ⚠️ Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_dual_comp_position_cross_mode_with_http_info(settle, inline_object, async_req=True) + >>> thread = api.update_position_leverage_with_http_info(settle, contract, leverage, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param InlineObject inline_object: (required) + :param str contract: Futures contract (required) + :param str leverage: Set the leverage for isolated margin. When setting isolated margin leverage, the `cross_leverage_limit` must be empty. (required) + :param str cross_leverage_limit: Set the leverage for cross margin. When setting cross margin leverage, the `leverage` must be set to 0. + :param int pid: Product ID :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2750,7 +3032,7 @@ def update_dual_comp_position_cross_mode_with_http_info(self, settle, inline_obj number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.Position], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.Position, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -2759,7 +3041,10 @@ def update_dual_comp_position_cross_mode_with_http_info(self, settle, inline_obj all_params = [ 'settle', - 'inline_object' + 'contract', + 'leverage', + 'cross_leverage_limit', + 'pid' ] all_params.extend( [ @@ -2774,26 +3059,38 @@ def update_dual_comp_position_cross_mode_with_http_info(self, settle, inline_obj if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method update_dual_comp_position_cross_mode" % k + " to method update_position_leverage" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `update_dual_comp_position_cross_mode`") # noqa: E501 - # verify the required parameter 'inline_object' is set - if self.api_client.client_side_validation and ('inline_object' not in local_var_params or # noqa: E501 - local_var_params['inline_object'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `inline_object` when calling `update_dual_comp_position_cross_mode`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_position_leverage`") # noqa: E501 + # verify the required parameter 'contract' is set + if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 + local_var_params['contract'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `update_position_leverage`") # noqa: E501 + # verify the required parameter 'leverage' is set + if self.api_client.client_side_validation and ('leverage' not in local_var_params or # noqa: E501 + local_var_params['leverage'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `leverage` when calling `update_position_leverage`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 + if 'contract' in local_var_params: + path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] + if 'leverage' in local_var_params and local_var_params['leverage'] is not None: # noqa: E501 + query_params.append(('leverage', local_var_params['leverage'])) # noqa: E501 + if 'cross_leverage_limit' in local_var_params and local_var_params['cross_leverage_limit'] is not None: # noqa: E501 + query_params.append(('cross_leverage_limit', local_var_params['cross_leverage_limit'])) # noqa: E501 + if 'pid' in local_var_params and local_var_params['pid'] is not None: # noqa: E501 + query_params.append(('pid', local_var_params['pid'])) # noqa: E501 header_params = {} @@ -2801,28 +3098,22 @@ def update_dual_comp_position_cross_mode_with_http_info(self, settle, inline_obj local_var_files = {} body_params = None - if 'inline_object' in local_var_params: - body_params = local_var_params['inline_object'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/dual_comp/positions/cross_mode', 'POST', + '/futures/{settle}/positions/{contract}/leverage', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Position]', # noqa: E501 + response_type='Position', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -2830,19 +3121,21 @@ def update_dual_comp_position_cross_mode_with_http_info(self, settle, inline_obj _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def update_position_risk_limit(self, settle, contract, risk_limit, **kwargs): # noqa: E501 - """Update position risk limit # noqa: E501 + def update_contract_position_leverage(self, settle, contract, leverage, margin_mode, **kwargs): # noqa: E501 + """Update Leverage for Specified Mode # noqa: E501 - Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 + To simplify the complex logic of the leverage interface, added a new interface for modifying leverage # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_position_risk_limit(settle, contract, risk_limit, async_req=True) + >>> thread = api.update_contract_position_leverage(settle, contract, leverage, margin_mode, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str risk_limit: New risk limit value (required) + :param str leverage: Position Leverage Multiple (required) + :param str margin_mode: Margin Mode isolated/cross (required) + :param str dual_side: dual_long - Long, dual_short - Short :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2855,21 +3148,23 @@ def update_position_risk_limit(self, settle, contract, risk_limit, **kwargs): # returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.update_position_risk_limit_with_http_info(settle, contract, risk_limit, **kwargs) # noqa: E501 + return self.update_contract_position_leverage_with_http_info(settle, contract, leverage, margin_mode, **kwargs) # noqa: E501 - def update_position_risk_limit_with_http_info(self, settle, contract, risk_limit, **kwargs): # noqa: E501 - """Update position risk limit # noqa: E501 + def update_contract_position_leverage_with_http_info(self, settle, contract, leverage, margin_mode, **kwargs): # noqa: E501 + """Update Leverage for Specified Mode # noqa: E501 - Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 + To simplify the complex logic of the leverage interface, added a new interface for modifying leverage # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_position_risk_limit_with_http_info(settle, contract, risk_limit, async_req=True) + >>> thread = api.update_contract_position_leverage_with_http_info(settle, contract, leverage, margin_mode, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str risk_limit: New risk limit value (required) + :param str leverage: Position Leverage Multiple (required) + :param str margin_mode: Margin Mode isolated/cross (required) + :param str dual_side: dual_long - Long, dual_short - Short :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -2889,7 +3184,9 @@ def update_position_risk_limit_with_http_info(self, settle, contract, risk_limit all_params = [ 'settle', 'contract', - 'risk_limit' + 'leverage', + 'margin_mode', + 'dual_side' ] all_params.extend( [ @@ -2904,22 +3201,26 @@ def update_position_risk_limit_with_http_info(self, settle, contract, risk_limit if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method update_position_risk_limit" % k + " to method update_contract_position_leverage" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `update_position_risk_limit`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_contract_position_leverage`") # noqa: E501 # verify the required parameter 'contract' is set if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 local_var_params['contract'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `contract` when calling `update_position_risk_limit`") # noqa: E501 - # verify the required parameter 'risk_limit' is set - if self.api_client.client_side_validation and ('risk_limit' not in local_var_params or # noqa: E501 - local_var_params['risk_limit'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `risk_limit` when calling `update_position_risk_limit`") # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `update_contract_position_leverage`") # noqa: E501 + # verify the required parameter 'leverage' is set + if self.api_client.client_side_validation and ('leverage' not in local_var_params or # noqa: E501 + local_var_params['leverage'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `leverage` when calling `update_contract_position_leverage`") # noqa: E501 + # verify the required parameter 'margin_mode' is set + if self.api_client.client_side_validation and ('margin_mode' not in local_var_params or # noqa: E501 + local_var_params['margin_mode'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `margin_mode` when calling `update_contract_position_leverage`") # noqa: E501 collection_formats = {} @@ -2930,8 +3231,12 @@ def update_position_risk_limit_with_http_info(self, settle, contract, risk_limit path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] - if 'risk_limit' in local_var_params and local_var_params['risk_limit'] is not None: # noqa: E501 - query_params.append(('risk_limit', local_var_params['risk_limit'])) # noqa: E501 + if 'leverage' in local_var_params and local_var_params['leverage'] is not None: # noqa: E501 + query_params.append(('leverage', local_var_params['leverage'])) # noqa: E501 + if 'margin_mode' in local_var_params and local_var_params['margin_mode'] is not None: # noqa: E501 + query_params.append(('margin_mode', local_var_params['margin_mode'])) # noqa: E501 + if 'dual_side' in local_var_params and local_var_params['dual_side'] is not None: # noqa: E501 + query_params.append(('dual_side', local_var_params['dual_side'])) # noqa: E501 header_params = {} @@ -2947,7 +3252,7 @@ def update_position_risk_limit_with_http_info(self, settle, contract, risk_limit auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/positions/{contract}/risk_limit', 'POST', + '/futures/{settle}/positions/{contract}/set_leverage', 'POST', path_params, query_params, header_params, @@ -2962,18 +3267,17 @@ def update_position_risk_limit_with_http_info(self, settle, contract, risk_limit _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def set_dual_mode(self, settle, dual_mode, **kwargs): # noqa: E501 - """Set position mode # noqa: E501 + def update_position_cross_mode(self, settle, futures_position_cross_mode, **kwargs): # noqa: E501 + """Switch Position Margin Mode # noqa: E501 - The prerequisite for changing mode is that all positions have no holdings and no pending orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.set_dual_mode(settle, dual_mode, async_req=True) + >>> thread = api.update_position_cross_mode(settle, futures_position_cross_mode, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param bool dual_mode: Whether to enable Hedge Mode (required) + :param FuturesPositionCrossMode futures_position_cross_mode: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -2981,25 +3285,24 @@ def set_dual_mode(self, settle, dual_mode, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.FuturesAccount + :rtype: gate_api.Position :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.set_dual_mode_with_http_info(settle, dual_mode, **kwargs) # noqa: E501 + return self.update_position_cross_mode_with_http_info(settle, futures_position_cross_mode, **kwargs) # noqa: E501 - def set_dual_mode_with_http_info(self, settle, dual_mode, **kwargs): # noqa: E501 - """Set position mode # noqa: E501 + def update_position_cross_mode_with_http_info(self, settle, futures_position_cross_mode, **kwargs): # noqa: E501 + """Switch Position Margin Mode # noqa: E501 - The prerequisite for changing mode is that all positions have no holdings and no pending orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.set_dual_mode_with_http_info(settle, dual_mode, async_req=True) + >>> thread = api.update_position_cross_mode_with_http_info(settle, futures_position_cross_mode, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param bool dual_mode: Whether to enable Hedge Mode (required) + :param FuturesPositionCrossMode futures_position_cross_mode: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3009,7 +3312,7 @@ def set_dual_mode_with_http_info(self, settle, dual_mode, **kwargs): # noqa: E5 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.FuturesAccount, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.Position, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -3018,7 +3321,7 @@ def set_dual_mode_with_http_info(self, settle, dual_mode, **kwargs): # noqa: E5 all_params = [ 'settle', - 'dual_mode' + 'futures_position_cross_mode' ] all_params.extend( [ @@ -3033,18 +3336,18 @@ def set_dual_mode_with_http_info(self, settle, dual_mode, **kwargs): # noqa: E5 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method set_dual_mode" % k + " to method update_position_cross_mode" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `set_dual_mode`") # noqa: E501 - # verify the required parameter 'dual_mode' is set - if self.api_client.client_side_validation and ('dual_mode' not in local_var_params or # noqa: E501 - local_var_params['dual_mode'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `dual_mode` when calling `set_dual_mode`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_position_cross_mode`") # noqa: E501 + # verify the required parameter 'futures_position_cross_mode' is set + if self.api_client.client_side_validation and ('futures_position_cross_mode' not in local_var_params or # noqa: E501 + local_var_params['futures_position_cross_mode'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `futures_position_cross_mode` when calling `update_position_cross_mode`") # noqa: E501 collection_formats = {} @@ -3053,8 +3356,6 @@ def set_dual_mode_with_http_info(self, settle, dual_mode, **kwargs): # noqa: E5 path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] - if 'dual_mode' in local_var_params and local_var_params['dual_mode'] is not None: # noqa: E501 - query_params.append(('dual_mode', local_var_params['dual_mode'])) # noqa: E501 header_params = {} @@ -3062,22 +3363,28 @@ def set_dual_mode_with_http_info(self, settle, dual_mode, **kwargs): # noqa: E5 local_var_files = {} body_params = None + if 'futures_position_cross_mode' in local_var_params: + body_params = local_var_params['futures_position_cross_mode'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/dual_mode', 'POST', + '/futures/{settle}/positions/cross_mode', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='FuturesAccount', # noqa: E501 + response_type='Position', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -3085,17 +3392,17 @@ def set_dual_mode_with_http_info(self, settle, dual_mode, **kwargs): # noqa: E5 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_dual_mode_position(self, settle, contract, **kwargs): # noqa: E501 - """Get position information in Hedge Mode # noqa: E501 + def update_dual_comp_position_cross_mode(self, settle, update_dual_comp_position_cross_mode_request, **kwargs): # noqa: E501 + """Switch Between Cross and Isolated Margin Modes Under Hedge Mode # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dual_mode_position(settle, contract, async_req=True) + >>> thread = api.update_dual_comp_position_cross_mode(settle, update_dual_comp_position_cross_mode_request, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract (required) + :param UpdateDualCompPositionCrossModeRequest update_dual_comp_position_cross_mode_request: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3108,19 +3415,19 @@ def get_dual_mode_position(self, settle, contract, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_dual_mode_position_with_http_info(settle, contract, **kwargs) # noqa: E501 + return self.update_dual_comp_position_cross_mode_with_http_info(settle, update_dual_comp_position_cross_mode_request, **kwargs) # noqa: E501 - def get_dual_mode_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 - """Get position information in Hedge Mode # noqa: E501 + def update_dual_comp_position_cross_mode_with_http_info(self, settle, update_dual_comp_position_cross_mode_request, **kwargs): # noqa: E501 + """Switch Between Cross and Isolated Margin Modes Under Hedge Mode # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dual_mode_position_with_http_info(settle, contract, async_req=True) + >>> thread = api.update_dual_comp_position_cross_mode_with_http_info(settle, update_dual_comp_position_cross_mode_request, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract (required) + :param UpdateDualCompPositionCrossModeRequest update_dual_comp_position_cross_mode_request: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3139,7 +3446,7 @@ def get_dual_mode_position_with_http_info(self, settle, contract, **kwargs): # all_params = [ 'settle', - 'contract' + 'update_dual_comp_position_cross_mode_request' ] all_params.extend( [ @@ -3154,26 +3461,24 @@ def get_dual_mode_position_with_http_info(self, settle, contract, **kwargs): # if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_dual_mode_position" % k + " to method update_dual_comp_position_cross_mode" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `get_dual_mode_position`") # noqa: E501 - # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 - local_var_params['contract'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `contract` when calling `get_dual_mode_position`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_dual_comp_position_cross_mode`") # noqa: E501 + # verify the required parameter 'update_dual_comp_position_cross_mode_request' is set + if self.api_client.client_side_validation and ('update_dual_comp_position_cross_mode_request' not in local_var_params or # noqa: E501 + local_var_params['update_dual_comp_position_cross_mode_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `update_dual_comp_position_cross_mode_request` when calling `update_dual_comp_position_cross_mode`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 - if 'contract' in local_var_params: - path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] @@ -3183,15 +3488,21 @@ def get_dual_mode_position_with_http_info(self, settle, contract, **kwargs): # local_var_files = {} body_params = None + if 'update_dual_comp_position_cross_mode_request' in local_var_params: + body_params = local_var_params['update_dual_comp_position_cross_mode_request'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/dual_comp/positions/{contract}', 'GET', + '/futures/{settle}/dual_comp/positions/cross_mode', 'POST', path_params, query_params, header_params, @@ -3206,19 +3517,19 @@ def get_dual_mode_position_with_http_info(self, settle, contract, **kwargs): # _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def update_dual_mode_position_margin(self, settle, contract, change, dual_side, **kwargs): # noqa: E501 - """Update position margin in Hedge Mode # noqa: E501 + def update_position_risk_limit(self, settle, contract, risk_limit, **kwargs): # noqa: E501 + """Update position risk limit # noqa: E501 + Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_dual_mode_position_margin(settle, contract, change, dual_side, async_req=True) + >>> thread = api.update_position_risk_limit(settle, contract, risk_limit, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str change: Margin change amount, positive number increases, negative number decreases (required) - :param str dual_side: Long or short position (required) + :param str risk_limit: New risk limit value (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3226,26 +3537,26 @@ def update_dual_mode_position_margin(self, settle, contract, change, dual_side, number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.Position] + :rtype: gate_api.Position :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.update_dual_mode_position_margin_with_http_info(settle, contract, change, dual_side, **kwargs) # noqa: E501 + return self.update_position_risk_limit_with_http_info(settle, contract, risk_limit, **kwargs) # noqa: E501 - def update_dual_mode_position_margin_with_http_info(self, settle, contract, change, dual_side, **kwargs): # noqa: E501 - """Update position margin in Hedge Mode # noqa: E501 + def update_position_risk_limit_with_http_info(self, settle, contract, risk_limit, **kwargs): # noqa: E501 + """Update position risk limit # noqa: E501 + Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_dual_mode_position_margin_with_http_info(settle, contract, change, dual_side, async_req=True) + >>> thread = api.update_position_risk_limit_with_http_info(settle, contract, risk_limit, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) :param str contract: Futures contract (required) - :param str change: Margin change amount, positive number increases, negative number decreases (required) - :param str dual_side: Long or short position (required) + :param str risk_limit: New risk limit value (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3255,7 +3566,7 @@ def update_dual_mode_position_margin_with_http_info(self, settle, contract, chan number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.Position], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.Position, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -3265,8 +3576,7 @@ def update_dual_mode_position_margin_with_http_info(self, settle, contract, chan all_params = [ 'settle', 'contract', - 'change', - 'dual_side' + 'risk_limit' ] all_params.extend( [ @@ -3281,26 +3591,22 @@ def update_dual_mode_position_margin_with_http_info(self, settle, contract, chan if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method update_dual_mode_position_margin" % k + " to method update_position_risk_limit" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `update_dual_mode_position_margin`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_position_risk_limit`") # noqa: E501 # verify the required parameter 'contract' is set if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 local_var_params['contract'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `contract` when calling `update_dual_mode_position_margin`") # noqa: E501 - # verify the required parameter 'change' is set - if self.api_client.client_side_validation and ('change' not in local_var_params or # noqa: E501 - local_var_params['change'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `change` when calling `update_dual_mode_position_margin`") # noqa: E501 - # verify the required parameter 'dual_side' is set - if self.api_client.client_side_validation and ('dual_side' not in local_var_params or # noqa: E501 - local_var_params['dual_side'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `dual_side` when calling `update_dual_mode_position_margin`") # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `update_position_risk_limit`") # noqa: E501 + # verify the required parameter 'risk_limit' is set + if self.api_client.client_side_validation and ('risk_limit' not in local_var_params or # noqa: E501 + local_var_params['risk_limit'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `risk_limit` when calling `update_position_risk_limit`") # noqa: E501 collection_formats = {} @@ -3311,10 +3617,8 @@ def update_dual_mode_position_margin_with_http_info(self, settle, contract, chan path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] - if 'change' in local_var_params and local_var_params['change'] is not None: # noqa: E501 - query_params.append(('change', local_var_params['change'])) # noqa: E501 - if 'dual_side' in local_var_params and local_var_params['dual_side'] is not None: # noqa: E501 - query_params.append(('dual_side', local_var_params['dual_side'])) # noqa: E501 + if 'risk_limit' in local_var_params and local_var_params['risk_limit'] is not None: # noqa: E501 + query_params.append(('risk_limit', local_var_params['risk_limit'])) # noqa: E501 header_params = {} @@ -3330,14 +3634,14 @@ def update_dual_mode_position_margin_with_http_info(self, settle, contract, chan auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/dual_comp/positions/{contract}/margin', 'POST', + '/futures/{settle}/positions/{contract}/risk_limit', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Position]', # noqa: E501 + response_type='Position', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -3345,19 +3649,18 @@ def update_dual_mode_position_margin_with_http_info(self, settle, contract, chan _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def update_dual_mode_position_leverage(self, settle, contract, leverage, **kwargs): # noqa: E501 - """Update position leverage in Hedge Mode # noqa: E501 + def set_dual_mode(self, settle, dual_mode, **kwargs): # noqa: E501 + """Set position mode # noqa: E501 + The prerequisite for changing mode is that all positions have no holdings and no pending orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_dual_mode_position_leverage(settle, contract, leverage, async_req=True) + >>> thread = api.set_dual_mode(settle, dual_mode, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract (required) - :param str leverage: New position leverage (required) - :param str cross_leverage_limit: Cross margin leverage (valid only when `leverage` is 0) + :param bool dual_mode: Whether to enable Hedge Mode (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3365,26 +3668,25 @@ def update_dual_mode_position_leverage(self, settle, contract, leverage, **kwarg number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.Position] + :rtype: gate_api.FuturesAccount :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.update_dual_mode_position_leverage_with_http_info(settle, contract, leverage, **kwargs) # noqa: E501 + return self.set_dual_mode_with_http_info(settle, dual_mode, **kwargs) # noqa: E501 - def update_dual_mode_position_leverage_with_http_info(self, settle, contract, leverage, **kwargs): # noqa: E501 - """Update position leverage in Hedge Mode # noqa: E501 + def set_dual_mode_with_http_info(self, settle, dual_mode, **kwargs): # noqa: E501 + """Set position mode # noqa: E501 + The prerequisite for changing mode is that all positions have no holdings and no pending orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_dual_mode_position_leverage_with_http_info(settle, contract, leverage, async_req=True) + >>> thread = api.set_dual_mode_with_http_info(settle, dual_mode, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract (required) - :param str leverage: New position leverage (required) - :param str cross_leverage_limit: Cross margin leverage (valid only when `leverage` is 0) + :param bool dual_mode: Whether to enable Hedge Mode (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3394,7 +3696,7 @@ def update_dual_mode_position_leverage_with_http_info(self, settle, contract, le number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.Position], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.FuturesAccount, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -3403,9 +3705,7 @@ def update_dual_mode_position_leverage_with_http_info(self, settle, contract, le all_params = [ 'settle', - 'contract', - 'leverage', - 'cross_leverage_limit' + 'dual_mode' ] all_params.extend( [ @@ -3420,36 +3720,28 @@ def update_dual_mode_position_leverage_with_http_info(self, settle, contract, le if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method update_dual_mode_position_leverage" % k + " to method set_dual_mode" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `update_dual_mode_position_leverage`") # noqa: E501 - # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 - local_var_params['contract'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `contract` when calling `update_dual_mode_position_leverage`") # noqa: E501 - # verify the required parameter 'leverage' is set - if self.api_client.client_side_validation and ('leverage' not in local_var_params or # noqa: E501 - local_var_params['leverage'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `leverage` when calling `update_dual_mode_position_leverage`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `set_dual_mode`") # noqa: E501 + # verify the required parameter 'dual_mode' is set + if self.api_client.client_side_validation and ('dual_mode' not in local_var_params or # noqa: E501 + local_var_params['dual_mode'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `dual_mode` when calling `set_dual_mode`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 - if 'contract' in local_var_params: - path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] - if 'leverage' in local_var_params and local_var_params['leverage'] is not None: # noqa: E501 - query_params.append(('leverage', local_var_params['leverage'])) # noqa: E501 - if 'cross_leverage_limit' in local_var_params and local_var_params['cross_leverage_limit'] is not None: # noqa: E501 - query_params.append(('cross_leverage_limit', local_var_params['cross_leverage_limit'])) # noqa: E501 + if 'dual_mode' in local_var_params and local_var_params['dual_mode'] is not None: # noqa: E501 + query_params.append(('dual_mode', local_var_params['dual_mode'])) # noqa: E501 header_params = {} @@ -3465,14 +3757,14 @@ def update_dual_mode_position_leverage_with_http_info(self, settle, contract, le auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/dual_comp/positions/{contract}/leverage', 'POST', + '/futures/{settle}/dual_mode', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Position]', # noqa: E501 + response_type='FuturesAccount', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -3480,19 +3772,18 @@ def update_dual_mode_position_leverage_with_http_info(self, settle, contract, le _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def update_dual_mode_position_risk_limit(self, settle, contract, risk_limit, **kwargs): # noqa: E501 - """Update position risk limit in Hedge Mode # noqa: E501 + def set_position_mode(self, settle, position_mode, **kwargs): # noqa: E501 + """Set Position Holding Mode, replacing the dual_mode interface # noqa: E501 - Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 + The prerequisite for changing mode is that all positions have no holdings and no pending orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_dual_mode_position_risk_limit(settle, contract, risk_limit, async_req=True) + >>> thread = api.set_position_mode(settle, position_mode, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract (required) - :param str risk_limit: New risk limit value (required) + :param str position_mode: Optional Values: single, dual, dual_plus, representing Single Direction, Dual Direction, Split Position respectively (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3500,26 +3791,25 @@ def update_dual_mode_position_risk_limit(self, settle, contract, risk_limit, **k number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.Position] + :rtype: gate_api.FuturesAccount :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.update_dual_mode_position_risk_limit_with_http_info(settle, contract, risk_limit, **kwargs) # noqa: E501 + return self.set_position_mode_with_http_info(settle, position_mode, **kwargs) # noqa: E501 - def update_dual_mode_position_risk_limit_with_http_info(self, settle, contract, risk_limit, **kwargs): # noqa: E501 - """Update position risk limit in Hedge Mode # noqa: E501 + def set_position_mode_with_http_info(self, settle, position_mode, **kwargs): # noqa: E501 + """Set Position Holding Mode, replacing the dual_mode interface # noqa: E501 - Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 + The prerequisite for changing mode is that all positions have no holdings and no pending orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_dual_mode_position_risk_limit_with_http_info(settle, contract, risk_limit, async_req=True) + >>> thread = api.set_position_mode_with_http_info(settle, position_mode, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract (required) - :param str risk_limit: New risk limit value (required) + :param str position_mode: Optional Values: single, dual, dual_plus, representing Single Direction, Dual Direction, Split Position respectively (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3529,7 +3819,7 @@ def update_dual_mode_position_risk_limit_with_http_info(self, settle, contract, number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.Position], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.FuturesAccount, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -3538,8 +3828,7 @@ def update_dual_mode_position_risk_limit_with_http_info(self, settle, contract, all_params = [ 'settle', - 'contract', - 'risk_limit' + 'position_mode' ] all_params.extend( [ @@ -3554,34 +3843,28 @@ def update_dual_mode_position_risk_limit_with_http_info(self, settle, contract, if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method update_dual_mode_position_risk_limit" % k + " to method set_position_mode" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `update_dual_mode_position_risk_limit`") # noqa: E501 - # verify the required parameter 'contract' is set - if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 - local_var_params['contract'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `contract` when calling `update_dual_mode_position_risk_limit`") # noqa: E501 - # verify the required parameter 'risk_limit' is set - if self.api_client.client_side_validation and ('risk_limit' not in local_var_params or # noqa: E501 - local_var_params['risk_limit'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `risk_limit` when calling `update_dual_mode_position_risk_limit`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `set_position_mode`") # noqa: E501 + # verify the required parameter 'position_mode' is set + if self.api_client.client_side_validation and ('position_mode' not in local_var_params or # noqa: E501 + local_var_params['position_mode'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `position_mode` when calling `set_position_mode`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 - if 'contract' in local_var_params: - path_params['contract'] = local_var_params['contract'] # noqa: E501 query_params = [] - if 'risk_limit' in local_var_params and local_var_params['risk_limit'] is not None: # noqa: E501 - query_params.append(('risk_limit', local_var_params['risk_limit'])) # noqa: E501 + if 'position_mode' in local_var_params and local_var_params['position_mode'] is not None: # noqa: E501 + query_params.append(('position_mode', local_var_params['position_mode'])) # noqa: E501 header_params = {} @@ -3597,14 +3880,14 @@ def update_dual_mode_position_risk_limit_with_http_info(self, settle, contract, auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/dual_comp/positions/{contract}/risk_limit', 'POST', + '/futures/{settle}/set_position_mode', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Position]', # noqa: E501 + response_type='FuturesAccount', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -3612,22 +3895,17 @@ def update_dual_mode_position_risk_limit_with_http_info(self, settle, contract, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_futures_orders(self, settle, status, **kwargs): # noqa: E501 - """Query futures order list # noqa: E501 + def get_dual_mode_position(self, settle, contract, **kwargs): # noqa: E501 + """Get position information in Hedge Mode # noqa: E501 - - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_futures_orders(settle, status, async_req=True) + >>> thread = api.get_dual_mode_position(settle, contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str status: Query order list based on status (required) - :param str contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param str last_id: Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used + :param str contract: Futures contract (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3635,29 +3913,24 @@ def list_futures_orders(self, settle, status, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.FuturesOrder] + :rtype: list[gate_api.Position] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_futures_orders_with_http_info(settle, status, **kwargs) # noqa: E501 + return self.get_dual_mode_position_with_http_info(settle, contract, **kwargs) # noqa: E501 - def list_futures_orders_with_http_info(self, settle, status, **kwargs): # noqa: E501 - """Query futures order list # noqa: E501 + def get_dual_mode_position_with_http_info(self, settle, contract, **kwargs): # noqa: E501 + """Get position information in Hedge Mode # noqa: E501 - - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_futures_orders_with_http_info(settle, status, async_req=True) + >>> thread = api.get_dual_mode_position_with_http_info(settle, contract, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str status: Query order list based on status (required) - :param str contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param str last_id: Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used + :param str contract: Futures contract (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3667,7 +3940,7 @@ def list_futures_orders_with_http_info(self, settle, status, **kwargs): # noqa: number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.FuturesOrder], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.Position], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -3676,11 +3949,7 @@ def list_futures_orders_with_http_info(self, settle, status, **kwargs): # noqa: all_params = [ 'settle', - 'status', - 'contract', - 'limit', - 'offset', - 'last_id' + 'contract' ] all_params.extend( [ @@ -3695,25 +3964,2250 @@ def list_futures_orders_with_http_info(self, settle, status, **kwargs): # noqa: if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_futures_orders" % k + " to method get_dual_mode_position" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `list_futures_orders`") # noqa: E501 - # verify the required parameter 'status' is set - if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 - local_var_params['status'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `status` when calling `list_futures_orders`") # noqa: E501 - - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_futures_orders`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_dual_mode_position`") # noqa: E501 + # verify the required parameter 'contract' is set + if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 + local_var_params['contract'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `get_dual_mode_position`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + if 'contract' in local_var_params: + path_params['contract'] = local_var_params['contract'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/dual_comp/positions/{contract}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Position]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_dual_mode_position_margin(self, settle, contract, change, dual_side, **kwargs): # noqa: E501 + """Update position margin in Hedge Mode # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_dual_mode_position_margin(settle, contract, change, dual_side, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract (required) + :param str change: Margin change amount, positive number increases, negative number decreases (required) + :param str dual_side: Long or short position (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.Position] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_dual_mode_position_margin_with_http_info(settle, contract, change, dual_side, **kwargs) # noqa: E501 + + def update_dual_mode_position_margin_with_http_info(self, settle, contract, change, dual_side, **kwargs): # noqa: E501 + """Update position margin in Hedge Mode # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_dual_mode_position_margin_with_http_info(settle, contract, change, dual_side, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract (required) + :param str change: Margin change amount, positive number increases, negative number decreases (required) + :param str dual_side: Long or short position (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.Position], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'contract', + 'change', + 'dual_side' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_dual_mode_position_margin" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_dual_mode_position_margin`") # noqa: E501 + # verify the required parameter 'contract' is set + if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 + local_var_params['contract'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `update_dual_mode_position_margin`") # noqa: E501 + # verify the required parameter 'change' is set + if self.api_client.client_side_validation and ('change' not in local_var_params or # noqa: E501 + local_var_params['change'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `change` when calling `update_dual_mode_position_margin`") # noqa: E501 + # verify the required parameter 'dual_side' is set + if self.api_client.client_side_validation and ('dual_side' not in local_var_params or # noqa: E501 + local_var_params['dual_side'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `dual_side` when calling `update_dual_mode_position_margin`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + if 'contract' in local_var_params: + path_params['contract'] = local_var_params['contract'] # noqa: E501 + + query_params = [] + if 'change' in local_var_params and local_var_params['change'] is not None: # noqa: E501 + query_params.append(('change', local_var_params['change'])) # noqa: E501 + if 'dual_side' in local_var_params and local_var_params['dual_side'] is not None: # noqa: E501 + query_params.append(('dual_side', local_var_params['dual_side'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/dual_comp/positions/{contract}/margin', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Position]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_dual_mode_position_leverage(self, settle, contract, leverage, **kwargs): # noqa: E501 + """Update position leverage in Hedge Mode # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_dual_mode_position_leverage(settle, contract, leverage, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract (required) + :param str leverage: New position leverage (required) + :param str cross_leverage_limit: Cross margin leverage (valid only when `leverage` is 0) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.Position] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_dual_mode_position_leverage_with_http_info(settle, contract, leverage, **kwargs) # noqa: E501 + + def update_dual_mode_position_leverage_with_http_info(self, settle, contract, leverage, **kwargs): # noqa: E501 + """Update position leverage in Hedge Mode # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_dual_mode_position_leverage_with_http_info(settle, contract, leverage, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract (required) + :param str leverage: New position leverage (required) + :param str cross_leverage_limit: Cross margin leverage (valid only when `leverage` is 0) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.Position], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'contract', + 'leverage', + 'cross_leverage_limit' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_dual_mode_position_leverage" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_dual_mode_position_leverage`") # noqa: E501 + # verify the required parameter 'contract' is set + if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 + local_var_params['contract'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `update_dual_mode_position_leverage`") # noqa: E501 + # verify the required parameter 'leverage' is set + if self.api_client.client_side_validation and ('leverage' not in local_var_params or # noqa: E501 + local_var_params['leverage'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `leverage` when calling `update_dual_mode_position_leverage`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + if 'contract' in local_var_params: + path_params['contract'] = local_var_params['contract'] # noqa: E501 + + query_params = [] + if 'leverage' in local_var_params and local_var_params['leverage'] is not None: # noqa: E501 + query_params.append(('leverage', local_var_params['leverage'])) # noqa: E501 + if 'cross_leverage_limit' in local_var_params and local_var_params['cross_leverage_limit'] is not None: # noqa: E501 + query_params.append(('cross_leverage_limit', local_var_params['cross_leverage_limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/dual_comp/positions/{contract}/leverage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Position]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_dual_mode_position_risk_limit(self, settle, contract, risk_limit, **kwargs): # noqa: E501 + """Update position risk limit in Hedge Mode # noqa: E501 + + Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_dual_mode_position_risk_limit(settle, contract, risk_limit, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract (required) + :param str risk_limit: New risk limit value (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.Position] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_dual_mode_position_risk_limit_with_http_info(settle, contract, risk_limit, **kwargs) # noqa: E501 + + def update_dual_mode_position_risk_limit_with_http_info(self, settle, contract, risk_limit, **kwargs): # noqa: E501 + """Update position risk limit in Hedge Mode # noqa: E501 + + Under the new risk limit rules(https://www.gate.com/en/help/futures/futures-logic/22162), the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_dual_mode_position_risk_limit_with_http_info(settle, contract, risk_limit, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract (required) + :param str risk_limit: New risk limit value (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.Position], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'contract', + 'risk_limit' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_dual_mode_position_risk_limit" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_dual_mode_position_risk_limit`") # noqa: E501 + # verify the required parameter 'contract' is set + if self.api_client.client_side_validation and ('contract' not in local_var_params or # noqa: E501 + local_var_params['contract'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `contract` when calling `update_dual_mode_position_risk_limit`") # noqa: E501 + # verify the required parameter 'risk_limit' is set + if self.api_client.client_side_validation and ('risk_limit' not in local_var_params or # noqa: E501 + local_var_params['risk_limit'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `risk_limit` when calling `update_dual_mode_position_risk_limit`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + if 'contract' in local_var_params: + path_params['contract'] = local_var_params['contract'] # noqa: E501 + + query_params = [] + if 'risk_limit' in local_var_params and local_var_params['risk_limit'] is not None: # noqa: E501 + query_params.append(('risk_limit', local_var_params['risk_limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/dual_comp/positions/{contract}/risk_limit', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Position]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_futures_orders(self, settle, status, **kwargs): # noqa: E501 + """Query futures order list # noqa: E501 + + - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_futures_orders(settle, status, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str status: Query order list based on status (required) + :param str contract: Futures contract, return related data only if specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param str last_id: Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.FuturesOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_futures_orders_with_http_info(settle, status, **kwargs) # noqa: E501 + + def list_futures_orders_with_http_info(self, settle, status, **kwargs): # noqa: E501 + """Query futures order list # noqa: E501 + + - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_futures_orders_with_http_info(settle, status, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str status: Query order list based on status (required) + :param str contract: Futures contract, return related data only if specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param str last_id: Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.FuturesOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'status', + 'contract', + 'limit', + 'offset', + 'last_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_futures_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `list_futures_orders`") # noqa: E501 + # verify the required parameter 'status' is set + if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 + local_var_params['status'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `status` when calling `list_futures_orders`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_futures_orders`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `limit` when calling `list_futures_orders`, must be a value greater than or equal to `1`") # noqa: E501 if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ApiValueError("Invalid value for parameter `offset` when calling `list_futures_orders`, must be a value greater than or equal to `0`") # noqa: E501 + raise ApiValueError("Invalid value for parameter `offset` when calling `list_futures_orders`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 + query_params.append(('contract', local_var_params['contract'])) # noqa: E501 + if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + query_params.append(('status', local_var_params['status'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if 'last_id' in local_var_params and local_var_params['last_id'] is not None: # noqa: E501 + query_params.append(('last_id', local_var_params['last_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FuturesOrder]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_futures_order(self, settle, futures_order, **kwargs): # noqa: E501 + """Place futures order # noqa: E501 + + - When placing an order, the number of contracts is specified `size`, not the number of coins. The number of coins corresponding to each contract is returned in the contract details interface `quanto_multiplier` - 0 The order that was completed cannot be obtained after 10 minutes of withdrawal, and the order will be mentioned that the order does not exist - Setting `reduce_only` to `true` can prevent the position from being penetrated when reducing the position - In single-position mode, if you need to close the position, you need to set `size` to 0 and `close` to `true` - In dual warehouse mode, - Reduce position: reduce_only=true, size is a positive number that indicates short position, negative number that indicates long position - Add number that indicates adding long positions, and negative numbers indicate adding short positions - Close position: size=0, set the direction of closing position according to auto_size, and set `reduce_only` to true at the same time - reduce_only: Make sure to only perform position reduction operations to prevent increased positions - Set `stp_act` to determine the use of a strategy that restricts user transactions. For detailed usage, refer to the body parameter `stp_act` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_futures_order(settle, futures_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param FuturesOrder futures_order: (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FuturesOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_futures_order_with_http_info(settle, futures_order, **kwargs) # noqa: E501 + + def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): # noqa: E501 + """Place futures order # noqa: E501 + + - When placing an order, the number of contracts is specified `size`, not the number of coins. The number of coins corresponding to each contract is returned in the contract details interface `quanto_multiplier` - 0 The order that was completed cannot be obtained after 10 minutes of withdrawal, and the order will be mentioned that the order does not exist - Setting `reduce_only` to `true` can prevent the position from being penetrated when reducing the position - In single-position mode, if you need to close the position, you need to set `size` to 0 and `close` to `true` - In dual warehouse mode, - Reduce position: reduce_only=true, size is a positive number that indicates short position, negative number that indicates long position - Add number that indicates adding long positions, and negative numbers indicate adding short positions - Close position: size=0, set the direction of closing position according to auto_size, and set `reduce_only` to true at the same time - reduce_only: Make sure to only perform position reduction operations to prevent increased positions - Set `stp_act` to determine the use of a strategy that restricts user transactions. For detailed usage, refer to the body parameter `stp_act` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_futures_order_with_http_info(settle, futures_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param FuturesOrder futures_order: (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FuturesOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'futures_order', + 'x_gate_exptime' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_futures_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `create_futures_order`") # noqa: E501 + # verify the required parameter 'futures_order' is set + if self.api_client.client_side_validation and ('futures_order' not in local_var_params or # noqa: E501 + local_var_params['futures_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `futures_order` when calling `create_futures_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_gate_exptime' in local_var_params: + header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'futures_order' in local_var_params: + body_params = local_var_params['futures_order'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FuturesOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def cancel_futures_orders(self, settle, **kwargs): # noqa: E501 + """Cancel all orders with 'open' status # noqa: E501 + + Zero-fill orders cannot be retrieved 10 minutes after order cancellation # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_futures_orders(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param str contract: Contract Identifier; if specified, only cancel pending orders related to this contract + :param str action_mode: Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) + :param str side: Specify all buy orders or all sell orders, both are included if not specified. Set to bid to cancel all buy orders, set to ask to cancel all sell orders + :param bool exclude_reduce_only: Whether to exclude reduce-only orders + :param str text: Remark for order cancellation + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.FuturesOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_futures_orders_with_http_info(settle, **kwargs) # noqa: E501 + + def cancel_futures_orders_with_http_info(self, settle, **kwargs): # noqa: E501 + """Cancel all orders with 'open' status # noqa: E501 + + Zero-fill orders cannot be retrieved 10 minutes after order cancellation # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_futures_orders_with_http_info(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param str contract: Contract Identifier; if specified, only cancel pending orders related to this contract + :param str action_mode: Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) + :param str side: Specify all buy orders or all sell orders, both are included if not specified. Set to bid to cancel all buy orders, set to ask to cancel all sell orders + :param bool exclude_reduce_only: Whether to exclude reduce-only orders + :param str text: Remark for order cancellation + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.FuturesOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'x_gate_exptime', + 'contract', + 'action_mode', + 'side', + 'exclude_reduce_only', + 'text' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_futures_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `cancel_futures_orders`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 + query_params.append(('contract', local_var_params['contract'])) # noqa: E501 + if 'action_mode' in local_var_params and local_var_params['action_mode'] is not None: # noqa: E501 + query_params.append(('action_mode', local_var_params['action_mode'])) # noqa: E501 + if 'side' in local_var_params and local_var_params['side'] is not None: # noqa: E501 + query_params.append(('side', local_var_params['side'])) # noqa: E501 + if 'exclude_reduce_only' in local_var_params and local_var_params['exclude_reduce_only'] is not None: # noqa: E501 + query_params.append(('exclude_reduce_only', local_var_params['exclude_reduce_only'])) # noqa: E501 + if 'text' in local_var_params and local_var_params['text'] is not None: # noqa: E501 + query_params.append(('text', local_var_params['text'])) # noqa: E501 + + header_params = {} + if 'x_gate_exptime' in local_var_params: + header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/orders', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FuturesOrder]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_orders_with_time_range(self, settle, **kwargs): # noqa: E501 + """Query futures order list by time range # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_orders_with_time_range(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.FuturesOrderTimerange] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_orders_with_time_range_with_http_info(settle, **kwargs) # noqa: E501 + + def get_orders_with_time_range_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query futures order list by time range # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_orders_with_time_range_with_http_info(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.FuturesOrderTimerange], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'contract', + '_from', + 'to', + 'limit', + 'offset' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_orders_with_time_range" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_orders_with_time_range`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `get_orders_with_time_range`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `get_orders_with_time_range`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ApiValueError("Invalid value for parameter `offset` when calling `get_orders_with_time_range`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 + query_params.append(('contract', local_var_params['contract'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/orders_timerange', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FuturesOrderTimerange]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_batch_futures_order(self, settle, futures_order, **kwargs): # noqa: E501 + """Place batch futures orders # noqa: E501 + + - Up to 10 orders per request - If any of the order's parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly - If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders - The returned result is in array format, and the order corresponds to the orders in the request body - In the returned result, the `succeeded` field of type bool indicates whether the execution was successful or not - If the execution is successful, the normal order content is included; if the execution fails, the `label` field is included to indicate the cause of the error - In the rate limiting, each order is counted individually # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_batch_futures_order(settle, futures_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param list[FuturesOrder] futures_order: (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.BatchFuturesOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_batch_futures_order_with_http_info(settle, futures_order, **kwargs) # noqa: E501 + + def create_batch_futures_order_with_http_info(self, settle, futures_order, **kwargs): # noqa: E501 + """Place batch futures orders # noqa: E501 + + - Up to 10 orders per request - If any of the order's parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly - If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders - The returned result is in array format, and the order corresponds to the orders in the request body - In the returned result, the `succeeded` field of type bool indicates whether the execution was successful or not - If the execution is successful, the normal order content is included; if the execution fails, the `label` field is included to indicate the cause of the error - In the rate limiting, each order is counted individually # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_batch_futures_order_with_http_info(settle, futures_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param list[FuturesOrder] futures_order: (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.BatchFuturesOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'futures_order', + 'x_gate_exptime' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_batch_futures_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `create_batch_futures_order`") # noqa: E501 + # verify the required parameter 'futures_order' is set + if self.api_client.client_side_validation and ('futures_order' not in local_var_params or # noqa: E501 + local_var_params['futures_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `futures_order` when calling `create_batch_futures_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_gate_exptime' in local_var_params: + header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'futures_order' in local_var_params: + body_params = local_var_params['futures_order'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/batch_orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[BatchFuturesOrder]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_futures_order(self, settle, order_id, **kwargs): # noqa: E501 + """Query single order details # noqa: E501 + + - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_futures_order(settle, order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str order_id: The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FuturesOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_futures_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 + + def get_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 + """Query single order details # noqa: E501 + + - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_futures_order_with_http_info(settle, order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str order_id: The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FuturesOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'order_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_futures_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_futures_order`") # noqa: E501 + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `get_futures_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/orders/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FuturesOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def amend_futures_order(self, settle, order_id, futures_order_amendment, **kwargs): # noqa: E501 + """Amend single order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.amend_futures_order(settle, order_id, futures_order_amendment, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str order_id: The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. (required) + :param FuturesOrderAmendment futures_order_amendment: (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FuturesOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.amend_futures_order_with_http_info(settle, order_id, futures_order_amendment, **kwargs) # noqa: E501 + + def amend_futures_order_with_http_info(self, settle, order_id, futures_order_amendment, **kwargs): # noqa: E501 + """Amend single order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.amend_futures_order_with_http_info(settle, order_id, futures_order_amendment, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str order_id: The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. (required) + :param FuturesOrderAmendment futures_order_amendment: (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FuturesOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'order_id', + 'futures_order_amendment', + 'x_gate_exptime' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method amend_futures_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `amend_futures_order`") # noqa: E501 + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `amend_futures_order`") # noqa: E501 + # verify the required parameter 'futures_order_amendment' is set + if self.api_client.client_side_validation and ('futures_order_amendment' not in local_var_params or # noqa: E501 + local_var_params['futures_order_amendment'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `futures_order_amendment` when calling `amend_futures_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_gate_exptime' in local_var_params: + header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'futures_order_amendment' in local_var_params: + body_params = local_var_params['futures_order_amendment'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/orders/{order_id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FuturesOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def cancel_futures_order(self, settle, order_id, **kwargs): # noqa: E501 + """Cancel single order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_futures_order(settle, order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str order_id: The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param str action_mode: Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FuturesOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_futures_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 + + def cancel_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 + """Cancel single order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_futures_order_with_http_info(settle, order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str order_id: The order ID returned when the order is created successfully, or the custom ID specified by the user when creating the order (i.e. the `text` field). When using the custom `text` field: 1. If the order was not filled and has been cancelled, after 60 seconds you cannot query the order by `text`; continuing to use `text` returns error ORDER_NOT_FOUND. 2. If the order was fully or partially filled, you can query the order by `text` indefinitely. (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param str action_mode: Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FuturesOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'order_id', + 'x_gate_exptime', + 'action_mode' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_futures_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `cancel_futures_order`") # noqa: E501 + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `cancel_futures_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + if 'action_mode' in local_var_params and local_var_params['action_mode'] is not None: # noqa: E501 + query_params.append(('action_mode', local_var_params['action_mode'])) # noqa: E501 + + header_params = {} + if 'x_gate_exptime' in local_var_params: + header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/orders/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FuturesOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_my_trades(self, settle, **kwargs): # noqa: E501 + """Query personal trading records # noqa: E501 + + By default, only supports querying data within 6 months. For older data, use `GET /futures/{settle}/my_trades_timerange` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_my_trades(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int order: Futures order ID, return related data only if specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param str last_id: Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.MyFuturesTrade] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_my_trades_with_http_info(settle, **kwargs) # noqa: E501 + + def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query personal trading records # noqa: E501 + + By default, only supports querying data within 6 months. For older data, use `GET /futures/{settle}/my_trades_timerange` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_my_trades_with_http_info(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int order: Futures order ID, return related data only if specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param str last_id: Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'. + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.MyFuturesTrade], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'contract', + 'order', + 'limit', + 'offset', + 'last_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_my_trades" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_my_trades`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `get_my_trades`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `get_my_trades`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ApiValueError("Invalid value for parameter `offset` when calling `get_my_trades`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 + query_params.append(('contract', local_var_params['contract'])) # noqa: E501 + if 'order' in local_var_params and local_var_params['order'] is not None: # noqa: E501 + query_params.append(('order', local_var_params['order'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if 'last_id' in local_var_params and local_var_params['last_id'] is not None: # noqa: E501 + query_params.append(('last_id', local_var_params['last_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/my_trades', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[MyFuturesTrade]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_my_trades_with_time_range(self, settle, **kwargs): # noqa: E501 + """Query personal trading records by time range # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_my_trades_with_time_range(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param str role: Query role, maker or taker + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.MyFuturesTradeTimeRange] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_my_trades_with_time_range_with_http_info(settle, **kwargs) # noqa: E501 + + def get_my_trades_with_time_range_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query personal trading records by time range # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_my_trades_with_time_range_with_http_info(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param str role: Query role, maker or taker + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.MyFuturesTradeTimeRange], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'contract', + '_from', + 'to', + 'limit', + 'offset', + 'role' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_my_trades_with_time_range" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_my_trades_with_time_range`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `get_my_trades_with_time_range`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `get_my_trades_with_time_range`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ApiValueError("Invalid value for parameter `offset` when calling `get_my_trades_with_time_range`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 + query_params.append(('contract', local_var_params['contract'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if 'role' in local_var_params and local_var_params['role'] is not None: # noqa: E501 + query_params.append(('role', local_var_params['role'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/my_trades_timerange', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[MyFuturesTradeTimeRange]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_position_close(self, settle, **kwargs): # noqa: E501 + """Query position close history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_position_close(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param str side: Query side. long or shot + :param str pnl: Query profit or loss + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.PositionClose] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_position_close_with_http_info(settle, **kwargs) # noqa: E501 + + def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query position close history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_position_close_with_http_info(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param str side: Query side. long or shot + :param str pnl: Query profit or loss + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.PositionClose], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'contract', + 'limit', + 'offset', + '_from', + 'to', + 'side', + 'pnl' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_position_close" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `list_position_close`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_position_close`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_position_close`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ApiValueError("Invalid value for parameter `offset` when calling `list_position_close`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 + query_params.append(('contract', local_var_params['contract'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'side' in local_var_params and local_var_params['side'] is not None: # noqa: E501 + query_params.append(('side', local_var_params['side'])) # noqa: E501 + if 'pnl' in local_var_params and local_var_params['pnl'] is not None: # noqa: E501 + query_params.append(('pnl', local_var_params['pnl'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/position_close', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[PositionClose]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_liquidates(self, settle, **kwargs): # noqa: E501 + """Query liquidation history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_liquidates(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param int at: Specify liquidation timestamp + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.FuturesLiquidate] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_liquidates_with_http_info(settle, **kwargs) # noqa: E501 + + def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query liquidation history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_liquidates_with_http_info(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param int at: Specify liquidation timestamp + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.FuturesLiquidate], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'contract', + 'limit', + 'offset', + '_from', + 'to', + 'at' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_liquidates" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `list_liquidates`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_liquidates`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_liquidates`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ApiValueError("Invalid value for parameter `offset` when calling `list_liquidates`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'settle' in local_var_params: + path_params['settle'] = local_var_params['settle'] # noqa: E501 + + query_params = [] + if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 + query_params.append(('contract', local_var_params['contract'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 + query_params.append(('offset', local_var_params['offset'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'at' in local_var_params and local_var_params['at'] is not None: # noqa: E501 + query_params.append(('at', local_var_params['at'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/futures/{settle}/liquidates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FuturesLiquidate]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_auto_deleverages(self, settle, **kwargs): # noqa: E501 + """Query ADL auto-deleveraging order information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_deleverages(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param int at: Specify auto-deleveraging timestamp + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.FuturesAutoDeleverage] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_auto_deleverages_with_http_info(settle, **kwargs) # noqa: E501 + + def list_auto_deleverages_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query ADL auto-deleveraging order information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_auto_deleverages_with_http_info(settle, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified + :param int limit: Maximum number of records returned in a single list + :param int offset: List offset, starting from 0 + :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) + :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp + :param int at: Specify auto-deleveraging timestamp + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.FuturesAutoDeleverage], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'settle', + 'contract', + 'limit', + 'offset', + '_from', + 'to', + 'at' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_auto_deleverages" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'settle' is set + if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 + local_var_params['settle'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `list_auto_deleverages`") # noqa: E501 + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_auto_deleverages`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_auto_deleverages`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 + raise ApiValueError("Invalid value for parameter `offset` when calling `list_auto_deleverages`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -3723,14 +6217,16 @@ def list_futures_orders_with_http_info(self, settle, status, **kwargs): # noqa: query_params = [] if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 - if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 - query_params.append(('status', local_var_params['status'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'last_id' in local_var_params and local_var_params['last_id'] is not None: # noqa: E501 - query_params.append(('last_id', local_var_params['last_id'])) # noqa: E501 + if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 + query_params.append(('from', local_var_params['_from'])) # noqa: E501 + if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 + query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'at' in local_var_params and local_var_params['at'] is not None: # noqa: E501 + query_params.append(('at', local_var_params['at'])) # noqa: E501 header_params = {} @@ -3746,14 +6242,14 @@ def list_futures_orders_with_http_info(self, settle, status, **kwargs): # noqa: auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/orders', 'GET', + '/futures/{settle}/auto_deleverages', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FuturesOrder]', # noqa: E501 + response_type='list[FuturesAutoDeleverage]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -3761,19 +6257,18 @@ def list_futures_orders_with_http_info(self, settle, status, **kwargs): # noqa: _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_futures_order(self, settle, futures_order, **kwargs): # noqa: E501 - """Place futures order # noqa: E501 + def countdown_cancel_all_futures(self, settle, countdown_cancel_all_futures_task, **kwargs): # noqa: E501 + """Countdown cancel orders # noqa: E501 - - When placing an order, the number of contracts is specified `size`, not the number of coins. The number of coins corresponding to each contract is returned in the contract details interface `quanto_multiplier` - 0 The order that was completed cannot be obtained after 10 minutes of withdrawal, and the order will be mentioned that the order does not exist - Setting `reduce_only` to `true` can prevent the position from being penetrated when reducing the position - In single-position mode, if you need to close the position, you need to set `size` to 0 and `close` to `true` - In dual warehouse mode, - Reduce position: reduce_only=true, size is a positive number that indicates short position, negative number that indicates long position - Add number that indicates adding long positions, and negative numbers indicate adding short positions - Close position: size=0, set the direction of closing position according to auto_size, and set `reduce_only` to true at the same time - reduce_only: Make sure to only perform position reduction operations to prevent increased positions - Set `stp_act` to determine the use of a strategy that restricts user transactions. For detailed usage, refer to the body parameter `stp_act` # noqa: E501 + Heartbeat detection for contract orders: When the user-set `timeout` time is reached, if neither the existing countdown is canceled nor a new countdown is set, the relevant contract orders will be automatically canceled. This API can be called repeatedly to or cancel the countdown. Usage example: Repeatedly call this API at 30-second intervals, setting the `timeout` to 30 (seconds) each time. If this API is not called again within 30 seconds, all open orders on your specified `market` will be automatically canceled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will terminate, and the automatic order cancellation function will be disabled. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_futures_order(settle, futures_order, async_req=True) + >>> thread = api.countdown_cancel_all_futures(settle, countdown_cancel_all_futures_task, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param FuturesOrder futures_order: (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param CountdownCancelAllFuturesTask countdown_cancel_all_futures_task: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3781,26 +6276,25 @@ def create_futures_order(self, settle, futures_order, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.FuturesOrder + :rtype: gate_api.TriggerTime :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.create_futures_order_with_http_info(settle, futures_order, **kwargs) # noqa: E501 + return self.countdown_cancel_all_futures_with_http_info(settle, countdown_cancel_all_futures_task, **kwargs) # noqa: E501 - def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): # noqa: E501 - """Place futures order # noqa: E501 + def countdown_cancel_all_futures_with_http_info(self, settle, countdown_cancel_all_futures_task, **kwargs): # noqa: E501 + """Countdown cancel orders # noqa: E501 - - When placing an order, the number of contracts is specified `size`, not the number of coins. The number of coins corresponding to each contract is returned in the contract details interface `quanto_multiplier` - 0 The order that was completed cannot be obtained after 10 minutes of withdrawal, and the order will be mentioned that the order does not exist - Setting `reduce_only` to `true` can prevent the position from being penetrated when reducing the position - In single-position mode, if you need to close the position, you need to set `size` to 0 and `close` to `true` - In dual warehouse mode, - Reduce position: reduce_only=true, size is a positive number that indicates short position, negative number that indicates long position - Add number that indicates adding long positions, and negative numbers indicate adding short positions - Close position: size=0, set the direction of closing position according to auto_size, and set `reduce_only` to true at the same time - reduce_only: Make sure to only perform position reduction operations to prevent increased positions - Set `stp_act` to determine the use of a strategy that restricts user transactions. For detailed usage, refer to the body parameter `stp_act` # noqa: E501 + Heartbeat detection for contract orders: When the user-set `timeout` time is reached, if neither the existing countdown is canceled nor a new countdown is set, the relevant contract orders will be automatically canceled. This API can be called repeatedly to or cancel the countdown. Usage example: Repeatedly call this API at 30-second intervals, setting the `timeout` to 30 (seconds) each time. If this API is not called again within 30 seconds, all open orders on your specified `market` will be automatically canceled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will terminate, and the automatic order cancellation function will be disabled. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_futures_order_with_http_info(settle, futures_order, async_req=True) + >>> thread = api.countdown_cancel_all_futures_with_http_info(settle, countdown_cancel_all_futures_task, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param FuturesOrder futures_order: (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param CountdownCancelAllFuturesTask countdown_cancel_all_futures_task: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3810,7 +6304,7 @@ def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.FuturesOrder, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.TriggerTime, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -3819,8 +6313,7 @@ def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): all_params = [ 'settle', - 'futures_order', - 'x_gate_exptime' + 'countdown_cancel_all_futures_task' ] all_params.extend( [ @@ -3835,18 +6328,18 @@ def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method create_futures_order" % k + " to method countdown_cancel_all_futures" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `create_futures_order`") # noqa: E501 - # verify the required parameter 'futures_order' is set - if self.api_client.client_side_validation and ('futures_order' not in local_var_params or # noqa: E501 - local_var_params['futures_order'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `futures_order` when calling `create_futures_order`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `countdown_cancel_all_futures`") # noqa: E501 + # verify the required parameter 'countdown_cancel_all_futures_task' is set + if self.api_client.client_side_validation and ('countdown_cancel_all_futures_task' not in local_var_params or # noqa: E501 + local_var_params['countdown_cancel_all_futures_task'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `countdown_cancel_all_futures_task` when calling `countdown_cancel_all_futures`") # noqa: E501 collection_formats = {} @@ -3857,15 +6350,13 @@ def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): query_params = [] header_params = {} - if 'x_gate_exptime' in local_var_params: - header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - if 'futures_order' in local_var_params: - body_params = local_var_params['futures_order'] + if 'countdown_cancel_all_futures_task' in local_var_params: + body_params = local_var_params['countdown_cancel_all_futures_task'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -3878,14 +6369,14 @@ def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/orders', 'POST', + '/futures/{settle}/countdown_cancel_all', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='FuturesOrder', # noqa: E501 + response_type='TriggerTime', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -3893,22 +6384,17 @@ def create_futures_order_with_http_info(self, settle, futures_order, **kwargs): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def cancel_futures_orders(self, settle, **kwargs): # noqa: E501 - """Cancel all orders with 'open' status # noqa: E501 + def get_futures_fee(self, settle, **kwargs): # noqa: E501 + """Query futures market trading fee rates # noqa: E501 - Zero-fill orders cannot be retrieved 10 minutes after order cancellation # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.cancel_futures_orders(settle, async_req=True) + >>> thread = api.get_futures_fee(settle, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected - :param str contract: Contract Identifier; if specified, only cancel pending orders related to this contract - :param str side: Specify all buy orders or all sell orders, both are included if not specified. Set to bid to cancel all buy orders, set to ask to cancel all sell orders - :param bool exclude_reduce_only: Whether to exclude reduce-only orders - :param str text: Remark for order cancellation + :param str contract: Futures contract, return related data only if specified :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -3916,29 +6402,24 @@ def cancel_futures_orders(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.FuturesOrder] + :rtype: dict(str, gate_api.FuturesFee) :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.cancel_futures_orders_with_http_info(settle, **kwargs) # noqa: E501 + return self.get_futures_fee_with_http_info(settle, **kwargs) # noqa: E501 - def cancel_futures_orders_with_http_info(self, settle, **kwargs): # noqa: E501 - """Cancel all orders with 'open' status # noqa: E501 + def get_futures_fee_with_http_info(self, settle, **kwargs): # noqa: E501 + """Query futures market trading fee rates # noqa: E501 - Zero-fill orders cannot be retrieved 10 minutes after order cancellation # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.cancel_futures_orders_with_http_info(settle, async_req=True) + >>> thread = api.get_futures_fee_with_http_info(settle, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected - :param str contract: Contract Identifier; if specified, only cancel pending orders related to this contract - :param str side: Specify all buy orders or all sell orders, both are included if not specified. Set to bid to cancel all buy orders, set to ask to cancel all sell orders - :param bool exclude_reduce_only: Whether to exclude reduce-only orders - :param str text: Remark for order cancellation + :param str contract: Futures contract, return related data only if specified :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -3948,20 +6429,16 @@ def cancel_futures_orders_with_http_info(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.FuturesOrder], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(dict(str, gate_api.FuturesFee), status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ local_var_params = locals() - - all_params = [ - 'settle', - 'x_gate_exptime', - 'contract', - 'side', - 'exclude_reduce_only', - 'text' + + all_params = [ + 'settle', + 'contract' ] all_params.extend( [ @@ -3976,14 +6453,14 @@ def cancel_futures_orders_with_http_info(self, settle, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method cancel_futures_orders" % k + " to method get_futures_fee" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `cancel_futures_orders`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_futures_fee`") # noqa: E501 collection_formats = {} @@ -3994,16 +6471,8 @@ def cancel_futures_orders_with_http_info(self, settle, **kwargs): # noqa: E501 query_params = [] if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 - if 'side' in local_var_params and local_var_params['side'] is not None: # noqa: E501 - query_params.append(('side', local_var_params['side'])) # noqa: E501 - if 'exclude_reduce_only' in local_var_params and local_var_params['exclude_reduce_only'] is not None: # noqa: E501 - query_params.append(('exclude_reduce_only', local_var_params['exclude_reduce_only'])) # noqa: E501 - if 'text' in local_var_params and local_var_params['text'] is not None: # noqa: E501 - query_params.append(('text', local_var_params['text'])) # noqa: E501 header_params = {} - if 'x_gate_exptime' in local_var_params: - header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 form_params = [] local_var_files = {} @@ -4017,14 +6486,14 @@ def cancel_futures_orders_with_http_info(self, settle, **kwargs): # noqa: E501 auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/orders', 'DELETE', + '/futures/{settle}/fee', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FuturesOrder]', # noqa: E501 + response_type='dict(str, FuturesFee)', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -4032,21 +6501,19 @@ def cancel_futures_orders_with_http_info(self, settle, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_orders_with_time_range(self, settle, **kwargs): # noqa: E501 - """Query futures order list by time range # noqa: E501 + def cancel_batch_future_orders(self, settle, request_body, **kwargs): # noqa: E501 + """Cancel batch orders by specified ID list # noqa: E501 + Multiple different order IDs can be specified. A maximum of 20 records can be cancelled in one request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orders_with_time_range(settle, async_req=True) + >>> thread = api.cancel_batch_future_orders(settle, request_body, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 + :param list[str] request_body: (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -4054,28 +6521,26 @@ def get_orders_with_time_range(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.FuturesOrder] + :rtype: list[gate_api.FutureCancelOrderResult] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_orders_with_time_range_with_http_info(settle, **kwargs) # noqa: E501 + return self.cancel_batch_future_orders_with_http_info(settle, request_body, **kwargs) # noqa: E501 - def get_orders_with_time_range_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query futures order list by time range # noqa: E501 + def cancel_batch_future_orders_with_http_info(self, settle, request_body, **kwargs): # noqa: E501 + """Cancel batch orders by specified ID list # noqa: E501 + Multiple different order IDs can be specified. A maximum of 20 records can be cancelled in one request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_orders_with_time_range_with_http_info(settle, async_req=True) + >>> thread = api.cancel_batch_future_orders_with_http_info(settle, request_body, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 + :param list[str] request_body: (required) + :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -4085,7 +6550,7 @@ def get_orders_with_time_range_with_http_info(self, settle, **kwargs): # noqa: number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.FuturesOrder], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.FutureCancelOrderResult], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -4094,11 +6559,8 @@ def get_orders_with_time_range_with_http_info(self, settle, **kwargs): # noqa: all_params = [ 'settle', - 'contract', - '_from', - 'to', - 'limit', - 'offset' + 'request_body', + 'x_gate_exptime' ] all_params.extend( [ @@ -4113,21 +6575,19 @@ def get_orders_with_time_range_with_http_info(self, settle, **kwargs): # noqa: if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_orders_with_time_range" % k + " to method cancel_batch_future_orders" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `get_orders_with_time_range`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `cancel_batch_future_orders`") # noqa: E501 + # verify the required parameter 'request_body' is set + if self.api_client.client_side_validation and ('request_body' not in local_var_params or # noqa: E501 + local_var_params['request_body'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `request_body` when calling `cancel_batch_future_orders`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `get_orders_with_time_range`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `get_orders_with_time_range`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ApiValueError("Invalid value for parameter `offset` when calling `get_orders_with_time_range`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -4135,39 +6595,37 @@ def get_orders_with_time_range_with_http_info(self, settle, **kwargs): # noqa: path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] - if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 - query_params.append(('contract', local_var_params['contract'])) # noqa: E501 - if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 - query_params.append(('from', local_var_params['_from'])) # noqa: E501 - if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 - query_params.append(('to', local_var_params['to'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 header_params = {} + if 'x_gate_exptime' in local_var_params: + header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 form_params = [] local_var_files = {} body_params = None + if 'request_body' in local_var_params: + body_params = local_var_params['request_body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/orders_timerange', 'GET', + '/futures/{settle}/batch_cancel_orders', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FuturesOrder]', # noqa: E501 + response_type='list[FutureCancelOrderResult]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -4175,18 +6633,18 @@ def get_orders_with_time_range_with_http_info(self, settle, **kwargs): # noqa: _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_batch_futures_order(self, settle, futures_order, **kwargs): # noqa: E501 - """Place batch futures orders # noqa: E501 + def amend_batch_future_orders(self, settle, batch_amend_order_req, **kwargs): # noqa: E501 + """Batch modify orders by specified IDs # noqa: E501 - - Up to 10 orders per request - If any of the order's parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly - If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders - The returned result is in array format, and the order corresponds to the orders in the request body - In the returned result, the `succeeded` field of type bool indicates whether the execution was successful or not - If the execution is successful, the normal order content is included; if the execution fails, the `label` field is included to indicate the cause of the error - In the rate limiting, each order is counted individually # noqa: E501 + Multiple different order IDs can be specified. A maximum of 10 orders can be modified in one request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_batch_futures_order(settle, futures_order, async_req=True) + >>> thread = api.amend_batch_future_orders(settle, batch_amend_order_req, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param list[FuturesOrder] futures_order: (required) + :param list[BatchAmendOrderReq] batch_amend_order_req: (required) :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response @@ -4200,20 +6658,20 @@ def create_batch_futures_order(self, settle, futures_order, **kwargs): # noqa: returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.create_batch_futures_order_with_http_info(settle, futures_order, **kwargs) # noqa: E501 + return self.amend_batch_future_orders_with_http_info(settle, batch_amend_order_req, **kwargs) # noqa: E501 - def create_batch_futures_order_with_http_info(self, settle, futures_order, **kwargs): # noqa: E501 - """Place batch futures orders # noqa: E501 + def amend_batch_future_orders_with_http_info(self, settle, batch_amend_order_req, **kwargs): # noqa: E501 + """Batch modify orders by specified IDs # noqa: E501 - - Up to 10 orders per request - If any of the order's parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly - If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders - The returned result is in array format, and the order corresponds to the orders in the request body - In the returned result, the `succeeded` field of type bool indicates whether the execution was successful or not - If the execution is successful, the normal order content is included; if the execution fails, the `label` field is included to indicate the cause of the error - In the rate limiting, each order is counted individually # noqa: E501 + Multiple different order IDs can be specified. A maximum of 10 orders can be modified in one request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_batch_futures_order_with_http_info(settle, futures_order, async_req=True) + >>> thread = api.amend_batch_future_orders_with_http_info(settle, batch_amend_order_req, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param list[FuturesOrder] futures_order: (required) + :param list[BatchAmendOrderReq] batch_amend_order_req: (required) :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected :param _return_http_data_only: response data without head status code and headers @@ -4233,7 +6691,7 @@ def create_batch_futures_order_with_http_info(self, settle, futures_order, **kwa all_params = [ 'settle', - 'futures_order', + 'batch_amend_order_req', 'x_gate_exptime' ] all_params.extend( @@ -4249,18 +6707,18 @@ def create_batch_futures_order_with_http_info(self, settle, futures_order, **kwa if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method create_batch_futures_order" % k + " to method amend_batch_future_orders" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `create_batch_futures_order`") # noqa: E501 - # verify the required parameter 'futures_order' is set - if self.api_client.client_side_validation and ('futures_order' not in local_var_params or # noqa: E501 - local_var_params['futures_order'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `futures_order` when calling `create_batch_futures_order`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `amend_batch_future_orders`") # noqa: E501 + # verify the required parameter 'batch_amend_order_req' is set + if self.api_client.client_side_validation and ('batch_amend_order_req' not in local_var_params or # noqa: E501 + local_var_params['batch_amend_order_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `batch_amend_order_req` when calling `amend_batch_future_orders`") # noqa: E501 collection_formats = {} @@ -4278,8 +6736,8 @@ def create_batch_futures_order_with_http_info(self, settle, futures_order, **kwa local_var_files = {} body_params = None - if 'futures_order' in local_var_params: - body_params = local_var_params['futures_order'] + if 'batch_amend_order_req' in local_var_params: + body_params = local_var_params['batch_amend_order_req'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -4292,7 +6750,7 @@ def create_batch_futures_order_with_http_info(self, settle, futures_order, **kwa auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/batch_orders', 'POST', + '/futures/{settle}/batch_amend_orders', 'POST', path_params, query_params, header_params, @@ -4307,18 +6765,18 @@ def create_batch_futures_order_with_http_info(self, settle, futures_order, **kwa _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_futures_order(self, settle, order_id, **kwargs): # noqa: E501 - """Query single order details # noqa: E501 + def get_futures_risk_limit_table(self, settle, table_id, **kwargs): # noqa: E501 + """Query risk limit table by table_id # noqa: E501 - - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. # noqa: E501 + Just pass table_id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_futures_order(settle, order_id, async_req=True) + >>> thread = api.get_futures_risk_limit_table(settle, table_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) + :param str table_id: Risk limit table ID (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -4326,25 +6784,25 @@ def get_futures_order(self, settle, order_id, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.FuturesOrder + :rtype: list[gate_api.FuturesRiskLimitTier] :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_futures_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 + return self.get_futures_risk_limit_table_with_http_info(settle, table_id, **kwargs) # noqa: E501 - def get_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Query single order details # noqa: E501 + def get_futures_risk_limit_table_with_http_info(self, settle, table_id, **kwargs): # noqa: E501 + """Query risk limit table by table_id # noqa: E501 - - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. # noqa: E501 + Just pass table_id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_futures_order_with_http_info(settle, order_id, async_req=True) + >>> thread = api.get_futures_risk_limit_table_with_http_info(settle, table_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) + :param str table_id: Risk limit table ID (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -4354,7 +6812,7 @@ def get_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.FuturesOrder, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.FuturesRiskLimitTier], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -4363,7 +6821,7 @@ def get_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: all_params = [ 'settle', - 'order_id' + 'table_id' ] all_params.extend( [ @@ -4378,28 +6836,28 @@ def get_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_futures_order" % k + " to method get_futures_risk_limit_table" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `get_futures_order`") # noqa: E501 - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `get_futures_order`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_futures_risk_limit_table`") # noqa: E501 + # verify the required parameter 'table_id' is set + if self.api_client.client_side_validation and ('table_id' not in local_var_params or # noqa: E501 + local_var_params['table_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `table_id` when calling `get_futures_risk_limit_table`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 query_params = [] + if 'table_id' in local_var_params and local_var_params['table_id'] is not None: # noqa: E501 + query_params.append(('table_id', local_var_params['table_id'])) # noqa: E501 header_params = {} @@ -4412,17 +6870,17 @@ def get_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['apiv4'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/orders/{order_id}', 'GET', + '/futures/{settle}/risk_limit_table', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='FuturesOrder', # noqa: E501 + response_type='list[FuturesRiskLimitTier]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -4430,18 +6888,18 @@ def get_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def amend_futures_order(self, settle, order_id, futures_order_amendment, **kwargs): # noqa: E501 - """Amend single order # noqa: E501 + def create_futures_bbo_order(self, settle, futures_bbo_order, **kwargs): # noqa: E501 + """Level-based BBO Contract Order Placement # noqa: E501 + Compared to the futures trading order placement interface (futures/{settle}/orders), it adds the `level` and `direction` parameters. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.amend_futures_order(settle, order_id, futures_order_amendment, async_req=True) + >>> thread = api.create_futures_bbo_order(settle, futures_bbo_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) - :param FuturesOrderAmendment futures_order_amendment: (required) + :param FuturesBBOOrder futures_bbo_order: (required) :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response @@ -4455,20 +6913,20 @@ def amend_futures_order(self, settle, order_id, futures_order_amendment, **kwarg returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.amend_futures_order_with_http_info(settle, order_id, futures_order_amendment, **kwargs) # noqa: E501 + return self.create_futures_bbo_order_with_http_info(settle, futures_bbo_order, **kwargs) # noqa: E501 - def amend_futures_order_with_http_info(self, settle, order_id, futures_order_amendment, **kwargs): # noqa: E501 - """Amend single order # noqa: E501 + def create_futures_bbo_order_with_http_info(self, settle, futures_bbo_order, **kwargs): # noqa: E501 + """Level-based BBO Contract Order Placement # noqa: E501 + Compared to the futures trading order placement interface (futures/{settle}/orders), it adds the `level` and `direction` parameters. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.amend_futures_order_with_http_info(settle, order_id, futures_order_amendment, async_req=True) + >>> thread = api.create_futures_bbo_order_with_http_info(settle, futures_bbo_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) - :param FuturesOrderAmendment futures_order_amendment: (required) + :param FuturesBBOOrder futures_bbo_order: (required) :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected :param _return_http_data_only: response data without head status code and headers @@ -4488,8 +6946,7 @@ def amend_futures_order_with_http_info(self, settle, order_id, futures_order_ame all_params = [ 'settle', - 'order_id', - 'futures_order_amendment', + 'futures_bbo_order', 'x_gate_exptime' ] all_params.extend( @@ -4505,30 +6962,24 @@ def amend_futures_order_with_http_info(self, settle, order_id, futures_order_ame if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method amend_futures_order" % k + " to method create_futures_bbo_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `amend_futures_order`") # noqa: E501 - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `amend_futures_order`") # noqa: E501 - # verify the required parameter 'futures_order_amendment' is set - if self.api_client.client_side_validation and ('futures_order_amendment' not in local_var_params or # noqa: E501 - local_var_params['futures_order_amendment'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `futures_order_amendment` when calling `amend_futures_order`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `create_futures_bbo_order`") # noqa: E501 + # verify the required parameter 'futures_bbo_order' is set + if self.api_client.client_side_validation and ('futures_bbo_order' not in local_var_params or # noqa: E501 + local_var_params['futures_bbo_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `futures_bbo_order` when calling `create_futures_bbo_order`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 query_params = [] @@ -4540,8 +6991,8 @@ def amend_futures_order_with_http_info(self, settle, order_id, futures_order_ame local_var_files = {} body_params = None - if 'futures_order_amendment' in local_var_params: - body_params = local_var_params['futures_order_amendment'] + if 'futures_bbo_order' in local_var_params: + body_params = local_var_params['futures_bbo_order'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -4554,7 +7005,7 @@ def amend_futures_order_with_http_info(self, settle, order_id, futures_order_ame auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/orders/{order_id}', 'PUT', + '/futures/{settle}/bbo_orders', 'POST', path_params, query_params, header_params, @@ -4569,18 +7020,17 @@ def amend_futures_order_with_http_info(self, settle, order_id, futures_order_ame _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def cancel_futures_order(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel single order # noqa: E501 + def create_trail_order(self, settle, create_trail_order, **kwargs): # noqa: E501 + """Create trail order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.cancel_futures_order(settle, order_id, async_req=True) + >>> thread = api.create_trail_order(settle, create_trail_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param CreateTrailOrder create_trail_order: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -4588,25 +7038,24 @@ def cancel_futures_order(self, settle, order_id, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.FuturesOrder + :rtype: gate_api.CreateTrailOrderResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.cancel_futures_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 + return self.create_trail_order_with_http_info(settle, create_trail_order, **kwargs) # noqa: E501 - def cancel_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel single order # noqa: E501 + def create_trail_order_with_http_info(self, settle, create_trail_order, **kwargs): # noqa: E501 + """Create trail order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.cancel_futures_order_with_http_info(settle, order_id, async_req=True) + >>> thread = api.create_trail_order_with_http_info(settle, create_trail_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param CreateTrailOrder create_trail_order: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -4616,7 +7065,7 @@ def cancel_futures_order_with_http_info(self, settle, order_id, **kwargs): # no number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.FuturesOrder, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.CreateTrailOrderResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -4625,8 +7074,7 @@ def cancel_futures_order_with_http_info(self, settle, order_id, **kwargs): # no all_params = [ 'settle', - 'order_id', - 'x_gate_exptime' + 'create_trail_order' ] all_params.extend( [ @@ -4641,53 +7089,55 @@ def cancel_futures_order_with_http_info(self, settle, order_id, **kwargs): # no if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method cancel_futures_order" % k + " to method create_trail_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `cancel_futures_order`") # noqa: E501 - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `cancel_futures_order`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `create_trail_order`") # noqa: E501 + # verify the required parameter 'create_trail_order' is set + if self.api_client.client_side_validation and ('create_trail_order' not in local_var_params or # noqa: E501 + local_var_params['create_trail_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_trail_order` when calling `create_trail_order`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: - path_params['settle'] = local_var_params['settle'] # noqa: E501 - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] header_params = {} - if 'x_gate_exptime' in local_var_params: - header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 form_params = [] local_var_files = {} body_params = None + if 'create_trail_order' in local_var_params: + body_params = local_var_params['create_trail_order'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/orders/{order_id}', 'DELETE', + '/futures/{settle}/autoorder/v1/trail/create', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='FuturesOrder', # noqa: E501 + response_type='CreateTrailOrderResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -4695,22 +7145,17 @@ def cancel_futures_order_with_http_info(self, settle, order_id, **kwargs): # no _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_my_trades(self, settle, **kwargs): # noqa: E501 - """Query personal trading records # noqa: E501 + def stop_trail_order(self, settle, stop_trail_order, **kwargs): # noqa: E501 + """Terminate trail order # noqa: E501 - By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/my_trades_timerange`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_my_trades(settle, async_req=True) + >>> thread = api.stop_trail_order(settle, stop_trail_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int order: Futures order ID, return related data only if specified - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param str last_id: Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'. + :param StopTrailOrder stop_trail_order: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -4718,29 +7163,24 @@ def get_my_trades(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.MyFuturesTrade] + :rtype: gate_api.TrailOrderResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_my_trades_with_http_info(settle, **kwargs) # noqa: E501 + return self.stop_trail_order_with_http_info(settle, stop_trail_order, **kwargs) # noqa: E501 - def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query personal trading records # noqa: E501 + def stop_trail_order_with_http_info(self, settle, stop_trail_order, **kwargs): # noqa: E501 + """Terminate trail order # noqa: E501 - By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/my_trades_timerange`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_my_trades_with_http_info(settle, async_req=True) + >>> thread = api.stop_trail_order_with_http_info(settle, stop_trail_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int order: Futures order ID, return related data only if specified - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param str last_id: Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'. + :param StopTrailOrder stop_trail_order: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -4750,7 +7190,7 @@ def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.MyFuturesTrade], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.TrailOrderResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -4759,11 +7199,7 @@ def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501 all_params = [ 'settle', - 'contract', - 'order', - 'limit', - 'offset', - 'last_id' + 'stop_trail_order' ] all_params.extend( [ @@ -4778,21 +7214,19 @@ def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_my_trades" % k + " to method stop_trail_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `get_my_trades`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `stop_trail_order`") # noqa: E501 + # verify the required parameter 'stop_trail_order' is set + if self.api_client.client_side_validation and ('stop_trail_order' not in local_var_params or # noqa: E501 + local_var_params['stop_trail_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `stop_trail_order` when calling `stop_trail_order`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `get_my_trades`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `get_my_trades`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ApiValueError("Invalid value for parameter `offset` when calling `get_my_trades`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -4800,16 +7234,6 @@ def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501 path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] - if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 - query_params.append(('contract', local_var_params['contract'])) # noqa: E501 - if 'order' in local_var_params and local_var_params['order'] is not None: # noqa: E501 - query_params.append(('order', local_var_params['order'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'last_id' in local_var_params and local_var_params['last_id'] is not None: # noqa: E501 - query_params.append(('last_id', local_var_params['last_id'])) # noqa: E501 header_params = {} @@ -4817,22 +7241,28 @@ def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501 local_var_files = {} body_params = None + if 'stop_trail_order' in local_var_params: + body_params = local_var_params['stop_trail_order'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/my_trades', 'GET', + '/futures/{settle}/autoorder/v1/trail/stop', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[MyFuturesTrade]', # noqa: E501 + response_type='TrailOrderResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -4840,22 +7270,17 @@ def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_my_trades_with_time_range(self, settle, **kwargs): # noqa: E501 - """Query personal trading records by time range # noqa: E501 + def stop_all_trail_orders(self, settle, stop_all_trail_orders, **kwargs): # noqa: E501 + """Batch terminate trail orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_my_trades_with_time_range(settle, async_req=True) + >>> thread = api.stop_all_trail_orders(settle, stop_all_trail_orders, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param str role: Query role, maker or taker + :param StopAllTrailOrders stop_all_trail_orders: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -4863,29 +7288,24 @@ def get_my_trades_with_time_range(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.MyFuturesTradeTimeRange] + :rtype: gate_api.TrailOrderListResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_my_trades_with_time_range_with_http_info(settle, **kwargs) # noqa: E501 + return self.stop_all_trail_orders_with_http_info(settle, stop_all_trail_orders, **kwargs) # noqa: E501 - def get_my_trades_with_time_range_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query personal trading records by time range # noqa: E501 + def stop_all_trail_orders_with_http_info(self, settle, stop_all_trail_orders, **kwargs): # noqa: E501 + """Batch terminate trail orders # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_my_trades_with_time_range_with_http_info(settle, async_req=True) + >>> thread = api.stop_all_trail_orders_with_http_info(settle, stop_all_trail_orders, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param str role: Query role, maker or taker + :param StopAllTrailOrders stop_all_trail_orders: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -4895,7 +7315,7 @@ def get_my_trades_with_time_range_with_http_info(self, settle, **kwargs): # noq number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.MyFuturesTradeTimeRange], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.TrailOrderListResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -4904,12 +7324,7 @@ def get_my_trades_with_time_range_with_http_info(self, settle, **kwargs): # noq all_params = [ 'settle', - 'contract', - '_from', - 'to', - 'limit', - 'offset', - 'role' + 'stop_all_trail_orders' ] all_params.extend( [ @@ -4924,21 +7339,19 @@ def get_my_trades_with_time_range_with_http_info(self, settle, **kwargs): # noq if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_my_trades_with_time_range" % k + " to method stop_all_trail_orders" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `get_my_trades_with_time_range`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `stop_all_trail_orders`") # noqa: E501 + # verify the required parameter 'stop_all_trail_orders' is set + if self.api_client.client_side_validation and ('stop_all_trail_orders' not in local_var_params or # noqa: E501 + local_var_params['stop_all_trail_orders'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `stop_all_trail_orders` when calling `stop_all_trail_orders`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `get_my_trades_with_time_range`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `get_my_trades_with_time_range`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ApiValueError("Invalid value for parameter `offset` when calling `get_my_trades_with_time_range`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -4946,18 +7359,6 @@ def get_my_trades_with_time_range_with_http_info(self, settle, **kwargs): # noq path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] - if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 - query_params.append(('contract', local_var_params['contract'])) # noqa: E501 - if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 - query_params.append(('from', local_var_params['_from'])) # noqa: E501 - if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 - query_params.append(('to', local_var_params['to'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if 'role' in local_var_params and local_var_params['role'] is not None: # noqa: E501 - query_params.append(('role', local_var_params['role'])) # noqa: E501 header_params = {} @@ -4965,22 +7366,28 @@ def get_my_trades_with_time_range_with_http_info(self, settle, **kwargs): # noq local_var_files = {} body_params = None + if 'stop_all_trail_orders' in local_var_params: + body_params = local_var_params['stop_all_trail_orders'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/my_trades_timerange', 'GET', + '/futures/{settle}/autoorder/v1/trail/stop_all', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[MyFuturesTradeTimeRange]', # noqa: E501 + response_type='TrailOrderListResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -4988,23 +7395,28 @@ def get_my_trades_with_time_range_with_http_info(self, settle, **kwargs): # noq _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_position_close(self, settle, **kwargs): # noqa: E501 - """Query position close history # noqa: E501 + def get_trail_orders(self, settle, **kwargs): # noqa: E501 + """Get trail order list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_position_close(settle, async_req=True) + >>> thread = api.get_trail_orders(settle, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param str side: Query side. long or shot - :param str pnl: Query profit or loss + :param str contract: Contract name + :param bool is_finished: Whether historical order + :param int start_at: Start time of time range + :param int end_at: End time of time range + :param int page_num: Page number, starting from 1 + :param int page_size: Number of items per page + :param int sort_by: Common sort field, 1-creation time, 2-end time + :param bool hide_cancel: Hide cancelled orders + :param int related_position: Associated position, if provided, only return orders associated with this position, 1-long, 2-short + :param bool sort_by_trigger: Sort by trigger price and activation price, easy to trigger or activate first, only for current orders associated with positions + :param int reduce_only: Whether reduce only, 1-yes, 2-no + :param int side: Direction, 1-long position, 2-short position :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -5012,30 +7424,35 @@ def list_position_close(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.PositionClose] + :rtype: gate_api.TrailOrderListResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_position_close_with_http_info(settle, **kwargs) # noqa: E501 + return self.get_trail_orders_with_http_info(settle, **kwargs) # noqa: E501 - def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query position close history # noqa: E501 + def get_trail_orders_with_http_info(self, settle, **kwargs): # noqa: E501 + """Get trail order list # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_position_close_with_http_info(settle, async_req=True) + >>> thread = api.get_trail_orders_with_http_info(settle, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param str side: Query side. long or shot - :param str pnl: Query profit or loss + :param str contract: Contract name + :param bool is_finished: Whether historical order + :param int start_at: Start time of time range + :param int end_at: End time of time range + :param int page_num: Page number, starting from 1 + :param int page_size: Number of items per page + :param int sort_by: Common sort field, 1-creation time, 2-end time + :param bool hide_cancel: Hide cancelled orders + :param int related_position: Associated position, if provided, only return orders associated with this position, 1-long, 2-short + :param bool sort_by_trigger: Sort by trigger price and activation price, easy to trigger or activate first, only for current orders associated with positions + :param int reduce_only: Whether reduce only, 1-yes, 2-no + :param int side: Direction, 1-long position, 2-short position :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -5045,7 +7462,7 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.PositionClose], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.TrailOrderListResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -5055,12 +7472,17 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 all_params = [ 'settle', 'contract', - 'limit', - 'offset', - '_from', - 'to', - 'side', - 'pnl' + 'is_finished', + 'start_at', + 'end_at', + 'page_num', + 'page_size', + 'sort_by', + 'hide_cancel', + 'related_position', + 'sort_by_trigger', + 'reduce_only', + 'side' ] all_params.extend( [ @@ -5075,21 +7497,15 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_position_close" % k + " to method get_trail_orders" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `list_position_close`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_trail_orders`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_position_close`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_position_close`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ApiValueError("Invalid value for parameter `offset` when calling `list_position_close`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -5099,18 +7515,28 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 query_params = [] if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 query_params.append(('contract', local_var_params['contract'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 - query_params.append(('from', local_var_params['_from'])) # noqa: E501 - if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 - query_params.append(('to', local_var_params['to'])) # noqa: E501 + if 'is_finished' in local_var_params and local_var_params['is_finished'] is not None: # noqa: E501 + query_params.append(('is_finished', local_var_params['is_finished'])) # noqa: E501 + if 'start_at' in local_var_params and local_var_params['start_at'] is not None: # noqa: E501 + query_params.append(('start_at', local_var_params['start_at'])) # noqa: E501 + if 'end_at' in local_var_params and local_var_params['end_at'] is not None: # noqa: E501 + query_params.append(('end_at', local_var_params['end_at'])) # noqa: E501 + if 'page_num' in local_var_params and local_var_params['page_num'] is not None: # noqa: E501 + query_params.append(('page_num', local_var_params['page_num'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + if 'sort_by' in local_var_params and local_var_params['sort_by'] is not None: # noqa: E501 + query_params.append(('sort_by', local_var_params['sort_by'])) # noqa: E501 + if 'hide_cancel' in local_var_params and local_var_params['hide_cancel'] is not None: # noqa: E501 + query_params.append(('hide_cancel', local_var_params['hide_cancel'])) # noqa: E501 + if 'related_position' in local_var_params and local_var_params['related_position'] is not None: # noqa: E501 + query_params.append(('related_position', local_var_params['related_position'])) # noqa: E501 + if 'sort_by_trigger' in local_var_params and local_var_params['sort_by_trigger'] is not None: # noqa: E501 + query_params.append(('sort_by_trigger', local_var_params['sort_by_trigger'])) # noqa: E501 + if 'reduce_only' in local_var_params and local_var_params['reduce_only'] is not None: # noqa: E501 + query_params.append(('reduce_only', local_var_params['reduce_only'])) # noqa: E501 if 'side' in local_var_params and local_var_params['side'] is not None: # noqa: E501 query_params.append(('side', local_var_params['side'])) # noqa: E501 - if 'pnl' in local_var_params and local_var_params['pnl'] is not None: # noqa: E501 - query_params.append(('pnl', local_var_params['pnl'])) # noqa: E501 header_params = {} @@ -5126,14 +7552,14 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/position_close', 'GET', + '/futures/{settle}/autoorder/v1/trail/list', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[PositionClose]', # noqa: E501 + response_type='TrailOrderListResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -5141,22 +7567,17 @@ def list_position_close_with_http_info(self, settle, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_liquidates(self, settle, **kwargs): # noqa: E501 - """Query liquidation history # noqa: E501 + def get_trail_order_detail(self, settle, id, **kwargs): # noqa: E501 + """Get trail order details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_liquidates(settle, async_req=True) + >>> thread = api.get_trail_order_detail(settle, id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param int at: Specify liquidation timestamp + :param int id: Order ID (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -5164,29 +7585,24 @@ def list_liquidates(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.FuturesLiquidate] + :rtype: gate_api.TrailOrderDetailResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_liquidates_with_http_info(settle, **kwargs) # noqa: E501 + return self.get_trail_order_detail_with_http_info(settle, id, **kwargs) # noqa: E501 - def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query liquidation history # noqa: E501 + def get_trail_order_detail_with_http_info(self, settle, id, **kwargs): # noqa: E501 + """Get trail order details # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_liquidates_with_http_info(settle, async_req=True) + >>> thread = api.get_trail_order_detail_with_http_info(settle, id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param int at: Specify liquidation timestamp + :param int id: Order ID (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -5196,7 +7612,7 @@ def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.FuturesLiquidate], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.TrailOrderDetailResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -5205,12 +7621,7 @@ def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 all_params = [ 'settle', - 'contract', - 'limit', - 'offset', - '_from', - 'to', - 'at' + 'id' ] all_params.extend( [ @@ -5225,21 +7636,19 @@ def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_liquidates" % k + " to method get_trail_order_detail" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `list_liquidates`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_trail_order_detail`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501 + local_var_params['id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `id` when calling `get_trail_order_detail`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_liquidates`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_liquidates`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ApiValueError("Invalid value for parameter `offset` when calling `list_liquidates`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -5247,18 +7656,8 @@ def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] - if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 - query_params.append(('contract', local_var_params['contract'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 - query_params.append(('from', local_var_params['_from'])) # noqa: E501 - if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 - query_params.append(('to', local_var_params['to'])) # noqa: E501 - if 'at' in local_var_params and local_var_params['at'] is not None: # noqa: E501 - query_params.append(('at', local_var_params['at'])) # noqa: E501 + if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501 + query_params.append(('id', local_var_params['id'])) # noqa: E501 header_params = {} @@ -5274,14 +7673,14 @@ def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/liquidates', 'GET', + '/futures/{settle}/autoorder/v1/trail/detail', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FuturesLiquidate]', # noqa: E501 + response_type='TrailOrderDetailResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -5289,22 +7688,17 @@ def list_liquidates_with_http_info(self, settle, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_auto_deleverages(self, settle, **kwargs): # noqa: E501 - """Query ADL auto-deleveraging order information # noqa: E501 + def update_trail_order(self, settle, update_trail_order, **kwargs): # noqa: E501 + """Update trail order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_auto_deleverages(settle, async_req=True) + >>> thread = api.update_trail_order(settle, update_trail_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param int at: Specify auto-deleveraging timestamp + :param UpdateTrailOrder update_trail_order: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -5312,29 +7706,24 @@ def list_auto_deleverages(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.FuturesAutoDeleverage] + :rtype: gate_api.TrailOrderResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_auto_deleverages_with_http_info(settle, **kwargs) # noqa: E501 + return self.update_trail_order_with_http_info(settle, update_trail_order, **kwargs) # noqa: E501 - def list_auto_deleverages_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query ADL auto-deleveraging order information # noqa: E501 + def update_trail_order_with_http_info(self, settle, update_trail_order, **kwargs): # noqa: E501 + """Update trail order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_auto_deleverages_with_http_info(settle, async_req=True) + >>> thread = api.update_trail_order_with_http_info(settle, update_trail_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified - :param int limit: Maximum number of records returned in a single list - :param int offset: List offset, starting from 0 - :param int _from: Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) - :param int to: Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp - :param int at: Specify auto-deleveraging timestamp + :param UpdateTrailOrder update_trail_order: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -5344,7 +7733,7 @@ def list_auto_deleverages_with_http_info(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.FuturesAutoDeleverage], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.TrailOrderResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -5353,12 +7742,7 @@ def list_auto_deleverages_with_http_info(self, settle, **kwargs): # noqa: E501 all_params = [ 'settle', - 'contract', - 'limit', - 'offset', - '_from', - 'to', - 'at' + 'update_trail_order' ] all_params.extend( [ @@ -5373,40 +7757,26 @@ def list_auto_deleverages_with_http_info(self, settle, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method list_auto_deleverages" % k + " to method update_trail_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `list_auto_deleverages`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_trail_order`") # noqa: E501 + # verify the required parameter 'update_trail_order' is set + if self.api_client.client_side_validation and ('update_trail_order' not in local_var_params or # noqa: E501 + local_var_params['update_trail_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `update_trail_order` when calling `update_trail_order`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_auto_deleverages`, must be a value less than or equal to `1000`") # noqa: E501 - if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 - raise ApiValueError("Invalid value for parameter `limit` when calling `list_auto_deleverages`, must be a value greater than or equal to `1`") # noqa: E501 - if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0: # noqa: E501 - raise ApiValueError("Invalid value for parameter `offset` when calling `list_auto_deleverages`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 - query_params = [] - if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 - query_params.append(('contract', local_var_params['contract'])) # noqa: E501 - if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501 - query_params.append(('offset', local_var_params['offset'])) # noqa: E501 - if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 - query_params.append(('from', local_var_params['_from'])) # noqa: E501 - if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501 - query_params.append(('to', local_var_params['to'])) # noqa: E501 - if 'at' in local_var_params and local_var_params['at'] is not None: # noqa: E501 - query_params.append(('at', local_var_params['at'])) # noqa: E501 + query_params = [] header_params = {} @@ -5414,22 +7784,28 @@ def list_auto_deleverages_with_http_info(self, settle, **kwargs): # noqa: E501 local_var_files = {} body_params = None + if 'update_trail_order' in local_var_params: + body_params = local_var_params['update_trail_order'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/auto_deleverages', 'GET', + '/futures/{settle}/autoorder/v1/trail/update', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FuturesAutoDeleverage]', # noqa: E501 + response_type='TrailOrderResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -5437,18 +7813,19 @@ def list_auto_deleverages_with_http_info(self, settle, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def countdown_cancel_all_futures(self, settle, countdown_cancel_all_futures_task, **kwargs): # noqa: E501 - """Countdown cancel orders # noqa: E501 + def get_trail_order_change_log(self, settle, id, **kwargs): # noqa: E501 + """Get trail order user modification records # noqa: E501 - Heartbeat detection for contract orders: When the user-set `timeout` time is reached, if neither the existing countdown is canceled nor a new countdown is set, the relevant contract orders will be automatically canceled. This API can be called repeatedly to or cancel the countdown. Usage example: Repeatedly call this API at 30-second intervals, setting the `timeout` to 30 (seconds) each time. If this API is not called again within 30 seconds, all open orders on your specified `market` will be automatically canceled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will terminate, and the automatic order cancellation function will be disabled. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.countdown_cancel_all_futures(settle, countdown_cancel_all_futures_task, async_req=True) + >>> thread = api.get_trail_order_change_log(settle, id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param CountdownCancelAllFuturesTask countdown_cancel_all_futures_task: (required) + :param int id: Order ID (required) + :param int page_num: Page number, starting from 1 + :param int page_size: Number of items per page :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -5456,25 +7833,26 @@ def countdown_cancel_all_futures(self, settle, countdown_cancel_all_futures_task number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.TriggerTime + :rtype: gate_api.TrailOrderChangeLogResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.countdown_cancel_all_futures_with_http_info(settle, countdown_cancel_all_futures_task, **kwargs) # noqa: E501 + return self.get_trail_order_change_log_with_http_info(settle, id, **kwargs) # noqa: E501 - def countdown_cancel_all_futures_with_http_info(self, settle, countdown_cancel_all_futures_task, **kwargs): # noqa: E501 - """Countdown cancel orders # noqa: E501 + def get_trail_order_change_log_with_http_info(self, settle, id, **kwargs): # noqa: E501 + """Get trail order user modification records # noqa: E501 - Heartbeat detection for contract orders: When the user-set `timeout` time is reached, if neither the existing countdown is canceled nor a new countdown is set, the relevant contract orders will be automatically canceled. This API can be called repeatedly to or cancel the countdown. Usage example: Repeatedly call this API at 30-second intervals, setting the `timeout` to 30 (seconds) each time. If this API is not called again within 30 seconds, all open orders on your specified `market` will be automatically canceled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will terminate, and the automatic order cancellation function will be disabled. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.countdown_cancel_all_futures_with_http_info(settle, countdown_cancel_all_futures_task, async_req=True) + >>> thread = api.get_trail_order_change_log_with_http_info(settle, id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param CountdownCancelAllFuturesTask countdown_cancel_all_futures_task: (required) + :param int id: Order ID (required) + :param int page_num: Page number, starting from 1 + :param int page_size: Number of items per page :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -5484,7 +7862,7 @@ def countdown_cancel_all_futures_with_http_info(self, settle, countdown_cancel_a number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.TriggerTime, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.TrailOrderChangeLogResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -5493,7 +7871,9 @@ def countdown_cancel_all_futures_with_http_info(self, settle, countdown_cancel_a all_params = [ 'settle', - 'countdown_cancel_all_futures_task' + 'id', + 'page_num', + 'page_size' ] all_params.extend( [ @@ -5508,18 +7888,18 @@ def countdown_cancel_all_futures_with_http_info(self, settle, countdown_cancel_a if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method countdown_cancel_all_futures" % k + " to method get_trail_order_change_log" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `countdown_cancel_all_futures`") # noqa: E501 - # verify the required parameter 'countdown_cancel_all_futures_task' is set - if self.api_client.client_side_validation and ('countdown_cancel_all_futures_task' not in local_var_params or # noqa: E501 - local_var_params['countdown_cancel_all_futures_task'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `countdown_cancel_all_futures_task` when calling `countdown_cancel_all_futures`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_trail_order_change_log`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501 + local_var_params['id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `id` when calling `get_trail_order_change_log`") # noqa: E501 collection_formats = {} @@ -5528,6 +7908,12 @@ def countdown_cancel_all_futures_with_http_info(self, settle, countdown_cancel_a path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] + if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501 + query_params.append(('id', local_var_params['id'])) # noqa: E501 + if 'page_num' in local_var_params and local_var_params['page_num'] is not None: # noqa: E501 + query_params.append(('page_num', local_var_params['page_num'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 header_params = {} @@ -5535,28 +7921,22 @@ def countdown_cancel_all_futures_with_http_info(self, settle, countdown_cancel_a local_var_files = {} body_params = None - if 'countdown_cancel_all_futures_task' in local_var_params: - body_params = local_var_params['countdown_cancel_all_futures_task'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/countdown_cancel_all', 'POST', + '/futures/{settle}/autoorder/v1/trail/change_log', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='TriggerTime', # noqa: E501 + response_type='TrailOrderChangeLogResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -5564,17 +7944,17 @@ def countdown_cancel_all_futures_with_http_info(self, settle, countdown_cancel_a _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_futures_fee(self, settle, **kwargs): # noqa: E501 - """Query futures market trading fee rates # noqa: E501 + def create_chase_order(self, settle, create_chase_order_req, **kwargs): # noqa: E501 + """Create a chase order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_futures_fee(settle, async_req=True) + >>> thread = api.create_chase_order(settle, create_chase_order_req, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified + :param CreateChaseOrderReq create_chase_order_req: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -5582,24 +7962,24 @@ def get_futures_fee(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: dict(str, gate_api.FuturesFee) + :rtype: gate_api.CreateChaseOrderResp :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_futures_fee_with_http_info(settle, **kwargs) # noqa: E501 + return self.create_chase_order_with_http_info(settle, create_chase_order_req, **kwargs) # noqa: E501 - def get_futures_fee_with_http_info(self, settle, **kwargs): # noqa: E501 - """Query futures market trading fee rates # noqa: E501 + def create_chase_order_with_http_info(self, settle, create_chase_order_req, **kwargs): # noqa: E501 + """Create a chase order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_futures_fee_with_http_info(settle, async_req=True) + >>> thread = api.create_chase_order_with_http_info(settle, create_chase_order_req, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str contract: Futures contract, return related data only if specified + :param CreateChaseOrderReq create_chase_order_req: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -5609,7 +7989,7 @@ def get_futures_fee_with_http_info(self, settle, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(dict(str, gate_api.FuturesFee), status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.CreateChaseOrderResp, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -5618,7 +7998,7 @@ def get_futures_fee_with_http_info(self, settle, **kwargs): # noqa: E501 all_params = [ 'settle', - 'contract' + 'create_chase_order_req' ] all_params.extend( [ @@ -5633,14 +8013,18 @@ def get_futures_fee_with_http_info(self, settle, **kwargs): # noqa: E501 if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_futures_fee" % k + " to method create_chase_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `get_futures_fee`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `create_chase_order`") # noqa: E501 + # verify the required parameter 'create_chase_order_req' is set + if self.api_client.client_side_validation and ('create_chase_order_req' not in local_var_params or # noqa: E501 + local_var_params['create_chase_order_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `create_chase_order_req` when calling `create_chase_order`") # noqa: E501 collection_formats = {} @@ -5649,8 +8033,6 @@ def get_futures_fee_with_http_info(self, settle, **kwargs): # noqa: E501 path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] - if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 - query_params.append(('contract', local_var_params['contract'])) # noqa: E501 header_params = {} @@ -5658,22 +8040,28 @@ def get_futures_fee_with_http_info(self, settle, **kwargs): # noqa: E501 local_var_files = {} body_params = None + if 'create_chase_order_req' in local_var_params: + body_params = local_var_params['create_chase_order_req'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/fee', 'GET', + '/futures/{settle}/autoorder/v1/chase/create', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='dict(str, FuturesFee)', # noqa: E501 + response_type='CreateChaseOrderResp', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -5681,19 +8069,17 @@ def get_futures_fee_with_http_info(self, settle, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def cancel_batch_future_orders(self, settle, request_body, **kwargs): # noqa: E501 - """Cancel batch orders by specified ID list # noqa: E501 + def stop_chase_order(self, settle, stop_chase_order_req, **kwargs): # noqa: E501 + """Stop a chase order # noqa: E501 - Multiple different order IDs can be specified. A maximum of 20 records can be cancelled in one request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.cancel_batch_future_orders(settle, request_body, async_req=True) + >>> thread = api.stop_chase_order(settle, stop_chase_order_req, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param list[str] request_body: (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param StopChaseOrderReq stop_chase_order_req: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -5701,26 +8087,24 @@ def cancel_batch_future_orders(self, settle, request_body, **kwargs): # noqa: E number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.FutureCancelOrderResult] + :rtype: gate_api.StopChaseOrderResp :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.cancel_batch_future_orders_with_http_info(settle, request_body, **kwargs) # noqa: E501 + return self.stop_chase_order_with_http_info(settle, stop_chase_order_req, **kwargs) # noqa: E501 - def cancel_batch_future_orders_with_http_info(self, settle, request_body, **kwargs): # noqa: E501 - """Cancel batch orders by specified ID list # noqa: E501 + def stop_chase_order_with_http_info(self, settle, stop_chase_order_req, **kwargs): # noqa: E501 + """Stop a chase order # noqa: E501 - Multiple different order IDs can be specified. A maximum of 20 records can be cancelled in one request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.cancel_batch_future_orders_with_http_info(settle, request_body, async_req=True) + >>> thread = api.stop_chase_order_with_http_info(settle, stop_chase_order_req, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param list[str] request_body: (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param StopChaseOrderReq stop_chase_order_req: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -5730,7 +8114,7 @@ def cancel_batch_future_orders_with_http_info(self, settle, request_body, **kwar number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.FutureCancelOrderResult], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.StopChaseOrderResp, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -5739,8 +8123,7 @@ def cancel_batch_future_orders_with_http_info(self, settle, request_body, **kwar all_params = [ 'settle', - 'request_body', - 'x_gate_exptime' + 'stop_chase_order_req' ] all_params.extend( [ @@ -5755,18 +8138,18 @@ def cancel_batch_future_orders_with_http_info(self, settle, request_body, **kwar if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method cancel_batch_future_orders" % k + " to method stop_chase_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `cancel_batch_future_orders`") # noqa: E501 - # verify the required parameter 'request_body' is set - if self.api_client.client_side_validation and ('request_body' not in local_var_params or # noqa: E501 - local_var_params['request_body'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `request_body` when calling `cancel_batch_future_orders`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `stop_chase_order`") # noqa: E501 + # verify the required parameter 'stop_chase_order_req' is set + if self.api_client.client_side_validation and ('stop_chase_order_req' not in local_var_params or # noqa: E501 + local_var_params['stop_chase_order_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `stop_chase_order_req` when calling `stop_chase_order`") # noqa: E501 collection_formats = {} @@ -5777,15 +8160,13 @@ def cancel_batch_future_orders_with_http_info(self, settle, request_body, **kwar query_params = [] header_params = {} - if 'x_gate_exptime' in local_var_params: - header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - if 'request_body' in local_var_params: - body_params = local_var_params['request_body'] + if 'stop_chase_order_req' in local_var_params: + body_params = local_var_params['stop_chase_order_req'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -5798,14 +8179,14 @@ def cancel_batch_future_orders_with_http_info(self, settle, request_body, **kwar auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/batch_cancel_orders', 'POST', + '/futures/{settle}/autoorder/v1/chase/stop', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FutureCancelOrderResult]', # noqa: E501 + response_type='StopChaseOrderResp', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -5813,19 +8194,17 @@ def cancel_batch_future_orders_with_http_info(self, settle, request_body, **kwar _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def amend_batch_future_orders(self, settle, batch_amend_order_req, **kwargs): # noqa: E501 - """Batch modify orders by specified IDs # noqa: E501 + def stop_all_chase_orders(self, settle, stop_all_chase_orders_req, **kwargs): # noqa: E501 + """Stop chase orders in batch # noqa: E501 - Multiple different order IDs can be specified. A maximum of 10 orders can be modified in one request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.amend_batch_future_orders(settle, batch_amend_order_req, async_req=True) + >>> thread = api.stop_all_chase_orders(settle, stop_all_chase_orders_req, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param list[BatchAmendOrderReq] batch_amend_order_req: (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param StopAllChaseOrdersReq stop_all_chase_orders_req: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -5833,26 +8212,24 @@ def amend_batch_future_orders(self, settle, batch_amend_order_req, **kwargs): # number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.BatchFuturesOrder] + :rtype: gate_api.StopAllChaseOrdersResp :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.amend_batch_future_orders_with_http_info(settle, batch_amend_order_req, **kwargs) # noqa: E501 + return self.stop_all_chase_orders_with_http_info(settle, stop_all_chase_orders_req, **kwargs) # noqa: E501 - def amend_batch_future_orders_with_http_info(self, settle, batch_amend_order_req, **kwargs): # noqa: E501 - """Batch modify orders by specified IDs # noqa: E501 + def stop_all_chase_orders_with_http_info(self, settle, stop_all_chase_orders_req, **kwargs): # noqa: E501 + """Stop chase orders in batch # noqa: E501 - Multiple different order IDs can be specified. A maximum of 10 orders can be modified in one request # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.amend_batch_future_orders_with_http_info(settle, batch_amend_order_req, async_req=True) + >>> thread = api.stop_all_chase_orders_with_http_info(settle, stop_all_chase_orders_req, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param list[BatchAmendOrderReq] batch_amend_order_req: (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param StopAllChaseOrdersReq stop_all_chase_orders_req: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -5862,7 +8239,7 @@ def amend_batch_future_orders_with_http_info(self, settle, batch_amend_order_req number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.BatchFuturesOrder], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.StopAllChaseOrdersResp, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -5871,8 +8248,7 @@ def amend_batch_future_orders_with_http_info(self, settle, batch_amend_order_req all_params = [ 'settle', - 'batch_amend_order_req', - 'x_gate_exptime' + 'stop_all_chase_orders_req' ] all_params.extend( [ @@ -5887,18 +8263,18 @@ def amend_batch_future_orders_with_http_info(self, settle, batch_amend_order_req if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method amend_batch_future_orders" % k + " to method stop_all_chase_orders" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `amend_batch_future_orders`") # noqa: E501 - # verify the required parameter 'batch_amend_order_req' is set - if self.api_client.client_side_validation and ('batch_amend_order_req' not in local_var_params or # noqa: E501 - local_var_params['batch_amend_order_req'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `batch_amend_order_req` when calling `amend_batch_future_orders`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `stop_all_chase_orders`") # noqa: E501 + # verify the required parameter 'stop_all_chase_orders_req' is set + if self.api_client.client_side_validation and ('stop_all_chase_orders_req' not in local_var_params or # noqa: E501 + local_var_params['stop_all_chase_orders_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `stop_all_chase_orders_req` when calling `stop_all_chase_orders`") # noqa: E501 collection_formats = {} @@ -5909,15 +8285,13 @@ def amend_batch_future_orders_with_http_info(self, settle, batch_amend_order_req query_params = [] header_params = {} - if 'x_gate_exptime' in local_var_params: - header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - if 'batch_amend_order_req' in local_var_params: - body_params = local_var_params['batch_amend_order_req'] + if 'stop_all_chase_orders_req' in local_var_params: + body_params = local_var_params['stop_all_chase_orders_req'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -5930,14 +8304,14 @@ def amend_batch_future_orders_with_http_info(self, settle, batch_amend_order_req auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/batch_amend_orders', 'POST', + '/futures/{settle}/autoorder/v1/chase/stop_all', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[BatchFuturesOrder]', # noqa: E501 + response_type='StopAllChaseOrdersResp', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -5945,18 +8319,26 @@ def amend_batch_future_orders_with_http_info(self, settle, batch_amend_order_req _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_futures_risk_limit_table(self, settle, table_id, **kwargs): # noqa: E501 - """Query risk limit table by table_id # noqa: E501 + def get_chase_orders(self, settle, sort_by, **kwargs): # noqa: E501 + """List chase orders # noqa: E501 - Just pass table_id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_futures_risk_limit_table(settle, table_id, async_req=True) + >>> thread = api.get_chase_orders(settle, sort_by, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str table_id: Risk limit table ID (required) + :param int sort_by: Sort field: 1 ORDER_SORT_CREATED_AT, 2 ORDER_SORT_FINISHED_AT; cannot be 0 (required) + :param str contract: Optional. When non-empty, must be a valid contract (validated against the market cache for the path settle); server-side converted to uppercase + :param bool is_finished: true to query finished orders, false to query in-progress orders + :param int start_at: Lower time bound for the history list, paired with end_at. Required when is_finished is true + :param int end_at: Upper time bound for the history list, paired with start_at. Required when is_finished is true + :param int page_num: Page number, starting from 1 + :param int page_size: Page size; must be between 1 and 100 + :param bool hide_cancel: When true, cancelled orders are hidden in the list + :param int reduce_only: OptionalBool: 0 unknown, 1 true, 2 false; used to filter by reduce-only flag + :param int side: Filter by long/short side: 1 long, 2 short :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -5964,25 +8346,33 @@ def get_futures_risk_limit_table(self, settle, table_id, **kwargs): # noqa: E50 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.FuturesRiskLimitTier] + :rtype: gate_api.GetChaseOrdersResp :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.get_futures_risk_limit_table_with_http_info(settle, table_id, **kwargs) # noqa: E501 + return self.get_chase_orders_with_http_info(settle, sort_by, **kwargs) # noqa: E501 - def get_futures_risk_limit_table_with_http_info(self, settle, table_id, **kwargs): # noqa: E501 - """Query risk limit table by table_id # noqa: E501 + def get_chase_orders_with_http_info(self, settle, sort_by, **kwargs): # noqa: E501 + """List chase orders # noqa: E501 - Just pass table_id # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_futures_risk_limit_table_with_http_info(settle, table_id, async_req=True) + >>> thread = api.get_chase_orders_with_http_info(settle, sort_by, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str table_id: Risk limit table ID (required) + :param int sort_by: Sort field: 1 ORDER_SORT_CREATED_AT, 2 ORDER_SORT_FINISHED_AT; cannot be 0 (required) + :param str contract: Optional. When non-empty, must be a valid contract (validated against the market cache for the path settle); server-side converted to uppercase + :param bool is_finished: true to query finished orders, false to query in-progress orders + :param int start_at: Lower time bound for the history list, paired with end_at. Required when is_finished is true + :param int end_at: Upper time bound for the history list, paired with start_at. Required when is_finished is true + :param int page_num: Page number, starting from 1 + :param int page_size: Page size; must be between 1 and 100 + :param bool hide_cancel: When true, cancelled orders are hidden in the list + :param int reduce_only: OptionalBool: 0 unknown, 1 true, 2 false; used to filter by reduce-only flag + :param int side: Filter by long/short side: 1 long, 2 short :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -5992,7 +8382,7 @@ def get_futures_risk_limit_table_with_http_info(self, settle, table_id, **kwargs number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.FuturesRiskLimitTier], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.GetChaseOrdersResp, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -6001,7 +8391,16 @@ def get_futures_risk_limit_table_with_http_info(self, settle, table_id, **kwargs all_params = [ 'settle', - 'table_id' + 'sort_by', + 'contract', + 'is_finished', + 'start_at', + 'end_at', + 'page_num', + 'page_size', + 'hide_cancel', + 'reduce_only', + 'side' ] all_params.extend( [ @@ -6016,19 +8415,25 @@ def get_futures_risk_limit_table_with_http_info(self, settle, table_id, **kwargs if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method get_futures_risk_limit_table" % k + " to method get_chase_orders" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `get_futures_risk_limit_table`") # noqa: E501 - # verify the required parameter 'table_id' is set - if self.api_client.client_side_validation and ('table_id' not in local_var_params or # noqa: E501 - local_var_params['table_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `table_id` when calling `get_futures_risk_limit_table`") # noqa: E501 - + raise ApiValueError("Missing the required parameter `settle` when calling `get_chase_orders`") # noqa: E501 + # verify the required parameter 'sort_by' is set + if self.api_client.client_side_validation and ('sort_by' not in local_var_params or # noqa: E501 + local_var_params['sort_by'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `sort_by` when calling `get_chase_orders`") # noqa: E501 + + if self.api_client.client_side_validation and 'page_num' in local_var_params and local_var_params['page_num'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page_num` when calling `get_chase_orders`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params['page_size'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page_size` when calling `get_chase_orders`, must be a value less than or equal to `100`") # noqa: E501 + if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params['page_size'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page_size` when calling `get_chase_orders`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -6036,8 +8441,26 @@ def get_futures_risk_limit_table_with_http_info(self, settle, table_id, **kwargs path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] - if 'table_id' in local_var_params and local_var_params['table_id'] is not None: # noqa: E501 - query_params.append(('table_id', local_var_params['table_id'])) # noqa: E501 + if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 + query_params.append(('contract', local_var_params['contract'])) # noqa: E501 + if 'is_finished' in local_var_params and local_var_params['is_finished'] is not None: # noqa: E501 + query_params.append(('is_finished', local_var_params['is_finished'])) # noqa: E501 + if 'start_at' in local_var_params and local_var_params['start_at'] is not None: # noqa: E501 + query_params.append(('start_at', local_var_params['start_at'])) # noqa: E501 + if 'end_at' in local_var_params and local_var_params['end_at'] is not None: # noqa: E501 + query_params.append(('end_at', local_var_params['end_at'])) # noqa: E501 + if 'page_num' in local_var_params and local_var_params['page_num'] is not None: # noqa: E501 + query_params.append(('page_num', local_var_params['page_num'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + if 'sort_by' in local_var_params and local_var_params['sort_by'] is not None: # noqa: E501 + query_params.append(('sort_by', local_var_params['sort_by'])) # noqa: E501 + if 'hide_cancel' in local_var_params and local_var_params['hide_cancel'] is not None: # noqa: E501 + query_params.append(('hide_cancel', local_var_params['hide_cancel'])) # noqa: E501 + if 'reduce_only' in local_var_params and local_var_params['reduce_only'] is not None: # noqa: E501 + query_params.append(('reduce_only', local_var_params['reduce_only'])) # noqa: E501 + if 'side' in local_var_params and local_var_params['side'] is not None: # noqa: E501 + query_params.append(('side', local_var_params['side'])) # noqa: E501 header_params = {} @@ -6050,17 +8473,17 @@ def get_futures_risk_limit_table_with_http_info(self, settle, table_id, **kwargs ['application/json']) # noqa: E501 # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/risk_limit_table', 'GET', + '/futures/{settle}/autoorder/v1/chase/list', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FuturesRiskLimitTier]', # noqa: E501 + response_type='GetChaseOrdersResp', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -6068,19 +8491,17 @@ def get_futures_risk_limit_table_with_http_info(self, settle, table_id, **kwargs _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_futures_bbo_order(self, settle, futures_bbo_order, **kwargs): # noqa: E501 - """Level-based BBO Contract Order Placement # noqa: E501 + def get_chase_order_detail(self, settle, id, **kwargs): # noqa: E501 + """Get chase order detail # noqa: E501 - Compared to the futures trading order placement interface (futures/{settle}/orders), it adds the `level` and `direction` parameters. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_futures_bbo_order(settle, futures_bbo_order, async_req=True) + >>> thread = api.get_chase_order_detail(settle, id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param FuturesBBOOrder futures_bbo_order: (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param str id: Order ID, must be a non-zero positive integer (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -6088,26 +8509,24 @@ def create_futures_bbo_order(self, settle, futures_bbo_order, **kwargs): # noqa number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.FuturesOrder + :rtype: gate_api.GetChaseOrderDetailResp :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.create_futures_bbo_order_with_http_info(settle, futures_bbo_order, **kwargs) # noqa: E501 + return self.get_chase_order_detail_with_http_info(settle, id, **kwargs) # noqa: E501 - def create_futures_bbo_order_with_http_info(self, settle, futures_bbo_order, **kwargs): # noqa: E501 - """Level-based BBO Contract Order Placement # noqa: E501 + def get_chase_order_detail_with_http_info(self, settle, id, **kwargs): # noqa: E501 + """Get chase order detail # noqa: E501 - Compared to the futures trading order placement interface (futures/{settle}/orders), it adds the `level` and `direction` parameters. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_futures_bbo_order_with_http_info(settle, futures_bbo_order, async_req=True) + >>> thread = api.get_chase_order_detail_with_http_info(settle, id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param FuturesBBOOrder futures_bbo_order: (required) - :param str x_gate_exptime: Specify the expiration time (milliseconds); if the GATE receives the request time greater than the expiration time, the request will be rejected + :param str id: Order ID, must be a non-zero positive integer (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -6117,7 +8536,7 @@ def create_futures_bbo_order_with_http_info(self, settle, futures_bbo_order, **k number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.FuturesOrder, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.GetChaseOrderDetailResp, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -6126,8 +8545,7 @@ def create_futures_bbo_order_with_http_info(self, settle, futures_bbo_order, **k all_params = [ 'settle', - 'futures_bbo_order', - 'x_gate_exptime' + 'id' ] all_params.extend( [ @@ -6142,18 +8560,18 @@ def create_futures_bbo_order_with_http_info(self, settle, futures_bbo_order, **k if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method create_futures_bbo_order" % k + " to method get_chase_order_detail" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `create_futures_bbo_order`") # noqa: E501 - # verify the required parameter 'futures_bbo_order' is set - if self.api_client.client_side_validation and ('futures_bbo_order' not in local_var_params or # noqa: E501 - local_var_params['futures_bbo_order'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `futures_bbo_order` when calling `create_futures_bbo_order`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `get_chase_order_detail`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501 + local_var_params['id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `id` when calling `get_chase_order_detail`") # noqa: E501 collection_formats = {} @@ -6162,37 +8580,31 @@ def create_futures_bbo_order_with_http_info(self, settle, futures_bbo_order, **k path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] + if 'id' in local_var_params and local_var_params['id'] is not None: # noqa: E501 + query_params.append(('id', local_var_params['id'])) # noqa: E501 header_params = {} - if 'x_gate_exptime' in local_var_params: - header_params['x-gate-exptime'] = local_var_params['x_gate_exptime'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - if 'futures_bbo_order' in local_var_params: - body_params = local_var_params['futures_bbo_order'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/bbo_orders', 'POST', + '/futures/{settle}/autoorder/v1/chase/detail', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='FuturesOrder', # noqa: E501 + response_type='GetChaseOrderDetailResp', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -6594,7 +9006,7 @@ def get_price_triggered_order(self, settle, order_id, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: ID returned when order is successfully created (required) + :param int order_id: ID returned when order is successfully created (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -6619,7 +9031,7 @@ def get_price_triggered_order_with_http_info(self, settle, order_id, **kwargs): :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: ID returned when order is successfully created (required) + :param int order_id: ID returned when order is successfully created (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -6705,18 +9117,17 @@ def get_price_triggered_order_with_http_info(self, settle, order_id, **kwargs): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def update_price_triggered_order(self, settle, order_id, futures_update_price_triggered_order, **kwargs): # noqa: E501 - """Modify a Single Auto Order # noqa: E501 + def cancel_price_triggered_order(self, settle, order_id, **kwargs): # noqa: E501 + """Cancel single auto order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_price_triggered_order(settle, order_id, futures_update_price_triggered_order, async_req=True) + >>> thread = api.cancel_price_triggered_order(settle, order_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: ID returned when order is successfully created (required) - :param FuturesUpdatePriceTriggeredOrder futures_update_price_triggered_order: (required) + :param int order_id: ID returned when order is successfully created (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -6724,25 +9135,24 @@ def update_price_triggered_order(self, settle, order_id, futures_update_price_tr number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.TriggerOrderResponse + :rtype: gate_api.FuturesPriceTriggeredOrder :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.update_price_triggered_order_with_http_info(settle, order_id, futures_update_price_triggered_order, **kwargs) # noqa: E501 + return self.cancel_price_triggered_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 - def update_price_triggered_order_with_http_info(self, settle, order_id, futures_update_price_triggered_order, **kwargs): # noqa: E501 - """Modify a Single Auto Order # noqa: E501 + def cancel_price_triggered_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 + """Cancel single auto order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_price_triggered_order_with_http_info(settle, order_id, futures_update_price_triggered_order, async_req=True) + >>> thread = api.cancel_price_triggered_order_with_http_info(settle, order_id, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: ID returned when order is successfully created (required) - :param FuturesUpdatePriceTriggeredOrder futures_update_price_triggered_order: (required) + :param int order_id: ID returned when order is successfully created (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -6752,7 +9162,7 @@ def update_price_triggered_order_with_http_info(self, settle, order_id, futures_ number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.TriggerOrderResponse, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.FuturesPriceTriggeredOrder, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -6761,8 +9171,7 @@ def update_price_triggered_order_with_http_info(self, settle, order_id, futures_ all_params = [ 'settle', - 'order_id', - 'futures_update_price_triggered_order' + 'order_id' ] all_params.extend( [ @@ -6777,22 +9186,18 @@ def update_price_triggered_order_with_http_info(self, settle, order_id, futures_ if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method update_price_triggered_order" % k + " to method cancel_price_triggered_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `update_price_triggered_order`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `cancel_price_triggered_order`") # noqa: E501 # verify the required parameter 'order_id' is set if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 local_var_params['order_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `update_price_triggered_order`") # noqa: E501 - # verify the required parameter 'futures_update_price_triggered_order' is set - if self.api_client.client_side_validation and ('futures_update_price_triggered_order' not in local_var_params or # noqa: E501 - local_var_params['futures_update_price_triggered_order'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `futures_update_price_triggered_order` when calling `update_price_triggered_order`") # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `cancel_price_triggered_order`") # noqa: E501 collection_formats = {} @@ -6810,28 +9215,22 @@ def update_price_triggered_order_with_http_info(self, settle, order_id, futures_ local_var_files = {} body_params = None - if 'futures_update_price_triggered_order' in local_var_params: - body_params = local_var_params['futures_update_price_triggered_order'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/price_orders/{order_id}', 'PUT', + '/futures/{settle}/price_orders/{order_id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='TriggerOrderResponse', # noqa: E501 + response_type='FuturesPriceTriggeredOrder', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -6839,17 +9238,17 @@ def update_price_triggered_order_with_http_info(self, settle, order_id, futures_ _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def cancel_price_triggered_order(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel single auto order # noqa: E501 + def update_price_triggered_order(self, settle, futures_update_price_triggered_order, **kwargs): # noqa: E501 + """Modify a Single Auto Order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.cancel_price_triggered_order(settle, order_id, async_req=True) + >>> thread = api.update_price_triggered_order(settle, futures_update_price_triggered_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: ID returned when order is successfully created (required) + :param FuturesUpdatePriceTriggeredOrder futures_update_price_triggered_order: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -6857,24 +9256,24 @@ def cancel_price_triggered_order(self, settle, order_id, **kwargs): # noqa: E50 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.FuturesPriceTriggeredOrder + :rtype: gate_api.TriggerOrderResponse :return: If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.cancel_price_triggered_order_with_http_info(settle, order_id, **kwargs) # noqa: E501 + return self.update_price_triggered_order_with_http_info(settle, futures_update_price_triggered_order, **kwargs) # noqa: E501 - def cancel_price_triggered_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 - """Cancel single auto order # noqa: E501 + def update_price_triggered_order_with_http_info(self, settle, futures_update_price_triggered_order, **kwargs): # noqa: E501 + """Modify a Single Auto Order # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.cancel_price_triggered_order_with_http_info(settle, order_id, async_req=True) + >>> thread = api.update_price_triggered_order_with_http_info(settle, futures_update_price_triggered_order, async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) - :param str order_id: ID returned when order is successfully created (required) + :param FuturesUpdatePriceTriggeredOrder futures_update_price_triggered_order: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -6884,7 +9283,7 @@ def cancel_price_triggered_order_with_http_info(self, settle, order_id, **kwargs number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.FuturesPriceTriggeredOrder, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.TriggerOrderResponse, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -6893,7 +9292,7 @@ def cancel_price_triggered_order_with_http_info(self, settle, order_id, **kwargs all_params = [ 'settle', - 'order_id' + 'futures_update_price_triggered_order' ] all_params.extend( [ @@ -6908,26 +9307,24 @@ def cancel_price_triggered_order_with_http_info(self, settle, order_id, **kwargs if k not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method cancel_price_triggered_order" % k + " to method update_price_triggered_order" % k ) local_var_params[k] = v del local_var_params['kwargs'] # verify the required parameter 'settle' is set if self.api_client.client_side_validation and ('settle' not in local_var_params or # noqa: E501 local_var_params['settle'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `settle` when calling `cancel_price_triggered_order`") # noqa: E501 - # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `order_id` when calling `cancel_price_triggered_order`") # noqa: E501 + raise ApiValueError("Missing the required parameter `settle` when calling `update_price_triggered_order`") # noqa: E501 + # verify the required parameter 'futures_update_price_triggered_order' is set + if self.api_client.client_side_validation and ('futures_update_price_triggered_order' not in local_var_params or # noqa: E501 + local_var_params['futures_update_price_triggered_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `futures_update_price_triggered_order` when calling `update_price_triggered_order`") # noqa: E501 collection_formats = {} path_params = {} if 'settle' in local_var_params: path_params['settle'] = local_var_params['settle'] # noqa: E501 - if 'order_id' in local_var_params: - path_params['order_id'] = local_var_params['order_id'] # noqa: E501 query_params = [] @@ -6937,22 +9334,28 @@ def cancel_price_triggered_order_with_http_info(self, settle, order_id, **kwargs local_var_files = {} body_params = None + if 'futures_update_price_triggered_order' in local_var_params: + body_params = local_var_params['futures_update_price_triggered_order'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['apiv4'] # noqa: E501 return self.api_client.call_api( - '/futures/{settle}/price_orders/{order_id}', 'DELETE', + '/futures/{settle}/price_orders/amend', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='FuturesPriceTriggeredOrder', # noqa: E501 + response_type='TriggerOrderResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 diff --git a/gate_api/api/multi_collateral_loan_api.py b/gate_api/api/multi_collateral_loan_api.py index 41cd90a8..4f5443f0 100644 --- a/gate_api/api/multi_collateral_loan_api.py +++ b/gate_api/api/multi_collateral_loan_api.py @@ -1024,7 +1024,7 @@ def list_user_currency_quota_with_http_info(self, type, currency, **kwargs): # collection_formats=collection_formats) def list_multi_collateral_currencies(self, **kwargs): # noqa: E501 - """Query supported borrowing and collateral currencies for multi-currency collateral # noqa: E501 + """Query borrow currencies and collateral currencies supported by multi-currency collateral # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1047,7 +1047,7 @@ def list_multi_collateral_currencies(self, **kwargs): # noqa: E501 return self.list_multi_collateral_currencies_with_http_info(**kwargs) # noqa: E501 def list_multi_collateral_currencies_with_http_info(self, **kwargs): # noqa: E501 - """Query supported borrowing and collateral currencies for multi-currency collateral # noqa: E501 + """Query borrow currencies and collateral currencies supported by multi-currency collateral # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1344,7 +1344,7 @@ def get_multi_collateral_current_rate(self, currencies, **kwargs): # noqa: E501 >>> result = thread.get() :param bool async_req: execute request asynchronously - :param list[str] currencies: Specify currency name query array, separated by commas, maximum 100 items (required) + :param list[str] currencies: Specify currency name query array, separated by commas, maximum 100 (required) :param str vip_level: VIP level, defaults to 0 if not specified :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response @@ -1370,7 +1370,7 @@ def get_multi_collateral_current_rate_with_http_info(self, currencies, **kwargs) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param list[str] currencies: Specify currency name query array, separated by commas, maximum 100 items (required) + :param list[str] currencies: Specify currency name query array, separated by commas, maximum 100 (required) :param str vip_level: VIP level, defaults to 0 if not specified :param _return_http_data_only: response data without head status code and headers diff --git a/gate_api/api/options_api.py b/gate_api/api/options_api.py index d5661e4f..b5da1193 100644 --- a/gate_api/api/options_api.py +++ b/gate_api/api/options_api.py @@ -902,7 +902,7 @@ def list_options_order_book(self, contract, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str contract: Options contract name (required) - :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param str interval: Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 :param int limit: Number of depth levels :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time the depth changes :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -930,7 +930,7 @@ def list_options_order_book_with_http_info(self, contract, **kwargs): # noqa: E :param bool async_req: execute request asynchronously :param str contract: Options contract name (required) - :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param str interval: Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 :param int limit: Number of depth levels :param bool with_id: Whether to return depth update ID. This ID increments by 1 each time the depth changes :param _return_http_data_only: response data without head status code @@ -2729,6 +2729,133 @@ def get_options_order_with_http_info(self, order_id, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + def amend_options_order(self, order_id, amend_options_order_request, **kwargs): # noqa: E501 + """Option Order Modification # noqa: E501 + + Modify the order price and/or quantity of a specified order; only orders with status 'open' are supported # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.amend_options_order(order_id, amend_options_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID returned when order is successfully created (required) + :param AmendOptionsOrderRequest amend_options_order_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OptionsOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.amend_options_order_with_http_info(order_id, amend_options_order_request, **kwargs) # noqa: E501 + + def amend_options_order_with_http_info(self, order_id, amend_options_order_request, **kwargs): # noqa: E501 + """Option Order Modification # noqa: E501 + + Modify the order price and/or quantity of a specified order; only orders with status 'open' are supported # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.amend_options_order_with_http_info(order_id, amend_options_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID returned when order is successfully created (required) + :param AmendOptionsOrderRequest amend_options_order_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OptionsOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id', + 'amend_options_order_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method amend_options_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `amend_options_order`") # noqa: E501 + # verify the required parameter 'amend_options_order_request' is set + if self.api_client.client_side_validation and ('amend_options_order_request' not in local_var_params or # noqa: E501 + local_var_params['amend_options_order_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `amend_options_order_request` when calling `amend_options_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'amend_options_order_request' in local_var_params: + body_params = local_var_params['amend_options_order_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/options/orders/{order_id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OptionsOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + def cancel_options_order(self, order_id, **kwargs): # noqa: E501 """Cancel single order # noqa: E501 diff --git a/gate_api/api/otc_api.py b/gate_api/api/otc_api.py new file mode 100644 index 00000000..6b1a1b53 --- /dev/null +++ b/gate_api/api/otc_api.py @@ -0,0 +1,1973 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class OTCApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_otc_quote(self, otc_quote_request, **kwargs): # noqa: E501 + """Fiat and stablecoin quote # noqa: E501 + + Create fiat and stablecoin quotes, supporting both PAY and GET directions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_otc_quote(otc_quote_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcQuoteRequest otc_quote_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcQuoteResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_otc_quote_with_http_info(otc_quote_request, **kwargs) # noqa: E501 + + def create_otc_quote_with_http_info(self, otc_quote_request, **kwargs): # noqa: E501 + """Fiat and stablecoin quote # noqa: E501 + + Create fiat and stablecoin quotes, supporting both PAY and GET directions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_otc_quote_with_http_info(otc_quote_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcQuoteRequest otc_quote_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcQuoteResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'otc_quote_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_otc_quote" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'otc_quote_request' is set + if self.api_client.client_side_validation and ('otc_quote_request' not in local_var_params or # noqa: E501 + local_var_params['otc_quote_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `otc_quote_request` when calling `create_otc_quote`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'otc_quote_request' in local_var_params: + body_params = local_var_params['otc_quote_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/quote', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcQuoteResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_otc_order(self, otc_order_request, **kwargs): # noqa: E501 + """Create fiat order # noqa: E501 + + Create a fiat order, supporting BUY for on-ramp and SELL for off-ramp # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_otc_order(otc_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcOrderRequest otc_order_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_otc_order_with_http_info(otc_order_request, **kwargs) # noqa: E501 + + def create_otc_order_with_http_info(self, otc_order_request, **kwargs): # noqa: E501 + """Create fiat order # noqa: E501 + + Create a fiat order, supporting BUY for on-ramp and SELL for off-ramp # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_otc_order_with_http_info(otc_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcOrderRequest otc_order_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'otc_order_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_otc_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'otc_order_request' is set + if self.api_client.client_side_validation and ('otc_order_request' not in local_var_params or # noqa: E501 + local_var_params['otc_order_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `otc_order_request` when calling `create_otc_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'otc_order_request' in local_var_params: + body_params = local_var_params['otc_order_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/order/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_stable_coin_order(self, otc_stable_coin_order_request, **kwargs): # noqa: E501 + """Create stablecoin order # noqa: E501 + + Create a stablecoin order. All request body fields except `promotion_code` are required. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_stable_coin_order(otc_stable_coin_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcStableCoinOrderRequest otc_stable_coin_order_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcStableCoinOrderCreateResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_stable_coin_order_with_http_info(otc_stable_coin_order_request, **kwargs) # noqa: E501 + + def create_stable_coin_order_with_http_info(self, otc_stable_coin_order_request, **kwargs): # noqa: E501 + """Create stablecoin order # noqa: E501 + + Create a stablecoin order. All request body fields except `promotion_code` are required. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_stable_coin_order_with_http_info(otc_stable_coin_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcStableCoinOrderRequest otc_stable_coin_order_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcStableCoinOrderCreateResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'otc_stable_coin_order_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_stable_coin_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'otc_stable_coin_order_request' is set + if self.api_client.client_side_validation and ('otc_stable_coin_order_request' not in local_var_params or # noqa: E501 + local_var_params['otc_stable_coin_order_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `otc_stable_coin_order_request` when calling `create_stable_coin_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'otc_stable_coin_order_request' in local_var_params: + body_params = local_var_params['otc_stable_coin_order_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/stable_coin/order/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcStableCoinOrderCreateResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_bank_list_inner_path(self, **kwargs): # noqa: E501 + """Get user bank card list # noqa: E501 + + List the user's bank cards for selecting a card when placing an order. **Default card**: use the `is_default` field in each list item (`1` indicates the default). The deprecated standalone default-bank-card endpoint is no longer required. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_bank_list_inner_path(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcBankListResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_bank_list_inner_path_with_http_info(**kwargs) # noqa: E501 + + def get_bank_list_inner_path_with_http_info(self, **kwargs): # noqa: E501 + """Get user bank card list # noqa: E501 + + List the user's bank cards for selecting a card when placing an order. **Default card**: use the `is_default` field in each list item (`1` indicates the default). The deprecated standalone default-bank-card endpoint is no longer required. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_bank_list_inner_path_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcBankListResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_bank_list_inner_path" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/bank/list', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcBankListResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_otc_bank(self, bank_account_name, bank_name, bank_country, bank_address, iban, swift, documentation_file, **kwargs): # noqa: E501 + """Create bank card # noqa: E501 + + Bind a bank card. Under the Global entity, an account with a non-matching name may enter manual review (`status` pending) and require subsequent supplementary materials. Corresponding Inner: `POST /bank/create`. Fields and protocol are subject to the production form/gateway; in some environments `bank_account_name` is passed Base64-encoded, see the integration notes for details. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_otc_bank(bank_account_name, bank_name, bank_country, bank_address, iban, swift, documentation_file, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str bank_account_name: (required) + :param str bank_name: (required) + :param str bank_country: (required) + :param str bank_address: (required) + :param str iban: (required) + :param str swift: (required) + :param str documentation_file: Account opening proof file content (multipart file field, binary/Base64; jpg/jpeg/png/pdf, etc.; maximum 10 MB per file, subject to the live environment) (required) + :param str remittance_line_number: + :param str agent_bank_name: + :param str agent_bank_swift: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcBankCreateResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_otc_bank_with_http_info(bank_account_name, bank_name, bank_country, bank_address, iban, swift, documentation_file, **kwargs) # noqa: E501 + + def create_otc_bank_with_http_info(self, bank_account_name, bank_name, bank_country, bank_address, iban, swift, documentation_file, **kwargs): # noqa: E501 + """Create bank card # noqa: E501 + + Bind a bank card. Under the Global entity, an account with a non-matching name may enter manual review (`status` pending) and require subsequent supplementary materials. Corresponding Inner: `POST /bank/create`. Fields and protocol are subject to the production form/gateway; in some environments `bank_account_name` is passed Base64-encoded, see the integration notes for details. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_otc_bank_with_http_info(bank_account_name, bank_name, bank_country, bank_address, iban, swift, documentation_file, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str bank_account_name: (required) + :param str bank_name: (required) + :param str bank_country: (required) + :param str bank_address: (required) + :param str iban: (required) + :param str swift: (required) + :param str documentation_file: Account opening proof file content (multipart file field, binary/Base64; jpg/jpeg/png/pdf, etc.; maximum 10 MB per file, subject to the live environment) (required) + :param str remittance_line_number: + :param str agent_bank_name: + :param str agent_bank_swift: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcBankCreateResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'bank_account_name', + 'bank_name', + 'bank_country', + 'bank_address', + 'iban', + 'swift', + 'documentation_file', + 'remittance_line_number', + 'agent_bank_name', + 'agent_bank_swift' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_otc_bank" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'bank_account_name' is set + if self.api_client.client_side_validation and ('bank_account_name' not in local_var_params or # noqa: E501 + local_var_params['bank_account_name'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `bank_account_name` when calling `create_otc_bank`") # noqa: E501 + # verify the required parameter 'bank_name' is set + if self.api_client.client_side_validation and ('bank_name' not in local_var_params or # noqa: E501 + local_var_params['bank_name'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `bank_name` when calling `create_otc_bank`") # noqa: E501 + # verify the required parameter 'bank_country' is set + if self.api_client.client_side_validation and ('bank_country' not in local_var_params or # noqa: E501 + local_var_params['bank_country'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `bank_country` when calling `create_otc_bank`") # noqa: E501 + # verify the required parameter 'bank_address' is set + if self.api_client.client_side_validation and ('bank_address' not in local_var_params or # noqa: E501 + local_var_params['bank_address'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `bank_address` when calling `create_otc_bank`") # noqa: E501 + # verify the required parameter 'iban' is set + if self.api_client.client_side_validation and ('iban' not in local_var_params or # noqa: E501 + local_var_params['iban'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `iban` when calling `create_otc_bank`") # noqa: E501 + # verify the required parameter 'swift' is set + if self.api_client.client_side_validation and ('swift' not in local_var_params or # noqa: E501 + local_var_params['swift'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `swift` when calling `create_otc_bank`") # noqa: E501 + # verify the required parameter 'documentation_file' is set + if self.api_client.client_side_validation and ('documentation_file' not in local_var_params or # noqa: E501 + local_var_params['documentation_file'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `documentation_file` when calling `create_otc_bank`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'bank_account_name' in local_var_params: + form_params.append(('bank_account_name', local_var_params['bank_account_name'])) # noqa: E501 + if 'bank_name' in local_var_params: + form_params.append(('bank_name', local_var_params['bank_name'])) # noqa: E501 + if 'bank_country' in local_var_params: + form_params.append(('bank_country', local_var_params['bank_country'])) # noqa: E501 + if 'bank_address' in local_var_params: + form_params.append(('bank_address', local_var_params['bank_address'])) # noqa: E501 + if 'iban' in local_var_params: + form_params.append(('iban', local_var_params['iban'])) # noqa: E501 + if 'swift' in local_var_params: + form_params.append(('swift', local_var_params['swift'])) # noqa: E501 + if 'remittance_line_number' in local_var_params: + form_params.append(('remittance_line_number', local_var_params['remittance_line_number'])) # noqa: E501 + if 'agent_bank_name' in local_var_params: + form_params.append(('agent_bank_name', local_var_params['agent_bank_name'])) # noqa: E501 + if 'agent_bank_swift' in local_var_params: + form_params.append(('agent_bank_swift', local_var_params['agent_bank_swift'])) # noqa: E501 + if 'documentation_file' in local_var_params: + form_params.append(('documentation_file', local_var_params['documentation_file'])) # noqa: E501 + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/bank/create', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcBankCreateResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_otc_bank(self, otc_bank_id_request, **kwargs): # noqa: E501 + """Delete bank card # noqa: E501 + + Delete the specified bank card. Corresponds to Inner: `POST /bank/delete`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_otc_bank(otc_bank_id_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcBankIdRequest otc_bank_id_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.delete_otc_bank_with_http_info(otc_bank_id_request, **kwargs) # noqa: E501 + + def delete_otc_bank_with_http_info(self, otc_bank_id_request, **kwargs): # noqa: E501 + """Delete bank card # noqa: E501 + + Delete the specified bank card. Corresponds to Inner: `POST /bank/delete`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_otc_bank_with_http_info(otc_bank_id_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcBankIdRequest otc_bank_id_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'otc_bank_id_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_otc_bank" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'otc_bank_id_request' is set + if self.api_client.client_side_validation and ('otc_bank_id_request' not in local_var_params or # noqa: E501 + local_var_params['otc_bank_id_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `otc_bank_id_request` when calling `delete_otc_bank`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'otc_bank_id_request' in local_var_params: + body_params = local_var_params['otc_bank_id_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/bank/delete', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def set_default_otc_bank(self, otc_bank_id_request, **kwargs): # noqa: E501 + """Set default bank card # noqa: E501 + + Set the specified bank card as default. Corresponds to Inner: `POST /bank/set_default`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_default_otc_bank(otc_bank_id_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcBankIdRequest otc_bank_id_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.set_default_otc_bank_with_http_info(otc_bank_id_request, **kwargs) # noqa: E501 + + def set_default_otc_bank_with_http_info(self, otc_bank_id_request, **kwargs): # noqa: E501 + """Set default bank card # noqa: E501 + + Set the specified bank card as default. Corresponds to Inner: `POST /bank/set_default`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_default_otc_bank_with_http_info(otc_bank_id_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcBankIdRequest otc_bank_id_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'otc_bank_id_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_default_otc_bank" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'otc_bank_id_request' is set + if self.api_client.client_side_validation and ('otc_bank_id_request' not in local_var_params or # noqa: E501 + local_var_params['otc_bank_id_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `otc_bank_id_request` when calling `set_default_otc_bank`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'otc_bank_id_request' in local_var_params: + body_params = local_var_params['otc_bank_id_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/bank/set_default', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_otc_bank_supplement_checklist(self, bank_id, **kwargs): # noqa: E501 + """Query the checklist of materials to supplement for a bank card # noqa: E501 + + **①** `bank_id` must be specified. After verifying that the card belongs to the current user and its status allows supplementary documents, the endpoint returns the required items based on the user's **approved advanced verification type** (personal/enterprise); each item's `description` states the submission requirements. Corresponding Inner endpoint: `GET /bank/bank_supplement_checklist`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_otc_bank_supplement_checklist(bank_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str bank_id: Bank card ID (otc_rds / the id returned by the list endpoint). (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcBankSupplementChecklistResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_otc_bank_supplement_checklist_with_http_info(bank_id, **kwargs) # noqa: E501 + + def get_otc_bank_supplement_checklist_with_http_info(self, bank_id, **kwargs): # noqa: E501 + """Query the checklist of materials to supplement for a bank card # noqa: E501 + + **①** `bank_id` must be specified. After verifying that the card belongs to the current user and its status allows supplementary documents, the endpoint returns the required items based on the user's **approved advanced verification type** (personal/enterprise); each item's `description` states the submission requirements. Corresponding Inner endpoint: `GET /bank/bank_supplement_checklist`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_otc_bank_supplement_checklist_with_http_info(bank_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str bank_id: Bank card ID (otc_rds / the id returned by the list endpoint). (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcBankSupplementChecklistResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'bank_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_otc_bank_supplement_checklist" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'bank_id' is set + if self.api_client.client_side_validation and ('bank_id' not in local_var_params or # noqa: E501 + local_var_params['bank_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `bank_id` when calling `get_otc_bank_supplement_checklist`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'bank_id' in local_var_params and local_var_params['bank_id'] is not None: # noqa: E501 + query_params.append(('bank_id', local_var_params['bank_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/bank/bank_supplement_checklist', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcBankSupplementChecklistResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def submit_otc_bank_personal_supplement(self, bank_id, id_document_front, id_document_back, address_proof, **kwargs): # noqa: E501 + """Submit Bank Card Supplement Materials (Personal) # noqa: E501 + + **Personal professional verification (type=1)** users submit non-same-person/supplementary materials. Must match `user_type=personal` returned by `GET /otc/bank/bank_supplement_checklist?bank_id=`, otherwise the request is rejected. **multipart/form-data** is recommended: each material item is a separate file field, with field names matching the checklist `code` (`id_document_front`, `id_document_back`, `address_proof`). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.submit_otc_bank_personal_supplement(bank_id, id_document_front, id_document_back, address_proof, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str bank_id: (required) + :param str id_document_front: ID document front-side file content (multipart file field, binary/Base64) (required) + :param str id_document_back: ID document back-side file content (multipart file field, binary/Base64) (required) + :param str address_proof: Proof-of-address file content (multipart file field, binary/Base64) (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.submit_otc_bank_personal_supplement_with_http_info(bank_id, id_document_front, id_document_back, address_proof, **kwargs) # noqa: E501 + + def submit_otc_bank_personal_supplement_with_http_info(self, bank_id, id_document_front, id_document_back, address_proof, **kwargs): # noqa: E501 + """Submit Bank Card Supplement Materials (Personal) # noqa: E501 + + **Personal professional verification (type=1)** users submit non-same-person/supplementary materials. Must match `user_type=personal` returned by `GET /otc/bank/bank_supplement_checklist?bank_id=`, otherwise the request is rejected. **multipart/form-data** is recommended: each material item is a separate file field, with field names matching the checklist `code` (`id_document_front`, `id_document_back`, `address_proof`). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.submit_otc_bank_personal_supplement_with_http_info(bank_id, id_document_front, id_document_back, address_proof, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str bank_id: (required) + :param str id_document_front: ID document front-side file content (multipart file field, binary/Base64) (required) + :param str id_document_back: ID document back-side file content (multipart file field, binary/Base64) (required) + :param str address_proof: Proof-of-address file content (multipart file field, binary/Base64) (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'bank_id', + 'id_document_front', + 'id_document_back', + 'address_proof' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method submit_otc_bank_personal_supplement" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'bank_id' is set + if self.api_client.client_side_validation and ('bank_id' not in local_var_params or # noqa: E501 + local_var_params['bank_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `bank_id` when calling `submit_otc_bank_personal_supplement`") # noqa: E501 + # verify the required parameter 'id_document_front' is set + if self.api_client.client_side_validation and ('id_document_front' not in local_var_params or # noqa: E501 + local_var_params['id_document_front'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `id_document_front` when calling `submit_otc_bank_personal_supplement`") # noqa: E501 + # verify the required parameter 'id_document_back' is set + if self.api_client.client_side_validation and ('id_document_back' not in local_var_params or # noqa: E501 + local_var_params['id_document_back'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `id_document_back` when calling `submit_otc_bank_personal_supplement`") # noqa: E501 + # verify the required parameter 'address_proof' is set + if self.api_client.client_side_validation and ('address_proof' not in local_var_params or # noqa: E501 + local_var_params['address_proof'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `address_proof` when calling `submit_otc_bank_personal_supplement`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'bank_id' in local_var_params: + form_params.append(('bank_id', local_var_params['bank_id'])) # noqa: E501 + if 'id_document_front' in local_var_params: + form_params.append(('id_document_front', local_var_params['id_document_front'])) # noqa: E501 + if 'id_document_back' in local_var_params: + form_params.append(('id_document_back', local_var_params['id_document_back'])) # noqa: E501 + if 'address_proof' in local_var_params: + form_params.append(('address_proof', local_var_params['address_proof'])) # noqa: E501 + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/bank/personal/bank_supplement', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def submit_otc_bank_enterprise_supplement(self, bank_id, certificate, share_holders, passport, share_holding_structure, **kwargs): # noqa: E501 + """Submit Bank Card Supplement Materials (Enterprise) # noqa: E501 + + **Enterprise professional verification (type=2)** users submit supplementary materials. Must match `user_type=enterprise` returned by the checklist. **multipart** file field names: `certificate`, `share_holders`, `passport`, `share_holding_structure`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.submit_otc_bank_enterprise_supplement(bank_id, certificate, share_holders, passport, share_holding_structure, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str bank_id: (required) + :param str certificate: Business license / registration certificate file content (multipart file field, binary/Base64) (required) + :param str share_holders: Register of shareholders file content (multipart file field, binary/Base64) (required) + :param str passport: Legal representative / shareholder passport file content (multipart file field, binary/Base64) (required) + :param str share_holding_structure: Ownership structure chart file content (multipart file field, binary/Base64) (required) + :param str uid: + :param str funds_statement: Proof-of-funds file content (multipart file field, binary/Base64, optional) + :param str additional: Other supplementary material file content (multipart file field, binary/Base64, optional) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.submit_otc_bank_enterprise_supplement_with_http_info(bank_id, certificate, share_holders, passport, share_holding_structure, **kwargs) # noqa: E501 + + def submit_otc_bank_enterprise_supplement_with_http_info(self, bank_id, certificate, share_holders, passport, share_holding_structure, **kwargs): # noqa: E501 + """Submit Bank Card Supplement Materials (Enterprise) # noqa: E501 + + **Enterprise professional verification (type=2)** users submit supplementary materials. Must match `user_type=enterprise` returned by the checklist. **multipart** file field names: `certificate`, `share_holders`, `passport`, `share_holding_structure`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.submit_otc_bank_enterprise_supplement_with_http_info(bank_id, certificate, share_holders, passport, share_holding_structure, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str bank_id: (required) + :param str certificate: Business license / registration certificate file content (multipart file field, binary/Base64) (required) + :param str share_holders: Register of shareholders file content (multipart file field, binary/Base64) (required) + :param str passport: Legal representative / shareholder passport file content (multipart file field, binary/Base64) (required) + :param str share_holding_structure: Ownership structure chart file content (multipart file field, binary/Base64) (required) + :param str uid: + :param str funds_statement: Proof-of-funds file content (multipart file field, binary/Base64, optional) + :param str additional: Other supplementary material file content (multipart file field, binary/Base64, optional) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'bank_id', + 'certificate', + 'share_holders', + 'passport', + 'share_holding_structure', + 'uid', + 'funds_statement', + 'additional' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method submit_otc_bank_enterprise_supplement" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'bank_id' is set + if self.api_client.client_side_validation and ('bank_id' not in local_var_params or # noqa: E501 + local_var_params['bank_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `bank_id` when calling `submit_otc_bank_enterprise_supplement`") # noqa: E501 + # verify the required parameter 'certificate' is set + if self.api_client.client_side_validation and ('certificate' not in local_var_params or # noqa: E501 + local_var_params['certificate'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `certificate` when calling `submit_otc_bank_enterprise_supplement`") # noqa: E501 + # verify the required parameter 'share_holders' is set + if self.api_client.client_side_validation and ('share_holders' not in local_var_params or # noqa: E501 + local_var_params['share_holders'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `share_holders` when calling `submit_otc_bank_enterprise_supplement`") # noqa: E501 + # verify the required parameter 'passport' is set + if self.api_client.client_side_validation and ('passport' not in local_var_params or # noqa: E501 + local_var_params['passport'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `passport` when calling `submit_otc_bank_enterprise_supplement`") # noqa: E501 + # verify the required parameter 'share_holding_structure' is set + if self.api_client.client_side_validation and ('share_holding_structure' not in local_var_params or # noqa: E501 + local_var_params['share_holding_structure'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `share_holding_structure` when calling `submit_otc_bank_enterprise_supplement`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'uid' in local_var_params: + form_params.append(('uid', local_var_params['uid'])) # noqa: E501 + if 'bank_id' in local_var_params: + form_params.append(('bank_id', local_var_params['bank_id'])) # noqa: E501 + if 'certificate' in local_var_params: + form_params.append(('certificate', local_var_params['certificate'])) # noqa: E501 + if 'share_holders' in local_var_params: + form_params.append(('share_holders', local_var_params['share_holders'])) # noqa: E501 + if 'passport' in local_var_params: + form_params.append(('passport', local_var_params['passport'])) # noqa: E501 + if 'share_holding_structure' in local_var_params: + form_params.append(('share_holding_structure', local_var_params['share_holding_structure'])) # noqa: E501 + if 'funds_statement' in local_var_params: + form_params.append(('funds_statement', local_var_params['funds_statement'])) # noqa: E501 + if 'additional' in local_var_params: + form_params.append(('additional', local_var_params['additional'])) # noqa: E501 + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/bank/enterprise/bank_supplement', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def mark_otc_order_paid(self, otc_mark_order_paid_request, **kwargs): # noqa: E501 + """Mark fiat order as paid (deposit confirmation) # noqa: E501 + + Mark a fiat BUY order as paid (deposit confirmation). **A user payment receipt must be uploaded**: `payment_receipt_file_key` is required; supported formats are jpg/jpeg/png/pdf, with a maximum size of 10 MB per file (validated jointly by the service and gateway). The compatibility field name `payment_receipt` is subject to the gateway/live environment. The persisted field is `otc_trade_record.payment_receipt_file_key`. The Pay Inner path is `POST .../pay/order_set_paid` (commonly associated by `client_order_id`); the Inner path corresponding to this OpenAPI endpoint, `POST /order/paid`, still primarily uses `order_id`. If the gateway standardizes on the merchant order ID, follow the gateway documentation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.mark_otc_order_paid(otc_mark_order_paid_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcMarkOrderPaidRequest otc_mark_order_paid_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.mark_otc_order_paid_with_http_info(otc_mark_order_paid_request, **kwargs) # noqa: E501 + + def mark_otc_order_paid_with_http_info(self, otc_mark_order_paid_request, **kwargs): # noqa: E501 + """Mark fiat order as paid (deposit confirmation) # noqa: E501 + + Mark a fiat BUY order as paid (deposit confirmation). **A user payment receipt must be uploaded**: `payment_receipt_file_key` is required; supported formats are jpg/jpeg/png/pdf, with a maximum size of 10 MB per file (validated jointly by the service and gateway). The compatibility field name `payment_receipt` is subject to the gateway/live environment. The persisted field is `otc_trade_record.payment_receipt_file_key`. The Pay Inner path is `POST .../pay/order_set_paid` (commonly associated by `client_order_id`); the Inner path corresponding to this OpenAPI endpoint, `POST /order/paid`, still primarily uses `order_id`. If the gateway standardizes on the merchant order ID, follow the gateway documentation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.mark_otc_order_paid_with_http_info(otc_mark_order_paid_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param OtcMarkOrderPaidRequest otc_mark_order_paid_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'otc_mark_order_paid_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method mark_otc_order_paid" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'otc_mark_order_paid_request' is set + if self.api_client.client_side_validation and ('otc_mark_order_paid_request' not in local_var_params or # noqa: E501 + local_var_params['otc_mark_order_paid_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `otc_mark_order_paid_request` when calling `mark_otc_order_paid`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'otc_mark_order_paid_request' in local_var_params: + body_params = local_var_params['otc_mark_order_paid_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/order/paid', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def cancel_otc_order(self, order_id, **kwargs): # noqa: E501 + """Fiat order cancellation # noqa: E501 + + Cancel fiat order # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_otc_order(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Order ID (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_otc_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def cancel_otc_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Fiat order cancellation # noqa: E501 + + Cancel fiat order # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_otc_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Order ID (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_otc_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `cancel_otc_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'order_id' in local_var_params and local_var_params['order_id'] is not None: # noqa: E501 + query_params.append(('order_id', local_var_params['order_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/order/cancel', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_otc_orders(self, **kwargs): # noqa: E501 + """Fiat order list # noqa: E501 + + Query the fiat order list with filters such as type, currency, time range, and status # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_otc_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: BUY for on-ramp, SELL for off-ramp + :param str fiat_currency: Fiat currency + :param str crypto_currency: Digital currency + :param str start_time: starttime for example : 2025-09-09 + :param str end_time: endtime for example :2025-09-09 + :param str status: DONE: completed CANCEL: canceled PROCESSING: in progress DISBURSED: disbursed + :param str pn: Page number + :param str ps: Number of items per page + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcOrderListResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_otc_orders_with_http_info(**kwargs) # noqa: E501 + + def list_otc_orders_with_http_info(self, **kwargs): # noqa: E501 + """Fiat order list # noqa: E501 + + Query the fiat order list with filters such as type, currency, time range, and status # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_otc_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: BUY for on-ramp, SELL for off-ramp + :param str fiat_currency: Fiat currency + :param str crypto_currency: Digital currency + :param str start_time: starttime for example : 2025-09-09 + :param str end_time: endtime for example :2025-09-09 + :param str status: DONE: completed CANCEL: canceled PROCESSING: in progress DISBURSED: disbursed + :param str pn: Page number + :param str ps: Number of items per page + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcOrderListResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'type', + 'fiat_currency', + 'crypto_currency', + 'start_time', + 'end_time', + 'status', + 'pn', + 'ps' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_otc_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + if 'fiat_currency' in local_var_params and local_var_params['fiat_currency'] is not None: # noqa: E501 + query_params.append(('fiat_currency', local_var_params['fiat_currency'])) # noqa: E501 + if 'crypto_currency' in local_var_params and local_var_params['crypto_currency'] is not None: # noqa: E501 + query_params.append(('crypto_currency', local_var_params['crypto_currency'])) # noqa: E501 + if 'start_time' in local_var_params and local_var_params['start_time'] is not None: # noqa: E501 + query_params.append(('start_time', local_var_params['start_time'])) # noqa: E501 + if 'end_time' in local_var_params and local_var_params['end_time'] is not None: # noqa: E501 + query_params.append(('end_time', local_var_params['end_time'])) # noqa: E501 + if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + query_params.append(('status', local_var_params['status'])) # noqa: E501 + if 'pn' in local_var_params and local_var_params['pn'] is not None: # noqa: E501 + query_params.append(('pn', local_var_params['pn'])) # noqa: E501 + if 'ps' in local_var_params and local_var_params['ps'] is not None: # noqa: E501 + query_params.append(('ps', local_var_params['ps'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/order/list', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcOrderListResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_stable_coin_orders(self, **kwargs): # noqa: E501 + """Stablecoin order list # noqa: E501 + + Query stablecoin order list with filtering by currency, time range, status, etc. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_stable_coin_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str page_size: Number of records per page + :param str page_number: Page number + :param str coin_name: ordercurrency + :param str start_time: Start Time + :param str end_time: End time + :param str status: Status: PROCESSING: in progress / DONE:completed / FAILED: failed + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcStableCoinOrderListResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_stable_coin_orders_with_http_info(**kwargs) # noqa: E501 + + def list_stable_coin_orders_with_http_info(self, **kwargs): # noqa: E501 + """Stablecoin order list # noqa: E501 + + Query stablecoin order list with filtering by currency, time range, status, etc. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_stable_coin_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str page_size: Number of records per page + :param str page_number: Page number + :param str coin_name: ordercurrency + :param str start_time: Start Time + :param str end_time: End time + :param str status: Status: PROCESSING: in progress / DONE:completed / FAILED: failed + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcStableCoinOrderListResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'page_size', + 'page_number', + 'coin_name', + 'start_time', + 'end_time', + 'status' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_stable_coin_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + if 'page_number' in local_var_params and local_var_params['page_number'] is not None: # noqa: E501 + query_params.append(('page_number', local_var_params['page_number'])) # noqa: E501 + if 'coin_name' in local_var_params and local_var_params['coin_name'] is not None: # noqa: E501 + query_params.append(('coin_name', local_var_params['coin_name'])) # noqa: E501 + if 'start_time' in local_var_params and local_var_params['start_time'] is not None: # noqa: E501 + query_params.append(('start_time', local_var_params['start_time'])) # noqa: E501 + if 'end_time' in local_var_params and local_var_params['end_time'] is not None: # noqa: E501 + query_params.append(('end_time', local_var_params['end_time'])) # noqa: E501 + if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + query_params.append(('status', local_var_params['status'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/stable_coin/order/list', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcStableCoinOrderListResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_otc_order_detail(self, order_id, **kwargs): # noqa: E501 + """Fiat order details # noqa: E501 + + Query fiat order details # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_otc_order_detail(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Order ID (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OtcOrderDetailResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_otc_order_detail_with_http_info(order_id, **kwargs) # noqa: E501 + + def get_otc_order_detail_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Fiat order details # noqa: E501 + + Query fiat order details # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_otc_order_detail_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: Order ID (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OtcOrderDetailResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_otc_order_detail" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `get_otc_order_detail`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'order_id' in local_var_params and local_var_params['order_id'] is not None: # noqa: E501 + query_params.append(('order_id', local_var_params['order_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/otc/order/detail', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OtcOrderDetailResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/p2p_api.py b/gate_api/api/p2p_api.py new file mode 100644 index 00000000..ea6aab29 --- /dev/null +++ b/gate_api/api/p2p_api.py @@ -0,0 +1,2211 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class P2pApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def p2p_merchant_query_spot_balance(self, **kwargs): # noqa: E501 + """Query spot balance # noqa: E501 + + Use Spot API `GET /spot/accounts` to query spot account balance; this entry is for guidance only and does not define separate P2P Merchant request parameters or response body. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_query_spot_balance(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_query_spot_balance_with_http_info(**kwargs) # noqa: E501 + + def p2p_merchant_query_spot_balance_with_http_info(self, **kwargs): # noqa: E501 + """Query spot balance # noqa: E501 + + Use Spot API `GET /spot/accounts` to query spot account balance; this entry is for guidance only and does not define separate P2P Merchant request parameters or response body. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_query_spot_balance_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_query_spot_balance" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/spot/accounts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_account_get_user_info(self, **kwargs): # noqa: E501 + """Get account information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_account_get_user_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pMerchantUserInfoResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_account_get_user_info_with_http_info(**kwargs) # noqa: E501 + + def p2p_merchant_account_get_user_info_with_http_info(self, **kwargs): # noqa: E501 + """Get account information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_account_get_user_info_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pMerchantUserInfoResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_account_get_user_info" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/account/get_user_info', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pMerchantUserInfoResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_account_get_counterparty_user_info(self, get_counterparty_user_info_request, **kwargs): # noqa: E501 + """Get counterparty information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_account_get_counterparty_user_info(get_counterparty_user_info_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetCounterpartyUserInfoRequest get_counterparty_user_info_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pCounterpartyUserInfoResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_account_get_counterparty_user_info_with_http_info(get_counterparty_user_info_request, **kwargs) # noqa: E501 + + def p2p_merchant_account_get_counterparty_user_info_with_http_info(self, get_counterparty_user_info_request, **kwargs): # noqa: E501 + """Get counterparty information # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_account_get_counterparty_user_info_with_http_info(get_counterparty_user_info_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetCounterpartyUserInfoRequest get_counterparty_user_info_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pCounterpartyUserInfoResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'get_counterparty_user_info_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_account_get_counterparty_user_info" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'get_counterparty_user_info_request' is set + if self.api_client.client_side_validation and ('get_counterparty_user_info_request' not in local_var_params or # noqa: E501 + local_var_params['get_counterparty_user_info_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `get_counterparty_user_info_request` when calling `p2p_merchant_account_get_counterparty_user_info`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'get_counterparty_user_info_request' in local_var_params: + body_params = local_var_params['get_counterparty_user_info_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/account/get_counterparty_user_info', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pCounterpartyUserInfoResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_account_get_myself_payment(self, **kwargs): # noqa: E501 + """Get payment method list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_account_get_myself_payment(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetMyselfPaymentRequest get_myself_payment_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pPaymentMethodsResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_account_get_myself_payment_with_http_info(**kwargs) # noqa: E501 + + def p2p_merchant_account_get_myself_payment_with_http_info(self, **kwargs): # noqa: E501 + """Get payment method list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_account_get_myself_payment_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetMyselfPaymentRequest get_myself_payment_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pPaymentMethodsResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'get_myself_payment_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_account_get_myself_payment" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'get_myself_payment_request' in local_var_params: + body_params = local_var_params['get_myself_payment_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/account/get_myself_payment', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pPaymentMethodsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_account_set_merchant_work_hours(self, set_merchant_work_hours_request, **kwargs): # noqa: E501 + """Set merchant working status and custom working hours # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_account_set_merchant_work_hours(set_merchant_work_hours_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SetMerchantWorkHoursRequest set_merchant_work_hours_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pMerchantWorkHoursResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_account_set_merchant_work_hours_with_http_info(set_merchant_work_hours_request, **kwargs) # noqa: E501 + + def p2p_merchant_account_set_merchant_work_hours_with_http_info(self, set_merchant_work_hours_request, **kwargs): # noqa: E501 + """Set merchant working status and custom working hours # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_account_set_merchant_work_hours_with_http_info(set_merchant_work_hours_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SetMerchantWorkHoursRequest set_merchant_work_hours_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pMerchantWorkHoursResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'set_merchant_work_hours_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_account_set_merchant_work_hours" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'set_merchant_work_hours_request' is set + if self.api_client.client_side_validation and ('set_merchant_work_hours_request' not in local_var_params or # noqa: E501 + local_var_params['set_merchant_work_hours_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `set_merchant_work_hours_request` when calling `p2p_merchant_account_set_merchant_work_hours`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'set_merchant_work_hours_request' in local_var_params: + body_params = local_var_params['set_merchant_work_hours_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/account/set_merchant_work_hours', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pMerchantWorkHoursResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_transaction_get_pending_transaction_list(self, get_pending_transaction_list_request, **kwargs): # noqa: E501 + """Get pending orders # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_get_pending_transaction_list(get_pending_transaction_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetPendingTransactionListRequest get_pending_transaction_list_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pTransactionListResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_transaction_get_pending_transaction_list_with_http_info(get_pending_transaction_list_request, **kwargs) # noqa: E501 + + def p2p_merchant_transaction_get_pending_transaction_list_with_http_info(self, get_pending_transaction_list_request, **kwargs): # noqa: E501 + """Get pending orders # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_get_pending_transaction_list_with_http_info(get_pending_transaction_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetPendingTransactionListRequest get_pending_transaction_list_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pTransactionListResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'get_pending_transaction_list_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_transaction_get_pending_transaction_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'get_pending_transaction_list_request' is set + if self.api_client.client_side_validation and ('get_pending_transaction_list_request' not in local_var_params or # noqa: E501 + local_var_params['get_pending_transaction_list_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `get_pending_transaction_list_request` when calling `p2p_merchant_transaction_get_pending_transaction_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'get_pending_transaction_list_request' in local_var_params: + body_params = local_var_params['get_pending_transaction_list_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/transaction/get_pending_transaction_list', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pTransactionListResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_transaction_get_completed_transaction_list(self, get_completed_transaction_list_request, **kwargs): # noqa: E501 + """Get all/historical orders # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_get_completed_transaction_list(get_completed_transaction_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetCompletedTransactionListRequest get_completed_transaction_list_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pTransactionListResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_transaction_get_completed_transaction_list_with_http_info(get_completed_transaction_list_request, **kwargs) # noqa: E501 + + def p2p_merchant_transaction_get_completed_transaction_list_with_http_info(self, get_completed_transaction_list_request, **kwargs): # noqa: E501 + """Get all/historical orders # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_get_completed_transaction_list_with_http_info(get_completed_transaction_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetCompletedTransactionListRequest get_completed_transaction_list_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pTransactionListResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'get_completed_transaction_list_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_transaction_get_completed_transaction_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'get_completed_transaction_list_request' is set + if self.api_client.client_side_validation and ('get_completed_transaction_list_request' not in local_var_params or # noqa: E501 + local_var_params['get_completed_transaction_list_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `get_completed_transaction_list_request` when calling `p2p_merchant_transaction_get_completed_transaction_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'get_completed_transaction_list_request' in local_var_params: + body_params = local_var_params['get_completed_transaction_list_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/transaction/get_completed_transaction_list', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pTransactionListResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_transaction_get_transaction_details(self, get_transaction_details_request, **kwargs): # noqa: E501 + """Query order details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_get_transaction_details(get_transaction_details_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetTransactionDetailsRequest get_transaction_details_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pTransactionDetailResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_transaction_get_transaction_details_with_http_info(get_transaction_details_request, **kwargs) # noqa: E501 + + def p2p_merchant_transaction_get_transaction_details_with_http_info(self, get_transaction_details_request, **kwargs): # noqa: E501 + """Query order details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_get_transaction_details_with_http_info(get_transaction_details_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetTransactionDetailsRequest get_transaction_details_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pTransactionDetailResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'get_transaction_details_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_transaction_get_transaction_details" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'get_transaction_details_request' is set + if self.api_client.client_side_validation and ('get_transaction_details_request' not in local_var_params or # noqa: E501 + local_var_params['get_transaction_details_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `get_transaction_details_request` when calling `p2p_merchant_transaction_get_transaction_details`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'get_transaction_details_request' in local_var_params: + body_params = local_var_params['get_transaction_details_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/transaction/get_transaction_details', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pTransactionDetailResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_transaction_confirm_payment(self, confirm_payment, **kwargs): # noqa: E501 + """Confirm payment # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_confirm_payment(confirm_payment, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ConfirmPayment confirm_payment: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pTransactionActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_transaction_confirm_payment_with_http_info(confirm_payment, **kwargs) # noqa: E501 + + def p2p_merchant_transaction_confirm_payment_with_http_info(self, confirm_payment, **kwargs): # noqa: E501 + """Confirm payment # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_confirm_payment_with_http_info(confirm_payment, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ConfirmPayment confirm_payment: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pTransactionActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'confirm_payment' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_transaction_confirm_payment" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'confirm_payment' is set + if self.api_client.client_side_validation and ('confirm_payment' not in local_var_params or # noqa: E501 + local_var_params['confirm_payment'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `confirm_payment` when calling `p2p_merchant_transaction_confirm_payment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'confirm_payment' in local_var_params: + body_params = local_var_params['confirm_payment'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/transaction/confirm-payment', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pTransactionActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_transaction_confirm_receipt(self, confirm_receipt, **kwargs): # noqa: E501 + """Confirm receipt # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_confirm_receipt(confirm_receipt, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ConfirmReceipt confirm_receipt: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pTransactionActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_transaction_confirm_receipt_with_http_info(confirm_receipt, **kwargs) # noqa: E501 + + def p2p_merchant_transaction_confirm_receipt_with_http_info(self, confirm_receipt, **kwargs): # noqa: E501 + """Confirm receipt # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_confirm_receipt_with_http_info(confirm_receipt, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ConfirmReceipt confirm_receipt: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pTransactionActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'confirm_receipt' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_transaction_confirm_receipt" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'confirm_receipt' is set + if self.api_client.client_side_validation and ('confirm_receipt' not in local_var_params or # noqa: E501 + local_var_params['confirm_receipt'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `confirm_receipt` when calling `p2p_merchant_transaction_confirm_receipt`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'confirm_receipt' in local_var_params: + body_params = local_var_params['confirm_receipt'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/transaction/confirm-receipt', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pTransactionActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_transaction_cancel(self, cancel_order, **kwargs): # noqa: E501 + """Cancel order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_cancel(cancel_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CancelOrder cancel_order: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pTransactionActionResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_transaction_cancel_with_http_info(cancel_order, **kwargs) # noqa: E501 + + def p2p_merchant_transaction_cancel_with_http_info(self, cancel_order, **kwargs): # noqa: E501 + """Cancel order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_transaction_cancel_with_http_info(cancel_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param CancelOrder cancel_order: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pTransactionActionResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'cancel_order' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_transaction_cancel" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'cancel_order' is set + if self.api_client.client_side_validation and ('cancel_order' not in local_var_params or # noqa: E501 + local_var_params['cancel_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `cancel_order` when calling `p2p_merchant_transaction_cancel`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'cancel_order' in local_var_params: + body_params = local_var_params['cancel_order'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/transaction/cancel', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pTransactionActionResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_books_place_biz_push_order(self, place_biz_push_order, **kwargs): # noqa: E501 + """Publish ad order # noqa: E501 + + When publishing or editing an advertisement, trade_tips and auto_reply go through off-platform traffic diversion risk control; when hit, the advertisement is not saved, and code 70305102 with data.risk_event is returned. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_books_place_biz_push_order(place_biz_push_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param PlaceBizPushOrder place_biz_push_order: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pMerchantBooksPlaceBizPushOrderResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_books_place_biz_push_order_with_http_info(place_biz_push_order, **kwargs) # noqa: E501 + + def p2p_merchant_books_place_biz_push_order_with_http_info(self, place_biz_push_order, **kwargs): # noqa: E501 + """Publish ad order # noqa: E501 + + When publishing or editing an advertisement, trade_tips and auto_reply go through off-platform traffic diversion risk control; when hit, the advertisement is not saved, and code 70305102 with data.risk_event is returned. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_books_place_biz_push_order_with_http_info(place_biz_push_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param PlaceBizPushOrder place_biz_push_order: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pMerchantBooksPlaceBizPushOrderResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'place_biz_push_order' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_books_place_biz_push_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'place_biz_push_order' is set + if self.api_client.client_side_validation and ('place_biz_push_order' not in local_var_params or # noqa: E501 + local_var_params['place_biz_push_order'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `place_biz_push_order` when calling `p2p_merchant_books_place_biz_push_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'place_biz_push_order' in local_var_params: + body_params = local_var_params['place_biz_push_order'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/books/place_biz_push_order', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pMerchantBooksPlaceBizPushOrderResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_books_ads_update_status(self, ads_update_status, **kwargs): # noqa: E501 + """Update ad status # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_books_ads_update_status(ads_update_status, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AdsUpdateStatus ads_update_status: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pAdsUpdateStatusResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_books_ads_update_status_with_http_info(ads_update_status, **kwargs) # noqa: E501 + + def p2p_merchant_books_ads_update_status_with_http_info(self, ads_update_status, **kwargs): # noqa: E501 + """Update ad status # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_books_ads_update_status_with_http_info(ads_update_status, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AdsUpdateStatus ads_update_status: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pAdsUpdateStatusResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'ads_update_status' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_books_ads_update_status" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'ads_update_status' is set + if self.api_client.client_side_validation and ('ads_update_status' not in local_var_params or # noqa: E501 + local_var_params['ads_update_status'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `ads_update_status` when calling `p2p_merchant_books_ads_update_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'ads_update_status' in local_var_params: + body_params = local_var_params['ads_update_status'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/books/ads_update_status', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pAdsUpdateStatusResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_books_ads_detail(self, ads_detail_request, **kwargs): # noqa: E501 + """Query ad details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_books_ads_detail(ads_detail_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AdsDetailRequest ads_detail_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pAdDetailResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_books_ads_detail_with_http_info(ads_detail_request, **kwargs) # noqa: E501 + + def p2p_merchant_books_ads_detail_with_http_info(self, ads_detail_request, **kwargs): # noqa: E501 + """Query ad details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_books_ads_detail_with_http_info(ads_detail_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AdsDetailRequest ads_detail_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pAdDetailResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'ads_detail_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_books_ads_detail" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'ads_detail_request' is set + if self.api_client.client_side_validation and ('ads_detail_request' not in local_var_params or # noqa: E501 + local_var_params['ads_detail_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `ads_detail_request` when calling `p2p_merchant_books_ads_detail`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'ads_detail_request' in local_var_params: + body_params = local_var_params['ads_detail_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/books/ads_detail', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pAdDetailResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_books_my_ads_list(self, **kwargs): # noqa: E501 + """Get my ad list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_books_my_ads_list(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param MyAdsListRequest my_ads_list_request: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pMyAdsListResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_books_my_ads_list_with_http_info(**kwargs) # noqa: E501 + + def p2p_merchant_books_my_ads_list_with_http_info(self, **kwargs): # noqa: E501 + """Get my ad list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_books_my_ads_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param MyAdsListRequest my_ads_list_request: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pMyAdsListResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'my_ads_list_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_books_my_ads_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'my_ads_list_request' in local_var_params: + body_params = local_var_params['my_ads_list_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/books/my_ads_list', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pMyAdsListResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_books_ads_list(self, ads_list_request, **kwargs): # noqa: E501 + """Get Advertisement List # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_books_ads_list(ads_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AdsListRequest ads_list_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pAdsListResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_books_ads_list_with_http_info(ads_list_request, **kwargs) # noqa: E501 + + def p2p_merchant_books_ads_list_with_http_info(self, ads_list_request, **kwargs): # noqa: E501 + """Get Advertisement List # noqa: E501 + + Project-Id-Version: GateApiTools 1.0.0 Report-Msgid-Bugs-To: EMAIL@ADDRESS POT-Creation-Date: 2025-11-12 18:14+0800 PO-Revision-Date: 2019-01-02 17:30+0800 Last-Translator: FULL NAME Language: en Language-Team: en Plural-Forms: nplurals=2; plural=(n !=1) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Generated-By: Babel 2.8.0 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_books_ads_list_with_http_info(ads_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param AdsListRequest ads_list_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pAdsListResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'ads_list_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_books_ads_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'ads_list_request' is set + if self.api_client.client_side_validation and ('ads_list_request' not in local_var_params or # noqa: E501 + local_var_params['ads_list_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `ads_list_request` when calling `p2p_merchant_books_ads_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'ads_list_request' in local_var_params: + body_params = local_var_params['ads_list_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/books/ads_list', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pAdsListResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_chat_get_chats_list(self, get_chats_list_request, **kwargs): # noqa: E501 + """Get chat history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_chat_get_chats_list(get_chats_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetChatsListRequest get_chats_list_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pChatListResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_chat_get_chats_list_with_http_info(get_chats_list_request, **kwargs) # noqa: E501 + + def p2p_merchant_chat_get_chats_list_with_http_info(self, get_chats_list_request, **kwargs): # noqa: E501 + """Get chat history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_chat_get_chats_list_with_http_info(get_chats_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param GetChatsListRequest get_chats_list_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pChatListResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'get_chats_list_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_chat_get_chats_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'get_chats_list_request' is set + if self.api_client.client_side_validation and ('get_chats_list_request' not in local_var_params or # noqa: E501 + local_var_params['get_chats_list_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `get_chats_list_request` when calling `p2p_merchant_chat_get_chats_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'get_chats_list_request' in local_var_params: + body_params = local_var_params['get_chats_list_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/chat/get_chats_list', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pChatListResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_chat_send_chat_message(self, send_chat_message_request, **kwargs): # noqa: E501 + """Send text message # noqa: E501 + + Text messages go through off-platform traffic diversion risk control. When hit, the API still returns code 0, and data contains risk_type=1 and toast_msg. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_chat_send_chat_message(send_chat_message_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SendChatMessageRequest send_chat_message_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pSendChatMessageResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_chat_send_chat_message_with_http_info(send_chat_message_request, **kwargs) # noqa: E501 + + def p2p_merchant_chat_send_chat_message_with_http_info(self, send_chat_message_request, **kwargs): # noqa: E501 + """Send text message # noqa: E501 + + Text messages go through off-platform traffic diversion risk control. When hit, the API still returns code 0, and data contains risk_type=1 and toast_msg. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_chat_send_chat_message_with_http_info(send_chat_message_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SendChatMessageRequest send_chat_message_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pSendChatMessageResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'send_chat_message_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_chat_send_chat_message" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'send_chat_message_request' is set + if self.api_client.client_side_validation and ('send_chat_message_request' not in local_var_params or # noqa: E501 + local_var_params['send_chat_message_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `send_chat_message_request` when calling `p2p_merchant_chat_send_chat_message`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'send_chat_message_request' in local_var_params: + body_params = local_var_params['send_chat_message_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/chat/send_chat_message', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pSendChatMessageResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def p2p_merchant_chat_upload_chat_file(self, upload_chat_file, **kwargs): # noqa: E501 + """Upload chat file # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_chat_upload_chat_file(upload_chat_file, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UploadChatFile upload_chat_file: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.P2pUploadChatFileResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.p2p_merchant_chat_upload_chat_file_with_http_info(upload_chat_file, **kwargs) # noqa: E501 + + def p2p_merchant_chat_upload_chat_file_with_http_info(self, upload_chat_file, **kwargs): # noqa: E501 + """Upload chat file # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.p2p_merchant_chat_upload_chat_file_with_http_info(upload_chat_file, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UploadChatFile upload_chat_file: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.P2pUploadChatFileResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'upload_chat_file' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method p2p_merchant_chat_upload_chat_file" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'upload_chat_file' is set + if self.api_client.client_side_validation and ('upload_chat_file' not in local_var_params or # noqa: E501 + local_var_params['upload_chat_file'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `upload_chat_file` when calling `p2p_merchant_chat_upload_chat_file`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'upload_chat_file' in local_var_params: + body_params = local_var_params['upload_chat_file'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/p2p/merchant/chat/upload_chat_file', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='P2pUploadChatFileResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/rebate_api.py b/gate_api/api/rebate_api.py index f04f15e2..fdc202f8 100644 --- a/gate_api/api/rebate_api.py +++ b/gate_api/api/rebate_api.py @@ -48,7 +48,7 @@ def agency_transaction_history(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Specify the trading pair. If not specified, returns all trading pairs :param int user_id: User ID. If not specified, all user records will be returned - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -78,7 +78,7 @@ def agency_transaction_history_with_http_info(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Specify the trading pair. If not specified, returns all trading pairs :param int user_id: User ID. If not specified, all user records will be returned - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -190,7 +190,7 @@ def agency_commissions_history(self, **kwargs): # noqa: E501 :param str currency: Specify the currency. If not specified, returns all currencies :param int commission_type: Rebate type: 1 - Direct rebate, 2 - Indirect rebate, 3 - Self rebate :param int user_id: User ID. If not specified, all user records will be returned - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -221,7 +221,7 @@ def agency_commissions_history_with_http_info(self, **kwargs): # noqa: E501 :param str currency: Specify the currency. If not specified, returns all currencies :param int commission_type: Rebate type: 1 - Direct rebate, 2 - Indirect rebate, 3 - Self rebate :param int user_id: User ID. If not specified, all user records will be returned - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -335,7 +335,7 @@ def partner_transaction_history(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Specify the trading pair. If not specified, returns all trading pairs :param int user_id: User ID. If not specified, all user records will be returned - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -365,7 +365,7 @@ def partner_transaction_history_with_http_info(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Specify the trading pair. If not specified, returns all trading pairs :param int user_id: User ID. If not specified, all user records will be returned - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -476,7 +476,7 @@ def partner_commissions_history(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency: Specify the currency. If not specified, returns all currencies :param int user_id: User ID. If not specified, all user records will be returned - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -506,7 +506,7 @@ def partner_commissions_history_with_http_info(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency: Specify the currency. If not specified, returns all currencies :param int user_id: User ID. If not specified, all user records will be returned - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -889,7 +889,7 @@ def rebate_broker_transaction_history(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.BrokerTransaction] + :rtype: list[gate_api.BrokerTransactionHistory] :return: If the method is called asynchronously, returns the request thread. """ @@ -920,7 +920,7 @@ def rebate_broker_transaction_history_with_http_info(self, **kwargs): # noqa: E number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.BrokerTransaction], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.BrokerTransactionHistory], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -995,7 +995,7 @@ def rebate_broker_transaction_history_with_http_info(self, **kwargs): # noqa: E body=body_params, post_params=form_params, files=local_var_files, - response_type='list[BrokerTransaction]', # noqa: E501 + response_type='list[BrokerTransactionHistory]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -1219,3 +1219,337 @@ def user_sub_relation_with_http_info(self, user_id_list, **kwargs): # noqa: E50 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def get_partner_application_recent(self, **kwargs): # noqa: E501 + """Get recent partner application records # noqa: E501 + + Get the current user's recent partner application records. This endpoint returns application records within the last 30 days, including application status, review information, application materials, and other details. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_partner_application_recent(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.PartnerApplicationResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_partner_application_recent_with_http_info(**kwargs) # noqa: E501 + + def get_partner_application_recent_with_http_info(self, **kwargs): # noqa: E501 + """Get recent partner application records # noqa: E501 + + Get the current user's recent partner application records. This endpoint returns application records within the last 30 days, including application status, review information, application materials, and other details. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_partner_application_recent_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.PartnerApplicationResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_partner_application_recent" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/rebate/partner/applications/recent', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PartnerApplicationResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_partner_eligibility(self, **kwargs): # noqa: E501 + """Check partner application eligibility # noqa: E501 + + Check whether the current user is eligible to apply as a partner. This endpoint checks multiple conditions: account status (banned or not), whether it is a sub-account, whether already a partner, KYC verification status, whether under another agent's referral chain, whether on the blacklist, and other business rule restrictions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_partner_eligibility(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.EligibilityResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_partner_eligibility_with_http_info(**kwargs) # noqa: E501 + + def get_partner_eligibility_with_http_info(self, **kwargs): # noqa: E501 + """Check partner application eligibility # noqa: E501 + + Check whether the current user is eligible to apply as a partner. This endpoint checks multiple conditions: account status (banned or not), whether it is a sub-account, whether already a partner, KYC verification status, whether under another agent's referral chain, whether on the blacklist, and other business rule restrictions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_partner_eligibility_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.EligibilityResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_partner_eligibility" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/rebate/partner/eligibility', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EligibilityResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_partner_agent_data_aggregated(self, **kwargs): # noqa: E501 + """Aggregated partner agent statistics # noqa: E501 + + Query aggregated partner-agent statistics for a time range, including rebate amount, trading volume, net fee, customer count, and trading user count. **Notes:** - `trading_user_count` is only returned when `business_type=0` (All). - Time parameters use UTC+8. - If no time range is passed, the last 7 days are queried by default. - Partner agents only; sub-accounts are not allowed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_partner_agent_data_aggregated(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str start_date: Query start time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the start of the last 7 days. + :param str end_date: Query end time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the end of the last 7 days. + :param int business_type: Business type filter: - 0: All (default) - 1: Spot - 2: Futures - 3: Alpha - 4: Web3 - 5: Perps (DEX) - 6: Exchange All - 7: Web3 All - 8: TradFi + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.PartnerDataAggregatedResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_partner_agent_data_aggregated_with_http_info(**kwargs) # noqa: E501 + + def get_partner_agent_data_aggregated_with_http_info(self, **kwargs): # noqa: E501 + """Aggregated partner agent statistics # noqa: E501 + + Query aggregated partner-agent statistics for a time range, including rebate amount, trading volume, net fee, customer count, and trading user count. **Notes:** - `trading_user_count` is only returned when `business_type=0` (All). - Time parameters use UTC+8. - If no time range is passed, the last 7 days are queried by default. - Partner agents only; sub-accounts are not allowed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_partner_agent_data_aggregated_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str start_date: Query start time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the start of the last 7 days. + :param str end_date: Query end time, format: yyyy-mm-dd hh:ii:ss (UTC+8). If omitted, defaults to the end of the last 7 days. + :param int business_type: Business type filter: - 0: All (default) - 1: Spot - 2: Futures - 3: Alpha - 4: Web3 - 5: Perps (DEX) - 6: Exchange All - 7: Web3 All - 8: TradFi + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.PartnerDataAggregatedResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'start_date', + 'end_date', + 'business_type' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_partner_agent_data_aggregated" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if self.api_client.client_side_validation and 'start_date' in local_var_params and not re.search(r'^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$', local_var_params['start_date']): # noqa: E501 + raise ApiValueError("Invalid value for parameter `start_date` when calling `get_partner_agent_data_aggregated`, must conform to the pattern `/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/`") # noqa: E501 + if self.api_client.client_side_validation and 'end_date' in local_var_params and not re.search(r'^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$', local_var_params['end_date']): # noqa: E501 + raise ApiValueError("Invalid value for parameter `end_date` when calling `get_partner_agent_data_aggregated`, must conform to the pattern `/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'start_date' in local_var_params and local_var_params['start_date'] is not None: # noqa: E501 + query_params.append(('start_date', local_var_params['start_date'])) # noqa: E501 + if 'end_date' in local_var_params and local_var_params['end_date'] is not None: # noqa: E501 + query_params.append(('end_date', local_var_params['end_date'])) # noqa: E501 + if 'business_type' in local_var_params and local_var_params['business_type'] is not None: # noqa: E501 + query_params.append(('business_type', local_var_params['business_type'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/rebate/partner/data/aggregated', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PartnerDataAggregatedResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/spot_api.py b/gate_api/api/spot_api.py index 69277c90..7fc02ecb 100644 --- a/gate_api/api/spot_api.py +++ b/gate_api/api/spot_api.py @@ -594,7 +594,7 @@ def list_order_book(self, currency_pair, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Currency pair (required) - :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param str interval: Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 :param int limit: Number of depth levels :param bool with_id: Return order book update ID :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -622,7 +622,7 @@ def list_order_book_with_http_info(self, currency_pair, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency_pair: Currency pair (required) - :param str interval: Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified + :param str interval: Price precision for merged depth. 0 means no merging. If not specified, defaults to 0 :param int limit: Number of depth levels :param bool with_id: Return order book update ID :param _return_http_data_only: response data without head status code @@ -867,7 +867,7 @@ def list_trades_with_http_info(self, currency_pair, **kwargs): # noqa: E501 def list_candlesticks(self, currency_pair, **kwargs): # noqa: E501 """Market K-line chart # noqa: E501 - Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval # noqa: E501 + K-line chart data returns a maximum of 1000 points per request. When specifying from, to, and interval, ensure the number of points is not excessive # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_candlesticks(currency_pair, async_req=True) @@ -896,7 +896,7 @@ def list_candlesticks(self, currency_pair, **kwargs): # noqa: E501 def list_candlesticks_with_http_info(self, currency_pair, **kwargs): # noqa: E501 """Market K-line chart # noqa: E501 - Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval # noqa: E501 + K-line chart data returns a maximum of 1000 points per request. When specifying from, to, and interval, ensure the number of points is not excessive # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_candlesticks_with_http_info(currency_pair, async_req=True) @@ -1222,114 +1222,6 @@ def get_batch_spot_fee_with_http_info(self, currency_pairs, **kwargs): # noqa: _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_spot_accounts(self, **kwargs): # noqa: E501 - """List spot trading accounts # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_spot_accounts(async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Query by specified currency name - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :rtype: list[gate_api.SpotAccount] - :return: If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.list_spot_accounts_with_http_info(**kwargs) # noqa: E501 - - def list_spot_accounts_with_http_info(self, **kwargs): # noqa: E501 - """List spot trading accounts # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_spot_accounts_with_http_info(async_req=True) - >>> result = thread.get() - - :param bool async_req: execute request asynchronously - :param str currency: Query by specified currency name - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :rtype: tuple(list[gate_api.SpotAccount], status_code(int), headers(HTTPHeaderDict)) - :return: If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = [ - 'currency' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout' - ] - ) - - for k, v in six.iteritems(local_var_params['kwargs']): - if k not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_spot_accounts" % k - ) - local_var_params[k] = v - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 - query_params.append(('currency', local_var_params['currency'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['apiv4'] # noqa: E501 - - return self.api_client.call_api( - '/spot/accounts', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[SpotAccount]', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - def list_spot_account_book(self, **kwargs): # noqa: E501 """Query spot account transaction history # noqa: E501 @@ -2003,7 +1895,7 @@ def list_orders_with_http_info(self, currency_pair, status, **kwargs): # noqa: collection_formats=collection_formats) def create_order(self, order, **kwargs): # noqa: E501 - """Create an order # noqa: E501 + """Create order # noqa: E501 Supports spot, margin, leverage, and cross-margin leverage orders. Use different accounts through the `account` field. Default is `spot`, which means using the spot account to place orders. If the user has a `unified` account, the default is to place orders with the unified account. When using leveraged account trading (i.e., when `account` is set to `margin`), you can set `auto_borrow` to `true`. In case of insufficient account balance, the system will automatically execute `POST /margin/uni/loans` to borrow the insufficient amount. Whether assets obtained after leveraged order execution are automatically used to repay borrowing orders of the isolated margin account depends on the automatic repayment settings of the user's isolated margin account. Account automatic repayment settings can be queried and set through `/margin/auto_repay`. When using unified account trading (i.e., when `account` is set to `unified`), `auto_borrow` can also be enabled to realize automatic borrowing of insufficient amounts. However, unlike the isolated margin account, whether unified account orders are automatically repaid depends on the `auto_repay` setting when placing the order. This setting only applies to the current order, meaning only assets obtained after order execution will be used to repay borrowing orders of the cross-margin account. Unified account ordering currently supports enabling both `auto_borrow` and `auto_repay` simultaneously. Auto repayment will be triggered when the order ends, i.e., when `status` is `cancelled` or `closed`. **Order Status** The order status in pending orders is `open`, which remains `open` until all quantity is filled. If fully filled, the order ends and status becomes `closed`. If the order is cancelled before all transactions are completed, regardless of partial fills, the status will become `cancelled`. **Iceberg Orders** `iceberg` is used to set the displayed quantity of iceberg orders and does not support complete hiding. Note that hidden portions are charged according to the taker's fee rate. **Self-Trade Prevention** Set `stp_act` to determine the self-trade prevention strategy to use # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -2029,7 +1921,7 @@ def create_order(self, order, **kwargs): # noqa: E501 return self.create_order_with_http_info(order, **kwargs) # noqa: E501 def create_order_with_http_info(self, order, **kwargs): # noqa: E501 - """Create an order # noqa: E501 + """Create order # noqa: E501 Supports spot, margin, leverage, and cross-margin leverage orders. Use different accounts through the `account` field. Default is `spot`, which means using the spot account to place orders. If the user has a `unified` account, the default is to place orders with the unified account. When using leveraged account trading (i.e., when `account` is set to `margin`), you can set `auto_borrow` to `true`. In case of insufficient account balance, the system will automatically execute `POST /margin/uni/loans` to borrow the insufficient amount. Whether assets obtained after leveraged order execution are automatically used to repay borrowing orders of the isolated margin account depends on the automatic repayment settings of the user's isolated margin account. Account automatic repayment settings can be queried and set through `/margin/auto_repay`. When using unified account trading (i.e., when `account` is set to `unified`), `auto_borrow` can also be enabled to realize automatic borrowing of insufficient amounts. However, unlike the isolated margin account, whether unified account orders are automatically repaid depends on the `auto_repay` setting when placing the order. This setting only applies to the current order, meaning only assets obtained after order execution will be used to repay borrowing orders of the cross-margin account. Unified account ordering currently supports enabling both `auto_borrow` and `auto_repay` simultaneously. Auto repayment will be triggered when the order ends, i.e., when `status` is `cancelled` or `closed`. **Order Status** The order status in pending orders is `open`, which remains `open` until all quantity is filled. If fully filled, the order ends and status becomes `closed`. If the order is cancelled before all transactions are completed, regardless of partial fills, the status will become `cancelled`. **Iceberg Orders** `iceberg` is used to set the displayed quantity of iceberg orders and does not support complete hiding. Note that hidden portions are charged according to the taker's fee rate. **Self-Trade Prevention** Set `stp_act` to determine the self-trade prevention strategy to use # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -2789,7 +2681,7 @@ def amend_order_with_http_info(self, order_id, order_patch, **kwargs): # noqa: def list_my_trades(self, **kwargs): # noqa: E501 """Query personal trading records # noqa: E501 - By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts. The history within a specified time range can be queried by specifying `from` or (and) `to`. - If no time parameters are specified, only data for the last 7 days can be obtained. - If only any parameter of `from` or `to` is specified, only 7-day data from the start (or end) of the specified time is returned. - The range not allowed to exceed 30 days. The parameters of the time range filter are processed according to the order end time. The maximum number of pages when searching data using limit&page paging function is 100,0, that is, limit * (page - 1) <= 100,0. # noqa: E501 + By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts. The history within a specified time range can be queried by specifying `from` or (and) `to`. - If no time parameters are specified, only data for the last 7 days can be obtained. - If only any parameter of `from` or `to` is specified, only 7-day data from the start (or end) of the specified time is returned. - The range not allowed to exceed 30 days. The parameters of the time range filter are processed according to the order end time. The maximum number of pages when searching data using limit&page paging function is 100,000, that is, limit * (page - 1) <= 100,000. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_my_trades(async_req=True) @@ -2820,7 +2712,7 @@ def list_my_trades(self, **kwargs): # noqa: E501 def list_my_trades_with_http_info(self, **kwargs): # noqa: E501 """Query personal trading records # noqa: E501 - By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts. The history within a specified time range can be queried by specifying `from` or (and) `to`. - If no time parameters are specified, only data for the last 7 days can be obtained. - If only any parameter of `from` or `to` is specified, only 7-day data from the start (or end) of the specified time is returned. - The range not allowed to exceed 30 days. The parameters of the time range filter are processed according to the order end time. The maximum number of pages when searching data using limit&page paging function is 100,0, that is, limit * (page - 1) <= 100,0. # noqa: E501 + By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts. The history within a specified time range can be queried by specifying `from` or (and) `to`. - If no time parameters are specified, only data for the last 7 days can be obtained. - If only any parameter of `from` or `to` is specified, only 7-day data from the start (or end) of the specified time is returned. - The range not allowed to exceed 30 days. The parameters of the time range filter are processed according to the order end time. The maximum number of pages when searching data using limit&page paging function is 100,000, that is, limit * (page - 1) <= 100,000. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_my_trades_with_http_info(async_req=True) @@ -4021,3 +3913,591 @@ def cancel_spot_price_triggered_order_with_http_info(self, order_id, **kwargs): _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def list_spot_pov_orders(self, status, **kwargs): # noqa: E501 + """List Spot POV orders # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_spot_pov_orders(status, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str status: Order status. Defaults to open - open: Active orders - finished: Finished orders (required) + :param str currency_pair: Currency pair + :param str side: Specify all bids or all asks, both included if not specified + :param int page: Page number, up to 100 + :param int limit: Maximum number of records returned in a single list + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.SpotPovOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_spot_pov_orders_with_http_info(status, **kwargs) # noqa: E501 + + def list_spot_pov_orders_with_http_info(self, status, **kwargs): # noqa: E501 + """List Spot POV orders # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_spot_pov_orders_with_http_info(status, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str status: Order status. Defaults to open - open: Active orders - finished: Finished orders (required) + :param str currency_pair: Currency pair + :param str side: Specify all bids or all asks, both included if not specified + :param int page: Page number, up to 100 + :param int limit: Maximum number of records returned in a single list + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.SpotPovOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'status', + 'currency_pair', + 'side', + 'page', + 'limit' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_spot_pov_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'status' is set + if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 + local_var_params['status'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `status` when calling `list_spot_pov_orders`") # noqa: E501 + + if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page` when calling `list_spot_pov_orders`, must be a value less than or equal to `100`") # noqa: E501 + if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page` when calling `list_spot_pov_orders`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_spot_pov_orders`, must be a value less than or equal to `1000`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_spot_pov_orders`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currency_pair' in local_var_params and local_var_params['currency_pair'] is not None: # noqa: E501 + query_params.append(('currency_pair', local_var_params['currency_pair'])) # noqa: E501 + if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + query_params.append(('status', local_var_params['status'])) # noqa: E501 + if 'side' in local_var_params and local_var_params['side'] is not None: # noqa: E501 + query_params.append(('side', local_var_params['side'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/spot/pov_orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SpotPovOrder]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_spot_pov_order(self, spot_pov_order_creator, **kwargs): # noqa: E501 + """Create a Spot POV order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_spot_pov_order(spot_pov_order_creator, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SpotPovOrderCreator spot_pov_order_creator: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.SpotPovOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_spot_pov_order_with_http_info(spot_pov_order_creator, **kwargs) # noqa: E501 + + def create_spot_pov_order_with_http_info(self, spot_pov_order_creator, **kwargs): # noqa: E501 + """Create a Spot POV order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_spot_pov_order_with_http_info(spot_pov_order_creator, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param SpotPovOrderCreator spot_pov_order_creator: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.SpotPovOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'spot_pov_order_creator' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_spot_pov_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'spot_pov_order_creator' is set + if self.api_client.client_side_validation and ('spot_pov_order_creator' not in local_var_params or # noqa: E501 + local_var_params['spot_pov_order_creator'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `spot_pov_order_creator` when calling `create_spot_pov_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'spot_pov_order_creator' in local_var_params: + body_params = local_var_params['spot_pov_order_creator'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/spot/pov_orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SpotPovOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def cancel_spot_pov_orders(self, **kwargs): # noqa: E501 + """Cancel Spot POV orders # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_spot_pov_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Currency pair + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.SpotPovOrder] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_spot_pov_orders_with_http_info(**kwargs) # noqa: E501 + + def cancel_spot_pov_orders_with_http_info(self, **kwargs): # noqa: E501 + """Cancel Spot POV orders # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_spot_pov_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency_pair: Currency pair + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.SpotPovOrder], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'currency_pair' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_spot_pov_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currency_pair' in local_var_params and local_var_params['currency_pair'] is not None: # noqa: E501 + query_params.append(('currency_pair', local_var_params['currency_pair'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/spot/pov_orders/cancel', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SpotPovOrder]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_spot_pov_order(self, order_id, **kwargs): # noqa: E501 + """Query Spot POV order details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_spot_pov_order(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: The order ID returned after successful creation, or the custom ID specified by the user in the `text` field. (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.SpotPovOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_spot_pov_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def get_spot_pov_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Query Spot POV order details # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_spot_pov_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: The order ID returned after successful creation, or the custom ID specified by the user in the `text` field. (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.SpotPovOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_spot_pov_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `get_spot_pov_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/spot/pov_orders/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SpotPovOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def cancel_spot_pov_order(self, order_id, **kwargs): # noqa: E501 + """Cancel a Spot POV order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_spot_pov_order(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: The order ID returned after successful creation, or the custom ID specified by the user in the `text` field. (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.SpotPovOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_spot_pov_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def cancel_spot_pov_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Cancel a Spot POV order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_spot_pov_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str order_id: The order ID returned after successful creation, or the custom ID specified by the user in the `text` field. (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.SpotPovOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_spot_pov_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `cancel_spot_pov_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/spot/pov_orders/{order_id}/cancel', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SpotPovOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/square_api.py b/gate_api/api/square_api.py new file mode 100644 index 00000000..0ac823af --- /dev/null +++ b/gate_api/api/square_api.py @@ -0,0 +1,307 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class SquareApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def list_square_ai_search(self, **kwargs): # noqa: E501 + """AI MCP Dynamic Search # noqa: E501 + + Dynamic search endpoint for AI MCP platform. All parameters are passed via query string. Returns simplified fields. Designed for LLM function calling / MCP tool scenarios. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_square_ai_search(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str keyword: Search keyword (currency name or content keyword, e.g., BTC, ETH) + :param str currency: Filter by currency (exact currency code, e.g., BTC, ETH, SOL) + :param int time_range: Time range: 0 = unlimited (default), 1 = last day, 2 = last week, 3 = last month + :param int sort: Sort order: 0 = most popular (default), 1 = latest + :param int limit: Return count, 1-50, default 10 + :param int page: Page number + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ListSquareAiSearchResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_square_ai_search_with_http_info(**kwargs) # noqa: E501 + + def list_square_ai_search_with_http_info(self, **kwargs): # noqa: E501 + """AI MCP Dynamic Search # noqa: E501 + + Dynamic search endpoint for AI MCP platform. All parameters are passed via query string. Returns simplified fields. Designed for LLM function calling / MCP tool scenarios. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_square_ai_search_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str keyword: Search keyword (currency name or content keyword, e.g., BTC, ETH) + :param str currency: Filter by currency (exact currency code, e.g., BTC, ETH, SOL) + :param int time_range: Time range: 0 = unlimited (default), 1 = last day, 2 = last week, 3 = last month + :param int sort: Sort order: 0 = most popular (default), 1 = latest + :param int limit: Return count, 1-50, default 10 + :param int page: Page number + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ListSquareAiSearchResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'keyword', + 'currency', + 'time_range', + 'sort', + 'limit', + 'page' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_square_ai_search" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 50: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_square_ai_search`, must be a value less than or equal to `50`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_square_ai_search`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page` when calling `list_square_ai_search`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'keyword' in local_var_params and local_var_params['keyword'] is not None: # noqa: E501 + query_params.append(('keyword', local_var_params['keyword'])) # noqa: E501 + if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 + query_params.append(('currency', local_var_params['currency'])) # noqa: E501 + if 'time_range' in local_var_params and local_var_params['time_range'] is not None: # noqa: E501 + query_params.append(('time_range', local_var_params['time_range'])) # noqa: E501 + if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 + query_params.append(('sort', local_var_params['sort'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/social/message/search', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListSquareAiSearchResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_live_replay(self, **kwargs): # noqa: E501 + """Gate AI Assistant live stream data retrieval # noqa: E501 + + AI assistant live stream/replay search endpoint. Filters live rooms or replay videos by business tags and currency. Each record in the returned list is distinguished by content_type: streaming = live broadcast (live field has value), video = replay video (video field has value). The number of results is controlled by the limit parameter (max 10), no additional pagination needed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_live_replay(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str tag: Business type filter. Available values: Market Analysis, Hot Topics, Blockchain, Others + :param str coin: Filter by currency name (e.g., BTC, ETH) + :param str sort: Sort order: hot = most popular (default), new = latest + :param int limit: Return count, 1-10, default 3 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ListLiveReplayResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_live_replay_with_http_info(**kwargs) # noqa: E501 + + def list_live_replay_with_http_info(self, **kwargs): # noqa: E501 + """Gate AI Assistant live stream data retrieval # noqa: E501 + + AI assistant live stream/replay search endpoint. Filters live rooms or replay videos by business tags and currency. Each record in the returned list is distinguished by content_type: streaming = live broadcast (live field has value), video = replay video (video field has value). The number of results is controlled by the limit parameter (max 10), no additional pagination needed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_live_replay_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str tag: Business type filter. Available values: Market Analysis, Hot Topics, Blockchain, Others + :param str coin: Filter by currency name (e.g., BTC, ETH) + :param str sort: Sort order: hot = most popular (default), new = latest + :param int limit: Return count, 1-10, default 3 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ListLiveReplayResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'tag', + 'coin', + 'sort', + 'limit' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_live_replay" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 10: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_live_replay`, must be a value less than or equal to `10`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_live_replay`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'tag' in local_var_params and local_var_params['tag'] is not None: # noqa: E501 + query_params.append(('tag', local_var_params['tag'])) # noqa: E501 + if 'coin' in local_var_params and local_var_params['coin'] is not None: # noqa: E501 + query_params.append(('coin', local_var_params['coin'])) # noqa: E501 + if 'sort' in local_var_params and local_var_params['sort'] is not None: # noqa: E501 + query_params.append(('sort', local_var_params['sort'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/social/live/tag_coin_live_replay', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListLiveReplayResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/stock_api.py b/gate_api/api/stock_api.py new file mode 100644 index 00000000..a5a8bd0e --- /dev/null +++ b/gate_api/api/stock_api.py @@ -0,0 +1,1947 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class StockApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def query_stock_user_assets(self, **kwargs): # noqa: E501 + """Query user assets # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_user_assets(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int pnl_calc_type: PnL calculation cost type. Defaults to average cost price when omitted (1 = average cost price, 2 = diluted cost price) + :param int pnl_calc_price: PnL calculation price type. Defaults to intraday price when omitted (1 = intraday price, 2 = latest extended-hours price) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.UserAssetResp2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_stock_user_assets_with_http_info(**kwargs) # noqa: E501 + + def query_stock_user_assets_with_http_info(self, **kwargs): # noqa: E501 + """Query user assets # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_user_assets_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int pnl_calc_type: PnL calculation cost type. Defaults to average cost price when omitted (1 = average cost price, 2 = diluted cost price) + :param int pnl_calc_price: PnL calculation price type. Defaults to intraday price when omitted (1 = intraday price, 2 = latest extended-hours price) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.UserAssetResp2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'pnl_calc_type', + 'pnl_calc_price' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_stock_user_assets" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'pnl_calc_type' in local_var_params and local_var_params['pnl_calc_type'] is not None: # noqa: E501 + query_params.append(('pnl_calc_type', local_var_params['pnl_calc_type'])) # noqa: E501 + if 'pnl_calc_price' in local_var_params and local_var_params['pnl_calc_price'] is not None: # noqa: E501 + query_params.append(('pnl_calc_price', local_var_params['pnl_calc_price'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/users/assets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserAssetResp2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_stock_symbols(self, **kwargs): # noqa: E501 + """Query symbol list # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_symbols(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Symbol list, multiple separated by commas + :param str exchange: Exchange, supports us, hk, and kr + :param bool with_desc_i18n: Whether to return multilingual symbol description + :param int page: Page number, defaults to 1 + :param int page_size: Page size, defaults to 10, max 500; server caps at 500 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.Symbols2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_stock_symbols_with_http_info(**kwargs) # noqa: E501 + + def query_stock_symbols_with_http_info(self, **kwargs): # noqa: E501 + """Query symbol list # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_symbols_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Symbol list, multiple separated by commas + :param str exchange: Exchange, supports us, hk, and kr + :param bool with_desc_i18n: Whether to return multilingual symbol description + :param int page: Page number, defaults to 1 + :param int page_size: Page size, defaults to 10, max 500; server caps at 500 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.Symbols2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbols', + 'exchange', + 'with_desc_i18n', + 'page', + 'page_size' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_stock_symbols" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params['page_size'] > 500: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page_size` when calling `query_stock_symbols`, must be a value less than or equal to `500`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbols' in local_var_params and local_var_params['symbols'] is not None: # noqa: E501 + query_params.append(('symbols', local_var_params['symbols'])) # noqa: E501 + if 'exchange' in local_var_params and local_var_params['exchange'] is not None: # noqa: E501 + query_params.append(('exchange', local_var_params['exchange'])) # noqa: E501 + if 'with_desc_i18n' in local_var_params and local_var_params['with_desc_i18n'] is not None: # noqa: E501 + query_params.append(('with_desc_i18n', local_var_params['with_desc_i18n'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/stock/symbols', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Symbols2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_stock_symbol_detail(self, **kwargs): # noqa: E501 + """Query symbol details # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_symbol_detail(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Symbol list, multiple separated by commas + :param str exchange: Exchange, supports us, hk, and kr + :param int page: Page number, defaults to 1 + :param int page_size: Page size, defaults to 10, max 500; server caps at 500 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.SymbolDetail + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_stock_symbol_detail_with_http_info(**kwargs) # noqa: E501 + + def query_stock_symbol_detail_with_http_info(self, **kwargs): # noqa: E501 + """Query symbol details # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_symbol_detail_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbols: Symbol list, multiple separated by commas + :param str exchange: Exchange, supports us, hk, and kr + :param int page: Page number, defaults to 1 + :param int page_size: Page size, defaults to 10, max 500; server caps at 500 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.SymbolDetail, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbols', + 'exchange', + 'page', + 'page_size' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_stock_symbol_detail" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params['page_size'] > 500: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page_size` when calling `query_stock_symbol_detail`, must be a value less than or equal to `500`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbols' in local_var_params and local_var_params['symbols'] is not None: # noqa: E501 + query_params.append(('symbols', local_var_params['symbols'])) # noqa: E501 + if 'exchange' in local_var_params and local_var_params['exchange'] is not None: # noqa: E501 + query_params.append(('exchange', local_var_params['exchange'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/stock/symbols/detail', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SymbolDetail', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_stock_order_book(self, symbol, **kwargs): # noqa: E501 + """Query market order book # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_order_book(symbol, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Symbol (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OrderBook2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_stock_order_book_with_http_info(symbol, **kwargs) # noqa: E501 + + def query_stock_order_book_with_http_info(self, symbol, **kwargs): # noqa: E501 + """Query market order book # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_order_book_with_http_info(symbol, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Symbol (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OrderBook2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_stock_order_book" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'symbol' is set + if self.api_client.client_side_validation and ('symbol' not in local_var_params or # noqa: E501 + local_var_params['symbol'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `symbol` when calling `query_stock_order_book`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'symbol' in local_var_params: + path_params['symbol'] = local_var_params['symbol'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/stock/market/{symbol}/orderbook', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OrderBook2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_stock_order_list(self, **kwargs): # noqa: E501 + """Query open order list # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_order_list(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Symbol + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OrderList2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_stock_order_list_with_http_info(**kwargs) # noqa: E501 + + def query_stock_order_list_with_http_info(self, **kwargs): # noqa: E501 + """Query open order list # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_order_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Symbol + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OrderList2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_stock_order_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/orders', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OrderList2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_stock_order(self, trad_fi_spot_order_request, **kwargs): # noqa: E501 + """Create order # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_stock_order(trad_fi_spot_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param TradFiSpotOrderRequest trad_fi_spot_order_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CreateOrder2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_stock_order_with_http_info(trad_fi_spot_order_request, **kwargs) # noqa: E501 + + def create_stock_order_with_http_info(self, trad_fi_spot_order_request, **kwargs): # noqa: E501 + """Create order # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_stock_order_with_http_info(trad_fi_spot_order_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param TradFiSpotOrderRequest trad_fi_spot_order_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CreateOrder2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'trad_fi_spot_order_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_stock_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'trad_fi_spot_order_request' is set + if self.api_client.client_side_validation and ('trad_fi_spot_order_request' not in local_var_params or # noqa: E501 + local_var_params['trad_fi_spot_order_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `trad_fi_spot_order_request` when calling `create_stock_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'trad_fi_spot_order_request' in local_var_params: + body_params = local_var_params['trad_fi_spot_order_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/orders', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateOrder2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_all_stock_orders(self, **kwargs): # noqa: E501 + """Cancel all open orders # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_all_stock_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.DeleteOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.delete_all_stock_orders_with_http_info(**kwargs) # noqa: E501 + + def delete_all_stock_orders_with_http_info(self, **kwargs): # noqa: E501 + """Cancel all open orders # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_all_stock_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.DeleteOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_all_stock_orders" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/orders', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeleteOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_stock_order_history(self, **kwargs): # noqa: E501 + """Query historical order list # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_order_history(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Symbol + :param str order_ids: Order ID list, multiple separated by commas; max 20, each must be a positive integer + :param int begin_time: Start time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. + :param int end_time: End time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. + :param int side: Side (1=sell, 2=buy) + :param int page: Page number, defaults to 1 + :param int page_size: Page size, defaults to 10, max 500; server caps at 500 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.OrderHistoryList2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_stock_order_history_with_http_info(**kwargs) # noqa: E501 + + def query_stock_order_history_with_http_info(self, **kwargs): # noqa: E501 + """Query historical order list # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_order_history_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str symbol: Symbol + :param str order_ids: Order ID list, multiple separated by commas; max 20, each must be a positive integer + :param int begin_time: Start time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. + :param int end_time: End time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. + :param int side: Side (1=sell, 2=buy) + :param int page: Page number, defaults to 1 + :param int page_size: Page size, defaults to 10, max 500; server caps at 500 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.OrderHistoryList2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'symbol', + 'order_ids', + 'begin_time', + 'end_time', + 'side', + 'page', + 'page_size' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_stock_order_history" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params['page_size'] > 500: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page_size` when calling `query_stock_order_history`, must be a value less than or equal to `500`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if 'order_ids' in local_var_params and local_var_params['order_ids'] is not None: # noqa: E501 + query_params.append(('order_ids', local_var_params['order_ids'])) # noqa: E501 + if 'begin_time' in local_var_params and local_var_params['begin_time'] is not None: # noqa: E501 + query_params.append(('begin_time', local_var_params['begin_time'])) # noqa: E501 + if 'end_time' in local_var_params and local_var_params['end_time'] is not None: # noqa: E501 + query_params.append(('end_time', local_var_params['end_time'])) # noqa: E501 + if 'side' in local_var_params and local_var_params['side'] is not None: # noqa: E501 + query_params.append(('side', local_var_params['side'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/orders/history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OrderHistoryList2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_stock_order(self, order_id, trad_fi_spot_order_update_request, **kwargs): # noqa: E501 + """Modify order # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_stock_order(order_id, trad_fi_spot_order_update_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID (required) + :param TradFiSpotOrderUpdateRequest trad_fi_spot_order_update_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.UpdateOrder2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.update_stock_order_with_http_info(order_id, trad_fi_spot_order_update_request, **kwargs) # noqa: E501 + + def update_stock_order_with_http_info(self, order_id, trad_fi_spot_order_update_request, **kwargs): # noqa: E501 + """Modify order # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_stock_order_with_http_info(order_id, trad_fi_spot_order_update_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID (required) + :param TradFiSpotOrderUpdateRequest trad_fi_spot_order_update_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.UpdateOrder2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id', + 'trad_fi_spot_order_update_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method update_stock_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `update_stock_order`") # noqa: E501 + # verify the required parameter 'trad_fi_spot_order_update_request' is set + if self.api_client.client_side_validation and ('trad_fi_spot_order_update_request' not in local_var_params or # noqa: E501 + local_var_params['trad_fi_spot_order_update_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `trad_fi_spot_order_update_request` when calling `update_stock_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'trad_fi_spot_order_update_request' in local_var_params: + body_params = local_var_params['trad_fi_spot_order_update_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/orders/{order_id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UpdateOrder2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_stock_order(self, order_id, **kwargs): # noqa: E501 + """Cancel order # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_stock_order(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.DeleteOrder + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.delete_stock_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def delete_stock_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Cancel order # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_stock_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.DeleteOrder, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'order_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_stock_order" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `order_id` when calling `delete_stock_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/orders/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeleteOrder', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_stock_positions(self, **kwargs): # noqa: E501 + """Query current position list # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_positions(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int pnl_calc_type: PnL calculation cost type. Defaults to average cost price when omitted (1 = average cost price, 2 = diluted cost price) + :param int pnl_calc_price: PnL calculation price type. Defaults to intraday price when omitted (1 = intraday price, 2 = latest extended-hours price) + :param str symbol: Symbol + :param str exchange: Exchange, supports us, hk, and kr + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.PositionList2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_stock_positions_with_http_info(**kwargs) # noqa: E501 + + def query_stock_positions_with_http_info(self, **kwargs): # noqa: E501 + """Query current position list # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_positions_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int pnl_calc_type: PnL calculation cost type. Defaults to average cost price when omitted (1 = average cost price, 2 = diluted cost price) + :param int pnl_calc_price: PnL calculation price type. Defaults to intraday price when omitted (1 = intraday price, 2 = latest extended-hours price) + :param str symbol: Symbol + :param str exchange: Exchange, supports us, hk, and kr + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.PositionList2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'pnl_calc_type', + 'pnl_calc_price', + 'symbol', + 'exchange' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_stock_positions" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'pnl_calc_type' in local_var_params and local_var_params['pnl_calc_type'] is not None: # noqa: E501 + query_params.append(('pnl_calc_type', local_var_params['pnl_calc_type'])) # noqa: E501 + if 'pnl_calc_price' in local_var_params and local_var_params['pnl_calc_price'] is not None: # noqa: E501 + query_params.append(('pnl_calc_price', local_var_params['pnl_calc_price'])) # noqa: E501 + if 'symbol' in local_var_params and local_var_params['symbol'] is not None: # noqa: E501 + query_params.append(('symbol', local_var_params['symbol'])) # noqa: E501 + if 'exchange' in local_var_params and local_var_params['exchange'] is not None: # noqa: E501 + query_params.append(('exchange', local_var_params['exchange'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/positions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PositionList2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def close_stock_position(self, trad_fi_spot_close_position_request, **kwargs): # noqa: E501 + """Close position # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.close_stock_position(trad_fi_spot_close_position_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param TradFiSpotClosePositionRequest trad_fi_spot_close_position_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ClosePosition + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.close_stock_position_with_http_info(trad_fi_spot_close_position_request, **kwargs) # noqa: E501 + + def close_stock_position_with_http_info(self, trad_fi_spot_close_position_request, **kwargs): # noqa: E501 + """Close position # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.close_stock_position_with_http_info(trad_fi_spot_close_position_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param TradFiSpotClosePositionRequest trad_fi_spot_close_position_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ClosePosition, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'trad_fi_spot_close_position_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method close_stock_position" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'trad_fi_spot_close_position_request' is set + if self.api_client.client_side_validation and ('trad_fi_spot_close_position_request' not in local_var_params or # noqa: E501 + local_var_params['trad_fi_spot_close_position_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `trad_fi_spot_close_position_request` when calling `close_stock_position`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'trad_fi_spot_close_position_request' in local_var_params: + body_params = local_var_params['trad_fi_spot_close_position_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/positions/close', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ClosePosition', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_stock_transactions(self, **kwargs): # noqa: E501 + """Query transaction records # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_transactions(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int begin_time: Start time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. + :param int end_time: End time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. + :param str ref_id: Business idempotent ID. When ref_id is provided, the server queries by ref_id, ignoring other parameters such as begin_time, end_time, type, page, page_size + :param str type: Transaction type + :param int page: Page number, defaults to 1 + :param int page_size: Page size, defaults to 10, max 500; server caps at 500 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.TransactionList2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_stock_transactions_with_http_info(**kwargs) # noqa: E501 + + def query_stock_transactions_with_http_info(self, **kwargs): # noqa: E501 + """Query transaction records # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_transactions_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int begin_time: Start time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. + :param int end_time: End time (Unix timestamp, seconds). When both begin_time and end_time are provided, end_time must be >= begin_time, query range must not exceed 3 months. + :param str ref_id: Business idempotent ID. When ref_id is provided, the server queries by ref_id, ignoring other parameters such as begin_time, end_time, type, page, page_size + :param str type: Transaction type + :param int page: Page number, defaults to 1 + :param int page_size: Page size, defaults to 10, max 500; server caps at 500 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.TransactionList2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'begin_time', + 'end_time', + 'ref_id', + 'type', + 'page', + 'page_size' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_stock_transactions" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if self.api_client.client_side_validation and 'page_size' in local_var_params and local_var_params['page_size'] > 500: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page_size` when calling `query_stock_transactions`, must be a value less than or equal to `500`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'begin_time' in local_var_params and local_var_params['begin_time'] is not None: # noqa: E501 + query_params.append(('begin_time', local_var_params['begin_time'])) # noqa: E501 + if 'end_time' in local_var_params and local_var_params['end_time'] is not None: # noqa: E501 + query_params.append(('end_time', local_var_params['end_time'])) # noqa: E501 + if 'ref_id' in local_var_params and local_var_params['ref_id'] is not None: # noqa: E501 + query_params.append(('ref_id', local_var_params['ref_id'])) # noqa: E501 + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'page_size' in local_var_params and local_var_params['page_size'] is not None: # noqa: E501 + query_params.append(('page_size', local_var_params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/transactions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TransactionList2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_stock_transaction(self, trad_fi_spot_transaction_request, **kwargs): # noqa: E501 + """Fund transfer # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_stock_transaction(trad_fi_spot_transaction_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param TradFiSpotTransactionRequest trad_fi_spot_transaction_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.CreateTransaction2 + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_stock_transaction_with_http_info(trad_fi_spot_transaction_request, **kwargs) # noqa: E501 + + def create_stock_transaction_with_http_info(self, trad_fi_spot_transaction_request, **kwargs): # noqa: E501 + """Fund transfer # noqa: E501 + + Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_stock_transaction_with_http_info(trad_fi_spot_transaction_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param TradFiSpotTransactionRequest trad_fi_spot_transaction_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.CreateTransaction2, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'trad_fi_spot_transaction_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_stock_transaction" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'trad_fi_spot_transaction_request' is set + if self.api_client.client_side_validation and ('trad_fi_spot_transaction_request' not in local_var_params or # noqa: E501 + local_var_params['trad_fi_spot_transaction_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `trad_fi_spot_transaction_request` when calling `create_stock_transaction`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'trad_fi_spot_transaction_request' in local_var_params: + body_params = local_var_params['trad_fi_spot_transaction_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/stock/transactions', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateTransaction2', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_stock_exchanges(self, **kwargs): # noqa: E501 + """Query supported exchanges # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_exchanges(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.Exchanges + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_stock_exchanges_with_http_info(**kwargs) # noqa: E501 + + def query_stock_exchanges_with_http_info(self, **kwargs): # noqa: E501 + """Query supported exchanges # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_exchanges_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.Exchanges, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_stock_exchanges" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/stock/exchanges', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Exchanges', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def query_stock_fee_rate(self, **kwargs): # noqa: E501 + """Query fee rates for Japanese and Korean stocks # noqa: E501 + + Query fee rates for Japanese and Korean stocks. Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_fee_rate(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.FeeRate + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.query_stock_fee_rate_with_http_info(**kwargs) # noqa: E501 + + def query_stock_fee_rate_with_http_info(self, **kwargs): # noqa: E501 + """Query fee rates for Japanese and Korean stocks # noqa: E501 + + Query fee rates for Japanese and Korean stocks. Rate limit: 5 qps. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.query_stock_fee_rate_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.FeeRate, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method query_stock_fee_rate" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/stock/fee-rate', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='FeeRate', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/unified_api.py b/gate_api/api/unified_api.py index d9436353..349ab0cb 100644 --- a/gate_api/api/unified_api.py +++ b/gate_api/api/unified_api.py @@ -504,7 +504,7 @@ def get_unified_borrowable_list(self, currencies, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.UnifiedBorrowable1] + :rtype: list[gate_api.UnifiedBorrowable] :return: If the method is called asynchronously, returns the request thread. """ @@ -530,7 +530,7 @@ def get_unified_borrowable_list_with_http_info(self, currencies, **kwargs): # n number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.UnifiedBorrowable1], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.UnifiedBorrowable], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -598,7 +598,7 @@ def get_unified_borrowable_list_with_http_info(self, currencies, **kwargs): # n body=body_params, post_params=form_params, files=local_var_files, - response_type='list[UnifiedBorrowable1]', # noqa: E501 + response_type='list[UnifiedBorrowable]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -1775,7 +1775,7 @@ def list_loan_margin_tiers_with_http_info(self, **kwargs): # noqa: E501 def calculate_portfolio_margin(self, unified_portfolio_input, **kwargs): # noqa: E501 """Portfolio margin calculator # noqa: E501 - Portfolio Margin Calculator When inputting simulated position portfolios, each position includes the position name and quantity held, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. When inputting simulated orders, each order includes the market identifier, order price, and order quantity, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. Market orders are not included. # noqa: E501 + Portfolio Margin Calculator This interface calculates maintenance and initial margin requirements under the portfolio margin model for custom simulated position and order portfolios. It currently supports all underlying currencies with active options trading. Each simulated position requires a name and holding quantity; each simulated pending order requires a market identifier, price, and quantity. Market orders are not supported. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.calculate_portfolio_margin(unified_portfolio_input, async_req=True) @@ -1800,7 +1800,7 @@ def calculate_portfolio_margin(self, unified_portfolio_input, **kwargs): # noqa def calculate_portfolio_margin_with_http_info(self, unified_portfolio_input, **kwargs): # noqa: E501 """Portfolio margin calculator # noqa: E501 - Portfolio Margin Calculator When inputting simulated position portfolios, each position includes the position name and quantity held, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. When inputting simulated orders, each order includes the market identifier, order price, and order quantity, supporting markets within the range of BTC and ETH perpetual contracts, options, and spot markets. Market orders are not included. # noqa: E501 + Portfolio Margin Calculator This interface calculates maintenance and initial margin requirements under the portfolio margin model for custom simulated position and order portfolios. It currently supports all underlying currencies with active options trading. Each simulated position requires a name and holding quantity; each simulated pending order requires a market identifier, price, and quantity. Market orders are not supported. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.calculate_portfolio_margin_with_http_info(unified_portfolio_input, async_req=True) @@ -1890,6 +1890,124 @@ def calculate_portfolio_margin_with_http_info(self, unified_portfolio_input, **k _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + def set_user_leverage(self, user_leverage_setting, **kwargs): # noqa: E501 + """Set leverage for all of the user's borrowed currencies # noqa: E501 + + Note the following: - Leverage cannot be changed for currencies with outstanding loans. - A leverage value above a currency's limit is capped at that limit. - Failures are not rolled back and affect only the currencies that failed. For example, if USDT has an outstanding loan, only the USDT leverage remains unchanged. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_user_leverage(user_leverage_setting, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UserLeverageSetting user_leverage_setting: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: list[gate_api.LeverageFailedCurrencies] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.set_user_leverage_with_http_info(user_leverage_setting, **kwargs) # noqa: E501 + + def set_user_leverage_with_http_info(self, user_leverage_setting, **kwargs): # noqa: E501 + """Set leverage for all of the user's borrowed currencies # noqa: E501 + + Note the following: - Leverage cannot be changed for currencies with outstanding loans. - A leverage value above a currency's limit is capped at that limit. - Failures are not rolled back and affect only the currencies that failed. For example, if USDT has an outstanding loan, only the USDT leverage remains unchanged. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_user_leverage_with_http_info(user_leverage_setting, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UserLeverageSetting user_leverage_setting: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(list[gate_api.LeverageFailedCurrencies], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'user_leverage_setting' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_user_leverage" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'user_leverage_setting' is set + if self.api_client.client_side_validation and ('user_leverage_setting' not in local_var_params or # noqa: E501 + local_var_params['user_leverage_setting'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `user_leverage_setting` when calling `set_user_leverage`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'user_leverage_setting' in local_var_params: + body_params = local_var_params['user_leverage_setting'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/leverage/user_setting', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[LeverageFailedCurrencies]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + def get_user_leverage_currency_config(self, currency, **kwargs): # noqa: E501 """Maximum and minimum currency leverage that can be set # noqa: E501 @@ -2580,3 +2698,447 @@ def set_unified_collateral_with_http_info(self, unified_collateral_req, **kwargs _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def get_estimated_quick_repayment(self, **kwargs): # noqa: E501 + """Estimated quick repayment details # noqa: E501 + + Available for unified account cross-currency margin mode and portfolio margin mode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_estimated_quick_repayment(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.QuickEstimatedRepayment + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_estimated_quick_repayment_with_http_info(**kwargs) # noqa: E501 + + def get_estimated_quick_repayment_with_http_info(self, **kwargs): # noqa: E501 + """Estimated quick repayment details # noqa: E501 + + Available for unified account cross-currency margin mode and portfolio margin mode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_estimated_quick_repayment_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.QuickEstimatedRepayment, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_estimated_quick_repayment" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/estimated_quick_repayment', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='QuickEstimatedRepayment', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_quick_repayment(self, quick_repayment_request, **kwargs): # noqa: E501 + """Quick repayment # noqa: E501 + + Available for unified account cross-currency margin mode and portfolio margin mode. Use `GET /unified/estimated_quick_repayment` to query liabilities and pending repayment information. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_quick_repayment(quick_repayment_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param QuickRepaymentRequest quick_repayment_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.QuickRepaymentResponse + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_quick_repayment_with_http_info(quick_repayment_request, **kwargs) # noqa: E501 + + def create_quick_repayment_with_http_info(self, quick_repayment_request, **kwargs): # noqa: E501 + """Quick repayment # noqa: E501 + + Available for unified account cross-currency margin mode and portfolio margin mode. Use `GET /unified/estimated_quick_repayment` to query liabilities and pending repayment information. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_quick_repayment_with_http_info(quick_repayment_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param QuickRepaymentRequest quick_repayment_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.QuickRepaymentResponse, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'quick_repayment_request' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_quick_repayment" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'quick_repayment_request' is set + if self.api_client.client_side_validation and ('quick_repayment_request' not in local_var_params or # noqa: E501 + local_var_params['quick_repayment_request'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `quick_repayment_request` when calling `create_quick_repayment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'quick_repayment_request' in local_var_params: + body_params = local_var_params['quick_repayment_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/quick_repayment', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='QuickRepaymentResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_unified_delta_neutral(self, **kwargs): # noqa: E501 + """Query the account Delta-neutral strategy mode setting # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_unified_delta_neutral(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.DeltaNeutralEnabled + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_unified_delta_neutral_with_http_info(**kwargs) # noqa: E501 + + def get_unified_delta_neutral_with_http_info(self, **kwargs): # noqa: E501 + """Query the account Delta-neutral strategy mode setting # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_unified_delta_neutral_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.DeltaNeutralEnabled, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_unified_delta_neutral" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/delta_neutral', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeltaNeutralEnabled', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def set_unified_delta_neutral(self, delta_neutral_enabled, **kwargs): # noqa: E501 + """Set the account Delta-neutral strategy mode # noqa: E501 + + Enable or disable the account Delta-neutral strategy mode. Requirements for enabling: VIP level >= 4 and the account is in cross-currency margin mode; otherwise 403 is returned. Returns the enabled status after the setting takes effect. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_unified_delta_neutral(delta_neutral_enabled, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param DeltaNeutralEnabled delta_neutral_enabled: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.DeltaNeutralEnabled + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.set_unified_delta_neutral_with_http_info(delta_neutral_enabled, **kwargs) # noqa: E501 + + def set_unified_delta_neutral_with_http_info(self, delta_neutral_enabled, **kwargs): # noqa: E501 + """Set the account Delta-neutral strategy mode # noqa: E501 + + Enable or disable the account Delta-neutral strategy mode. Requirements for enabling: VIP level >= 4 and the account is in cross-currency margin mode; otherwise 403 is returned. Returns the enabled status after the setting takes effect. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_unified_delta_neutral_with_http_info(delta_neutral_enabled, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param DeltaNeutralEnabled delta_neutral_enabled: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.DeltaNeutralEnabled, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'delta_neutral_enabled' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_unified_delta_neutral" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'delta_neutral_enabled' is set + if self.api_client.client_side_validation and ('delta_neutral_enabled' not in local_var_params or # noqa: E501 + local_var_params['delta_neutral_enabled'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `delta_neutral_enabled` when calling `set_unified_delta_neutral`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'delta_neutral_enabled' in local_var_params: + body_params = local_var_params['delta_neutral_enabled'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/delta_neutral', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeltaNeutralEnabled', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api/wallet_api.py b/gate_api/api/wallet_api.py index 5766d058..1c2f2f6e 100644 --- a/gate_api/api/wallet_api.py +++ b/gate_api/api/wallet_api.py @@ -276,7 +276,7 @@ def list_withdrawals(self, **kwargs): # noqa: E501 :param str withdraw_id: Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled :param str asset_class: Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone :param str withdraw_order_id: User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -308,7 +308,7 @@ def list_withdrawals_with_http_info(self, **kwargs): # noqa: E501 :param str withdraw_id: Withdrawal record ID starts with 'w', such as: w1879219868. When withdraw_id is not empty, only this specific withdrawal record will be queried, and time-based querying will be disabled :param str asset_class: Currency type of withdrawal record, empty by default. Supports querying withdrawal records in main zone and innovation zone on demand. Value range: SPOT, PILOT SPOT: Main Zone PILOT: Innovation Zone :param str withdraw_order_id: User-defined order number for withdrawal. Default is empty. When not empty, the specified user-defined order number record will be queried - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -424,7 +424,7 @@ def list_deposits(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency: Specify the currency. If not specified, returns all currencies - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of entries returned in the list, limited to 500 transactions :param int offset: List offset, starting from 0 @@ -453,7 +453,7 @@ def list_deposits_with_http_info(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str currency: Specify the currency. If not specified, returns all currencies - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of entries returned in the list, limited to 500 transactions :param int offset: List offset, starting from 0 @@ -549,6 +549,120 @@ def list_deposits_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + def get_transfer(self, tx_id, **kwargs): # noqa: E501 + """Get trading account transfer # noqa: E501 + + Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transfer(tx_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str tx_id: Transfer transaction ID (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.AccountTransferDetail + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_transfer_with_http_info(tx_id, **kwargs) # noqa: E501 + + def get_transfer_with_http_info(self, tx_id, **kwargs): # noqa: E501 + """Get trading account transfer # noqa: E501 + + Get the current user's trading account transfer details using the tx_id returned by the transfer endpoint # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_transfer_with_http_info(tx_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str tx_id: Transfer transaction ID (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.AccountTransferDetail, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'tx_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_transfer" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'tx_id' is set + if self.api_client.client_side_validation and ('tx_id' not in local_var_params or # noqa: E501 + local_var_params['tx_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `tx_id` when calling `get_transfer`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'tx_id' in local_var_params and local_var_params['tx_id'] is not None: # noqa: E501 + query_params.append(('tx_id', local_var_params['tx_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/wallet/transfers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AccountTransferDetail', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + def transfer(self, transfer, **kwargs): # noqa: E501 """Transfer between trading accounts # noqa: E501 @@ -678,7 +792,7 @@ def list_sub_account_transfers(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str sub_uid: Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -707,7 +821,7 @@ def list_sub_account_transfers_with_http_info(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str sub_uid: Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts - :param int _from: Start time for querying records, defaults to 7 days before current time if not specified + :param int _from: Start time for querying records. If not specified, defaults to 7 days before current time :param int to: End timestamp for the query, defaults to current time if not specified :param int limit: Maximum number of records returned in a single list :param int offset: List offset, starting from 0 @@ -1040,9 +1154,9 @@ def sub_account_to_sub_account_with_http_info(self, sub_account_to_sub_account, collection_formats=collection_formats) def get_transfer_order_status(self, **kwargs): # noqa: E501 - """Transfer status query # noqa: E501 + """Main-Sub Account Transfer Status Query # noqa: E501 - Supports querying transfer status based on user-defined client_order_id or tx_id returned by the transfer interface # noqa: E501 + Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_transfer_order_status(async_req=True) @@ -1066,9 +1180,9 @@ def get_transfer_order_status(self, **kwargs): # noqa: E501 return self.get_transfer_order_status_with_http_info(**kwargs) # noqa: E501 def get_transfer_order_status_with_http_info(self, **kwargs): # noqa: E501 - """Transfer status query # noqa: E501 + """Main-Sub Account Transfer Status Query # noqa: E501 - Supports querying transfer status based on user-defined client_order_id or tx_id returned by the transfer interface # noqa: E501 + Supports querying Main-Sub Account Transfer Status based on user-defined client_order_id or tx_id returned by the transfer interface # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_transfer_order_status_with_http_info(async_req=True) @@ -1274,6 +1388,8 @@ def list_sub_account_balances(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str sub_uid: Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts + :param int page: Page number + :param int limit: Maximum number of records returned. Default 20, max 100. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1298,6 +1414,8 @@ def list_sub_account_balances_with_http_info(self, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str sub_uid: Sub-account user ID, you can query multiple records separated by `,`. If not specified, it will return records of all sub-accounts + :param int page: Page number + :param int limit: Maximum number of records returned. Default 20, max 100. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1315,7 +1433,9 @@ def list_sub_account_balances_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() all_params = [ - 'sub_uid' + 'sub_uid', + 'page', + 'limit' ] all_params.extend( [ @@ -1335,6 +1455,12 @@ def list_sub_account_balances_with_http_info(self, **kwargs): # noqa: E501 local_var_params[k] = v del local_var_params['kwargs'] + if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `page` when calling `list_sub_account_balances`, must be a value greater than or equal to `1`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_sub_account_balances`, must be a value less than or equal to `100`") # noqa: E501 + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 + raise ApiValueError("Invalid value for parameter `limit` when calling `list_sub_account_balances`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} path_params = {} @@ -1342,6 +1468,10 @@ def list_sub_account_balances_with_http_info(self, **kwargs): # noqa: E501 query_params = [] if 'sub_uid' in local_var_params and local_var_params['sub_uid'] is not None: # noqa: E501 query_params.append(('sub_uid', local_var_params['sub_uid'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 header_params = {} @@ -1701,19 +1831,20 @@ def list_sub_account_cross_margin_balances_with_http_info(self, **kwargs): # no _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_saved_address(self, currency, **kwargs): # noqa: E501 - """Query withdrawal address whitelist # noqa: E501 + def list_saved_address(self, **kwargs): # noqa: E501 + """Query saved address # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_saved_address(currency, async_req=True) + >>> thread = api.list_saved_address(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Currency (required) + :param str currency: Currency :param str chain: Chain name + :param str verified: 1 means verified address, 0 means normal address, empty string means no limit :param str limit: Maximum number returned, up to 100 - :param int page: Page number + :param int page: page number :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -1726,21 +1857,22 @@ def list_saved_address(self, currency, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.list_saved_address_with_http_info(currency, **kwargs) # noqa: E501 + return self.list_saved_address_with_http_info(**kwargs) # noqa: E501 - def list_saved_address_with_http_info(self, currency, **kwargs): # noqa: E501 - """Query withdrawal address whitelist # noqa: E501 + def list_saved_address_with_http_info(self, **kwargs): # noqa: E501 + """Query saved address # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_saved_address_with_http_info(currency, async_req=True) + >>> thread = api.list_saved_address_with_http_info(async_req=True) >>> result = thread.get() :param bool async_req: execute request asynchronously - :param str currency: Currency (required) + :param str currency: Currency :param str chain: Chain name + :param str verified: 1 means verified address, 0 means normal address, empty string means no limit :param str limit: Maximum number returned, up to 100 - :param int page: Page number + :param int page: page number :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -1760,6 +1892,7 @@ def list_saved_address_with_http_info(self, currency, **kwargs): # noqa: E501 all_params = [ 'currency', 'chain', + 'verified', 'limit', 'page' ] @@ -1780,10 +1913,6 @@ def list_saved_address_with_http_info(self, currency, **kwargs): # noqa: E501 ) local_var_params[k] = v del local_var_params['kwargs'] - # verify the required parameter 'currency' is set - if self.api_client.client_side_validation and ('currency' not in local_var_params or # noqa: E501 - local_var_params['currency'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `currency` when calling `list_saved_address`") # noqa: E501 if self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `page` when calling `list_saved_address`, must be a value greater than or equal to `1`") # noqa: E501 @@ -1796,6 +1925,8 @@ def list_saved_address_with_http_info(self, currency, **kwargs): # noqa: E501 query_params.append(('currency', local_var_params['currency'])) # noqa: E501 if 'chain' in local_var_params and local_var_params['chain'] is not None: # noqa: E501 query_params.append(('chain', local_var_params['chain'])) # noqa: E501 + if 'verified' in local_var_params and local_var_params['verified'] is not None: # noqa: E501 + query_params.append(('verified', local_var_params['verified'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 diff --git a/gate_api/api/welfare_api.py b/gate_api/api/welfare_api.py new file mode 100644 index 00000000..fcfaa782 --- /dev/null +++ b/gate_api/api/welfare_api.py @@ -0,0 +1,483 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class WelfareApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_user_identity(self, **kwargs): # noqa: E501 + """Get user identity # noqa: E501 + + Validate whether the user is eligible for new user rewards. Returns the corresponding error code on validation failure, data is an empty object on success. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_identity(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseExSkillGetUserIdentityResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_user_identity_with_http_info(**kwargs) # noqa: E501 + + def get_user_identity_with_http_info(self, **kwargs): # noqa: E501 + """Get user identity # noqa: E501 + + Validate whether the user is eligible for new user rewards. Returns the corresponding error code on validation failure, data is an empty object on success. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_identity_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseExSkillGetUserIdentityResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_identity" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/rewards/getUserIdentity', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseExSkillGetUserIdentityResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_beginner_task_list(self, **kwargs): # noqa: E501 + """Get beginner task list # noqa: E501 + + Get the current user's onboarding task list. By default, the registration tasks (type=10) and guidance tasks (type=11) that have been assigned to the current user are returned. The registration tasks are ranked first and the guidance tasks are ranked behind. When the user does not have a download task and the system determines that the user has not downloaded the app, a \"Download task to be received\" card will be dynamically added. Among them: - `task_type = 23` for download tasks - `status = 0` for download tasks to be collected Results are cached for 60 seconds. Task lists are limited in number (usually no more than 10) and do not require pagination. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_beginner_task_list(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseExSkillGetBeginnerTaskListResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_beginner_task_list_with_http_info(**kwargs) # noqa: E501 + + def get_beginner_task_list_with_http_info(self, **kwargs): # noqa: E501 + """Get beginner task list # noqa: E501 + + Get the current user's onboarding task list. By default, the registration tasks (type=10) and guidance tasks (type=11) that have been assigned to the current user are returned. The registration tasks are ranked first and the guidance tasks are ranked behind. When the user does not have a download task and the system determines that the user has not downloaded the app, a \"Download task to be received\" card will be dynamically added. Among them: - `task_type = 23` for download tasks - `status = 0` for download tasks to be collected Results are cached for 60 seconds. Task lists are limited in number (usually no more than 10) and do not require pagination. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_beginner_task_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseExSkillGetBeginnerTaskListResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beginner_task_list" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/rewards/getBeginnerTaskList', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseExSkillGetBeginnerTaskListResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def claim_task(self, ex_skill_claim_task_req, **kwargs): # noqa: E501 + """Get the task # noqa: E501 + + Receive a single welfare task. The current main scene is for new customer download tasks to be collected, but the interface itself supports new customer registration, guidance, and advanced task types. Processing flow: 1. Read the logged in user 2. Verify user qualifications 3. Risk control verification (event code `task_center`) 4. Verify task configuration and task center tasks 5. Verify whether there is an ongoing task 6. If it is a download task, verify whether the App has been downloaded 7. Write `welfare_user_tasks_xx` 8. Report to task center Risk control transparent transmission fields: - Old fields: `user_id`, `ip`, `const_id`, `is_async`, `action`, `task_id` - New fields: `req_method`, `traceid` - Among them: - `req_method` from `X-Gate-Request-Source` - `ip` from `X-Gate-Ip` - `traceid` from `X-Gate-Trace-Id` - `const_id` is fixed to an empty string # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.claim_task(ex_skill_claim_task_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ExSkillClaimTaskReq ex_skill_claim_task_req: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseExSkillClaimTaskResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.claim_task_with_http_info(ex_skill_claim_task_req, **kwargs) # noqa: E501 + + def claim_task_with_http_info(self, ex_skill_claim_task_req, **kwargs): # noqa: E501 + """Get the task # noqa: E501 + + Receive a single welfare task. The current main scene is for new customer download tasks to be collected, but the interface itself supports new customer registration, guidance, and advanced task types. Processing flow: 1. Read the logged in user 2. Verify user qualifications 3. Risk control verification (event code `task_center`) 4. Verify task configuration and task center tasks 5. Verify whether there is an ongoing task 6. If it is a download task, verify whether the App has been downloaded 7. Write `welfare_user_tasks_xx` 8. Report to task center Risk control transparent transmission fields: - Old fields: `user_id`, `ip`, `const_id`, `is_async`, `action`, `task_id` - New fields: `req_method`, `traceid` - Among them: - `req_method` from `X-Gate-Request-Source` - `ip` from `X-Gate-Ip` - `traceid` from `X-Gate-Trace-Id` - `const_id` is fixed to an empty string # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.claim_task_with_http_info(ex_skill_claim_task_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ExSkillClaimTaskReq ex_skill_claim_task_req: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseExSkillClaimTaskResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'ex_skill_claim_task_req' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method claim_task" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'ex_skill_claim_task_req' is set + if self.api_client.client_side_validation and ('ex_skill_claim_task_req' not in local_var_params or # noqa: E501 + local_var_params['ex_skill_claim_task_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `ex_skill_claim_task_req` when calling `claim_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'ex_skill_claim_task_req' in local_var_params: + body_params = local_var_params['ex_skill_claim_task_req'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/rewards/claimTask', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseExSkillClaimTaskResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + + def claim_reward(self, ex_skill_claim_reward_req, **kwargs): # noqa: E501 + """Receive mission rewards # noqa: E501 + + Receive rewards from a single welfare task. Processing flow: 1. Read the logged in user 2. Verify user qualifications 3. Query `welfare_user_tasks_xx` and require the task status to be `StatusDone(2)` 4. Risk control verification (event code `index_page_check`) 5. Query task details and reward information in the task center 6. If the reward is m and n is selected from the prize pool, then `has_m_n_task = true` will be returned and the reward will not be actually issued. 7. Ordinary rewards will enter the original reward collection logic of the Welfare Center Risk control transparent transmission fields: - Old fields: `user_id`, `ip`, `const_id`, `is_async` - New fields: `req_method`, `traceid` - Among them: - `req_method` from `X-Gate-Request-Source` - `ip` from `X-Gate-Ip` - `traceid` from `X-Gate-Trace-Id` - `const_id` is fixed to an empty string # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.claim_reward(ex_skill_claim_reward_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ExSkillClaimRewardReq ex_skill_claim_reward_req: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: gate_api.ApiResponseExSkillClaimRewardResp + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.claim_reward_with_http_info(ex_skill_claim_reward_req, **kwargs) # noqa: E501 + + def claim_reward_with_http_info(self, ex_skill_claim_reward_req, **kwargs): # noqa: E501 + """Receive mission rewards # noqa: E501 + + Receive rewards from a single welfare task. Processing flow: 1. Read the logged in user 2. Verify user qualifications 3. Query `welfare_user_tasks_xx` and require the task status to be `StatusDone(2)` 4. Risk control verification (event code `index_page_check`) 5. Query task details and reward information in the task center 6. If the reward is m and n is selected from the prize pool, then `has_m_n_task = true` will be returned and the reward will not be actually issued. 7. Ordinary rewards will enter the original reward collection logic of the Welfare Center Risk control transparent transmission fields: - Old fields: `user_id`, `ip`, `const_id`, `is_async` - New fields: `req_method`, `traceid` - Among them: - `req_method` from `X-Gate-Request-Source` - `ip` from `X-Gate-Ip` - `traceid` from `X-Gate-Trace-Id` - `const_id` is fixed to an empty string # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.claim_reward_with_http_info(ex_skill_claim_reward_req, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param ExSkillClaimRewardReq ex_skill_claim_reward_req: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :rtype: tuple(gate_api.ApiResponseExSkillClaimRewardResp, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'ex_skill_claim_reward_req' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method claim_reward" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'ex_skill_claim_reward_req' is set + if self.api_client.client_side_validation and ('ex_skill_claim_reward_req' not in local_var_params or # noqa: E501 + local_var_params['ex_skill_claim_reward_req'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `ex_skill_claim_reward_req` when calling `claim_reward`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'ex_skill_claim_reward_req' in local_var_params: + body_params = local_var_params['ex_skill_claim_reward_req'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/rewards/claimReward', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponseExSkillClaimRewardResp', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/gate_api/api_client.py b/gate_api/api_client.py index bd9750aa..c68f5102 100644 --- a/gate_api/api_client.py +++ b/gate_api/api_client.py @@ -83,7 +83,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/7.2.8/python' + self.user_agent = 'OpenAPI-Generator/7.2.123/python' # Set default X-Gate-Size-Decimal header for futures API self.default_headers['X-Gate-Size-Decimal'] = '1' self.client_side_validation = configuration.client_side_validation diff --git a/gate_api/configuration.py b/gate_api/configuration.py index f5c222a3..ff07ebc0 100644 --- a/gate_api/configuration.py +++ b/gate_api/configuration.py @@ -313,8 +313,8 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: v4.106.8\n"\ - "SDK Package Version: 7.2.8".\ + "Version of the API: v4.106.123\n"\ + "SDK Package Version: 7.2.123".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/gate_api/models/__init__.py b/gate_api/models/__init__.py index cde6ce93..dcb189a1 100644 --- a/gate_api/models/__init__.py +++ b/gate_api/models/__init__.py @@ -14,63 +14,195 @@ from __future__ import absolute_import # import models into model package +from gate_api.models.ai_hub_create_data import AIHubCreateData +from gate_api.models.ai_hub_create_success_response import AIHubCreateSuccessResponse +from gate_api.models.ai_hub_discover_data import AIHubDiscoverData +from gate_api.models.ai_hub_discover_success_response import AIHubDiscoverSuccessResponse +from gate_api.models.ai_hub_portfolio_base_info import AIHubPortfolioBaseInfo +from gate_api.models.ai_hub_portfolio_detail_data import AIHubPortfolioDetailData +from gate_api.models.ai_hub_portfolio_detail_success_response import AIHubPortfolioDetailSuccessResponse +from gate_api.models.ai_hub_portfolio_metrics import AIHubPortfolioMetrics +from gate_api.models.ai_hub_portfolio_position import AIHubPortfolioPosition +from gate_api.models.ai_hub_portfolio_running_data import AIHubPortfolioRunningData +from gate_api.models.ai_hub_portfolio_running_item import AIHubPortfolioRunningItem +from gate_api.models.ai_hub_portfolio_running_success_response import AIHubPortfolioRunningSuccessResponse +from gate_api.models.ai_hub_portfolio_stop_data import AIHubPortfolioStopData +from gate_api.models.ai_hub_portfolio_stop_request import AIHubPortfolioStopRequest +from gate_api.models.ai_hub_portfolio_stop_success_response import AIHubPortfolioStopSuccessResponse +from gate_api.models.ai_hub_recommendation import AIHubRecommendation from gate_api.models.account_balance import AccountBalance +from gate_api.models.account_book_response import AccountBookResponse from gate_api.models.account_detail import AccountDetail from gate_api.models.account_detail_key import AccountDetailKey from gate_api.models.account_key_info import AccountKeyInfo from gate_api.models.account_key_info_perms import AccountKeyInfoPerms from gate_api.models.account_rate_limit import AccountRateLimit +from gate_api.models.account_transfer_detail import AccountTransferDetail +from gate_api.models.accounts_response import AccountsResponse +from gate_api.models.ads_detail_request import AdsDetailRequest +from gate_api.models.ads_list_request import AdsListRequest +from gate_api.models.ads_update_status import AdsUpdateStatus from gate_api.models.agency_commission import AgencyCommission from gate_api.models.agency_commission_history import AgencyCommissionHistory from gate_api.models.agency_transaction import AgencyTransaction from gate_api.models.agency_transaction_history import AgencyTransactionHistory +from gate_api.models.alpha_currency import AlphaCurrency +from gate_api.models.alpha_ticker import AlphaTicker +from gate_api.models.amend_options_order_request import AmendOptionsOrderRequest +from gate_api.models.api_response_asset_swap_config import ApiResponseAssetSwapConfig +from gate_api.models.api_response_asset_swap_evaluate import ApiResponseAssetSwapEvaluate +from gate_api.models.api_response_asset_swap_list_assets import ApiResponseAssetSwapListAssets +from gate_api.models.api_response_asset_swap_order_create_v1 import ApiResponseAssetSwapOrderCreateV1 +from gate_api.models.api_response_asset_swap_order_list_v1 import ApiResponseAssetSwapOrderListV1 +from gate_api.models.api_response_asset_swap_order_preview_v1 import ApiResponseAssetSwapOrderPreviewV1 +from gate_api.models.api_response_asset_swap_order_query_v1 import ApiResponseAssetSwapOrderQueryV1 +from gate_api.models.api_response_ex_skill_claim_reward_resp import ApiResponseExSkillClaimRewardResp +from gate_api.models.api_response_ex_skill_claim_reward_resp_data import ApiResponseExSkillClaimRewardRespData +from gate_api.models.api_response_ex_skill_claim_task_resp import ApiResponseExSkillClaimTaskResp +from gate_api.models.api_response_ex_skill_get_beginner_task_list_resp import ApiResponseExSkillGetBeginnerTaskListResp +from gate_api.models.api_response_ex_skill_get_beginner_task_list_resp_data import ApiResponseExSkillGetBeginnerTaskListRespData +from gate_api.models.api_response_ex_skill_get_beginner_task_list_resp_data_tasks import ApiResponseExSkillGetBeginnerTaskListRespDataTasks +from gate_api.models.api_response_ex_skill_get_user_identity_resp import ApiResponseExSkillGetUserIdentityResp +from gate_api.models.asset_list_resp import AssetListResp +from gate_api.models.asset_swap_frontend import AssetSwapFrontend +from gate_api.models.auto_invest_coins_item import AutoInvestCoinsItem +from gate_api.models.auto_invest_config_item import AutoInvestConfigItem +from gate_api.models.auto_invest_min_invest_amount import AutoInvestMinInvestAmount +from gate_api.models.auto_invest_min_invest_amount_items import AutoInvestMinInvestAmountItems +from gate_api.models.auto_invest_min_invest_amount_resp import AutoInvestMinInvestAmountResp +from gate_api.models.auto_invest_order_item import AutoInvestOrderItem +from gate_api.models.auto_invest_plan_add_position import AutoInvestPlanAddPosition +from gate_api.models.auto_invest_plan_create import AutoInvestPlanCreate +from gate_api.models.auto_invest_plan_create_items import AutoInvestPlanCreateItems +from gate_api.models.auto_invest_plan_create_resp import AutoInvestPlanCreateResp +from gate_api.models.auto_invest_plan_detail import AutoInvestPlanDetail +from gate_api.models.auto_invest_plan_list_info_resp import AutoInvestPlanListInfoResp +from gate_api.models.auto_invest_plan_record_item import AutoInvestPlanRecordItem +from gate_api.models.auto_invest_plan_records_resp import AutoInvestPlanRecordsResp +from gate_api.models.auto_invest_plan_stop import AutoInvestPlanStop +from gate_api.models.auto_invest_plan_update import AutoInvestPlanUpdate +from gate_api.models.auto_invest_portfolio_item import AutoInvestPortfolioItem from gate_api.models.auto_repay_setting import AutoRepaySetting from gate_api.models.award_list_struct import AwardListStruct from gate_api.models.award_list_struct_list import AwardListStructList +from gate_api.models.base_response import BaseResponse from gate_api.models.batch_amend_item import BatchAmendItem from gate_api.models.batch_amend_order_req import BatchAmendOrderReq +from gate_api.models.batch_funding_rates_request import BatchFundingRatesRequest +from gate_api.models.batch_funding_rates_response import BatchFundingRatesResponse from gate_api.models.batch_futures_order import BatchFuturesOrder from gate_api.models.batch_order import BatchOrder from gate_api.models.borrow_currency_info import BorrowCurrencyInfo from gate_api.models.broker_commission import BrokerCommission -from gate_api.models.broker_commission1 import BrokerCommission1 +from gate_api.models.broker_commission_item import BrokerCommissionItem from gate_api.models.broker_commission_sub_broker_info import BrokerCommissionSubBrokerInfo from gate_api.models.broker_transaction import BrokerTransaction -from gate_api.models.broker_transaction1 import BrokerTransaction1 +from gate_api.models.broker_transaction_history import BrokerTransactionHistory from gate_api.models.cancel_batch_order import CancelBatchOrder +from gate_api.models.cancel_order import CancelOrder from gate_api.models.cancel_order_result import CancelOrderResult +from gate_api.models.categories import Categories +from gate_api.models.categories_data import CategoriesData +from gate_api.models.categories_data_list import CategoriesDataList +from gate_api.models.chase_order import ChaseOrder +from gate_api.models.claim_reward_error import ClaimRewardError +from gate_api.models.claim_task_error import ClaimTaskError +from gate_api.models.close_position import ClosePosition +from gate_api.models.close_position_data import ClosePositionData from gate_api.models.collateral_adjust import CollateralAdjust from gate_api.models.collateral_adjust_res import CollateralAdjustRes -from gate_api.models.collateral_align import CollateralAlign from gate_api.models.collateral_currency import CollateralCurrency from gate_api.models.collateral_currency_info import CollateralCurrencyInfo from gate_api.models.collateral_currency_res import CollateralCurrencyRes from gate_api.models.collateral_current_rate import CollateralCurrentRate from gate_api.models.collateral_fix_rate import CollateralFixRate -from gate_api.models.collateral_loan_currency import CollateralLoanCurrency from gate_api.models.collateral_ltv import CollateralLtv -from gate_api.models.collateral_order import CollateralOrder -from gate_api.models.collateral_record import CollateralRecord +from gate_api.models.confirm_payment import ConfirmPayment +from gate_api.models.confirm_receipt import ConfirmReceipt from gate_api.models.contract import Contract +from gate_api.models.contract_detail import ContractDetail +from gate_api.models.contract_detail_data import ContractDetailData +from gate_api.models.contract_detail_data_list import ContractDetailDataList +from gate_api.models.contract_martingale_create_params import ContractMartingaleCreateParams +from gate_api.models.contract_martingale_create_request import ContractMartingaleCreateRequest +from gate_api.models.contract_martingale_direction import ContractMartingaleDirection from gate_api.models.contract_stat import ContractStat +from gate_api.models.convert_currencies_v2_item import ConvertCurrenciesV2Item from gate_api.models.convert_small_balance import ConvertSmallBalance from gate_api.models.countdown_cancel_all_futures_task import CountdownCancelAllFuturesTask from gate_api.models.countdown_cancel_all_options_task import CountdownCancelAllOptionsTask from gate_api.models.countdown_cancel_all_spot_task import CountdownCancelAllSpotTask -from gate_api.models.create_collateral_order import CreateCollateralOrder +from gate_api.models.create_chase_order_req import CreateChaseOrderReq +from gate_api.models.create_chase_order_resp import CreateChaseOrderResp +from gate_api.models.create_earn_fixed_term_lend_response import CreateEarnFixedTermLendResponse +from gate_api.models.create_earn_fixed_term_lend_response_data import CreateEarnFixedTermLendResponseData +from gate_api.models.create_earn_fixed_term_pre_redeem_response import CreateEarnFixedTermPreRedeemResponse from gate_api.models.create_multi_collateral_order import CreateMultiCollateralOrder +from gate_api.models.create_order import CreateOrder +from gate_api.models.create_order2 import CreateOrder2 +from gate_api.models.create_order2_data import CreateOrder2Data +from gate_api.models.create_order_detail import CreateOrderDetail +from gate_api.models.create_param import CreateParam +from gate_api.models.create_trail_order import CreateTrailOrder +from gate_api.models.create_trail_order_response import CreateTrailOrderResponse +from gate_api.models.create_trail_order_result import CreateTrailOrderResult +from gate_api.models.create_transaction import CreateTransaction +from gate_api.models.create_transaction2 import CreateTransaction2 from gate_api.models.create_uni_lend import CreateUniLend from gate_api.models.create_uni_loan import CreateUniLoan +from gate_api.models.create_user_resp import CreateUserResp +from gate_api.models.create_user_resp_data import CreateUserRespData from gate_api.models.cross_margin_balance import CrossMarginBalance from gate_api.models.cross_margin_loan import CrossMarginLoan from gate_api.models.cross_margin_repayment import CrossMarginRepayment +from gate_api.models.crossex_account import CrossexAccount +from gate_api.models.crossex_account_asset import CrossexAccountAsset +from gate_api.models.crossex_account_book_record import CrossexAccountBookRecord +from gate_api.models.crossex_account_update_request import CrossexAccountUpdateRequest +from gate_api.models.crossex_account_update_response import CrossexAccountUpdateResponse +from gate_api.models.crossex_adl_rank import CrossexAdlRank +from gate_api.models.crossex_batch_cancel_order_request import CrossexBatchCancelOrderRequest +from gate_api.models.crossex_batch_cancel_order_response import CrossexBatchCancelOrderResponse +from gate_api.models.crossex_close_position_request import CrossexClosePositionRequest +from gate_api.models.crossex_coin_discount_rate import CrossexCoinDiscountRate +from gate_api.models.crossex_convert_order_request import CrossexConvertOrderRequest +from gate_api.models.crossex_convert_order_response import CrossexConvertOrderResponse +from gate_api.models.crossex_convert_quote_request import CrossexConvertQuoteRequest +from gate_api.models.crossex_convert_quote_response import CrossexConvertQuoteResponse +from gate_api.models.crossex_historical_margin_position import CrossexHistoricalMarginPosition +from gate_api.models.crossex_historical_position import CrossexHistoricalPosition +from gate_api.models.crossex_interest_rate import CrossexInterestRate +from gate_api.models.crossex_isolated_margin_request import CrossexIsolatedMarginRequest +from gate_api.models.crossex_isolated_margin_response import CrossexIsolatedMarginResponse +from gate_api.models.crossex_leverage_request import CrossexLeverageRequest +from gate_api.models.crossex_leverage_response import CrossexLeverageResponse +from gate_api.models.crossex_margin_interest_record import CrossexMarginInterestRecord +from gate_api.models.crossex_margin_mode_request import CrossexMarginModeRequest +from gate_api.models.crossex_margin_mode_response import CrossexMarginModeResponse +from gate_api.models.crossex_margin_position import CrossexMarginPosition +from gate_api.models.crossex_order import CrossexOrder +from gate_api.models.crossex_order_action_response import CrossexOrderActionResponse +from gate_api.models.crossex_order_request import CrossexOrderRequest +from gate_api.models.crossex_order_update_request import CrossexOrderUpdateRequest +from gate_api.models.crossex_position import CrossexPosition +from gate_api.models.crossex_risk_limit import CrossexRiskLimit +from gate_api.models.crossex_risk_limit_tier import CrossexRiskLimitTier +from gate_api.models.crossex_special_fee import CrossexSpecialFee +from gate_api.models.crossex_trade import CrossexTrade +from gate_api.models.crossex_transfer_coin import CrossexTransferCoin +from gate_api.models.crossex_transfer_record import CrossexTransferRecord +from gate_api.models.crossex_transfer_request import CrossexTransferRequest +from gate_api.models.crossex_transfer_response import CrossexTransferResponse from gate_api.models.currency import Currency from gate_api.models.currency_chain import CurrencyChain from gate_api.models.currency_pair import CurrencyPair from gate_api.models.currency_quota import CurrencyQuota from gate_api.models.debit_fee import DebitFee +from gate_api.models.delete_order import DeleteOrder +from gate_api.models.delete_position import DeletePosition from gate_api.models.delivery_account import DeliveryAccount from gate_api.models.delivery_account_book import DeliveryAccountBook +from gate_api.models.delivery_account_history import DeliveryAccountHistory from gate_api.models.delivery_candlestick import DeliveryCandlestick from gate_api.models.delivery_contract import DeliveryContract from gate_api.models.delivery_limit_risk_tiers import DeliveryLimitRiskTiers @@ -78,21 +210,72 @@ from gate_api.models.delivery_my_trade import DeliveryMyTrade from gate_api.models.delivery_order import DeliveryOrder from gate_api.models.delivery_order_book import DeliveryOrderBook +from gate_api.models.delivery_order_book_item import DeliveryOrderBookItem from gate_api.models.delivery_position import DeliveryPosition from gate_api.models.delivery_position_close import DeliveryPositionClose from gate_api.models.delivery_settlement import DeliverySettlement from gate_api.models.delivery_ticker import DeliveryTicker from gate_api.models.delivery_trade import DeliveryTrade +from gate_api.models.delta_neutral_enabled import DeltaNeutralEnabled from gate_api.models.deposit_address import DepositAddress from gate_api.models.deposit_record import DepositRecord +from gate_api.models.discover_scene import DiscoverScene +from gate_api.models.dual_get_balance import DualGetBalance from gate_api.models.dual_get_orders import DualGetOrders from gate_api.models.dual_get_plans import DualGetPlans -from gate_api.models.eth2_rate_list import Eth2RateList -from gate_api.models.eth2_swap import Eth2Swap -from gate_api.models.find_coin import FindCoin +from gate_api.models.dual_modify_order_reinvest_params import DualModifyOrderReinvestParams +from gate_api.models.dual_order_refund_params import DualOrderRefundParams +from gate_api.models.dual_order_refund_preview import DualOrderRefundPreview +from gate_api.models.dual_project_recommend import DualProjectRecommend +from gate_api.models.earn_fixed_term_pre_redeem_request import EarnFixedTermPreRedeemRequest +from gate_api.models.eligibility import Eligibility +from gate_api.models.eligibility_response import EligibilityResponse +from gate_api.models.eligibility_response_all_of import EligibilityResponseAllOf +from gate_api.models.err_code_msg import ErrCodeMsg +from gate_api.models.error_response import ErrorResponse +from gate_api.models.evaluate_item import EvaluateItem +from gate_api.models.evaluate_resp import EvaluateResp +from gate_api.models.ex_skill_claim_reward_req import ExSkillClaimRewardReq +from gate_api.models.ex_skill_claim_task_req import ExSkillClaimTaskReq +from gate_api.models.exchanges import Exchanges +from gate_api.models.exchanges_data import ExchangesData +from gate_api.models.exchanges_data_list import ExchangesDataList +from gate_api.models.fee_rate import FeeRate +from gate_api.models.fee_rate_data import FeeRateData +from gate_api.models.fee_rate_data_list import FeeRateDataList +from gate_api.models.fixed_term_bonus_info import FixedTermBonusInfo +from gate_api.models.fixed_term_coupon_info import FixedTermCouponInfo +from gate_api.models.fixed_term_history_record import FixedTermHistoryRecord +from gate_api.models.fixed_term_lend_order import FixedTermLendOrder +from gate_api.models.fixed_term_lend_request import FixedTermLendRequest +from gate_api.models.fixed_term_product import FixedTermProduct +from gate_api.models.fixed_term_product_info import FixedTermProductInfo +from gate_api.models.fixed_term_product_simple import FixedTermProductSimple from gate_api.models.flash_swap_currency_pair import FlashSwapCurrencyPair +from gate_api.models.flash_swap_error_response import FlashSwapErrorResponse +from gate_api.models.flash_swap_multi_currency_create_param import FlashSwapMultiCurrencyCreateParam +from gate_api.models.flash_swap_multi_currency_many_to_one_order_create_req import FlashSwapMultiCurrencyManyToOneOrderCreateReq +from gate_api.models.flash_swap_multi_currency_many_to_one_order_create_resp import FlashSwapMultiCurrencyManyToOneOrderCreateResp +from gate_api.models.flash_swap_multi_currency_many_to_one_order_create_resp_data import FlashSwapMultiCurrencyManyToOneOrderCreateRespData +from gate_api.models.flash_swap_multi_currency_many_to_one_order_preview_req import FlashSwapMultiCurrencyManyToOneOrderPreviewReq +from gate_api.models.flash_swap_multi_currency_many_to_one_order_preview_resp import FlashSwapMultiCurrencyManyToOneOrderPreviewResp +from gate_api.models.flash_swap_multi_currency_many_to_one_order_preview_resp_data import FlashSwapMultiCurrencyManyToOneOrderPreviewRespData +from gate_api.models.flash_swap_multi_currency_one_to_many_order_create_req import FlashSwapMultiCurrencyOneToManyOrderCreateReq +from gate_api.models.flash_swap_multi_currency_one_to_many_order_create_resp import FlashSwapMultiCurrencyOneToManyOrderCreateResp +from gate_api.models.flash_swap_multi_currency_one_to_many_order_create_resp_data import FlashSwapMultiCurrencyOneToManyOrderCreateRespData +from gate_api.models.flash_swap_multi_currency_one_to_many_order_preview_req import FlashSwapMultiCurrencyOneToManyOrderPreviewReq +from gate_api.models.flash_swap_multi_currency_one_to_many_order_preview_resp import FlashSwapMultiCurrencyOneToManyOrderPreviewResp +from gate_api.models.flash_swap_multi_currency_one_to_many_order_preview_resp_data import FlashSwapMultiCurrencyOneToManyOrderPreviewRespData +from gate_api.models.flash_swap_multi_currency_order import FlashSwapMultiCurrencyOrder +from gate_api.models.flash_swap_multi_currency_preview_order import FlashSwapMultiCurrencyPreviewOrder +from gate_api.models.flash_swap_multi_currency_preview_param import FlashSwapMultiCurrencyPreviewParam from gate_api.models.flash_swap_order import FlashSwapOrder +from gate_api.models.flash_swap_order_create_req import FlashSwapOrderCreateReq +from gate_api.models.flash_swap_order_create_resp import FlashSwapOrderCreateResp +from gate_api.models.flash_swap_order_create_resp_data import FlashSwapOrderCreateRespData from gate_api.models.flash_swap_order_preview import FlashSwapOrderPreview +from gate_api.models.flash_swap_order_preview_resp import FlashSwapOrderPreviewResp +from gate_api.models.flash_swap_order_preview_resp_data import FlashSwapOrderPreviewRespData from gate_api.models.flash_swap_order_request import FlashSwapOrderRequest from gate_api.models.flash_swap_preview_request import FlashSwapPreviewRequest from gate_api.models.funding_account import FundingAccount @@ -105,9 +288,13 @@ from gate_api.models.futures_bbo_order import FuturesBBOOrder from gate_api.models.futures_batch_amend_order_request import FuturesBatchAmendOrderRequest from gate_api.models.futures_candlestick import FuturesCandlestick +from gate_api.models.futures_direction import FuturesDirection from gate_api.models.futures_fee import FuturesFee +from gate_api.models.futures_grid_create_params import FuturesGridCreateParams +from gate_api.models.futures_grid_create_request import FuturesGridCreateRequest from gate_api.models.futures_index_constituents import FuturesIndexConstituents from gate_api.models.futures_initial_order import FuturesInitialOrder +from gate_api.models.futures_leverage import FuturesLeverage from gate_api.models.futures_limit_risk_tiers import FuturesLimitRiskTiers from gate_api.models.futures_liq_order import FuturesLiqOrder from gate_api.models.futures_liquidate import FuturesLiquidate @@ -115,7 +302,7 @@ from gate_api.models.futures_order_amendment import FuturesOrderAmendment from gate_api.models.futures_order_book import FuturesOrderBook from gate_api.models.futures_order_book_item import FuturesOrderBookItem -from gate_api.models.futures_order_book_item1 import FuturesOrderBookItem1 +from gate_api.models.futures_order_timerange import FuturesOrderTimerange from gate_api.models.futures_position_cross_mode import FuturesPositionCrossMode from gate_api.models.futures_premium_index import FuturesPremiumIndex from gate_api.models.futures_price_trigger import FuturesPriceTrigger @@ -124,16 +311,72 @@ from gate_api.models.futures_ticker import FuturesTicker from gate_api.models.futures_trade import FuturesTrade from gate_api.models.futures_update_price_triggered_order import FuturesUpdatePriceTriggeredOrder +from gate_api.models.gate_error_response import GateErrorResponse +from gate_api.models.get_beginner_task_list_error import GetBeginnerTaskListError +from gate_api.models.get_chase_order_detail_resp import GetChaseOrderDetailResp +from gate_api.models.get_chase_orders_resp import GetChaseOrdersResp +from gate_api.models.get_chats_list_request import GetChatsListRequest +from gate_api.models.get_completed_transaction_list_request import GetCompletedTransactionListRequest +from gate_api.models.get_counterparty_user_info_request import GetCounterpartyUserInfoRequest +from gate_api.models.get_my_activity_entry_response import GetMyActivityEntryResponse +from gate_api.models.get_my_activity_entry_response_data import GetMyActivityEntryResponseData +from gate_api.models.get_myself_payment_request import GetMyselfPaymentRequest +from gate_api.models.get_pending_transaction_list_request import GetPendingTransactionListRequest +from gate_api.models.get_transaction_details_request import GetTransactionDetailsRequest +from gate_api.models.get_user_coupon_detail_response import GetUserCouponDetailResponse +from gate_api.models.get_user_coupon_detail_response_data import GetUserCouponDetailResponseData +from gate_api.models.get_user_identity_error import GetUserIdentityError +from gate_api.models.i18n_txt import I18nTxt from gate_api.models.index_constituent import IndexConstituent -from gate_api.models.inline_object import InlineObject +from gate_api.models.infinite_grid_create_params import InfiniteGridCreateParams +from gate_api.models.infinite_grid_create_request import InfiniteGridCreateRequest from gate_api.models.inline_response200 import InlineResponse200 from gate_api.models.inline_response2001 import InlineResponse2001 +from gate_api.models.inline_response2002 import InlineResponse2002 from gate_api.models.insurance_record import InsuranceRecord +from gate_api.models.klines import Klines +from gate_api.models.klines_data import KlinesData +from gate_api.models.klines_data_list import KlinesDataList +from gate_api.models.ladder_apr import LadderApr from gate_api.models.ledger_record import LedgerRecord +from gate_api.models.leverage_failed_currencies import LeverageFailedCurrencies from gate_api.models.liquidate_order import LiquidateOrder +from gate_api.models.list_activities_response import ListActivitiesResponse +from gate_api.models.list_activities_response_data import ListActivitiesResponseData +from gate_api.models.list_activities_response_data_list import ListActivitiesResponseDataList +from gate_api.models.list_activity_types_response import ListActivityTypesResponse +from gate_api.models.list_activity_types_response_data import ListActivityTypesResponseData +from gate_api.models.list_activity_types_response_data_list import ListActivityTypesResponseDataList +from gate_api.models.list_earn_fixed_term_history_response import ListEarnFixedTermHistoryResponse +from gate_api.models.list_earn_fixed_term_history_response_data import ListEarnFixedTermHistoryResponseData +from gate_api.models.list_earn_fixed_term_lends_response import ListEarnFixedTermLendsResponse +from gate_api.models.list_earn_fixed_term_lends_response_data import ListEarnFixedTermLendsResponseData +from gate_api.models.list_earn_fixed_term_products_by_asset_response import ListEarnFixedTermProductsByAssetResponse +from gate_api.models.list_earn_fixed_term_products_by_asset_response_data import ListEarnFixedTermProductsByAssetResponseData +from gate_api.models.list_earn_fixed_term_products_response import ListEarnFixedTermProductsResponse +from gate_api.models.list_earn_fixed_term_products_response_data import ListEarnFixedTermProductsResponseData +from gate_api.models.list_live_replay_error import ListLiveReplayError +from gate_api.models.list_live_replay_response import ListLiveReplayResponse +from gate_api.models.list_live_replay_response_data import ListLiveReplayResponseData +from gate_api.models.list_live_replay_response_data_list import ListLiveReplayResponseDataList +from gate_api.models.list_live_replay_response_data_live import ListLiveReplayResponseDataLive +from gate_api.models.list_live_replay_response_data_live_host import ListLiveReplayResponseDataLiveHost +from gate_api.models.list_live_replay_response_data_video import ListLiveReplayResponseDataVideo +from gate_api.models.list_square_ai_search_error import ListSquareAiSearchError +from gate_api.models.list_square_ai_search_response import ListSquareAiSearchResponse +from gate_api.models.list_square_ai_search_response_data import ListSquareAiSearchResponseData +from gate_api.models.list_square_ai_search_response_data_items import ListSquareAiSearchResponseDataItems +from gate_api.models.list_user_coupons_response import ListUserCouponsResponse +from gate_api.models.list_user_coupons_response_data import ListUserCouponsResponseData +from gate_api.models.list_user_coupons_response_data_help_url import ListUserCouponsResponseDataHelpUrl +from gate_api.models.list_user_coupons_response_data_jump_url import ListUserCouponsResponseDataJumpUrl +from gate_api.models.list_user_coupons_response_data_list import ListUserCouponsResponseDataList +from gate_api.models.list_user_coupons_response_data_progress_config import ListUserCouponsResponseDataProgressConfig from gate_api.models.margin_account import MarginAccount from gate_api.models.margin_account_book import MarginAccountBook from gate_api.models.margin_account_currency import MarginAccountCurrency +from gate_api.models.margin_grid_create_params import MarginGridCreateParams +from gate_api.models.margin_grid_create_request import MarginGridCreateRequest from gate_api.models.margin_leverage_tier import MarginLeverageTier from gate_api.models.margin_market_leverage import MarginMarketLeverage from gate_api.models.margin_tiers import MarginTiers @@ -147,6 +390,8 @@ from gate_api.models.mock_risk_unit import MockRiskUnit from gate_api.models.mock_spot_balance import MockSpotBalance from gate_api.models.mock_spot_order import MockSpotOrder +from gate_api.models.mt5_account import Mt5Account +from gate_api.models.mt5_account_data import Mt5AccountData from gate_api.models.multi_chain_address_item import MultiChainAddressItem from gate_api.models.multi_collateral_currency import MultiCollateralCurrency from gate_api.models.multi_collateral_item import MultiCollateralItem @@ -157,6 +402,7 @@ from gate_api.models.multi_loan_repay_item import MultiLoanRepayItem from gate_api.models.multi_repay_record import MultiRepayRecord from gate_api.models.multi_repay_resp import MultiRepayResp +from gate_api.models.my_ads_list_request import MyAdsListRequest from gate_api.models.my_futures_trade import MyFuturesTrade from gate_api.models.my_futures_trade_time_range import MyFuturesTradeTimeRange from gate_api.models.open_orders import OpenOrders @@ -180,48 +426,189 @@ from gate_api.models.options_underlying_ticker import OptionsUnderlyingTicker from gate_api.models.order import Order from gate_api.models.order_book import OrderBook +from gate_api.models.order_book2 import OrderBook2 +from gate_api.models.order_book2_data import OrderBook2Data +from gate_api.models.order_book_price import OrderBookPrice from gate_api.models.order_cancel import OrderCancel +from gate_api.models.order_create_v1_req import OrderCreateV1Req +from gate_api.models.order_create_v1_resp import OrderCreateV1Resp +from gate_api.models.order_history_list import OrderHistoryList +from gate_api.models.order_history_list2 import OrderHistoryList2 +from gate_api.models.order_history_list2_data import OrderHistoryList2Data +from gate_api.models.order_history_list_data import OrderHistoryListData +from gate_api.models.order_history_list_data_list import OrderHistoryListDataList +from gate_api.models.order_history_list_item import OrderHistoryListItem +from gate_api.models.order_history_list_item_status_detail import OrderHistoryListItemStatusDetail +from gate_api.models.order_list import OrderList +from gate_api.models.order_list2 import OrderList2 +from gate_api.models.order_list2_data import OrderList2Data +from gate_api.models.order_list_data import OrderListData +from gate_api.models.order_list_data_list import OrderListDataList +from gate_api.models.order_list_item import OrderListItem from gate_api.models.order_list_struct import OrderListStruct from gate_api.models.order_list_struct_list import OrderListStructList +from gate_api.models.order_list_v1_resp import OrderListV1Resp +from gate_api.models.order_log import OrderLog +from gate_api.models.order_log_data import OrderLogData from gate_api.models.order_patch import OrderPatch +from gate_api.models.order_preview_v1_req import OrderPreviewV1Req +from gate_api.models.order_preview_v1_resp import OrderPreviewV1Resp from gate_api.models.order_resp import OrderResp +from gate_api.models.order_response import OrderResponse +from gate_api.models.otc_action_response import OtcActionResponse +from gate_api.models.otc_bank_create_multipart_request import OtcBankCreateMultipartRequest +from gate_api.models.otc_bank_create_response import OtcBankCreateResponse +from gate_api.models.otc_bank_create_response_data import OtcBankCreateResponseData +from gate_api.models.otc_bank_enterprise_supplement_multipart_request import OtcBankEnterpriseSupplementMultipartRequest +from gate_api.models.otc_bank_id_request import OtcBankIdRequest +from gate_api.models.otc_bank_list_item import OtcBankListItem +from gate_api.models.otc_bank_list_response import OtcBankListResponse +from gate_api.models.otc_bank_list_result import OtcBankListResult +from gate_api.models.otc_bank_personal_supplement_multipart_request import OtcBankPersonalSupplementMultipartRequest +from gate_api.models.otc_bank_supplement_checklist_item import OtcBankSupplementChecklistItem +from gate_api.models.otc_bank_supplement_checklist_response import OtcBankSupplementChecklistResponse +from gate_api.models.otc_bank_supplement_checklist_response_data import OtcBankSupplementChecklistResponseData +from gate_api.models.otc_mark_order_paid_request import OtcMarkOrderPaidRequest +from gate_api.models.otc_order_detail import OtcOrderDetail +from gate_api.models.otc_order_detail_response import OtcOrderDetailResponse +from gate_api.models.otc_order_list_crypto_currency_info import OtcOrderListCryptoCurrencyInfo +from gate_api.models.otc_order_list_fiat_currency_info import OtcOrderListFiatCurrencyInfo +from gate_api.models.otc_order_list_item import OtcOrderListItem +from gate_api.models.otc_order_list_response import OtcOrderListResponse +from gate_api.models.otc_order_list_result import OtcOrderListResult +from gate_api.models.otc_order_request import OtcOrderRequest +from gate_api.models.otc_quote_request import OtcQuoteRequest +from gate_api.models.otc_quote_response import OtcQuoteResponse +from gate_api.models.otc_quote_result import OtcQuoteResult +from gate_api.models.otc_stable_coin_order_create_response import OtcStableCoinOrderCreateResponse +from gate_api.models.otc_stable_coin_order_list_item import OtcStableCoinOrderListItem +from gate_api.models.otc_stable_coin_order_list_response import OtcStableCoinOrderListResponse +from gate_api.models.otc_stable_coin_order_list_result import OtcStableCoinOrderListResult +from gate_api.models.otc_stable_coin_order_request import OtcStableCoinOrderRequest +from gate_api.models.other_contact import OtherContact +from gate_api.models.p2p_ad_detail import P2pAdDetail +from gate_api.models.p2p_ad_detail_response import P2pAdDetailResponse +from gate_api.models.p2p_ads_list_item import P2pAdsListItem +from gate_api.models.p2p_ads_list_response import P2pAdsListResponse +from gate_api.models.p2p_ads_list_trade_method import P2pAdsListTradeMethod +from gate_api.models.p2p_ads_update_status_response import P2pAdsUpdateStatusResponse +from gate_api.models.p2p_ads_update_status_result import P2pAdsUpdateStatusResult +from gate_api.models.p2p_chat_list_response import P2pChatListResponse +from gate_api.models.p2p_chat_list_result import P2pChatListResult +from gate_api.models.p2p_chat_message import P2pChatMessage +from gate_api.models.p2p_chat_message_payload import P2pChatMessagePayload +from gate_api.models.p2p_counterparty_user_info import P2pCounterpartyUserInfo +from gate_api.models.p2p_counterparty_user_info_response import P2pCounterpartyUserInfoResponse +from gate_api.models.p2p_merchant_books_place_biz_push_order_response import P2pMerchantBooksPlaceBizPushOrderResponse +from gate_api.models.p2p_merchant_books_place_biz_push_order_response_data import P2pMerchantBooksPlaceBizPushOrderResponseData +from gate_api.models.p2p_merchant_books_place_biz_push_order_response_data_risk_event import P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent +from gate_api.models.p2p_merchant_books_place_biz_push_order_response_data_risk_event_action import P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction +from gate_api.models.p2p_merchant_market_info import P2pMerchantMarketInfo +from gate_api.models.p2p_merchant_user_info import P2pMerchantUserInfo +from gate_api.models.p2p_merchant_user_info_response import P2pMerchantUserInfoResponse +from gate_api.models.p2p_merchant_work_hours import P2pMerchantWorkHours +from gate_api.models.p2p_merchant_work_hours_response import P2pMerchantWorkHoursResponse +from gate_api.models.p2p_my_ad import P2pMyAd +from gate_api.models.p2p_my_ads_list_response import P2pMyAdsListResponse +from gate_api.models.p2p_my_ads_list_result import P2pMyAdsListResult +from gate_api.models.p2p_payment_method_account import P2pPaymentMethodAccount +from gate_api.models.p2p_payment_method_group import P2pPaymentMethodGroup +from gate_api.models.p2p_payment_methods_response import P2pPaymentMethodsResponse +from gate_api.models.p2p_send_chat_message_response import P2pSendChatMessageResponse +from gate_api.models.p2p_send_chat_message_result import P2pSendChatMessageResult +from gate_api.models.p2p_transaction_action_response import P2pTransactionActionResponse +from gate_api.models.p2p_transaction_convert_info import P2pTransactionConvertInfo +from gate_api.models.p2p_transaction_detail import P2pTransactionDetail +from gate_api.models.p2p_transaction_detail_pay_others import P2pTransactionDetailPayOthers +from gate_api.models.p2p_transaction_detail_response import P2pTransactionDetailResponse +from gate_api.models.p2p_transaction_list_item import P2pTransactionListItem +from gate_api.models.p2p_transaction_list_response import P2pTransactionListResponse +from gate_api.models.p2p_transaction_list_result import P2pTransactionListResult +from gate_api.models.p2p_transaction_list_result_pay_others import P2pTransactionListResultPayOthers +from gate_api.models.p2p_transaction_time_marker import P2pTransactionTimeMarker +from gate_api.models.p2p_upload_chat_file_response import P2pUploadChatFileResponse +from gate_api.models.p2p_upload_chat_file_result import P2pUploadChatFileResult +from gate_api.models.partner_application import PartnerApplication +from gate_api.models.partner_application_response import PartnerApplicationResponse +from gate_api.models.partner_application_response_all_of import PartnerApplicationResponseAllOf from gate_api.models.partner_commission_history import PartnerCommissionHistory +from gate_api.models.partner_data_aggregated import PartnerDataAggregated +from gate_api.models.partner_data_aggregated_response import PartnerDataAggregatedResponse +from gate_api.models.partner_data_aggregated_response_all_of import PartnerDataAggregatedResponseAllOf from gate_api.models.partner_sub import PartnerSub from gate_api.models.partner_sub_list import PartnerSubList from gate_api.models.partner_transaction_history import PartnerTransactionHistory from gate_api.models.patch_uni_lend import PatchUniLend +from gate_api.models.place_biz_push_order import PlaceBizPushOrder from gate_api.models.place_dual_investment_order import PlaceDualInvestmentOrder +from gate_api.models.place_dual_investment_order_params import PlaceDualInvestmentOrderParams +from gate_api.models.place_order_request import PlaceOrderRequest +from gate_api.models.place_order_response import PlaceOrderResponse from gate_api.models.position import Position from gate_api.models.position_close import PositionClose from gate_api.models.position_close_order import PositionCloseOrder +from gate_api.models.position_history_list import PositionHistoryList +from gate_api.models.position_history_list_data import PositionHistoryListData +from gate_api.models.position_history_list_data_close_detail import PositionHistoryListDataCloseDetail +from gate_api.models.position_history_list_data_list import PositionHistoryListDataList +from gate_api.models.position_history_list_data_realized_pnl_detail import PositionHistoryListDataRealizedPnlDetail +from gate_api.models.position_list import PositionList +from gate_api.models.position_list2 import PositionList2 +from gate_api.models.position_list2_data import PositionList2Data +from gate_api.models.position_list_data import PositionListData +from gate_api.models.position_list_data_list import PositionListDataList +from gate_api.models.position_list_item import PositionListItem +from gate_api.models.position_timerange import PositionTimerange +from gate_api.models.preview_from_param import PreviewFromParam +from gate_api.models.preview_order import PreviewOrder +from gate_api.models.preview_order_detail import PreviewOrderDetail +from gate_api.models.preview_to_param import PreviewToParam from gate_api.models.profit_loss_range import ProfitLossRange +from gate_api.models.quick_estimated_repayment import QuickEstimatedRepayment +from gate_api.models.quick_repayment_request import QuickRepaymentRequest +from gate_api.models.quick_repayment_response import QuickRepaymentResponse +from gate_api.models.quote_request import QuoteRequest +from gate_api.models.quote_response import QuoteResponse from gate_api.models.rebate_user_info import RebateUserInfo +from gate_api.models.recommend import Recommend +from gate_api.models.recommend_v2_scheme import RecommendV2Scheme +from gate_api.models.recommend_v2_strategy import RecommendV2Strategy from gate_api.models.repay_currency_res import RepayCurrencyRes -from gate_api.models.repay_loan import RepayLoan from gate_api.models.repay_multi_loan import RepayMultiLoan -from gate_api.models.repay_record import RepayRecord from gate_api.models.repay_record_currency import RepayRecordCurrency from gate_api.models.repay_record_left_interest import RepayRecordLeftInterest from gate_api.models.repay_record_repaid_currency import RepayRecordRepaidCurrency from gate_api.models.repay_record_total_interest import RepayRecordTotalInterest -from gate_api.models.repay_resp import RepayResp from gate_api.models.risk_units import RiskUnits from gate_api.models.saved_address import SavedAddress +from gate_api.models.send_chat_message_request import SendChatMessageRequest +from gate_api.models.set_merchant_work_hours_request import SetMerchantWorkHoursRequest from gate_api.models.small_balance import SmallBalance from gate_api.models.small_balance_history import SmallBalanceHistory -from gate_api.models.spot_account import SpotAccount from gate_api.models.spot_account_book import SpotAccountBook from gate_api.models.spot_currency_chain import SpotCurrencyChain from gate_api.models.spot_fee import SpotFee +from gate_api.models.spot_grid_create_params import SpotGridCreateParams +from gate_api.models.spot_grid_create_request import SpotGridCreateRequest from gate_api.models.spot_insurance_history import SpotInsuranceHistory +from gate_api.models.spot_martingale_create_params import SpotMartingaleCreateParams +from gate_api.models.spot_martingale_create_request import SpotMartingaleCreateRequest +from gate_api.models.spot_order_stop_loss import SpotOrderStopLoss +from gate_api.models.spot_order_stop_profit import SpotOrderStopProfit +from gate_api.models.spot_pov_order import SpotPovOrder +from gate_api.models.spot_pov_order_creator import SpotPovOrderCreator from gate_api.models.spot_price_put_order import SpotPricePutOrder from gate_api.models.spot_price_trigger import SpotPriceTrigger from gate_api.models.spot_price_triggered_order import SpotPriceTriggeredOrder +from gate_api.models.stop_all_chase_orders_req import StopAllChaseOrdersReq +from gate_api.models.stop_all_chase_orders_resp import StopAllChaseOrdersResp +from gate_api.models.stop_all_trail_orders import StopAllTrailOrders +from gate_api.models.stop_chase_order_req import StopChaseOrderReq +from gate_api.models.stop_chase_order_resp import StopChaseOrderResp +from gate_api.models.stop_trail_order import StopTrailOrder from gate_api.models.stp_group import StpGroup from gate_api.models.stp_group_user import StpGroupUser -from gate_api.models.structured_buy import StructuredBuy -from gate_api.models.structured_get_project_list import StructuredGetProjectList -from gate_api.models.structured_order_list import StructuredOrderList +from gate_api.models.strategy_type import StrategyType from gate_api.models.sub_account import SubAccount from gate_api.models.sub_account_balance import SubAccountBalance from gate_api.models.sub_account_cross_margin_balance import SubAccountCrossMarginBalance @@ -236,12 +623,52 @@ from gate_api.models.sub_user_mode import SubUserMode from gate_api.models.swap_coin import SwapCoin from gate_api.models.swap_coin_struct import SwapCoinStruct +from gate_api.models.symbol import Symbol +from gate_api.models.symbol_commissions import SymbolCommissions +from gate_api.models.symbol_commissions_data import SymbolCommissionsData +from gate_api.models.symbol_commissions_data_list import SymbolCommissionsDataList +from gate_api.models.symbol_detail import SymbolDetail +from gate_api.models.symbol_detail_data import SymbolDetailData +from gate_api.models.symbol_detail_item import SymbolDetailItem +from gate_api.models.symbol_detail_item_symbol_descs import SymbolDetailItemSymbolDescs +from gate_api.models.symbol_list_item import SymbolListItem +from gate_api.models.symbols import Symbols +from gate_api.models.symbols2 import Symbols2 +from gate_api.models.symbols2_data import Symbols2Data +from gate_api.models.symbols_data import SymbolsData +from gate_api.models.symbols_data_list import SymbolsDataList from gate_api.models.system_time import SystemTime from gate_api.models.ticker import Ticker +from gate_api.models.tokens import Tokens from gate_api.models.total_balance import TotalBalance +from gate_api.models.trad_fi_close_position_request import TradFiClosePositionRequest +from gate_api.models.trad_fi_error import TradFiError +from gate_api.models.trad_fi_order_request import TradFiOrderRequest +from gate_api.models.trad_fi_order_update_request import TradFiOrderUpdateRequest +from gate_api.models.trad_fi_position_update_request import TradFiPositionUpdateRequest +from gate_api.models.trad_fi_spot_close_position_request import TradFiSpotClosePositionRequest +from gate_api.models.trad_fi_spot_error import TradFiSpotError +from gate_api.models.trad_fi_spot_order_request import TradFiSpotOrderRequest +from gate_api.models.trad_fi_spot_order_update_request import TradFiSpotOrderUpdateRequest +from gate_api.models.trad_fi_spot_transaction_request import TradFiSpotTransactionRequest +from gate_api.models.trad_fi_ticker import TradFiTicker +from gate_api.models.trad_fi_ticker_data import TradFiTickerData +from gate_api.models.trad_fi_transaction_request import TradFiTransactionRequest from gate_api.models.trade import Trade from gate_api.models.trade_fee import TradeFee +from gate_api.models.trail_change_log import TrailChangeLog +from gate_api.models.trail_order import TrailOrder +from gate_api.models.trail_order_change_log_response import TrailOrderChangeLogResponse +from gate_api.models.trail_order_detail_response import TrailOrderDetailResponse +from gate_api.models.trail_order_list_response import TrailOrderListResponse +from gate_api.models.trail_order_response import TrailOrderResponse from gate_api.models.transaction_id import TransactionID +from gate_api.models.transaction_item import TransactionItem +from gate_api.models.transaction_list import TransactionList +from gate_api.models.transaction_list2 import TransactionList2 +from gate_api.models.transaction_list2_data import TransactionList2Data +from gate_api.models.transaction_list_data import TransactionListData +from gate_api.models.transaction_list_data_list import TransactionListDataList from gate_api.models.transfer import Transfer from gate_api.models.transfer_order_status import TransferOrderStatus from gate_api.models.transferables_result import TransferablesResult @@ -250,9 +677,11 @@ from gate_api.models.uid_push_order import UidPushOrder from gate_api.models.uid_push_withdrawal import UidPushWithdrawal from gate_api.models.uid_push_withdrawal_resp import UidPushWithdrawalResp +from gate_api.models.uni_chart_point import UniChartPoint from gate_api.models.uni_currency import UniCurrency from gate_api.models.uni_currency_interest import UniCurrencyInterest from gate_api.models.uni_currency_pair import UniCurrencyPair +from gate_api.models.uni_estimated_rate import UniEstimatedRate from gate_api.models.uni_interest_record import UniInterestRecord from gate_api.models.uni_lend import UniLend from gate_api.models.uni_lend_interest import UniLendInterest @@ -263,7 +692,6 @@ from gate_api.models.unified_account import UnifiedAccount from gate_api.models.unified_balance import UnifiedBalance from gate_api.models.unified_borrowable import UnifiedBorrowable -from gate_api.models.unified_borrowable1 import UnifiedBorrowable1 from gate_api.models.unified_collateral_req import UnifiedCollateralReq from gate_api.models.unified_collateral_res import UnifiedCollateralRes from gate_api.models.unified_currency import UnifiedCurrency @@ -280,13 +708,28 @@ from gate_api.models.unified_mode_set import UnifiedModeSet from gate_api.models.unified_portfolio_input import UnifiedPortfolioInput from gate_api.models.unified_portfolio_output import UnifiedPortfolioOutput +from gate_api.models.unified_quick_repay_available_item import UnifiedQuickRepayAvailableItem +from gate_api.models.unified_quick_repay_debt_item import UnifiedQuickRepayDebtItem +from gate_api.models.unified_quick_repay_repaid_info import UnifiedQuickRepayRepaidInfo +from gate_api.models.unified_quick_repay_used_info import UnifiedQuickRepayUsedInfo from gate_api.models.unified_risk_units import UnifiedRiskUnits from gate_api.models.unified_settings import UnifiedSettings from gate_api.models.unified_transferable import UnifiedTransferable -from gate_api.models.user_ltv_info import UserLtvInfo +from gate_api.models.update_dual_comp_position_cross_mode_request import UpdateDualCompPositionCrossModeRequest +from gate_api.models.update_order import UpdateOrder +from gate_api.models.update_order2 import UpdateOrder2 +from gate_api.models.update_order2_data import UpdateOrder2Data +from gate_api.models.update_order_data import UpdateOrderData +from gate_api.models.update_position import UpdatePosition +from gate_api.models.update_trail_order import UpdateTrailOrder +from gate_api.models.upload_chat_file import UploadChatFile +from gate_api.models.user_asset_resp import UserAssetResp +from gate_api.models.user_asset_resp2 import UserAssetResp2 +from gate_api.models.user_asset_resp2_data import UserAssetResp2Data +from gate_api.models.user_asset_resp_data import UserAssetRespData +from gate_api.models.user_leverage_setting import UserLeverageSetting from gate_api.models.user_sub import UserSub from gate_api.models.user_sub_relation import UserSubRelation -from gate_api.models.user_total_amount import UserTotalAmount from gate_api.models.withdraw_status import WithdrawStatus from gate_api.models.withdrawal_record import WithdrawalRecord from gate_api.models.withdrawals_del import WithdrawalsDel diff --git a/gate_api/models/account_book_response.py b/gate_api/models/account_book_response.py new file mode 100644 index 00000000..5e2e997f --- /dev/null +++ b/gate_api/models/account_book_response.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AccountBookResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'time': 'int', + 'currency': 'str', + 'change': 'str', + 'balance': 'str' + } + + attribute_map = { + 'id': 'id', + 'time': 'time', + 'currency': 'currency', + 'change': 'change', + 'balance': 'balance' + } + + def __init__(self, id=None, time=None, currency=None, change=None, balance=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, Configuration) -> None + """AccountBookResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._time = None + self._currency = None + self._change = None + self._balance = None + self.discriminator = None + + if id is not None: + self.id = id + if time is not None: + self.time = time + if currency is not None: + self.currency = currency + if change is not None: + self.change = change + if balance is not None: + self.balance = balance + + @property + def id(self): + """Gets the id of this AccountBookResponse. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this AccountBookResponse. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AccountBookResponse. + + Order ID # noqa: E501 + + :param id: The id of this AccountBookResponse. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def time(self): + """Gets the time of this AccountBookResponse. # noqa: E501 + + Operation timestamp # noqa: E501 + + :return: The time of this AccountBookResponse. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this AccountBookResponse. + + Operation timestamp # noqa: E501 + + :param time: The time of this AccountBookResponse. # noqa: E501 + :type: int + """ + + self._time = time + + @property + def currency(self): + """Gets the currency of this AccountBookResponse. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this AccountBookResponse. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this AccountBookResponse. + + Currency name # noqa: E501 + + :param currency: The currency of this AccountBookResponse. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def change(self): + """Gets the change of this AccountBookResponse. # noqa: E501 + + Change amount # noqa: E501 + + :return: The change of this AccountBookResponse. # noqa: E501 + :rtype: str + """ + return self._change + + @change.setter + def change(self, change): + """Sets the change of this AccountBookResponse. + + Change amount # noqa: E501 + + :param change: The change of this AccountBookResponse. # noqa: E501 + :type: str + """ + + self._change = change + + @property + def balance(self): + """Gets the balance of this AccountBookResponse. # noqa: E501 + + Balance after change # noqa: E501 + + :return: The balance of this AccountBookResponse. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this AccountBookResponse. + + Balance after change # noqa: E501 + + :param balance: The balance of this AccountBookResponse. # noqa: E501 + :type: str + """ + + self._balance = balance + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AccountBookResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AccountBookResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/account_key_info.py b/gate_api/models/account_key_info.py index 52c358a3..47398bea 100644 --- a/gate_api/models/account_key_info.py +++ b/gate_api/models/account_key_info.py @@ -107,7 +107,7 @@ def __init__(self, state=None, mode=None, name=None, currency_pairs=None, user_i def state(self): """Gets the state of this AccountKeyInfo. # noqa: E501 - API Key Status: 1 - Normal, 2 - Locked, 3 - Frozen (can only be modified; default is 1 upon creation) # noqa: E501 + API key status: 1 - Normal, 2 - Locked, 3 - Frozen (can only be modified, default is 1 when creating)API Key Status: 1 - Normal, 2 - Locked, 3 - Frozen (can only be modified; default is 1 upon creation) # noqa: E501 :return: The state of this AccountKeyInfo. # noqa: E501 :rtype: int @@ -118,7 +118,7 @@ def state(self): def state(self, state): """Sets the state of this AccountKeyInfo. - API Key Status: 1 - Normal, 2 - Locked, 3 - Frozen (can only be modified; default is 1 upon creation) # noqa: E501 + API key status: 1 - Normal, 2 - Locked, 3 - Frozen (can only be modified, default is 1 when creating)API Key Status: 1 - Normal, 2 - Locked, 3 - Frozen (can only be modified; default is 1 upon creation) # noqa: E501 :param state: The state of this AccountKeyInfo. # noqa: E501 :type: int @@ -130,7 +130,7 @@ def state(self, state): def mode(self): """Gets the mode of this AccountKeyInfo. # noqa: E501 - User Mode: 1 - Classic, 2 - Legacy Unified (can only be specified during creation, non-modifiable afterwards) # noqa: E501 + User mode: 1 - Classic mode, 2 - Legacy unified mode (can only be specified when creating, cannot be modified) # noqa: E501 :return: The mode of this AccountKeyInfo. # noqa: E501 :rtype: int @@ -141,7 +141,7 @@ def mode(self): def mode(self, mode): """Sets the mode of this AccountKeyInfo. - User Mode: 1 - Classic, 2 - Legacy Unified (can only be specified during creation, non-modifiable afterwards) # noqa: E501 + User mode: 1 - Classic mode, 2 - Legacy unified mode (can only be specified when creating, cannot be modified) # noqa: E501 :param mode: The mode of this AccountKeyInfo. # noqa: E501 :type: int diff --git a/gate_api/models/account_transfer_detail.py b/gate_api/models/account_transfer_detail.py new file mode 100644 index 00000000..b9925f31 --- /dev/null +++ b/gate_api/models/account_transfer_detail.py @@ -0,0 +1,341 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AccountTransferDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'tx_id': 'str', + 'status': 'str', + 'currency': 'str', + 'amount': 'str', + 'from_account': 'str', + 'to_account': 'str', + 'settle': 'str', + 'currency_pair': 'str' + } + + attribute_map = { + 'tx_id': 'tx_id', + 'status': 'status', + 'currency': 'currency', + 'amount': 'amount', + 'from_account': 'from_account', + 'to_account': 'to_account', + 'settle': 'settle', + 'currency_pair': 'currency_pair' + } + + def __init__(self, tx_id=None, status=None, currency=None, amount=None, from_account=None, to_account=None, settle=None, currency_pair=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, Configuration) -> None + """AccountTransferDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._tx_id = None + self._status = None + self._currency = None + self._amount = None + self._from_account = None + self._to_account = None + self._settle = None + self._currency_pair = None + self.discriminator = None + + self.tx_id = tx_id + self.status = status + self.currency = currency + self.amount = amount + self.from_account = from_account + self.to_account = to_account + self.settle = settle + self.currency_pair = currency_pair + + @property + def tx_id(self): + """Gets the tx_id of this AccountTransferDetail. # noqa: E501 + + Transfer transaction ID # noqa: E501 + + :return: The tx_id of this AccountTransferDetail. # noqa: E501 + :rtype: str + """ + return self._tx_id + + @tx_id.setter + def tx_id(self, tx_id): + """Sets the tx_id of this AccountTransferDetail. + + Transfer transaction ID # noqa: E501 + + :param tx_id: The tx_id of this AccountTransferDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and tx_id is None: # noqa: E501 + raise ValueError("Invalid value for `tx_id`, must not be `None`") # noqa: E501 + + self._tx_id = tx_id + + @property + def status(self): + """Gets the status of this AccountTransferDetail. # noqa: E501 + + Transfer status: - `pending`: Processing - `success`: Successful - `fail`: Failed # noqa: E501 + + :return: The status of this AccountTransferDetail. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AccountTransferDetail. + + Transfer status: - `pending`: Processing - `success`: Successful - `fail`: Failed # noqa: E501 + + :param status: The status of this AccountTransferDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["pending", "success", "fail"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def currency(self): + """Gets the currency of this AccountTransferDetail. # noqa: E501 + + Transfer currency # noqa: E501 + + :return: The currency of this AccountTransferDetail. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this AccountTransferDetail. + + Transfer currency # noqa: E501 + + :param currency: The currency of this AccountTransferDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501 + raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501 + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this AccountTransferDetail. # noqa: E501 + + Transfer amount # noqa: E501 + + :return: The amount of this AccountTransferDetail. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this AccountTransferDetail. + + Transfer amount # noqa: E501 + + :param amount: The amount of this AccountTransferDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def from_account(self): + """Gets the from_account of this AccountTransferDetail. # noqa: E501 + + Source account type: - `spot`: Spot account - `margin`: Margin account - `futures`: Perpetual futures account - `delivery`: Delivery futures account - `options`: Options account - `unknown`: Unrecognized account type # noqa: E501 + + :return: The from_account of this AccountTransferDetail. # noqa: E501 + :rtype: str + """ + return self._from_account + + @from_account.setter + def from_account(self, from_account): + """Sets the from_account of this AccountTransferDetail. + + Source account type: - `spot`: Spot account - `margin`: Margin account - `futures`: Perpetual futures account - `delivery`: Delivery futures account - `options`: Options account - `unknown`: Unrecognized account type # noqa: E501 + + :param from_account: The from_account of this AccountTransferDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and from_account is None: # noqa: E501 + raise ValueError("Invalid value for `from_account`, must not be `None`") # noqa: E501 + allowed_values = ["spot", "margin", "futures", "delivery", "options", "unknown"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and from_account not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `from_account` ({0}), must be one of {1}" # noqa: E501 + .format(from_account, allowed_values) + ) + + self._from_account = from_account + + @property + def to_account(self): + """Gets the to_account of this AccountTransferDetail. # noqa: E501 + + Destination account type: - `spot`: Spot account - `margin`: Margin account - `futures`: Perpetual futures account - `delivery`: Delivery futures account - `options`: Options account - `unknown`: Unrecognized account type # noqa: E501 + + :return: The to_account of this AccountTransferDetail. # noqa: E501 + :rtype: str + """ + return self._to_account + + @to_account.setter + def to_account(self, to_account): + """Sets the to_account of this AccountTransferDetail. + + Destination account type: - `spot`: Spot account - `margin`: Margin account - `futures`: Perpetual futures account - `delivery`: Delivery futures account - `options`: Options account - `unknown`: Unrecognized account type # noqa: E501 + + :param to_account: The to_account of this AccountTransferDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and to_account is None: # noqa: E501 + raise ValueError("Invalid value for `to_account`, must not be `None`") # noqa: E501 + allowed_values = ["spot", "margin", "futures", "delivery", "options", "unknown"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and to_account not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `to_account` ({0}), must be one of {1}" # noqa: E501 + .format(to_account, allowed_values) + ) + + self._to_account = to_account + + @property + def settle(self): + """Gets the settle of this AccountTransferDetail. # noqa: E501 + + Settlement currency for futures, delivery, and options transfers; otherwise, null # noqa: E501 + + :return: The settle of this AccountTransferDetail. # noqa: E501 + :rtype: str + """ + return self._settle + + @settle.setter + def settle(self, settle): + """Sets the settle of this AccountTransferDetail. + + Settlement currency for futures, delivery, and options transfers; otherwise, null # noqa: E501 + + :param settle: The settle of this AccountTransferDetail. # noqa: E501 + :type: str + """ + + self._settle = settle + + @property + def currency_pair(self): + """Gets the currency_pair of this AccountTransferDetail. # noqa: E501 + + Currency pair for margin transfers; otherwise, null # noqa: E501 + + :return: The currency_pair of this AccountTransferDetail. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this AccountTransferDetail. + + Currency pair for margin transfers; otherwise, null # noqa: E501 + + :param currency_pair: The currency_pair of this AccountTransferDetail. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AccountTransferDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AccountTransferDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/accounts_response.py b/gate_api/models/accounts_response.py new file mode 100644 index 00000000..825a9ecb --- /dev/null +++ b/gate_api/models/accounts_response.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AccountsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency': 'str', + 'available': 'str', + 'locked': 'str', + 'token_address': 'str', + 'chain': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'available': 'available', + 'locked': 'locked', + 'token_address': 'token_address', + 'chain': 'chain' + } + + def __init__(self, currency=None, available=None, locked=None, token_address=None, chain=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """AccountsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._available = None + self._locked = None + self._token_address = None + self._chain = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if available is not None: + self.available = available + if locked is not None: + self.locked = locked + if token_address is not None: + self.token_address = token_address + if chain is not None: + self.chain = chain + + @property + def currency(self): + """Gets the currency of this AccountsResponse. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this AccountsResponse. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this AccountsResponse. + + Currency name # noqa: E501 + + :param currency: The currency of this AccountsResponse. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def available(self): + """Gets the available of this AccountsResponse. # noqa: E501 + + Available Balance # noqa: E501 + + :return: The available of this AccountsResponse. # noqa: E501 + :rtype: str + """ + return self._available + + @available.setter + def available(self, available): + """Sets the available of this AccountsResponse. + + Available Balance # noqa: E501 + + :param available: The available of this AccountsResponse. # noqa: E501 + :type: str + """ + + self._available = available + + @property + def locked(self): + """Gets the locked of this AccountsResponse. # noqa: E501 + + Locked balance # noqa: E501 + + :return: The locked of this AccountsResponse. # noqa: E501 + :rtype: str + """ + return self._locked + + @locked.setter + def locked(self, locked): + """Sets the locked of this AccountsResponse. + + Locked balance # noqa: E501 + + :param locked: The locked of this AccountsResponse. # noqa: E501 + :type: str + """ + + self._locked = locked + + @property + def token_address(self): + """Gets the token_address of this AccountsResponse. # noqa: E501 + + Token address # noqa: E501 + + :return: The token_address of this AccountsResponse. # noqa: E501 + :rtype: str + """ + return self._token_address + + @token_address.setter + def token_address(self, token_address): + """Sets the token_address of this AccountsResponse. + + Token address # noqa: E501 + + :param token_address: The token_address of this AccountsResponse. # noqa: E501 + :type: str + """ + + self._token_address = token_address + + @property + def chain(self): + """Gets the chain of this AccountsResponse. # noqa: E501 + + Blockchain name # noqa: E501 + + :return: The chain of this AccountsResponse. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this AccountsResponse. + + Blockchain name # noqa: E501 + + :param chain: The chain of this AccountsResponse. # noqa: E501 + :type: str + """ + + self._chain = chain + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AccountsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AccountsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ads_detail_request.py b/gate_api/models/ads_detail_request.py new file mode 100644 index 00000000..7bee685f --- /dev/null +++ b/gate_api/models/ads_detail_request.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AdsDetailRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'adv_no': 'str' + } + + attribute_map = { + 'adv_no': 'adv_no' + } + + def __init__(self, adv_no=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """AdsDetailRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._adv_no = None + self.discriminator = None + + self.adv_no = adv_no + + @property + def adv_no(self): + """Gets the adv_no of this AdsDetailRequest. # noqa: E501 + + Advertisement ID. # noqa: E501 + + :return: The adv_no of this AdsDetailRequest. # noqa: E501 + :rtype: str + """ + return self._adv_no + + @adv_no.setter + def adv_no(self, adv_no): + """Sets the adv_no of this AdsDetailRequest. + + Advertisement ID. # noqa: E501 + + :param adv_no: The adv_no of this AdsDetailRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and adv_no is None: # noqa: E501 + raise ValueError("Invalid value for `adv_no`, must not be `None`") # noqa: E501 + + self._adv_no = adv_no + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdsDetailRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AdsDetailRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ads_list_request.py b/gate_api/models/ads_list_request.py new file mode 100644 index 00000000..29814ec2 --- /dev/null +++ b/gate_api/models/ads_list_request.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AdsListRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'fiat_unit': 'str', + 'trade_type': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'fiat_unit': 'fiat_unit', + 'trade_type': 'trade_type' + } + + def __init__(self, asset=None, fiat_unit=None, trade_type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """AdsListRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._fiat_unit = None + self._trade_type = None + self.discriminator = None + + self.asset = asset + self.fiat_unit = fiat_unit + self.trade_type = trade_type + + @property + def asset(self): + """Gets the asset of this AdsListRequest. # noqa: E501 + + Cryptocurrency symbol. # noqa: E501 + + :return: The asset of this AdsListRequest. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this AdsListRequest. + + Cryptocurrency symbol. # noqa: E501 + + :param asset: The asset of this AdsListRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def fiat_unit(self): + """Gets the fiat_unit of this AdsListRequest. # noqa: E501 + + Fiat currency # noqa: E501 + + :return: The fiat_unit of this AdsListRequest. # noqa: E501 + :rtype: str + """ + return self._fiat_unit + + @fiat_unit.setter + def fiat_unit(self, fiat_unit): + """Sets the fiat_unit of this AdsListRequest. + + Fiat currency # noqa: E501 + + :param fiat_unit: The fiat_unit of this AdsListRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fiat_unit is None: # noqa: E501 + raise ValueError("Invalid value for `fiat_unit`, must not be `None`") # noqa: E501 + + self._fiat_unit = fiat_unit + + @property + def trade_type(self): + """Gets the trade_type of this AdsListRequest. # noqa: E501 + + Ad side: `buy` buy-crypto ad; `sell` sell-crypto ad. # noqa: E501 + + :return: The trade_type of this AdsListRequest. # noqa: E501 + :rtype: str + """ + return self._trade_type + + @trade_type.setter + def trade_type(self, trade_type): + """Sets the trade_type of this AdsListRequest. + + Ad side: `buy` buy-crypto ad; `sell` sell-crypto ad. # noqa: E501 + + :param trade_type: The trade_type of this AdsListRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and trade_type is None: # noqa: E501 + raise ValueError("Invalid value for `trade_type`, must not be `None`") # noqa: E501 + + self._trade_type = trade_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdsListRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AdsListRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ads_update_status.py b/gate_api/models/ads_update_status.py new file mode 100644 index 00000000..25ee0e3e --- /dev/null +++ b/gate_api/models/ads_update_status.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AdsUpdateStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'adv_no': 'int', + 'adv_status': 'int' + } + + attribute_map = { + 'adv_no': 'adv_no', + 'adv_status': 'adv_status' + } + + def __init__(self, adv_no=None, adv_status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, Configuration) -> None + """AdsUpdateStatus - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._adv_no = None + self._adv_status = None + self.discriminator = None + + self.adv_no = adv_no + self.adv_status = adv_status + + @property + def adv_no(self): + """Gets the adv_no of this AdsUpdateStatus. # noqa: E501 + + Advertisement ID. # noqa: E501 + + :return: The adv_no of this AdsUpdateStatus. # noqa: E501 + :rtype: int + """ + return self._adv_no + + @adv_no.setter + def adv_no(self, adv_no): + """Sets the adv_no of this AdsUpdateStatus. + + Advertisement ID. # noqa: E501 + + :param adv_no: The adv_no of this AdsUpdateStatus. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and adv_no is None: # noqa: E501 + raise ValueError("Invalid value for `adv_no`, must not be `None`") # noqa: E501 + + self._adv_no = adv_no + + @property + def adv_status(self): + """Gets the adv_status of this AdsUpdateStatus. # noqa: E501 + + Ad status. `1`: listed; `3`: delisted; `4`: closed. # noqa: E501 + + :return: The adv_status of this AdsUpdateStatus. # noqa: E501 + :rtype: int + """ + return self._adv_status + + @adv_status.setter + def adv_status(self, adv_status): + """Sets the adv_status of this AdsUpdateStatus. + + Ad status. `1`: listed; `3`: delisted; `4`: closed. # noqa: E501 + + :param adv_status: The adv_status of this AdsUpdateStatus. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and adv_status is None: # noqa: E501 + raise ValueError("Invalid value for `adv_status`, must not be `None`") # noqa: E501 + allowed_values = [1, 3, 4] # noqa: E501 + if self.local_vars_configuration.client_side_validation and adv_status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `adv_status` ({0}), must be one of {1}" # noqa: E501 + .format(adv_status, allowed_values) + ) + + self._adv_status = adv_status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdsUpdateStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AdsUpdateStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/agency_commission.py b/gate_api/models/agency_commission.py index d843953c..1870abe2 100644 --- a/gate_api/models/agency_commission.py +++ b/gate_api/models/agency_commission.py @@ -151,7 +151,7 @@ def group_name(self, group_name): def commission_amount(self): """Gets the commission_amount of this AgencyCommission. # noqa: E501 - Transaction amount # noqa: E501 + Commission amount # noqa: E501 :return: The commission_amount of this AgencyCommission. # noqa: E501 :rtype: str @@ -162,7 +162,7 @@ def commission_amount(self): def commission_amount(self, commission_amount): """Sets the commission_amount of this AgencyCommission. - Transaction amount # noqa: E501 + Commission amount # noqa: E501 :param commission_amount: The commission_amount of this AgencyCommission. # noqa: E501 :type: str diff --git a/gate_api/models/agency_transaction.py b/gate_api/models/agency_transaction.py index abdf1198..93927341 100644 --- a/gate_api/models/agency_transaction.py +++ b/gate_api/models/agency_transaction.py @@ -258,7 +258,7 @@ def amount(self, amount): def amount_asset(self): """Gets the amount_asset of this AgencyTransaction. # noqa: E501 - Commission Asset # noqa: E501 + Transaction amount currency # noqa: E501 :return: The amount_asset of this AgencyTransaction. # noqa: E501 :rtype: str @@ -269,7 +269,7 @@ def amount_asset(self): def amount_asset(self, amount_asset): """Sets the amount_asset of this AgencyTransaction. - Commission Asset # noqa: E501 + Transaction amount currency # noqa: E501 :param amount_asset: The amount_asset of this AgencyTransaction. # noqa: E501 :type: str diff --git a/gate_api/models/ai_hub_create_data.py b/gate_api/models/ai_hub_create_data.py new file mode 100644 index 00000000..b5c3350d --- /dev/null +++ b/gate_api/models/ai_hub_create_data.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubCreateData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_id': 'str', + 'strategy_type': 'StrategyType', + 'market': 'str', + 'status': 'str', + 'jump_url': 'str' + } + + attribute_map = { + 'strategy_id': 'strategy_id', + 'strategy_type': 'strategy_type', + 'market': 'market', + 'status': 'status', + 'jump_url': 'jump_url' + } + + def __init__(self, strategy_id=None, strategy_type=None, market=None, status=None, jump_url=None, local_vars_configuration=None): # noqa: E501 + # type: (str, StrategyType, str, str, str, Configuration) -> None + """AIHubCreateData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_id = None + self._strategy_type = None + self._market = None + self._status = None + self._jump_url = None + self.discriminator = None + + self.strategy_id = strategy_id + self.strategy_type = strategy_type + self.market = market + self.status = status + if jump_url is not None: + self.jump_url = jump_url + + @property + def strategy_id(self): + """Gets the strategy_id of this AIHubCreateData. # noqa: E501 + + + :return: The strategy_id of this AIHubCreateData. # noqa: E501 + :rtype: str + """ + return self._strategy_id + + @strategy_id.setter + def strategy_id(self, strategy_id): + """Sets the strategy_id of this AIHubCreateData. + + + :param strategy_id: The strategy_id of this AIHubCreateData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_id is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_id`, must not be `None`") # noqa: E501 + + self._strategy_id = strategy_id + + @property + def strategy_type(self): + """Gets the strategy_type of this AIHubCreateData. # noqa: E501 + + + :return: The strategy_type of this AIHubCreateData. # noqa: E501 + :rtype: StrategyType + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this AIHubCreateData. + + + :param strategy_type: The strategy_type of this AIHubCreateData. # noqa: E501 + :type: StrategyType + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + + self._strategy_type = strategy_type + + @property + def market(self): + """Gets the market of this AIHubCreateData. # noqa: E501 + + + :return: The market of this AIHubCreateData. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this AIHubCreateData. + + + :param market: The market of this AIHubCreateData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def status(self): + """Gets the status of this AIHubCreateData. # noqa: E501 + + The initial state after successful creation, usually `running` # noqa: E501 + + :return: The status of this AIHubCreateData. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AIHubCreateData. + + The initial state after successful creation, usually `running` # noqa: E501 + + :param status: The status of this AIHubCreateData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def jump_url(self): + """Gets the jump_url of this AIHubCreateData. # noqa: E501 + + + :return: The jump_url of this AIHubCreateData. # noqa: E501 + :rtype: str + """ + return self._jump_url + + @jump_url.setter + def jump_url(self, jump_url): + """Sets the jump_url of this AIHubCreateData. + + + :param jump_url: The jump_url of this AIHubCreateData. # noqa: E501 + :type: str + """ + + self._jump_url = jump_url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubCreateData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubCreateData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_create_success_response.py b/gate_api/models/ai_hub_create_success_response.py new file mode 100644 index 00000000..becbc495 --- /dev/null +++ b/gate_api/models/ai_hub_create_success_response.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubCreateSuccessResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'AIHubCreateData', + 'trace_id': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'trace_id': 'trace_id' + } + + def __init__(self, code=None, message=None, data=None, trace_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, AIHubCreateData, str, Configuration) -> None + """AIHubCreateSuccessResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._trace_id = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.trace_id = trace_id + + @property + def code(self): + """Gets the code of this AIHubCreateSuccessResponse. # noqa: E501 + + + :return: The code of this AIHubCreateSuccessResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this AIHubCreateSuccessResponse. + + + :param code: The code of this AIHubCreateSuccessResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this AIHubCreateSuccessResponse. # noqa: E501 + + + :return: The message of this AIHubCreateSuccessResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this AIHubCreateSuccessResponse. + + + :param message: The message of this AIHubCreateSuccessResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this AIHubCreateSuccessResponse. # noqa: E501 + + + :return: The data of this AIHubCreateSuccessResponse. # noqa: E501 + :rtype: AIHubCreateData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this AIHubCreateSuccessResponse. + + + :param data: The data of this AIHubCreateSuccessResponse. # noqa: E501 + :type: AIHubCreateData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def trace_id(self): + """Gets the trace_id of this AIHubCreateSuccessResponse. # noqa: E501 + + + :return: The trace_id of this AIHubCreateSuccessResponse. # noqa: E501 + :rtype: str + """ + return self._trace_id + + @trace_id.setter + def trace_id(self, trace_id): + """Sets the trace_id of this AIHubCreateSuccessResponse. + + + :param trace_id: The trace_id of this AIHubCreateSuccessResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and trace_id is None: # noqa: E501 + raise ValueError("Invalid value for `trace_id`, must not be `None`") # noqa: E501 + + self._trace_id = trace_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubCreateSuccessResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubCreateSuccessResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_discover_data.py b/gate_api/models/ai_hub_discover_data.py new file mode 100644 index 00000000..4c521a8b --- /dev/null +++ b/gate_api/models/ai_hub_discover_data.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubDiscoverData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'scene': 'DiscoverScene', + 'recommendations': 'list[AIHubRecommendation]', + 'unsupported_filters': 'list[str]' + } + + attribute_map = { + 'scene': 'scene', + 'recommendations': 'recommendations', + 'unsupported_filters': 'unsupported_filters' + } + + def __init__(self, scene=None, recommendations=None, unsupported_filters=None, local_vars_configuration=None): # noqa: E501 + # type: (DiscoverScene, list[AIHubRecommendation], list[str], Configuration) -> None + """AIHubDiscoverData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._scene = None + self._recommendations = None + self._unsupported_filters = None + self.discriminator = None + + self.scene = scene + self.recommendations = recommendations + self.unsupported_filters = unsupported_filters + + @property + def scene(self): + """Gets the scene of this AIHubDiscoverData. # noqa: E501 + + + :return: The scene of this AIHubDiscoverData. # noqa: E501 + :rtype: DiscoverScene + """ + return self._scene + + @scene.setter + def scene(self, scene): + """Sets the scene of this AIHubDiscoverData. + + + :param scene: The scene of this AIHubDiscoverData. # noqa: E501 + :type: DiscoverScene + """ + if self.local_vars_configuration.client_side_validation and scene is None: # noqa: E501 + raise ValueError("Invalid value for `scene`, must not be `None`") # noqa: E501 + + self._scene = scene + + @property + def recommendations(self): + """Gets the recommendations of this AIHubDiscoverData. # noqa: E501 + + + :return: The recommendations of this AIHubDiscoverData. # noqa: E501 + :rtype: list[AIHubRecommendation] + """ + return self._recommendations + + @recommendations.setter + def recommendations(self, recommendations): + """Sets the recommendations of this AIHubDiscoverData. + + + :param recommendations: The recommendations of this AIHubDiscoverData. # noqa: E501 + :type: list[AIHubRecommendation] + """ + if self.local_vars_configuration.client_side_validation and recommendations is None: # noqa: E501 + raise ValueError("Invalid value for `recommendations`, must not be `None`") # noqa: E501 + + self._recommendations = recommendations + + @property + def unsupported_filters(self): + """Gets the unsupported_filters of this AIHubDiscoverData. # noqa: E501 + + Filter conditions not supported in this issue # noqa: E501 + + :return: The unsupported_filters of this AIHubDiscoverData. # noqa: E501 + :rtype: list[str] + """ + return self._unsupported_filters + + @unsupported_filters.setter + def unsupported_filters(self, unsupported_filters): + """Sets the unsupported_filters of this AIHubDiscoverData. + + Filter conditions not supported in this issue # noqa: E501 + + :param unsupported_filters: The unsupported_filters of this AIHubDiscoverData. # noqa: E501 + :type: list[str] + """ + if self.local_vars_configuration.client_side_validation and unsupported_filters is None: # noqa: E501 + raise ValueError("Invalid value for `unsupported_filters`, must not be `None`") # noqa: E501 + + self._unsupported_filters = unsupported_filters + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubDiscoverData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubDiscoverData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_discover_success_response.py b/gate_api/models/ai_hub_discover_success_response.py new file mode 100644 index 00000000..049cd392 --- /dev/null +++ b/gate_api/models/ai_hub_discover_success_response.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubDiscoverSuccessResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'AIHubDiscoverData', + 'trace_id': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'trace_id': 'trace_id' + } + + def __init__(self, code=None, message=None, data=None, trace_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, AIHubDiscoverData, str, Configuration) -> None + """AIHubDiscoverSuccessResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._trace_id = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.trace_id = trace_id + + @property + def code(self): + """Gets the code of this AIHubDiscoverSuccessResponse. # noqa: E501 + + + :return: The code of this AIHubDiscoverSuccessResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this AIHubDiscoverSuccessResponse. + + + :param code: The code of this AIHubDiscoverSuccessResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this AIHubDiscoverSuccessResponse. # noqa: E501 + + + :return: The message of this AIHubDiscoverSuccessResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this AIHubDiscoverSuccessResponse. + + + :param message: The message of this AIHubDiscoverSuccessResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this AIHubDiscoverSuccessResponse. # noqa: E501 + + + :return: The data of this AIHubDiscoverSuccessResponse. # noqa: E501 + :rtype: AIHubDiscoverData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this AIHubDiscoverSuccessResponse. + + + :param data: The data of this AIHubDiscoverSuccessResponse. # noqa: E501 + :type: AIHubDiscoverData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def trace_id(self): + """Gets the trace_id of this AIHubDiscoverSuccessResponse. # noqa: E501 + + + :return: The trace_id of this AIHubDiscoverSuccessResponse. # noqa: E501 + :rtype: str + """ + return self._trace_id + + @trace_id.setter + def trace_id(self, trace_id): + """Sets the trace_id of this AIHubDiscoverSuccessResponse. + + + :param trace_id: The trace_id of this AIHubDiscoverSuccessResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and trace_id is None: # noqa: E501 + raise ValueError("Invalid value for `trace_id`, must not be `None`") # noqa: E501 + + self._trace_id = trace_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubDiscoverSuccessResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubDiscoverSuccessResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_portfolio_base_info.py b/gate_api/models/ai_hub_portfolio_base_info.py new file mode 100644 index 00000000..36594570 --- /dev/null +++ b/gate_api/models/ai_hub_portfolio_base_info.py @@ -0,0 +1,261 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubPortfolioBaseInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_name': 'str', + 'created_at': 'str', + 'running_duration': 'int', + 'invest_amount': 'str', + 'total_profit': 'str', + 'profit_rate': 'str' + } + + attribute_map = { + 'strategy_name': 'strategy_name', + 'created_at': 'created_at', + 'running_duration': 'running_duration', + 'invest_amount': 'invest_amount', + 'total_profit': 'total_profit', + 'profit_rate': 'profit_rate' + } + + def __init__(self, strategy_name=None, created_at=None, running_duration=None, invest_amount=None, total_profit=None, profit_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, str, str, str, Configuration) -> None + """AIHubPortfolioBaseInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_name = None + self._created_at = None + self._running_duration = None + self._invest_amount = None + self._total_profit = None + self._profit_rate = None + self.discriminator = None + + self.strategy_name = strategy_name + self.created_at = created_at + self.running_duration = running_duration + self.invest_amount = invest_amount + self.total_profit = total_profit + self.profit_rate = profit_rate + + @property + def strategy_name(self): + """Gets the strategy_name of this AIHubPortfolioBaseInfo. # noqa: E501 + + + :return: The strategy_name of this AIHubPortfolioBaseInfo. # noqa: E501 + :rtype: str + """ + return self._strategy_name + + @strategy_name.setter + def strategy_name(self, strategy_name): + """Sets the strategy_name of this AIHubPortfolioBaseInfo. + + + :param strategy_name: The strategy_name of this AIHubPortfolioBaseInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_name is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_name`, must not be `None`") # noqa: E501 + + self._strategy_name = strategy_name + + @property + def created_at(self): + """Gets the created_at of this AIHubPortfolioBaseInfo. # noqa: E501 + + Created time # noqa: E501 + + :return: The created_at of this AIHubPortfolioBaseInfo. # noqa: E501 + :rtype: str + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this AIHubPortfolioBaseInfo. + + Created time # noqa: E501 + + :param created_at: The created_at of this AIHubPortfolioBaseInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and created_at is None: # noqa: E501 + raise ValueError("Invalid value for `created_at`, must not be `None`") # noqa: E501 + + self._created_at = created_at + + @property + def running_duration(self): + """Gets the running_duration of this AIHubPortfolioBaseInfo. # noqa: E501 + + Runtime duration in seconds. # noqa: E501 + + :return: The running_duration of this AIHubPortfolioBaseInfo. # noqa: E501 + :rtype: int + """ + return self._running_duration + + @running_duration.setter + def running_duration(self, running_duration): + """Sets the running_duration of this AIHubPortfolioBaseInfo. + + Runtime duration in seconds. # noqa: E501 + + :param running_duration: The running_duration of this AIHubPortfolioBaseInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and running_duration is None: # noqa: E501 + raise ValueError("Invalid value for `running_duration`, must not be `None`") # noqa: E501 + + self._running_duration = running_duration + + @property + def invest_amount(self): + """Gets the invest_amount of this AIHubPortfolioBaseInfo. # noqa: E501 + + + :return: The invest_amount of this AIHubPortfolioBaseInfo. # noqa: E501 + :rtype: str + """ + return self._invest_amount + + @invest_amount.setter + def invest_amount(self, invest_amount): + """Sets the invest_amount of this AIHubPortfolioBaseInfo. + + + :param invest_amount: The invest_amount of this AIHubPortfolioBaseInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and invest_amount is None: # noqa: E501 + raise ValueError("Invalid value for `invest_amount`, must not be `None`") # noqa: E501 + + self._invest_amount = invest_amount + + @property + def total_profit(self): + """Gets the total_profit of this AIHubPortfolioBaseInfo. # noqa: E501 + + + :return: The total_profit of this AIHubPortfolioBaseInfo. # noqa: E501 + :rtype: str + """ + return self._total_profit + + @total_profit.setter + def total_profit(self, total_profit): + """Sets the total_profit of this AIHubPortfolioBaseInfo. + + + :param total_profit: The total_profit of this AIHubPortfolioBaseInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total_profit is None: # noqa: E501 + raise ValueError("Invalid value for `total_profit`, must not be `None`") # noqa: E501 + + self._total_profit = total_profit + + @property + def profit_rate(self): + """Gets the profit_rate of this AIHubPortfolioBaseInfo. # noqa: E501 + + + :return: The profit_rate of this AIHubPortfolioBaseInfo. # noqa: E501 + :rtype: str + """ + return self._profit_rate + + @profit_rate.setter + def profit_rate(self, profit_rate): + """Sets the profit_rate of this AIHubPortfolioBaseInfo. + + + :param profit_rate: The profit_rate of this AIHubPortfolioBaseInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and profit_rate is None: # noqa: E501 + raise ValueError("Invalid value for `profit_rate`, must not be `None`") # noqa: E501 + + self._profit_rate = profit_rate + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubPortfolioBaseInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubPortfolioBaseInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_portfolio_detail_data.py b/gate_api/models/ai_hub_portfolio_detail_data.py new file mode 100644 index 00000000..707ef93b --- /dev/null +++ b/gate_api/models/ai_hub_portfolio_detail_data.py @@ -0,0 +1,309 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubPortfolioDetailData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_id': 'str', + 'strategy_type': 'StrategyType', + 'market': 'str', + 'status': 'str', + 'base_info': 'AIHubPortfolioBaseInfo', + 'metrics': 'AIHubPortfolioMetrics', + 'position': 'AIHubPortfolioPosition', + 'stop_supported': 'bool' + } + + attribute_map = { + 'strategy_id': 'strategy_id', + 'strategy_type': 'strategy_type', + 'market': 'market', + 'status': 'status', + 'base_info': 'base_info', + 'metrics': 'metrics', + 'position': 'position', + 'stop_supported': 'stop_supported' + } + + def __init__(self, strategy_id=None, strategy_type=None, market=None, status=None, base_info=None, metrics=None, position=None, stop_supported=None, local_vars_configuration=None): # noqa: E501 + # type: (str, StrategyType, str, str, AIHubPortfolioBaseInfo, AIHubPortfolioMetrics, AIHubPortfolioPosition, bool, Configuration) -> None + """AIHubPortfolioDetailData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_id = None + self._strategy_type = None + self._market = None + self._status = None + self._base_info = None + self._metrics = None + self._position = None + self._stop_supported = None + self.discriminator = None + + self.strategy_id = strategy_id + self.strategy_type = strategy_type + self.market = market + self.status = status + self.base_info = base_info + self.metrics = metrics + self.position = position + self.stop_supported = stop_supported + + @property + def strategy_id(self): + """Gets the strategy_id of this AIHubPortfolioDetailData. # noqa: E501 + + + :return: The strategy_id of this AIHubPortfolioDetailData. # noqa: E501 + :rtype: str + """ + return self._strategy_id + + @strategy_id.setter + def strategy_id(self, strategy_id): + """Sets the strategy_id of this AIHubPortfolioDetailData. + + + :param strategy_id: The strategy_id of this AIHubPortfolioDetailData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_id is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_id`, must not be `None`") # noqa: E501 + + self._strategy_id = strategy_id + + @property + def strategy_type(self): + """Gets the strategy_type of this AIHubPortfolioDetailData. # noqa: E501 + + + :return: The strategy_type of this AIHubPortfolioDetailData. # noqa: E501 + :rtype: StrategyType + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this AIHubPortfolioDetailData. + + + :param strategy_type: The strategy_type of this AIHubPortfolioDetailData. # noqa: E501 + :type: StrategyType + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + + self._strategy_type = strategy_type + + @property + def market(self): + """Gets the market of this AIHubPortfolioDetailData. # noqa: E501 + + + :return: The market of this AIHubPortfolioDetailData. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this AIHubPortfolioDetailData. + + + :param market: The market of this AIHubPortfolioDetailData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def status(self): + """Gets the status of this AIHubPortfolioDetailData. # noqa: E501 + + + :return: The status of this AIHubPortfolioDetailData. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AIHubPortfolioDetailData. + + + :param status: The status of this AIHubPortfolioDetailData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def base_info(self): + """Gets the base_info of this AIHubPortfolioDetailData. # noqa: E501 + + + :return: The base_info of this AIHubPortfolioDetailData. # noqa: E501 + :rtype: AIHubPortfolioBaseInfo + """ + return self._base_info + + @base_info.setter + def base_info(self, base_info): + """Sets the base_info of this AIHubPortfolioDetailData. + + + :param base_info: The base_info of this AIHubPortfolioDetailData. # noqa: E501 + :type: AIHubPortfolioBaseInfo + """ + if self.local_vars_configuration.client_side_validation and base_info is None: # noqa: E501 + raise ValueError("Invalid value for `base_info`, must not be `None`") # noqa: E501 + + self._base_info = base_info + + @property + def metrics(self): + """Gets the metrics of this AIHubPortfolioDetailData. # noqa: E501 + + + :return: The metrics of this AIHubPortfolioDetailData. # noqa: E501 + :rtype: AIHubPortfolioMetrics + """ + return self._metrics + + @metrics.setter + def metrics(self, metrics): + """Sets the metrics of this AIHubPortfolioDetailData. + + + :param metrics: The metrics of this AIHubPortfolioDetailData. # noqa: E501 + :type: AIHubPortfolioMetrics + """ + if self.local_vars_configuration.client_side_validation and metrics is None: # noqa: E501 + raise ValueError("Invalid value for `metrics`, must not be `None`") # noqa: E501 + + self._metrics = metrics + + @property + def position(self): + """Gets the position of this AIHubPortfolioDetailData. # noqa: E501 + + + :return: The position of this AIHubPortfolioDetailData. # noqa: E501 + :rtype: AIHubPortfolioPosition + """ + return self._position + + @position.setter + def position(self, position): + """Sets the position of this AIHubPortfolioDetailData. + + + :param position: The position of this AIHubPortfolioDetailData. # noqa: E501 + :type: AIHubPortfolioPosition + """ + + self._position = position + + @property + def stop_supported(self): + """Gets the stop_supported of this AIHubPortfolioDetailData. # noqa: E501 + + + :return: The stop_supported of this AIHubPortfolioDetailData. # noqa: E501 + :rtype: bool + """ + return self._stop_supported + + @stop_supported.setter + def stop_supported(self, stop_supported): + """Sets the stop_supported of this AIHubPortfolioDetailData. + + + :param stop_supported: The stop_supported of this AIHubPortfolioDetailData. # noqa: E501 + :type: bool + """ + if self.local_vars_configuration.client_side_validation and stop_supported is None: # noqa: E501 + raise ValueError("Invalid value for `stop_supported`, must not be `None`") # noqa: E501 + + self._stop_supported = stop_supported + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubPortfolioDetailData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubPortfolioDetailData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_portfolio_detail_success_response.py b/gate_api/models/ai_hub_portfolio_detail_success_response.py new file mode 100644 index 00000000..11f44570 --- /dev/null +++ b/gate_api/models/ai_hub_portfolio_detail_success_response.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubPortfolioDetailSuccessResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'AIHubPortfolioDetailData', + 'trace_id': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'trace_id': 'trace_id' + } + + def __init__(self, code=None, message=None, data=None, trace_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, AIHubPortfolioDetailData, str, Configuration) -> None + """AIHubPortfolioDetailSuccessResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._trace_id = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.trace_id = trace_id + + @property + def code(self): + """Gets the code of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + + + :return: The code of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this AIHubPortfolioDetailSuccessResponse. + + + :param code: The code of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + + + :return: The message of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this AIHubPortfolioDetailSuccessResponse. + + + :param message: The message of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + + + :return: The data of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + :rtype: AIHubPortfolioDetailData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this AIHubPortfolioDetailSuccessResponse. + + + :param data: The data of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + :type: AIHubPortfolioDetailData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def trace_id(self): + """Gets the trace_id of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + + + :return: The trace_id of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + :rtype: str + """ + return self._trace_id + + @trace_id.setter + def trace_id(self, trace_id): + """Sets the trace_id of this AIHubPortfolioDetailSuccessResponse. + + + :param trace_id: The trace_id of this AIHubPortfolioDetailSuccessResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and trace_id is None: # noqa: E501 + raise ValueError("Invalid value for `trace_id`, must not be `None`") # noqa: E501 + + self._trace_id = trace_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubPortfolioDetailSuccessResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubPortfolioDetailSuccessResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_portfolio_metrics.py b/gate_api/models/ai_hub_portfolio_metrics.py new file mode 100644 index 00000000..e8ad444c --- /dev/null +++ b/gate_api/models/ai_hub_portfolio_metrics.py @@ -0,0 +1,433 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubPortfolioMetrics(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'grid_profit': 'str', + 'floating_pnl': 'str', + 'arbitrage_count': 'int', + 'price_range': 'str', + 'grid_count': 'int', + 'estimated_liquidation_price': 'str', + 'price_floor': 'str', + 'grid_profit_rate': 'str', + 'realized_pnl': 'str', + 'finished_rounds': 'int', + 'avg_cost': 'str', + 'take_profit_price': 'str', + 'maintenance_margin_ratio': 'str' + } + + attribute_map = { + 'grid_profit': 'grid_profit', + 'floating_pnl': 'floating_pnl', + 'arbitrage_count': 'arbitrage_count', + 'price_range': 'price_range', + 'grid_count': 'grid_count', + 'estimated_liquidation_price': 'estimated_liquidation_price', + 'price_floor': 'price_floor', + 'grid_profit_rate': 'grid_profit_rate', + 'realized_pnl': 'realized_pnl', + 'finished_rounds': 'finished_rounds', + 'avg_cost': 'avg_cost', + 'take_profit_price': 'take_profit_price', + 'maintenance_margin_ratio': 'maintenance_margin_ratio' + } + + def __init__(self, grid_profit=None, floating_pnl=None, arbitrage_count=None, price_range=None, grid_count=None, estimated_liquidation_price=None, price_floor=None, grid_profit_rate=None, realized_pnl=None, finished_rounds=None, avg_cost=None, take_profit_price=None, maintenance_margin_ratio=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, str, int, str, str, str, str, int, str, str, str, Configuration) -> None + """AIHubPortfolioMetrics - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._grid_profit = None + self._floating_pnl = None + self._arbitrage_count = None + self._price_range = None + self._grid_count = None + self._estimated_liquidation_price = None + self._price_floor = None + self._grid_profit_rate = None + self._realized_pnl = None + self._finished_rounds = None + self._avg_cost = None + self._take_profit_price = None + self._maintenance_margin_ratio = None + self.discriminator = None + + if grid_profit is not None: + self.grid_profit = grid_profit + if floating_pnl is not None: + self.floating_pnl = floating_pnl + if arbitrage_count is not None: + self.arbitrage_count = arbitrage_count + if price_range is not None: + self.price_range = price_range + if grid_count is not None: + self.grid_count = grid_count + if estimated_liquidation_price is not None: + self.estimated_liquidation_price = estimated_liquidation_price + if price_floor is not None: + self.price_floor = price_floor + if grid_profit_rate is not None: + self.grid_profit_rate = grid_profit_rate + if realized_pnl is not None: + self.realized_pnl = realized_pnl + if finished_rounds is not None: + self.finished_rounds = finished_rounds + if avg_cost is not None: + self.avg_cost = avg_cost + if take_profit_price is not None: + self.take_profit_price = take_profit_price + if maintenance_margin_ratio is not None: + self.maintenance_margin_ratio = maintenance_margin_ratio + + @property + def grid_profit(self): + """Gets the grid_profit of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The grid_profit of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: str + """ + return self._grid_profit + + @grid_profit.setter + def grid_profit(self, grid_profit): + """Sets the grid_profit of this AIHubPortfolioMetrics. + + + :param grid_profit: The grid_profit of this AIHubPortfolioMetrics. # noqa: E501 + :type: str + """ + + self._grid_profit = grid_profit + + @property + def floating_pnl(self): + """Gets the floating_pnl of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The floating_pnl of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: str + """ + return self._floating_pnl + + @floating_pnl.setter + def floating_pnl(self, floating_pnl): + """Sets the floating_pnl of this AIHubPortfolioMetrics. + + + :param floating_pnl: The floating_pnl of this AIHubPortfolioMetrics. # noqa: E501 + :type: str + """ + + self._floating_pnl = floating_pnl + + @property + def arbitrage_count(self): + """Gets the arbitrage_count of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The arbitrage_count of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: int + """ + return self._arbitrage_count + + @arbitrage_count.setter + def arbitrage_count(self, arbitrage_count): + """Sets the arbitrage_count of this AIHubPortfolioMetrics. + + + :param arbitrage_count: The arbitrage_count of this AIHubPortfolioMetrics. # noqa: E501 + :type: int + """ + + self._arbitrage_count = arbitrage_count + + @property + def price_range(self): + """Gets the price_range of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The price_range of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: str + """ + return self._price_range + + @price_range.setter + def price_range(self, price_range): + """Sets the price_range of this AIHubPortfolioMetrics. + + + :param price_range: The price_range of this AIHubPortfolioMetrics. # noqa: E501 + :type: str + """ + + self._price_range = price_range + + @property + def grid_count(self): + """Gets the grid_count of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The grid_count of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: int + """ + return self._grid_count + + @grid_count.setter + def grid_count(self, grid_count): + """Sets the grid_count of this AIHubPortfolioMetrics. + + + :param grid_count: The grid_count of this AIHubPortfolioMetrics. # noqa: E501 + :type: int + """ + + self._grid_count = grid_count + + @property + def estimated_liquidation_price(self): + """Gets the estimated_liquidation_price of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The estimated_liquidation_price of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: str + """ + return self._estimated_liquidation_price + + @estimated_liquidation_price.setter + def estimated_liquidation_price(self, estimated_liquidation_price): + """Sets the estimated_liquidation_price of this AIHubPortfolioMetrics. + + + :param estimated_liquidation_price: The estimated_liquidation_price of this AIHubPortfolioMetrics. # noqa: E501 + :type: str + """ + + self._estimated_liquidation_price = estimated_liquidation_price + + @property + def price_floor(self): + """Gets the price_floor of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The price_floor of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: str + """ + return self._price_floor + + @price_floor.setter + def price_floor(self, price_floor): + """Sets the price_floor of this AIHubPortfolioMetrics. + + + :param price_floor: The price_floor of this AIHubPortfolioMetrics. # noqa: E501 + :type: str + """ + + self._price_floor = price_floor + + @property + def grid_profit_rate(self): + """Gets the grid_profit_rate of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The grid_profit_rate of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: str + """ + return self._grid_profit_rate + + @grid_profit_rate.setter + def grid_profit_rate(self, grid_profit_rate): + """Sets the grid_profit_rate of this AIHubPortfolioMetrics. + + + :param grid_profit_rate: The grid_profit_rate of this AIHubPortfolioMetrics. # noqa: E501 + :type: str + """ + + self._grid_profit_rate = grid_profit_rate + + @property + def realized_pnl(self): + """Gets the realized_pnl of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The realized_pnl of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: str + """ + return self._realized_pnl + + @realized_pnl.setter + def realized_pnl(self, realized_pnl): + """Sets the realized_pnl of this AIHubPortfolioMetrics. + + + :param realized_pnl: The realized_pnl of this AIHubPortfolioMetrics. # noqa: E501 + :type: str + """ + + self._realized_pnl = realized_pnl + + @property + def finished_rounds(self): + """Gets the finished_rounds of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The finished_rounds of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: int + """ + return self._finished_rounds + + @finished_rounds.setter + def finished_rounds(self, finished_rounds): + """Sets the finished_rounds of this AIHubPortfolioMetrics. + + + :param finished_rounds: The finished_rounds of this AIHubPortfolioMetrics. # noqa: E501 + :type: int + """ + + self._finished_rounds = finished_rounds + + @property + def avg_cost(self): + """Gets the avg_cost of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The avg_cost of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: str + """ + return self._avg_cost + + @avg_cost.setter + def avg_cost(self, avg_cost): + """Sets the avg_cost of this AIHubPortfolioMetrics. + + + :param avg_cost: The avg_cost of this AIHubPortfolioMetrics. # noqa: E501 + :type: str + """ + + self._avg_cost = avg_cost + + @property + def take_profit_price(self): + """Gets the take_profit_price of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The take_profit_price of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: str + """ + return self._take_profit_price + + @take_profit_price.setter + def take_profit_price(self, take_profit_price): + """Sets the take_profit_price of this AIHubPortfolioMetrics. + + + :param take_profit_price: The take_profit_price of this AIHubPortfolioMetrics. # noqa: E501 + :type: str + """ + + self._take_profit_price = take_profit_price + + @property + def maintenance_margin_ratio(self): + """Gets the maintenance_margin_ratio of this AIHubPortfolioMetrics. # noqa: E501 + + + :return: The maintenance_margin_ratio of this AIHubPortfolioMetrics. # noqa: E501 + :rtype: str + """ + return self._maintenance_margin_ratio + + @maintenance_margin_ratio.setter + def maintenance_margin_ratio(self, maintenance_margin_ratio): + """Sets the maintenance_margin_ratio of this AIHubPortfolioMetrics. + + + :param maintenance_margin_ratio: The maintenance_margin_ratio of this AIHubPortfolioMetrics. # noqa: E501 + :type: str + """ + + self._maintenance_margin_ratio = maintenance_margin_ratio + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubPortfolioMetrics): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubPortfolioMetrics): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_portfolio_position.py b/gate_api/models/ai_hub_portfolio_position.py new file mode 100644 index 00000000..5a749494 --- /dev/null +++ b/gate_api/models/ai_hub_portfolio_position.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubPortfolioPosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'amount': 'str', + 'entry_price': 'str', + 'quote_amount': 'str', + 'position_value': 'str', + 'margin': 'str', + 'side': 'str' + } + + attribute_map = { + 'amount': 'amount', + 'entry_price': 'entry_price', + 'quote_amount': 'quote_amount', + 'position_value': 'position_value', + 'margin': 'margin', + 'side': 'side' + } + + def __init__(self, amount=None, entry_price=None, quote_amount=None, position_value=None, margin=None, side=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """AIHubPortfolioPosition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._amount = None + self._entry_price = None + self._quote_amount = None + self._position_value = None + self._margin = None + self._side = None + self.discriminator = None + + if amount is not None: + self.amount = amount + if entry_price is not None: + self.entry_price = entry_price + if quote_amount is not None: + self.quote_amount = quote_amount + if position_value is not None: + self.position_value = position_value + if margin is not None: + self.margin = margin + if side is not None: + self.side = side + + @property + def amount(self): + """Gets the amount of this AIHubPortfolioPosition. # noqa: E501 + + + :return: The amount of this AIHubPortfolioPosition. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this AIHubPortfolioPosition. + + + :param amount: The amount of this AIHubPortfolioPosition. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def entry_price(self): + """Gets the entry_price of this AIHubPortfolioPosition. # noqa: E501 + + + :return: The entry_price of this AIHubPortfolioPosition. # noqa: E501 + :rtype: str + """ + return self._entry_price + + @entry_price.setter + def entry_price(self, entry_price): + """Sets the entry_price of this AIHubPortfolioPosition. + + + :param entry_price: The entry_price of this AIHubPortfolioPosition. # noqa: E501 + :type: str + """ + + self._entry_price = entry_price + + @property + def quote_amount(self): + """Gets the quote_amount of this AIHubPortfolioPosition. # noqa: E501 + + + :return: The quote_amount of this AIHubPortfolioPosition. # noqa: E501 + :rtype: str + """ + return self._quote_amount + + @quote_amount.setter + def quote_amount(self, quote_amount): + """Sets the quote_amount of this AIHubPortfolioPosition. + + + :param quote_amount: The quote_amount of this AIHubPortfolioPosition. # noqa: E501 + :type: str + """ + + self._quote_amount = quote_amount + + @property + def position_value(self): + """Gets the position_value of this AIHubPortfolioPosition. # noqa: E501 + + + :return: The position_value of this AIHubPortfolioPosition. # noqa: E501 + :rtype: str + """ + return self._position_value + + @position_value.setter + def position_value(self, position_value): + """Sets the position_value of this AIHubPortfolioPosition. + + + :param position_value: The position_value of this AIHubPortfolioPosition. # noqa: E501 + :type: str + """ + + self._position_value = position_value + + @property + def margin(self): + """Gets the margin of this AIHubPortfolioPosition. # noqa: E501 + + + :return: The margin of this AIHubPortfolioPosition. # noqa: E501 + :rtype: str + """ + return self._margin + + @margin.setter + def margin(self, margin): + """Sets the margin of this AIHubPortfolioPosition. + + + :param margin: The margin of this AIHubPortfolioPosition. # noqa: E501 + :type: str + """ + + self._margin = margin + + @property + def side(self): + """Gets the side of this AIHubPortfolioPosition. # noqa: E501 + + + :return: The side of this AIHubPortfolioPosition. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this AIHubPortfolioPosition. + + + :param side: The side of this AIHubPortfolioPosition. # noqa: E501 + :type: str + """ + + self._side = side + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubPortfolioPosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubPortfolioPosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_portfolio_running_data.py b/gate_api/models/ai_hub_portfolio_running_data.py new file mode 100644 index 00000000..40e279f0 --- /dev/null +++ b/gate_api/models/ai_hub_portfolio_running_data.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubPortfolioRunningData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'items': 'list[AIHubPortfolioRunningItem]', + 'page': 'int', + 'page_size': 'int', + 'total': 'int' + } + + attribute_map = { + 'items': 'items', + 'page': 'page', + 'page_size': 'page_size', + 'total': 'total' + } + + def __init__(self, items=None, page=None, page_size=None, total=None, local_vars_configuration=None): # noqa: E501 + # type: (list[AIHubPortfolioRunningItem], int, int, int, Configuration) -> None + """AIHubPortfolioRunningData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._items = None + self._page = None + self._page_size = None + self._total = None + self.discriminator = None + + self.items = items + self.page = page + self.page_size = page_size + self.total = total + + @property + def items(self): + """Gets the items of this AIHubPortfolioRunningData. # noqa: E501 + + + :return: The items of this AIHubPortfolioRunningData. # noqa: E501 + :rtype: list[AIHubPortfolioRunningItem] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this AIHubPortfolioRunningData. + + + :param items: The items of this AIHubPortfolioRunningData. # noqa: E501 + :type: list[AIHubPortfolioRunningItem] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def page(self): + """Gets the page of this AIHubPortfolioRunningData. # noqa: E501 + + + :return: The page of this AIHubPortfolioRunningData. # noqa: E501 + :rtype: int + """ + return self._page + + @page.setter + def page(self, page): + """Sets the page of this AIHubPortfolioRunningData. + + + :param page: The page of this AIHubPortfolioRunningData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page is None: # noqa: E501 + raise ValueError("Invalid value for `page`, must not be `None`") # noqa: E501 + + self._page = page + + @property + def page_size(self): + """Gets the page_size of this AIHubPortfolioRunningData. # noqa: E501 + + + :return: The page_size of this AIHubPortfolioRunningData. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this AIHubPortfolioRunningData. + + + :param page_size: The page_size of this AIHubPortfolioRunningData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page_size is None: # noqa: E501 + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def total(self): + """Gets the total of this AIHubPortfolioRunningData. # noqa: E501 + + + :return: The total of this AIHubPortfolioRunningData. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this AIHubPortfolioRunningData. + + + :param total: The total of this AIHubPortfolioRunningData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubPortfolioRunningData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubPortfolioRunningData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_portfolio_running_item.py b/gate_api/models/ai_hub_portfolio_running_item.py new file mode 100644 index 00000000..9d7d214b --- /dev/null +++ b/gate_api/models/ai_hub_portfolio_running_item.py @@ -0,0 +1,336 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubPortfolioRunningItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_id': 'str', + 'strategy_type': 'StrategyType', + 'strategy_name': 'str', + 'market': 'str', + 'status': 'str', + 'pnl': 'str', + 'pnl_rate': 'str', + 'invest_amount': 'str', + 'created_at': 'str' + } + + attribute_map = { + 'strategy_id': 'strategy_id', + 'strategy_type': 'strategy_type', + 'strategy_name': 'strategy_name', + 'market': 'market', + 'status': 'status', + 'pnl': 'pnl', + 'pnl_rate': 'pnl_rate', + 'invest_amount': 'invest_amount', + 'created_at': 'created_at' + } + + def __init__(self, strategy_id=None, strategy_type=None, strategy_name=None, market=None, status=None, pnl=None, pnl_rate=None, invest_amount=None, created_at=None, local_vars_configuration=None): # noqa: E501 + # type: (str, StrategyType, str, str, str, str, str, str, str, Configuration) -> None + """AIHubPortfolioRunningItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_id = None + self._strategy_type = None + self._strategy_name = None + self._market = None + self._status = None + self._pnl = None + self._pnl_rate = None + self._invest_amount = None + self._created_at = None + self.discriminator = None + + self.strategy_id = strategy_id + self.strategy_type = strategy_type + self.strategy_name = strategy_name + self.market = market + self.status = status + if pnl is not None: + self.pnl = pnl + if pnl_rate is not None: + self.pnl_rate = pnl_rate + if invest_amount is not None: + self.invest_amount = invest_amount + if created_at is not None: + self.created_at = created_at + + @property + def strategy_id(self): + """Gets the strategy_id of this AIHubPortfolioRunningItem. # noqa: E501 + + + :return: The strategy_id of this AIHubPortfolioRunningItem. # noqa: E501 + :rtype: str + """ + return self._strategy_id + + @strategy_id.setter + def strategy_id(self, strategy_id): + """Sets the strategy_id of this AIHubPortfolioRunningItem. + + + :param strategy_id: The strategy_id of this AIHubPortfolioRunningItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_id is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_id`, must not be `None`") # noqa: E501 + + self._strategy_id = strategy_id + + @property + def strategy_type(self): + """Gets the strategy_type of this AIHubPortfolioRunningItem. # noqa: E501 + + + :return: The strategy_type of this AIHubPortfolioRunningItem. # noqa: E501 + :rtype: StrategyType + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this AIHubPortfolioRunningItem. + + + :param strategy_type: The strategy_type of this AIHubPortfolioRunningItem. # noqa: E501 + :type: StrategyType + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + + self._strategy_type = strategy_type + + @property + def strategy_name(self): + """Gets the strategy_name of this AIHubPortfolioRunningItem. # noqa: E501 + + + :return: The strategy_name of this AIHubPortfolioRunningItem. # noqa: E501 + :rtype: str + """ + return self._strategy_name + + @strategy_name.setter + def strategy_name(self, strategy_name): + """Sets the strategy_name of this AIHubPortfolioRunningItem. + + + :param strategy_name: The strategy_name of this AIHubPortfolioRunningItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_name is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_name`, must not be `None`") # noqa: E501 + + self._strategy_name = strategy_name + + @property + def market(self): + """Gets the market of this AIHubPortfolioRunningItem. # noqa: E501 + + + :return: The market of this AIHubPortfolioRunningItem. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this AIHubPortfolioRunningItem. + + + :param market: The market of this AIHubPortfolioRunningItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def status(self): + """Gets the status of this AIHubPortfolioRunningItem. # noqa: E501 + + + :return: The status of this AIHubPortfolioRunningItem. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AIHubPortfolioRunningItem. + + + :param status: The status of this AIHubPortfolioRunningItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def pnl(self): + """Gets the pnl of this AIHubPortfolioRunningItem. # noqa: E501 + + + :return: The pnl of this AIHubPortfolioRunningItem. # noqa: E501 + :rtype: str + """ + return self._pnl + + @pnl.setter + def pnl(self, pnl): + """Sets the pnl of this AIHubPortfolioRunningItem. + + + :param pnl: The pnl of this AIHubPortfolioRunningItem. # noqa: E501 + :type: str + """ + + self._pnl = pnl + + @property + def pnl_rate(self): + """Gets the pnl_rate of this AIHubPortfolioRunningItem. # noqa: E501 + + + :return: The pnl_rate of this AIHubPortfolioRunningItem. # noqa: E501 + :rtype: str + """ + return self._pnl_rate + + @pnl_rate.setter + def pnl_rate(self, pnl_rate): + """Sets the pnl_rate of this AIHubPortfolioRunningItem. + + + :param pnl_rate: The pnl_rate of this AIHubPortfolioRunningItem. # noqa: E501 + :type: str + """ + + self._pnl_rate = pnl_rate + + @property + def invest_amount(self): + """Gets the invest_amount of this AIHubPortfolioRunningItem. # noqa: E501 + + + :return: The invest_amount of this AIHubPortfolioRunningItem. # noqa: E501 + :rtype: str + """ + return self._invest_amount + + @invest_amount.setter + def invest_amount(self, invest_amount): + """Sets the invest_amount of this AIHubPortfolioRunningItem. + + + :param invest_amount: The invest_amount of this AIHubPortfolioRunningItem. # noqa: E501 + :type: str + """ + + self._invest_amount = invest_amount + + @property + def created_at(self): + """Gets the created_at of this AIHubPortfolioRunningItem. # noqa: E501 + + Created time # noqa: E501 + + :return: The created_at of this AIHubPortfolioRunningItem. # noqa: E501 + :rtype: str + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this AIHubPortfolioRunningItem. + + Created time # noqa: E501 + + :param created_at: The created_at of this AIHubPortfolioRunningItem. # noqa: E501 + :type: str + """ + + self._created_at = created_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubPortfolioRunningItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubPortfolioRunningItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_portfolio_running_success_response.py b/gate_api/models/ai_hub_portfolio_running_success_response.py new file mode 100644 index 00000000..4cf146e2 --- /dev/null +++ b/gate_api/models/ai_hub_portfolio_running_success_response.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubPortfolioRunningSuccessResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'AIHubPortfolioRunningData', + 'trace_id': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'trace_id': 'trace_id' + } + + def __init__(self, code=None, message=None, data=None, trace_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, AIHubPortfolioRunningData, str, Configuration) -> None + """AIHubPortfolioRunningSuccessResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._trace_id = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.trace_id = trace_id + + @property + def code(self): + """Gets the code of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + + + :return: The code of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this AIHubPortfolioRunningSuccessResponse. + + + :param code: The code of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + + + :return: The message of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this AIHubPortfolioRunningSuccessResponse. + + + :param message: The message of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + + + :return: The data of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + :rtype: AIHubPortfolioRunningData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this AIHubPortfolioRunningSuccessResponse. + + + :param data: The data of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + :type: AIHubPortfolioRunningData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def trace_id(self): + """Gets the trace_id of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + + + :return: The trace_id of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + :rtype: str + """ + return self._trace_id + + @trace_id.setter + def trace_id(self, trace_id): + """Sets the trace_id of this AIHubPortfolioRunningSuccessResponse. + + + :param trace_id: The trace_id of this AIHubPortfolioRunningSuccessResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and trace_id is None: # noqa: E501 + raise ValueError("Invalid value for `trace_id`, must not be `None`") # noqa: E501 + + self._trace_id = trace_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubPortfolioRunningSuccessResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubPortfolioRunningSuccessResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_portfolio_stop_data.py b/gate_api/models/ai_hub_portfolio_stop_data.py new file mode 100644 index 00000000..ad57364d --- /dev/null +++ b/gate_api/models/ai_hub_portfolio_stop_data.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubPortfolioStopData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_id': 'str', + 'strategy_type': 'StrategyType', + 'status': 'str', + 'result_message': 'str' + } + + attribute_map = { + 'strategy_id': 'strategy_id', + 'strategy_type': 'strategy_type', + 'status': 'status', + 'result_message': 'result_message' + } + + def __init__(self, strategy_id=None, strategy_type=None, status=None, result_message=None, local_vars_configuration=None): # noqa: E501 + # type: (str, StrategyType, str, str, Configuration) -> None + """AIHubPortfolioStopData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_id = None + self._strategy_type = None + self._status = None + self._result_message = None + self.discriminator = None + + self.strategy_id = strategy_id + self.strategy_type = strategy_type + self.status = status + self.result_message = result_message + + @property + def strategy_id(self): + """Gets the strategy_id of this AIHubPortfolioStopData. # noqa: E501 + + + :return: The strategy_id of this AIHubPortfolioStopData. # noqa: E501 + :rtype: str + """ + return self._strategy_id + + @strategy_id.setter + def strategy_id(self, strategy_id): + """Sets the strategy_id of this AIHubPortfolioStopData. + + + :param strategy_id: The strategy_id of this AIHubPortfolioStopData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_id is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_id`, must not be `None`") # noqa: E501 + + self._strategy_id = strategy_id + + @property + def strategy_type(self): + """Gets the strategy_type of this AIHubPortfolioStopData. # noqa: E501 + + + :return: The strategy_type of this AIHubPortfolioStopData. # noqa: E501 + :rtype: StrategyType + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this AIHubPortfolioStopData. + + + :param strategy_type: The strategy_type of this AIHubPortfolioStopData. # noqa: E501 + :type: StrategyType + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + + self._strategy_type = strategy_type + + @property + def status(self): + """Gets the status of this AIHubPortfolioStopData. # noqa: E501 + + The current implementation returns `stopping` # noqa: E501 + + :return: The status of this AIHubPortfolioStopData. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AIHubPortfolioStopData. + + The current implementation returns `stopping` # noqa: E501 + + :param status: The status of this AIHubPortfolioStopData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def result_message(self): + """Gets the result_message of this AIHubPortfolioStopData. # noqa: E501 + + + :return: The result_message of this AIHubPortfolioStopData. # noqa: E501 + :rtype: str + """ + return self._result_message + + @result_message.setter + def result_message(self, result_message): + """Sets the result_message of this AIHubPortfolioStopData. + + + :param result_message: The result_message of this AIHubPortfolioStopData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and result_message is None: # noqa: E501 + raise ValueError("Invalid value for `result_message`, must not be `None`") # noqa: E501 + + self._result_message = result_message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubPortfolioStopData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubPortfolioStopData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_loan_currency.py b/gate_api/models/ai_hub_portfolio_stop_request.py similarity index 54% rename from gate_api/models/collateral_loan_currency.py rename to gate_api/models/ai_hub_portfolio_stop_request.py index 67b6713c..e39c103a 100644 --- a/gate_api/models/collateral_loan_currency.py +++ b/gate_api/models/ai_hub_portfolio_stop_request.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class CollateralLoanCurrency(object): +class AIHubPortfolioStopRequest(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -33,76 +33,74 @@ class CollateralLoanCurrency(object): and the value is json key in definition. """ openapi_types = { - 'loan_currency': 'str', - 'collateral_currency': 'list[str]' + 'strategy_id': 'str', + 'strategy_type': 'StrategyType' } attribute_map = { - 'loan_currency': 'loan_currency', - 'collateral_currency': 'collateral_currency' + 'strategy_id': 'strategy_id', + 'strategy_type': 'strategy_type' } - def __init__(self, loan_currency=None, collateral_currency=None, local_vars_configuration=None): # noqa: E501 - # type: (str, list[str], Configuration) -> None - """CollateralLoanCurrency - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, strategy_id=None, strategy_type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, StrategyType, Configuration) -> None + """AIHubPortfolioStopRequest - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration - self._loan_currency = None - self._collateral_currency = None + self._strategy_id = None + self._strategy_type = None self.discriminator = None - if loan_currency is not None: - self.loan_currency = loan_currency - if collateral_currency is not None: - self.collateral_currency = collateral_currency + self.strategy_id = strategy_id + self.strategy_type = strategy_type @property - def loan_currency(self): - """Gets the loan_currency of this CollateralLoanCurrency. # noqa: E501 + def strategy_id(self): + """Gets the strategy_id of this AIHubPortfolioStopRequest. # noqa: E501 - Borrowed currency # noqa: E501 - :return: The loan_currency of this CollateralLoanCurrency. # noqa: E501 + :return: The strategy_id of this AIHubPortfolioStopRequest. # noqa: E501 :rtype: str """ - return self._loan_currency + return self._strategy_id - @loan_currency.setter - def loan_currency(self, loan_currency): - """Sets the loan_currency of this CollateralLoanCurrency. + @strategy_id.setter + def strategy_id(self, strategy_id): + """Sets the strategy_id of this AIHubPortfolioStopRequest. - Borrowed currency # noqa: E501 - :param loan_currency: The loan_currency of this CollateralLoanCurrency. # noqa: E501 + :param strategy_id: The strategy_id of this AIHubPortfolioStopRequest. # noqa: E501 :type: str """ + if self.local_vars_configuration.client_side_validation and strategy_id is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_id`, must not be `None`") # noqa: E501 - self._loan_currency = loan_currency + self._strategy_id = strategy_id @property - def collateral_currency(self): - """Gets the collateral_currency of this CollateralLoanCurrency. # noqa: E501 + def strategy_type(self): + """Gets the strategy_type of this AIHubPortfolioStopRequest. # noqa: E501 - List of supported collateral currencies # noqa: E501 - :return: The collateral_currency of this CollateralLoanCurrency. # noqa: E501 - :rtype: list[str] + :return: The strategy_type of this AIHubPortfolioStopRequest. # noqa: E501 + :rtype: StrategyType """ - return self._collateral_currency + return self._strategy_type - @collateral_currency.setter - def collateral_currency(self, collateral_currency): - """Sets the collateral_currency of this CollateralLoanCurrency. + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this AIHubPortfolioStopRequest. - List of supported collateral currencies # noqa: E501 - :param collateral_currency: The collateral_currency of this CollateralLoanCurrency. # noqa: E501 - :type: list[str] + :param strategy_type: The strategy_type of this AIHubPortfolioStopRequest. # noqa: E501 + :type: StrategyType """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 - self._collateral_currency = collateral_currency + self._strategy_type = strategy_type def to_dict(self): """Returns the model properties as a dict""" @@ -138,14 +136,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, CollateralLoanCurrency): + if not isinstance(other, AIHubPortfolioStopRequest): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, CollateralLoanCurrency): + if not isinstance(other, AIHubPortfolioStopRequest): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_portfolio_stop_success_response.py b/gate_api/models/ai_hub_portfolio_stop_success_response.py new file mode 100644 index 00000000..1917fe64 --- /dev/null +++ b/gate_api/models/ai_hub_portfolio_stop_success_response.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubPortfolioStopSuccessResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'AIHubPortfolioStopData', + 'trace_id': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'trace_id': 'trace_id' + } + + def __init__(self, code=None, message=None, data=None, trace_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, AIHubPortfolioStopData, str, Configuration) -> None + """AIHubPortfolioStopSuccessResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._trace_id = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.trace_id = trace_id + + @property + def code(self): + """Gets the code of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + + + :return: The code of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this AIHubPortfolioStopSuccessResponse. + + + :param code: The code of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + + + :return: The message of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this AIHubPortfolioStopSuccessResponse. + + + :param message: The message of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + + + :return: The data of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + :rtype: AIHubPortfolioStopData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this AIHubPortfolioStopSuccessResponse. + + + :param data: The data of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + :type: AIHubPortfolioStopData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def trace_id(self): + """Gets the trace_id of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + + + :return: The trace_id of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + :rtype: str + """ + return self._trace_id + + @trace_id.setter + def trace_id(self, trace_id): + """Sets the trace_id of this AIHubPortfolioStopSuccessResponse. + + + :param trace_id: The trace_id of this AIHubPortfolioStopSuccessResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and trace_id is None: # noqa: E501 + raise ValueError("Invalid value for `trace_id`, must not be `None`") # noqa: E501 + + self._trace_id = trace_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubPortfolioStopSuccessResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubPortfolioStopSuccessResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ai_hub_recommendation.py b/gate_api/models/ai_hub_recommendation.py new file mode 100644 index 00000000..1d23c1b6 --- /dev/null +++ b/gate_api/models/ai_hub_recommendation.py @@ -0,0 +1,310 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AIHubRecommendation(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'recommendation_id': 'str', + 'market': 'str', + 'strategy_type': 'StrategyType', + 'strategy_name': 'str', + 'backtest_apr': 'str', + 'max_drawdown': 'str', + 'summary': 'str', + 'strategy_params_preview': 'str' + } + + attribute_map = { + 'recommendation_id': 'recommendation_id', + 'market': 'market', + 'strategy_type': 'strategy_type', + 'strategy_name': 'strategy_name', + 'backtest_apr': 'backtest_apr', + 'max_drawdown': 'max_drawdown', + 'summary': 'summary', + 'strategy_params_preview': 'strategy_params_preview' + } + + def __init__(self, recommendation_id=None, market=None, strategy_type=None, strategy_name=None, backtest_apr=None, max_drawdown=None, summary=None, strategy_params_preview=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, StrategyType, str, str, str, str, str, Configuration) -> None + """AIHubRecommendation - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._recommendation_id = None + self._market = None + self._strategy_type = None + self._strategy_name = None + self._backtest_apr = None + self._max_drawdown = None + self._summary = None + self._strategy_params_preview = None + self.discriminator = None + + self.recommendation_id = recommendation_id + self.market = market + self.strategy_type = strategy_type + self.strategy_name = strategy_name + if backtest_apr is not None: + self.backtest_apr = backtest_apr + if max_drawdown is not None: + self.max_drawdown = max_drawdown + self.summary = summary + if strategy_params_preview is not None: + self.strategy_params_preview = strategy_params_preview + + @property + def recommendation_id(self): + """Gets the recommendation_id of this AIHubRecommendation. # noqa: E501 + + + :return: The recommendation_id of this AIHubRecommendation. # noqa: E501 + :rtype: str + """ + return self._recommendation_id + + @recommendation_id.setter + def recommendation_id(self, recommendation_id): + """Sets the recommendation_id of this AIHubRecommendation. + + + :param recommendation_id: The recommendation_id of this AIHubRecommendation. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and recommendation_id is None: # noqa: E501 + raise ValueError("Invalid value for `recommendation_id`, must not be `None`") # noqa: E501 + + self._recommendation_id = recommendation_id + + @property + def market(self): + """Gets the market of this AIHubRecommendation. # noqa: E501 + + + :return: The market of this AIHubRecommendation. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this AIHubRecommendation. + + + :param market: The market of this AIHubRecommendation. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def strategy_type(self): + """Gets the strategy_type of this AIHubRecommendation. # noqa: E501 + + + :return: The strategy_type of this AIHubRecommendation. # noqa: E501 + :rtype: StrategyType + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this AIHubRecommendation. + + + :param strategy_type: The strategy_type of this AIHubRecommendation. # noqa: E501 + :type: StrategyType + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + + self._strategy_type = strategy_type + + @property + def strategy_name(self): + """Gets the strategy_name of this AIHubRecommendation. # noqa: E501 + + + :return: The strategy_name of this AIHubRecommendation. # noqa: E501 + :rtype: str + """ + return self._strategy_name + + @strategy_name.setter + def strategy_name(self, strategy_name): + """Sets the strategy_name of this AIHubRecommendation. + + + :param strategy_name: The strategy_name of this AIHubRecommendation. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_name is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_name`, must not be `None`") # noqa: E501 + + self._strategy_name = strategy_name + + @property + def backtest_apr(self): + """Gets the backtest_apr of this AIHubRecommendation. # noqa: E501 + + + :return: The backtest_apr of this AIHubRecommendation. # noqa: E501 + :rtype: str + """ + return self._backtest_apr + + @backtest_apr.setter + def backtest_apr(self, backtest_apr): + """Sets the backtest_apr of this AIHubRecommendation. + + + :param backtest_apr: The backtest_apr of this AIHubRecommendation. # noqa: E501 + :type: str + """ + + self._backtest_apr = backtest_apr + + @property + def max_drawdown(self): + """Gets the max_drawdown of this AIHubRecommendation. # noqa: E501 + + + :return: The max_drawdown of this AIHubRecommendation. # noqa: E501 + :rtype: str + """ + return self._max_drawdown + + @max_drawdown.setter + def max_drawdown(self, max_drawdown): + """Sets the max_drawdown of this AIHubRecommendation. + + + :param max_drawdown: The max_drawdown of this AIHubRecommendation. # noqa: E501 + :type: str + """ + + self._max_drawdown = max_drawdown + + @property + def summary(self): + """Gets the summary of this AIHubRecommendation. # noqa: E501 + + + :return: The summary of this AIHubRecommendation. # noqa: E501 + :rtype: str + """ + return self._summary + + @summary.setter + def summary(self, summary): + """Sets the summary of this AIHubRecommendation. + + + :param summary: The summary of this AIHubRecommendation. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and summary is None: # noqa: E501 + raise ValueError("Invalid value for `summary`, must not be `None`") # noqa: E501 + + self._summary = summary + + @property + def strategy_params_preview(self): + """Gets the strategy_params_preview of this AIHubRecommendation. # noqa: E501 + + Recommended-parameter preview as JSON text (string-encoded so clients deserialize it consistently). The value is a serialized JSON object whose structure varies by strategy type; callers or upper-layer models must parse it. # noqa: E501 + + :return: The strategy_params_preview of this AIHubRecommendation. # noqa: E501 + :rtype: str + """ + return self._strategy_params_preview + + @strategy_params_preview.setter + def strategy_params_preview(self, strategy_params_preview): + """Sets the strategy_params_preview of this AIHubRecommendation. + + Recommended-parameter preview as JSON text (string-encoded so clients deserialize it consistently). The value is a serialized JSON object whose structure varies by strategy type; callers or upper-layer models must parse it. # noqa: E501 + + :param strategy_params_preview: The strategy_params_preview of this AIHubRecommendation. # noqa: E501 + :type: str + """ + + self._strategy_params_preview = strategy_params_preview + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AIHubRecommendation): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AIHubRecommendation): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/alpha_currency.py b/gate_api/models/alpha_currency.py new file mode 100644 index 00000000..c3e84805 --- /dev/null +++ b/gate_api/models/alpha_currency.py @@ -0,0 +1,291 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AlphaCurrency(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency': 'str', + 'name': 'str', + 'chain': 'str', + 'address': 'str', + 'amount_precision': 'int', + 'precision': 'int', + 'status': 'int' + } + + attribute_map = { + 'currency': 'currency', + 'name': 'name', + 'chain': 'chain', + 'address': 'address', + 'amount_precision': 'amount_precision', + 'precision': 'precision', + 'status': 'status' + } + + def __init__(self, currency=None, name=None, chain=None, address=None, amount_precision=None, precision=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, int, int, Configuration) -> None + """AlphaCurrency - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._name = None + self._chain = None + self._address = None + self._amount_precision = None + self._precision = None + self._status = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if name is not None: + self.name = name + if chain is not None: + self.chain = chain + if address is not None: + self.address = address + if amount_precision is not None: + self.amount_precision = amount_precision + if precision is not None: + self.precision = precision + if status is not None: + self.status = status + + @property + def currency(self): + """Gets the currency of this AlphaCurrency. # noqa: E501 + + Currency symbol # noqa: E501 + + :return: The currency of this AlphaCurrency. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this AlphaCurrency. + + Currency symbol # noqa: E501 + + :param currency: The currency of this AlphaCurrency. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def name(self): + """Gets the name of this AlphaCurrency. # noqa: E501 + + Currency name # noqa: E501 + + :return: The name of this AlphaCurrency. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AlphaCurrency. + + Currency name # noqa: E501 + + :param name: The name of this AlphaCurrency. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def chain(self): + """Gets the chain of this AlphaCurrency. # noqa: E501 + + The main chain corresponding to the coin # noqa: E501 + + :return: The chain of this AlphaCurrency. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this AlphaCurrency. + + The main chain corresponding to the coin # noqa: E501 + + :param chain: The chain of this AlphaCurrency. # noqa: E501 + :type: str + """ + + self._chain = chain + + @property + def address(self): + """Gets the address of this AlphaCurrency. # noqa: E501 + + Contract Address # noqa: E501 + + :return: The address of this AlphaCurrency. # noqa: E501 + :rtype: str + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this AlphaCurrency. + + Contract Address # noqa: E501 + + :param address: The address of this AlphaCurrency. # noqa: E501 + :type: str + """ + + self._address = address + + @property + def amount_precision(self): + """Gets the amount_precision of this AlphaCurrency. # noqa: E501 + + Quantity precision # noqa: E501 + + :return: The amount_precision of this AlphaCurrency. # noqa: E501 + :rtype: int + """ + return self._amount_precision + + @amount_precision.setter + def amount_precision(self, amount_precision): + """Sets the amount_precision of this AlphaCurrency. + + Quantity precision # noqa: E501 + + :param amount_precision: The amount_precision of this AlphaCurrency. # noqa: E501 + :type: int + """ + + self._amount_precision = amount_precision + + @property + def precision(self): + """Gets the precision of this AlphaCurrency. # noqa: E501 + + Price precision # noqa: E501 + + :return: The precision of this AlphaCurrency. # noqa: E501 + :rtype: int + """ + return self._precision + + @precision.setter + def precision(self, precision): + """Sets the precision of this AlphaCurrency. + + Price precision # noqa: E501 + + :param precision: The precision of this AlphaCurrency. # noqa: E501 + :type: int + """ + + self._precision = precision + + @property + def status(self): + """Gets the status of this AlphaCurrency. # noqa: E501 + + Currency Trading Status - `1` : Normal trading - `2` : Suspended trading - `3` : Delisted # noqa: E501 + + :return: The status of this AlphaCurrency. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AlphaCurrency. + + Currency Trading Status - `1` : Normal trading - `2` : Suspended trading - `3` : Delisted # noqa: E501 + + :param status: The status of this AlphaCurrency. # noqa: E501 + :type: int + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AlphaCurrency): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AlphaCurrency): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/alpha_ticker.py b/gate_api/models/alpha_ticker.py new file mode 100644 index 00000000..0fee1033 --- /dev/null +++ b/gate_api/models/alpha_ticker.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AlphaTicker(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency': 'str', + 'last': 'str', + 'change': 'str', + 'volume': 'str', + 'market_cap': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'last': 'last', + 'change': 'change', + 'volume': 'volume', + 'market_cap': 'market_cap' + } + + def __init__(self, currency=None, last=None, change=None, volume=None, market_cap=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """AlphaTicker - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._last = None + self._change = None + self._volume = None + self._market_cap = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if last is not None: + self.last = last + if change is not None: + self.change = change + if volume is not None: + self.volume = volume + if market_cap is not None: + self.market_cap = market_cap + + @property + def currency(self): + """Gets the currency of this AlphaTicker. # noqa: E501 + + Currency symbol # noqa: E501 + + :return: The currency of this AlphaTicker. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this AlphaTicker. + + Currency symbol # noqa: E501 + + :param currency: The currency of this AlphaTicker. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def last(self): + """Gets the last of this AlphaTicker. # noqa: E501 + + Last trading price # noqa: E501 + + :return: The last of this AlphaTicker. # noqa: E501 + :rtype: str + """ + return self._last + + @last.setter + def last(self, last): + """Sets the last of this AlphaTicker. + + Last trading price # noqa: E501 + + :param last: The last of this AlphaTicker. # noqa: E501 + :type: str + """ + + self._last = last + + @property + def change(self): + """Gets the change of this AlphaTicker. # noqa: E501 + + 24h price change percentage (negative for decrease, e.g., -7.45) # noqa: E501 + + :return: The change of this AlphaTicker. # noqa: E501 + :rtype: str + """ + return self._change + + @change.setter + def change(self, change): + """Sets the change of this AlphaTicker. + + 24h price change percentage (negative for decrease, e.g., -7.45) # noqa: E501 + + :param change: The change of this AlphaTicker. # noqa: E501 + :type: str + """ + + self._change = change + + @property + def volume(self): + """Gets the volume of this AlphaTicker. # noqa: E501 + + 24h Trading Volume (USDT) # noqa: E501 + + :return: The volume of this AlphaTicker. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this AlphaTicker. + + 24h Trading Volume (USDT) # noqa: E501 + + :param volume: The volume of this AlphaTicker. # noqa: E501 + :type: str + """ + + self._volume = volume + + @property + def market_cap(self): + """Gets the market_cap of this AlphaTicker. # noqa: E501 + + Current Token Market Cap # noqa: E501 + + :return: The market_cap of this AlphaTicker. # noqa: E501 + :rtype: str + """ + return self._market_cap + + @market_cap.setter + def market_cap(self, market_cap): + """Sets the market_cap of this AlphaTicker. + + Current Token Market Cap # noqa: E501 + + :param market_cap: The market_cap of this AlphaTicker. # noqa: E501 + :type: str + """ + + self._market_cap = market_cap + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AlphaTicker): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AlphaTicker): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/amend_options_order_request.py b/gate_api/models/amend_options_order_request.py new file mode 100644 index 00000000..5b57d56d --- /dev/null +++ b/gate_api/models/amend_options_order_request.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AmendOptionsOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'contract': 'str', + 'price': 'str', + 'size': 'int' + } + + attribute_map = { + 'contract': 'contract', + 'price': 'price', + 'size': 'size' + } + + def __init__(self, contract=None, price=None, size=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, Configuration) -> None + """AmendOptionsOrderRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._contract = None + self._price = None + self._size = None + self.discriminator = None + + self.contract = contract + self.price = price + self.size = size + + @property + def contract(self): + """Gets the contract of this AmendOptionsOrderRequest. # noqa: E501 + + Options contract name # noqa: E501 + + :return: The contract of this AmendOptionsOrderRequest. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this AmendOptionsOrderRequest. + + Options contract name # noqa: E501 + + :param contract: The contract of this AmendOptionsOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and contract is None: # noqa: E501 + raise ValueError("Invalid value for `contract`, must not be `None`") # noqa: E501 + + self._contract = contract + + @property + def price(self): + """Gets the price of this AmendOptionsOrderRequest. # noqa: E501 + + Order Price # noqa: E501 + + :return: The price of this AmendOptionsOrderRequest. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this AmendOptionsOrderRequest. + + Order Price # noqa: E501 + + :param price: The price of this AmendOptionsOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price is None: # noqa: E501 + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + @property + def size(self): + """Gets the size of this AmendOptionsOrderRequest. # noqa: E501 + + Trade amount # noqa: E501 + + :return: The size of this AmendOptionsOrderRequest. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this AmendOptionsOrderRequest. + + Trade amount # noqa: E501 + + :param size: The size of this AmendOptionsOrderRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and size is None: # noqa: E501 + raise ValueError("Invalid value for `size`, must not be `None`") # noqa: E501 + + self._size = size + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AmendOptionsOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AmendOptionsOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_asset_swap_config.py b/gate_api/models/api_response_asset_swap_config.py new file mode 100644 index 00000000..5a6a6fac --- /dev/null +++ b/gate_api/models/api_response_asset_swap_config.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseAssetSwapConfig(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, object, int, Configuration) -> None + """ApiResponseAssetSwapConfig - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + if label is not None: + self.label = label + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseAssetSwapConfig. # noqa: E501 + + Business error code, 0 means success # noqa: E501 + + :return: The code of this ApiResponseAssetSwapConfig. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseAssetSwapConfig. + + Business error code, 0 means success # noqa: E501 + + :param code: The code of this ApiResponseAssetSwapConfig. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseAssetSwapConfig. # noqa: E501 + + Error identification code, empty string on success # noqa: E501 + + :return: The label of this ApiResponseAssetSwapConfig. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseAssetSwapConfig. + + Error identification code, empty string on success # noqa: E501 + + :param label: The label of this ApiResponseAssetSwapConfig. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseAssetSwapConfig. # noqa: E501 + + Description information # noqa: E501 + + :return: The message of this ApiResponseAssetSwapConfig. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseAssetSwapConfig. + + Description information # noqa: E501 + + :param message: The message of this ApiResponseAssetSwapConfig. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseAssetSwapConfig. # noqa: E501 + + Front-end configuration on success, null on failure # noqa: E501 + + :return: The data of this ApiResponseAssetSwapConfig. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseAssetSwapConfig. + + Front-end configuration on success, null on failure # noqa: E501 + + :param data: The data of this ApiResponseAssetSwapConfig. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseAssetSwapConfig. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseAssetSwapConfig. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseAssetSwapConfig. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseAssetSwapConfig. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseAssetSwapConfig): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseAssetSwapConfig): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_asset_swap_evaluate.py b/gate_api/models/api_response_asset_swap_evaluate.py new file mode 100644 index 00000000..dd44ba76 --- /dev/null +++ b/gate_api/models/api_response_asset_swap_evaluate.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseAssetSwapEvaluate(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, object, int, Configuration) -> None + """ApiResponseAssetSwapEvaluate - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + if label is not None: + self.label = label + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseAssetSwapEvaluate. # noqa: E501 + + Business error code, 0 means success # noqa: E501 + + :return: The code of this ApiResponseAssetSwapEvaluate. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseAssetSwapEvaluate. + + Business error code, 0 means success # noqa: E501 + + :param code: The code of this ApiResponseAssetSwapEvaluate. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseAssetSwapEvaluate. # noqa: E501 + + Error identification code, empty string on success # noqa: E501 + + :return: The label of this ApiResponseAssetSwapEvaluate. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseAssetSwapEvaluate. + + Error identification code, empty string on success # noqa: E501 + + :param label: The label of this ApiResponseAssetSwapEvaluate. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseAssetSwapEvaluate. # noqa: E501 + + Description information # noqa: E501 + + :return: The message of this ApiResponseAssetSwapEvaluate. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseAssetSwapEvaluate. + + Description information # noqa: E501 + + :param message: The message of this ApiResponseAssetSwapEvaluate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseAssetSwapEvaluate. # noqa: E501 + + Estimated paginated data on success, null on failure # noqa: E501 + + :return: The data of this ApiResponseAssetSwapEvaluate. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseAssetSwapEvaluate. + + Estimated paginated data on success, null on failure # noqa: E501 + + :param data: The data of this ApiResponseAssetSwapEvaluate. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseAssetSwapEvaluate. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseAssetSwapEvaluate. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseAssetSwapEvaluate. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseAssetSwapEvaluate. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseAssetSwapEvaluate): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseAssetSwapEvaluate): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_asset_swap_list_assets.py b/gate_api/models/api_response_asset_swap_list_assets.py new file mode 100644 index 00000000..166d5b3b --- /dev/null +++ b/gate_api/models/api_response_asset_swap_list_assets.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseAssetSwapListAssets(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, object, int, Configuration) -> None + """ApiResponseAssetSwapListAssets - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + if label is not None: + self.label = label + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseAssetSwapListAssets. # noqa: E501 + + Business error code, 0 means success # noqa: E501 + + :return: The code of this ApiResponseAssetSwapListAssets. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseAssetSwapListAssets. + + Business error code, 0 means success # noqa: E501 + + :param code: The code of this ApiResponseAssetSwapListAssets. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseAssetSwapListAssets. # noqa: E501 + + Error identification code, empty string on success # noqa: E501 + + :return: The label of this ApiResponseAssetSwapListAssets. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseAssetSwapListAssets. + + Error identification code, empty string on success # noqa: E501 + + :param label: The label of this ApiResponseAssetSwapListAssets. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseAssetSwapListAssets. # noqa: E501 + + Description information # noqa: E501 + + :return: The message of this ApiResponseAssetSwapListAssets. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseAssetSwapListAssets. + + Description information # noqa: E501 + + :param message: The message of this ApiResponseAssetSwapListAssets. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseAssetSwapListAssets. # noqa: E501 + + Currency list data on success, null on failure # noqa: E501 + + :return: The data of this ApiResponseAssetSwapListAssets. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseAssetSwapListAssets. + + Currency list data on success, null on failure # noqa: E501 + + :param data: The data of this ApiResponseAssetSwapListAssets. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseAssetSwapListAssets. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseAssetSwapListAssets. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseAssetSwapListAssets. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseAssetSwapListAssets. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseAssetSwapListAssets): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseAssetSwapListAssets): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_asset_swap_order_create_v1.py b/gate_api/models/api_response_asset_swap_order_create_v1.py new file mode 100644 index 00000000..b7e1ed22 --- /dev/null +++ b/gate_api/models/api_response_asset_swap_order_create_v1.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseAssetSwapOrderCreateV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, object, int, Configuration) -> None + """ApiResponseAssetSwapOrderCreateV1 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + if label is not None: + self.label = label + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + + Business error code, 0 means success # noqa: E501 + + :return: The code of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseAssetSwapOrderCreateV1. + + Business error code, 0 means success # noqa: E501 + + :param code: The code of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + + Error identification code, empty string on success # noqa: E501 + + :return: The label of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseAssetSwapOrderCreateV1. + + Error identification code, empty string on success # noqa: E501 + + :param label: The label of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + + Description information # noqa: E501 + + :return: The message of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseAssetSwapOrderCreateV1. + + Description information # noqa: E501 + + :param message: The message of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + + It is the order result when successful, and null when it fails. # noqa: E501 + + :return: The data of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseAssetSwapOrderCreateV1. + + It is the order result when successful, and null when it fails. # noqa: E501 + + :param data: The data of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseAssetSwapOrderCreateV1. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseAssetSwapOrderCreateV1. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseAssetSwapOrderCreateV1): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseAssetSwapOrderCreateV1): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_asset_swap_order_list_v1.py b/gate_api/models/api_response_asset_swap_order_list_v1.py new file mode 100644 index 00000000..246b4b79 --- /dev/null +++ b/gate_api/models/api_response_asset_swap_order_list_v1.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseAssetSwapOrderListV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, object, int, Configuration) -> None + """ApiResponseAssetSwapOrderListV1 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + if label is not None: + self.label = label + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + + Business error code, 0 means success # noqa: E501 + + :return: The code of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseAssetSwapOrderListV1. + + Business error code, 0 means success # noqa: E501 + + :param code: The code of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + + Error identification code, empty string on success # noqa: E501 + + :return: The label of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseAssetSwapOrderListV1. + + Error identification code, empty string on success # noqa: E501 + + :param label: The label of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + + Description information # noqa: E501 + + :return: The message of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseAssetSwapOrderListV1. + + Description information # noqa: E501 + + :param message: The message of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + + Order list data on success, null on failure # noqa: E501 + + :return: The data of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseAssetSwapOrderListV1. + + Order list data on success, null on failure # noqa: E501 + + :param data: The data of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseAssetSwapOrderListV1. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseAssetSwapOrderListV1. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseAssetSwapOrderListV1): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseAssetSwapOrderListV1): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_asset_swap_order_preview_v1.py b/gate_api/models/api_response_asset_swap_order_preview_v1.py new file mode 100644 index 00000000..24533878 --- /dev/null +++ b/gate_api/models/api_response_asset_swap_order_preview_v1.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseAssetSwapOrderPreviewV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, object, int, Configuration) -> None + """ApiResponseAssetSwapOrderPreviewV1 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + if label is not None: + self.label = label + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + + Business error code, 0 means success # noqa: E501 + + :return: The code of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseAssetSwapOrderPreviewV1. + + Business error code, 0 means success # noqa: E501 + + :param code: The code of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + + Error identification code, empty string on success # noqa: E501 + + :return: The label of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseAssetSwapOrderPreviewV1. + + Error identification code, empty string on success # noqa: E501 + + :param label: The label of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + + Description information # noqa: E501 + + :return: The message of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseAssetSwapOrderPreviewV1. + + Description information # noqa: E501 + + :param message: The message of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + + Preview result when successful, null when failed # noqa: E501 + + :return: The data of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseAssetSwapOrderPreviewV1. + + Preview result when successful, null when failed # noqa: E501 + + :param data: The data of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseAssetSwapOrderPreviewV1. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseAssetSwapOrderPreviewV1. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseAssetSwapOrderPreviewV1): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseAssetSwapOrderPreviewV1): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_asset_swap_order_query_v1.py b/gate_api/models/api_response_asset_swap_order_query_v1.py new file mode 100644 index 00000000..0c39b171 --- /dev/null +++ b/gate_api/models/api_response_asset_swap_order_query_v1.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseAssetSwapOrderQueryV1(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, object, int, Configuration) -> None + """ApiResponseAssetSwapOrderQueryV1 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + if label is not None: + self.label = label + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + + Business error code, 0 means success # noqa: E501 + + :return: The code of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseAssetSwapOrderQueryV1. + + Business error code, 0 means success # noqa: E501 + + :param code: The code of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + + Error identification code, empty string on success # noqa: E501 + + :return: The label of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseAssetSwapOrderQueryV1. + + Error identification code, empty string on success # noqa: E501 + + :param label: The label of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + + Description information # noqa: E501 + + :return: The message of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseAssetSwapOrderQueryV1. + + Description information # noqa: E501 + + :param message: The message of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + + Order details on success, null on failure # noqa: E501 + + :return: The data of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseAssetSwapOrderQueryV1. + + Order details on success, null on failure # noqa: E501 + + :param data: The data of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseAssetSwapOrderQueryV1. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseAssetSwapOrderQueryV1. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseAssetSwapOrderQueryV1): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseAssetSwapOrderQueryV1): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_ex_skill_claim_reward_resp.py b/gate_api/models/api_response_ex_skill_claim_reward_resp.py new file mode 100644 index 00000000..dce5f741 --- /dev/null +++ b/gate_api/models/api_response_ex_skill_claim_reward_resp.py @@ -0,0 +1,233 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseExSkillClaimRewardResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'ApiResponseExSkillClaimRewardRespData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, ApiResponseExSkillClaimRewardRespData, int, Configuration) -> None + """ApiResponseExSkillClaimRewardResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + if code is not None: + self.code = code + if label is not None: + self.label = label + if message is not None: + self.message = message + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + + Business error code, 0 means success # noqa: E501 + + :return: The code of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseExSkillClaimRewardResp. + + Business error code, 0 means success # noqa: E501 + + :param code: The code of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :return: The label of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseExSkillClaimRewardResp. + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :param label: The label of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + + Error description # noqa: E501 + + :return: The message of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseExSkillClaimRewardResp. + + Error description # noqa: E501 + + :param message: The message of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + + + :return: The data of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + :rtype: ApiResponseExSkillClaimRewardRespData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseExSkillClaimRewardResp. + + + :param data: The data of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + :type: ApiResponseExSkillClaimRewardRespData + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseExSkillClaimRewardResp. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseExSkillClaimRewardResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseExSkillClaimRewardResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseExSkillClaimRewardResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_ex_skill_claim_reward_resp_data.py b/gate_api/models/api_response_ex_skill_claim_reward_resp_data.py new file mode 100644 index 00000000..f9bdc714 --- /dev/null +++ b/gate_api/models/api_response_ex_skill_claim_reward_resp_data.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseExSkillClaimRewardRespData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'has_m_n_task': 'bool', + 'coupon_full_name': 'str' + } + + attribute_map = { + 'has_m_n_task': 'has_m_n_task', + 'coupon_full_name': 'coupon_full_name' + } + + def __init__(self, has_m_n_task=None, coupon_full_name=None, local_vars_configuration=None): # noqa: E501 + # type: (bool, str, Configuration) -> None + """ApiResponseExSkillClaimRewardRespData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._has_m_n_task = None + self._coupon_full_name = None + self.discriminator = None + + if has_m_n_task is not None: + self.has_m_n_task = has_m_n_task + if coupon_full_name is not None: + self.coupon_full_name = coupon_full_name + + @property + def has_m_n_task(self): + """Gets the has_m_n_task of this ApiResponseExSkillClaimRewardRespData. # noqa: E501 + + Whether to choose n prize pool tasks for m. When it is true, it only prompts a jump and does not actually issue prizes. # noqa: E501 + + :return: The has_m_n_task of this ApiResponseExSkillClaimRewardRespData. # noqa: E501 + :rtype: bool + """ + return self._has_m_n_task + + @has_m_n_task.setter + def has_m_n_task(self, has_m_n_task): + """Sets the has_m_n_task of this ApiResponseExSkillClaimRewardRespData. + + Whether to choose n prize pool tasks for m. When it is true, it only prompts a jump and does not actually issue prizes. # noqa: E501 + + :param has_m_n_task: The has_m_n_task of this ApiResponseExSkillClaimRewardRespData. # noqa: E501 + :type: bool + """ + + self._has_m_n_task = has_m_n_task + + @property + def coupon_full_name(self): + """Gets the coupon_full_name of this ApiResponseExSkillClaimRewardRespData. # noqa: E501 + + The full name of the card reward. It is an empty string when it is not a coupon reward or cannot be parsed. # noqa: E501 + + :return: The coupon_full_name of this ApiResponseExSkillClaimRewardRespData. # noqa: E501 + :rtype: str + """ + return self._coupon_full_name + + @coupon_full_name.setter + def coupon_full_name(self, coupon_full_name): + """Sets the coupon_full_name of this ApiResponseExSkillClaimRewardRespData. + + The full name of the card reward. It is an empty string when it is not a coupon reward or cannot be parsed. # noqa: E501 + + :param coupon_full_name: The coupon_full_name of this ApiResponseExSkillClaimRewardRespData. # noqa: E501 + :type: str + """ + + self._coupon_full_name = coupon_full_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseExSkillClaimRewardRespData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseExSkillClaimRewardRespData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_ex_skill_claim_task_resp.py b/gate_api/models/api_response_ex_skill_claim_task_resp.py new file mode 100644 index 00000000..66115115 --- /dev/null +++ b/gate_api/models/api_response_ex_skill_claim_task_resp.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseExSkillClaimTaskResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, object, int, Configuration) -> None + """ApiResponseExSkillClaimTaskResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + if code is not None: + self.code = code + if label is not None: + self.label = label + if message is not None: + self.message = message + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + + Business error code, 0 means success # noqa: E501 + + :return: The code of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseExSkillClaimTaskResp. + + Business error code, 0 means success # noqa: E501 + + :param code: The code of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :return: The label of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseExSkillClaimTaskResp. + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :param label: The label of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + + Error description # noqa: E501 + + :return: The message of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseExSkillClaimTaskResp. + + Error description # noqa: E501 + + :param message: The message of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + + Empty object {} on success # noqa: E501 + + :return: The data of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseExSkillClaimTaskResp. + + Empty object {} on success # noqa: E501 + + :param data: The data of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseExSkillClaimTaskResp. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseExSkillClaimTaskResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseExSkillClaimTaskResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseExSkillClaimTaskResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_ex_skill_get_beginner_task_list_resp.py b/gate_api/models/api_response_ex_skill_get_beginner_task_list_resp.py new file mode 100644 index 00000000..f9d7685b --- /dev/null +++ b/gate_api/models/api_response_ex_skill_get_beginner_task_list_resp.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseExSkillGetBeginnerTaskListResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'ApiResponseExSkillGetBeginnerTaskListRespData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, ApiResponseExSkillGetBeginnerTaskListRespData, int, Configuration) -> None + """ApiResponseExSkillGetBeginnerTaskListResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + if label is not None: + self.label = label + if message is not None: + self.message = message + if data is not None: + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + + Business error code: 0 = success, 1007 = no task data, 1008 = not logged in # noqa: E501 + + :return: The code of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseExSkillGetBeginnerTaskListResp. + + Business error code: 0 = success, 1007 = no task data, 1008 = not logged in # noqa: E501 + + :param code: The code of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :return: The label of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseExSkillGetBeginnerTaskListResp. + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :param label: The label of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + + Error description # noqa: E501 + + :return: The message of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseExSkillGetBeginnerTaskListResp. + + Error description # noqa: E501 + + :param message: The message of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + + + :return: The data of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + :rtype: ApiResponseExSkillGetBeginnerTaskListRespData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseExSkillGetBeginnerTaskListResp. + + + :param data: The data of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + :type: ApiResponseExSkillGetBeginnerTaskListRespData + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseExSkillGetBeginnerTaskListResp. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseExSkillGetBeginnerTaskListResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseExSkillGetBeginnerTaskListResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseExSkillGetBeginnerTaskListResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_ex_skill_get_beginner_task_list_resp_data.py b/gate_api/models/api_response_ex_skill_get_beginner_task_list_resp_data.py new file mode 100644 index 00000000..152d6274 --- /dev/null +++ b/gate_api/models/api_response_ex_skill_get_beginner_task_list_resp_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseExSkillGetBeginnerTaskListRespData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'tasks': 'list[ApiResponseExSkillGetBeginnerTaskListRespDataTasks]' + } + + attribute_map = { + 'tasks': 'tasks' + } + + def __init__(self, tasks=None, local_vars_configuration=None): # noqa: E501 + # type: (list[ApiResponseExSkillGetBeginnerTaskListRespDataTasks], Configuration) -> None + """ApiResponseExSkillGetBeginnerTaskListRespData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._tasks = None + self.discriminator = None + + if tasks is not None: + self.tasks = tasks + + @property + def tasks(self): + """Gets the tasks of this ApiResponseExSkillGetBeginnerTaskListRespData. # noqa: E501 + + Getting started task list (registration tasks come first, guidance tasks follow; when conditions are met, an additional download task to be collected will be returned) # noqa: E501 + + :return: The tasks of this ApiResponseExSkillGetBeginnerTaskListRespData. # noqa: E501 + :rtype: list[ApiResponseExSkillGetBeginnerTaskListRespDataTasks] + """ + return self._tasks + + @tasks.setter + def tasks(self, tasks): + """Sets the tasks of this ApiResponseExSkillGetBeginnerTaskListRespData. + + Getting started task list (registration tasks come first, guidance tasks follow; when conditions are met, an additional download task to be collected will be returned) # noqa: E501 + + :param tasks: The tasks of this ApiResponseExSkillGetBeginnerTaskListRespData. # noqa: E501 + :type: list[ApiResponseExSkillGetBeginnerTaskListRespDataTasks] + """ + + self._tasks = tasks + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseExSkillGetBeginnerTaskListRespData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseExSkillGetBeginnerTaskListRespData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_ex_skill_get_beginner_task_list_resp_data_tasks.py b/gate_api/models/api_response_ex_skill_get_beginner_task_list_resp_data_tasks.py new file mode 100644 index 00000000..2828dbfe --- /dev/null +++ b/gate_api/models/api_response_ex_skill_get_beginner_task_list_resp_data_tasks.py @@ -0,0 +1,361 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseExSkillGetBeginnerTaskListRespDataTasks(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'welfare_task_id': 'int', + 'task_center_id': 'int', + 'task_type': 'int', + 'task_name': 'str', + 'task_desc': 'str', + 'reward_num': 'str', + 'reward_unit': 'str', + 'prize_type': 'int', + 'status': 'int' + } + + attribute_map = { + 'welfare_task_id': 'welfare_task_id', + 'task_center_id': 'task_center_id', + 'task_type': 'task_type', + 'task_name': 'task_name', + 'task_desc': 'task_desc', + 'reward_num': 'reward_num', + 'reward_unit': 'reward_unit', + 'prize_type': 'prize_type', + 'status': 'status' + } + + def __init__(self, welfare_task_id=None, task_center_id=None, task_type=None, task_name=None, task_desc=None, reward_num=None, reward_unit=None, prize_type=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, str, str, str, str, int, int, Configuration) -> None + """ApiResponseExSkillGetBeginnerTaskListRespDataTasks - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._welfare_task_id = None + self._task_center_id = None + self._task_type = None + self._task_name = None + self._task_desc = None + self._reward_num = None + self._reward_unit = None + self._prize_type = None + self._status = None + self.discriminator = None + + if welfare_task_id is not None: + self.welfare_task_id = welfare_task_id + self.task_center_id = task_center_id + if task_type is not None: + self.task_type = task_type + if task_name is not None: + self.task_name = task_name + if task_desc is not None: + self.task_desc = task_desc + if reward_num is not None: + self.reward_num = reward_num + if reward_unit is not None: + self.reward_unit = reward_unit + if prize_type is not None: + self.prize_type = prize_type + self.status = status + + @property + def welfare_task_id(self): + """Gets the welfare_task_id of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + + Rewards Center task ID # noqa: E501 + + :return: The welfare_task_id of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :rtype: int + """ + return self._welfare_task_id + + @welfare_task_id.setter + def welfare_task_id(self, welfare_task_id): + """Sets the welfare_task_id of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. + + Rewards Center task ID # noqa: E501 + + :param welfare_task_id: The welfare_task_id of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :type: int + """ + + self._welfare_task_id = welfare_task_id + + @property + def task_center_id(self): + """Gets the task_center_id of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + + Task center task ID (fixed at 0 for registration tasks) # noqa: E501 + + :return: The task_center_id of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :rtype: int + """ + return self._task_center_id + + @task_center_id.setter + def task_center_id(self, task_center_id): + """Sets the task_center_id of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. + + Task center task ID (fixed at 0 for registration tasks) # noqa: E501 + + :param task_center_id: The task_center_id of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and task_center_id is None: # noqa: E501 + raise ValueError("Invalid value for `task_center_id`, must not be `None`") # noqa: E501 + + self._task_center_id = task_center_id + + @property + def task_type(self): + """Gets the task_type of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + + Task type: 1=KYC secondary certification 2=Spot 3=Contract 4=Invitation 5=Quantification 6=Yu Bibao 7=startup 8=First deposit 10=Registration task 11=Guide task 23=Download task # noqa: E501 + + :return: The task_type of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :rtype: int + """ + return self._task_type + + @task_type.setter + def task_type(self, task_type): + """Sets the task_type of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. + + Task type: 1=KYC secondary certification 2=Spot 3=Contract 4=Invitation 5=Quantification 6=Yu Bibao 7=startup 8=First deposit 10=Registration task 11=Guide task 23=Download task # noqa: E501 + + :param task_type: The task_type of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :type: int + """ + + self._task_type = task_type + + @property + def task_name(self): + """Gets the task_name of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + + Task name # noqa: E501 + + :return: The task_name of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :rtype: str + """ + return self._task_name + + @task_name.setter + def task_name(self, task_name): + """Sets the task_name of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. + + Task name # noqa: E501 + + :param task_name: The task_name of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :type: str + """ + + self._task_name = task_name + + @property + def task_desc(self): + """Gets the task_desc of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + + Task description, may contain highlight tags # noqa: E501 + + :return: The task_desc of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :rtype: str + """ + return self._task_desc + + @task_desc.setter + def task_desc(self, task_desc): + """Sets the task_desc of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. + + Task description, may contain highlight tags # noqa: E501 + + :param task_desc: The task_desc of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :type: str + """ + + self._task_desc = task_desc + + @property + def reward_num(self): + """Gets the reward_num of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + + Reward value # noqa: E501 + + :return: The reward_num of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :rtype: str + """ + return self._reward_num + + @reward_num.setter + def reward_num(self, reward_num): + """Sets the reward_num of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. + + Reward value # noqa: E501 + + :param reward_num: The reward_num of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :type: str + """ + + self._reward_num = reward_num + + @property + def reward_unit(self): + """Gets the reward_unit of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + + Reward unit (e.g., USDT, BTC) # noqa: E501 + + :return: The reward_unit of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :rtype: str + """ + return self._reward_unit + + @reward_unit.setter + def reward_unit(self, reward_unit): + """Sets the reward_unit of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. + + Reward unit (e.g., USDT, BTC) # noqa: E501 + + :param reward_unit: The reward_unit of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :type: str + """ + + self._reward_unit = reward_unit + + @property + def prize_type(self): + """Gets the prize_type of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + + Reward type: 1 = points, 2 = regular coupon, 3 = VIP coupon # noqa: E501 + + :return: The prize_type of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :rtype: int + """ + return self._prize_type + + @prize_type.setter + def prize_type(self, prize_type): + """Sets the prize_type of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. + + Reward type: 1 = points, 2 = regular coupon, 3 = VIP coupon # noqa: E501 + + :param prize_type: The prize_type of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :type: int + """ + allowed_values = [1, 2, 3] # noqa: E501 + if self.local_vars_configuration.client_side_validation and prize_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `prize_type` ({0}), must be one of {1}" # noqa: E501 + .format(prize_type, allowed_values) + ) + + self._prize_type = prize_type + + @property + def status(self): + """Gets the status of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + + Task status: 0=Not claimed (typically a download task waiting to be claimed) 1=Received/in progress 2=Completed and waiting to be claimed 3=Rewards in progress 4=Completed/settled 5=Expired # noqa: E501 + + :return: The status of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. + + Task status: 0=Not claimed (typically a download task waiting to be claimed) 1=Received/in progress 2=Completed and waiting to be claimed 3=Rewards in progress 4=Completed/settled 5=Expired # noqa: E501 + + :param status: The status of this ApiResponseExSkillGetBeginnerTaskListRespDataTasks. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = [0, 1, 2, 3, 4, 5] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseExSkillGetBeginnerTaskListRespDataTasks): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseExSkillGetBeginnerTaskListRespDataTasks): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/api_response_ex_skill_get_user_identity_resp.py b/gate_api/models/api_response_ex_skill_get_user_identity_resp.py new file mode 100644 index 00000000..a8fb8943 --- /dev/null +++ b/gate_api/models/api_response_ex_skill_get_user_identity_resp.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ApiResponseExSkillGetUserIdentityResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, object, int, Configuration) -> None + """ApiResponseExSkillGetUserIdentityResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + if code is not None: + self.code = code + if label is not None: + self.label = label + if message is not None: + self.message = message + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + + Business error code: 0 = success, 1001 = existing user, 1002 = risk-controlled user, 1003 = sub-account, 1004 = agent, 1005 = market maker, 1006 = enterprise account, 1008 = not logged in # noqa: E501 + + :return: The code of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponseExSkillGetUserIdentityResp. + + Business error code: 0 = success, 1001 = existing user, 1002 = risk-controlled user, 1003 = sub-account, 1004 = agent, 1005 = market maker, 1006 = enterprise account, 1008 = not logged in # noqa: E501 + + :param code: The code of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def label(self): + """Gets the label of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :return: The label of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ApiResponseExSkillGetUserIdentityResp. + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :param label: The label of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + + Error description # noqa: E501 + + :return: The message of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponseExSkillGetUserIdentityResp. + + Error description # noqa: E501 + + :param message: The message of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + + Empty object {} on success, null on failure # noqa: E501 + + :return: The data of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ApiResponseExSkillGetUserIdentityResp. + + Empty object {} on success, null on failure # noqa: E501 + + :param data: The data of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ApiResponseExSkillGetUserIdentityResp. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ApiResponseExSkillGetUserIdentityResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponseExSkillGetUserIdentityResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiResponseExSkillGetUserIdentityResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/asset_list_resp.py b/gate_api/models/asset_list_resp.py new file mode 100644 index 00000000..5f40fc79 --- /dev/null +++ b/gate_api/models/asset_list_resp.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AssetListResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[str]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[str], Configuration) -> None + """AssetListResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + self.list = list + + @property + def list(self): + """Gets the list of this AssetListResp. # noqa: E501 + + + :return: The list of this AssetListResp. # noqa: E501 + :rtype: list[str] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this AssetListResp. + + + :param list: The list of this AssetListResp. # noqa: E501 + :type: list[str] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AssetListResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AssetListResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/asset_swap_frontend.py b/gate_api/models/asset_swap_frontend.py new file mode 100644 index 00000000..00ffbfad --- /dev/null +++ b/gate_api/models/asset_swap_frontend.py @@ -0,0 +1,369 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AssetSwapFrontend(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset_evaluate_range': 'list[int]', + 'banner_reappear_interval_hours': 'int', + 'convert_currencies': 'list[str]', + 'convert_currencies_v2': 'list[ConvertCurrenciesV2Item]', + 'default': 'dict(str, str)', + 'max_select_currencies': 'int', + 'min_evaluate_value': 'str', + 'recommend': 'Recommend', + 'recommend_v2': 'dict(str, list[RecommendV2Strategy])', + 'title_tips': 'str' + } + + attribute_map = { + 'asset_evaluate_range': 'asset_evaluate_range', + 'banner_reappear_interval_hours': 'banner_reappear_interval_hours', + 'convert_currencies': 'convert_currencies', + 'convert_currencies_v2': 'convert_currencies_v2', + 'default': 'default', + 'max_select_currencies': 'max_select_currencies', + 'min_evaluate_value': 'min_evaluate_value', + 'recommend': 'recommend', + 'recommend_v2': 'recommend_v2', + 'title_tips': 'title_tips' + } + + def __init__(self, asset_evaluate_range=None, banner_reappear_interval_hours=None, convert_currencies=None, convert_currencies_v2=None, default=None, max_select_currencies=None, min_evaluate_value=None, recommend=None, recommend_v2=None, title_tips=None, local_vars_configuration=None): # noqa: E501 + # type: (list[int], int, list[str], list[ConvertCurrenciesV2Item], dict(str, str), int, str, Recommend, dict(str, list[RecommendV2Strategy]), str, Configuration) -> None + """AssetSwapFrontend - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset_evaluate_range = None + self._banner_reappear_interval_hours = None + self._convert_currencies = None + self._convert_currencies_v2 = None + self._default = None + self._max_select_currencies = None + self._min_evaluate_value = None + self._recommend = None + self._recommend_v2 = None + self._title_tips = None + self.discriminator = None + + self.asset_evaluate_range = asset_evaluate_range + self.banner_reappear_interval_hours = banner_reappear_interval_hours + self.convert_currencies = convert_currencies + self.convert_currencies_v2 = convert_currencies_v2 + self.default = default + self.max_select_currencies = max_select_currencies + self.min_evaluate_value = min_evaluate_value + self.recommend = recommend + self.recommend_v2 = recommend_v2 + self.title_tips = title_tips + + @property + def asset_evaluate_range(self): + """Gets the asset_evaluate_range of this AssetSwapFrontend. # noqa: E501 + + + :return: The asset_evaluate_range of this AssetSwapFrontend. # noqa: E501 + :rtype: list[int] + """ + return self._asset_evaluate_range + + @asset_evaluate_range.setter + def asset_evaluate_range(self, asset_evaluate_range): + """Sets the asset_evaluate_range of this AssetSwapFrontend. + + + :param asset_evaluate_range: The asset_evaluate_range of this AssetSwapFrontend. # noqa: E501 + :type: list[int] + """ + if self.local_vars_configuration.client_side_validation and asset_evaluate_range is None: # noqa: E501 + raise ValueError("Invalid value for `asset_evaluate_range`, must not be `None`") # noqa: E501 + + self._asset_evaluate_range = asset_evaluate_range + + @property + def banner_reappear_interval_hours(self): + """Gets the banner_reappear_interval_hours of this AssetSwapFrontend. # noqa: E501 + + + :return: The banner_reappear_interval_hours of this AssetSwapFrontend. # noqa: E501 + :rtype: int + """ + return self._banner_reappear_interval_hours + + @banner_reappear_interval_hours.setter + def banner_reappear_interval_hours(self, banner_reappear_interval_hours): + """Sets the banner_reappear_interval_hours of this AssetSwapFrontend. + + + :param banner_reappear_interval_hours: The banner_reappear_interval_hours of this AssetSwapFrontend. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and banner_reappear_interval_hours is None: # noqa: E501 + raise ValueError("Invalid value for `banner_reappear_interval_hours`, must not be `None`") # noqa: E501 + + self._banner_reappear_interval_hours = banner_reappear_interval_hours + + @property + def convert_currencies(self): + """Gets the convert_currencies of this AssetSwapFrontend. # noqa: E501 + + + :return: The convert_currencies of this AssetSwapFrontend. # noqa: E501 + :rtype: list[str] + """ + return self._convert_currencies + + @convert_currencies.setter + def convert_currencies(self, convert_currencies): + """Sets the convert_currencies of this AssetSwapFrontend. + + + :param convert_currencies: The convert_currencies of this AssetSwapFrontend. # noqa: E501 + :type: list[str] + """ + if self.local_vars_configuration.client_side_validation and convert_currencies is None: # noqa: E501 + raise ValueError("Invalid value for `convert_currencies`, must not be `None`") # noqa: E501 + + self._convert_currencies = convert_currencies + + @property + def convert_currencies_v2(self): + """Gets the convert_currencies_v2 of this AssetSwapFrontend. # noqa: E501 + + + :return: The convert_currencies_v2 of this AssetSwapFrontend. # noqa: E501 + :rtype: list[ConvertCurrenciesV2Item] + """ + return self._convert_currencies_v2 + + @convert_currencies_v2.setter + def convert_currencies_v2(self, convert_currencies_v2): + """Sets the convert_currencies_v2 of this AssetSwapFrontend. + + + :param convert_currencies_v2: The convert_currencies_v2 of this AssetSwapFrontend. # noqa: E501 + :type: list[ConvertCurrenciesV2Item] + """ + if self.local_vars_configuration.client_side_validation and convert_currencies_v2 is None: # noqa: E501 + raise ValueError("Invalid value for `convert_currencies_v2`, must not be `None`") # noqa: E501 + + self._convert_currencies_v2 = convert_currencies_v2 + + @property + def default(self): + """Gets the default of this AssetSwapFrontend. # noqa: E501 + + Mapping of string keys to string values, corresponding to Go's map[string]string. # noqa: E501 + + :return: The default of this AssetSwapFrontend. # noqa: E501 + :rtype: dict(str, str) + """ + return self._default + + @default.setter + def default(self, default): + """Sets the default of this AssetSwapFrontend. + + Mapping of string keys to string values, corresponding to Go's map[string]string. # noqa: E501 + + :param default: The default of this AssetSwapFrontend. # noqa: E501 + :type: dict(str, str) + """ + if self.local_vars_configuration.client_side_validation and default is None: # noqa: E501 + raise ValueError("Invalid value for `default`, must not be `None`") # noqa: E501 + + self._default = default + + @property + def max_select_currencies(self): + """Gets the max_select_currencies of this AssetSwapFrontend. # noqa: E501 + + + :return: The max_select_currencies of this AssetSwapFrontend. # noqa: E501 + :rtype: int + """ + return self._max_select_currencies + + @max_select_currencies.setter + def max_select_currencies(self, max_select_currencies): + """Sets the max_select_currencies of this AssetSwapFrontend. + + + :param max_select_currencies: The max_select_currencies of this AssetSwapFrontend. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and max_select_currencies is None: # noqa: E501 + raise ValueError("Invalid value for `max_select_currencies`, must not be `None`") # noqa: E501 + + self._max_select_currencies = max_select_currencies + + @property + def min_evaluate_value(self): + """Gets the min_evaluate_value of this AssetSwapFrontend. # noqa: E501 + + + :return: The min_evaluate_value of this AssetSwapFrontend. # noqa: E501 + :rtype: str + """ + return self._min_evaluate_value + + @min_evaluate_value.setter + def min_evaluate_value(self, min_evaluate_value): + """Sets the min_evaluate_value of this AssetSwapFrontend. + + + :param min_evaluate_value: The min_evaluate_value of this AssetSwapFrontend. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and min_evaluate_value is None: # noqa: E501 + raise ValueError("Invalid value for `min_evaluate_value`, must not be `None`") # noqa: E501 + + self._min_evaluate_value = min_evaluate_value + + @property + def recommend(self): + """Gets the recommend of this AssetSwapFrontend. # noqa: E501 + + + :return: The recommend of this AssetSwapFrontend. # noqa: E501 + :rtype: Recommend + """ + return self._recommend + + @recommend.setter + def recommend(self, recommend): + """Sets the recommend of this AssetSwapFrontend. + + + :param recommend: The recommend of this AssetSwapFrontend. # noqa: E501 + :type: Recommend + """ + if self.local_vars_configuration.client_side_validation and recommend is None: # noqa: E501 + raise ValueError("Invalid value for `recommend`, must not be `None`") # noqa: E501 + + self._recommend = recommend + + @property + def recommend_v2(self): + """Gets the recommend_v2 of this AssetSwapFrontend. # noqa: E501 + + Mapping of strategy grouping keys to RecommendV2Strategy lists. # noqa: E501 + + :return: The recommend_v2 of this AssetSwapFrontend. # noqa: E501 + :rtype: dict(str, list[RecommendV2Strategy]) + """ + return self._recommend_v2 + + @recommend_v2.setter + def recommend_v2(self, recommend_v2): + """Sets the recommend_v2 of this AssetSwapFrontend. + + Mapping of strategy grouping keys to RecommendV2Strategy lists. # noqa: E501 + + :param recommend_v2: The recommend_v2 of this AssetSwapFrontend. # noqa: E501 + :type: dict(str, list[RecommendV2Strategy]) + """ + if self.local_vars_configuration.client_side_validation and recommend_v2 is None: # noqa: E501 + raise ValueError("Invalid value for `recommend_v2`, must not be `None`") # noqa: E501 + + self._recommend_v2 = recommend_v2 + + @property + def title_tips(self): + """Gets the title_tips of this AssetSwapFrontend. # noqa: E501 + + + :return: The title_tips of this AssetSwapFrontend. # noqa: E501 + :rtype: str + """ + return self._title_tips + + @title_tips.setter + def title_tips(self, title_tips): + """Sets the title_tips of this AssetSwapFrontend. + + + :param title_tips: The title_tips of this AssetSwapFrontend. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and title_tips is None: # noqa: E501 + raise ValueError("Invalid value for `title_tips`, must not be `None`") # noqa: E501 + + self._title_tips = title_tips + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AssetSwapFrontend): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AssetSwapFrontend): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_coins_item.py b/gate_api/models/auto_invest_coins_item.py new file mode 100644 index 00000000..61b5bb90 --- /dev/null +++ b/gate_api/models/auto_invest_coins_item.py @@ -0,0 +1,210 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestCoinsItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'key': 'str', + 'value': 'str', + 'asset_icon_url': 'str', + 'sort': 'int' + } + + attribute_map = { + 'key': 'key', + 'value': 'value', + 'asset_icon_url': 'asset_icon_url', + 'sort': 'sort' + } + + def __init__(self, key=None, value=None, asset_icon_url=None, sort=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, Configuration) -> None + """AutoInvestCoinsItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._key = None + self._value = None + self._asset_icon_url = None + self._sort = None + self.discriminator = None + + self.key = key + self.value = value + self.asset_icon_url = asset_icon_url + if sort is not None: + self.sort = sort + + @property + def key(self): + """Gets the key of this AutoInvestCoinsItem. # noqa: E501 + + Currency code # noqa: E501 + + :return: The key of this AutoInvestCoinsItem. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this AutoInvestCoinsItem. + + Currency code # noqa: E501 + + :param key: The key of this AutoInvestCoinsItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and key is None: # noqa: E501 + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def value(self): + """Gets the value of this AutoInvestCoinsItem. # noqa: E501 + + Currency name # noqa: E501 + + :return: The value of this AutoInvestCoinsItem. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this AutoInvestCoinsItem. + + Currency name # noqa: E501 + + :param value: The value of this AutoInvestCoinsItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and value is None: # noqa: E501 + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + @property + def asset_icon_url(self): + """Gets the asset_icon_url of this AutoInvestCoinsItem. # noqa: E501 + + Currency icon URL # noqa: E501 + + :return: The asset_icon_url of this AutoInvestCoinsItem. # noqa: E501 + :rtype: str + """ + return self._asset_icon_url + + @asset_icon_url.setter + def asset_icon_url(self, asset_icon_url): + """Sets the asset_icon_url of this AutoInvestCoinsItem. + + Currency icon URL # noqa: E501 + + :param asset_icon_url: The asset_icon_url of this AutoInvestCoinsItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset_icon_url is None: # noqa: E501 + raise ValueError("Invalid value for `asset_icon_url`, must not be `None`") # noqa: E501 + + self._asset_icon_url = asset_icon_url + + @property + def sort(self): + """Gets the sort of this AutoInvestCoinsItem. # noqa: E501 + + Sort # noqa: E501 + + :return: The sort of this AutoInvestCoinsItem. # noqa: E501 + :rtype: int + """ + return self._sort + + @sort.setter + def sort(self, sort): + """Sets the sort of this AutoInvestCoinsItem. + + Sort # noqa: E501 + + :param sort: The sort of this AutoInvestCoinsItem. # noqa: E501 + :type: int + """ + + self._sort = sort + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestCoinsItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestCoinsItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_config_item.py b/gate_api/models/auto_invest_config_item.py new file mode 100644 index 00000000..ce57fe7a --- /dev/null +++ b/gate_api/models/auto_invest_config_item.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestConfigItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'coin': 'str', + 'max_limit': 'str' + } + + attribute_map = { + 'coin': 'coin', + 'max_limit': 'max_limit' + } + + def __init__(self, coin=None, max_limit=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """AutoInvestConfigItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._coin = None + self._max_limit = None + self.discriminator = None + + self.coin = coin + self.max_limit = max_limit + + @property + def coin(self): + """Gets the coin of this AutoInvestConfigItem. # noqa: E501 + + Currency # noqa: E501 + + :return: The coin of this AutoInvestConfigItem. # noqa: E501 + :rtype: str + """ + return self._coin + + @coin.setter + def coin(self, coin): + """Sets the coin of this AutoInvestConfigItem. + + Currency # noqa: E501 + + :param coin: The coin of this AutoInvestConfigItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and coin is None: # noqa: E501 + raise ValueError("Invalid value for `coin`, must not be `None`") # noqa: E501 + + self._coin = coin + + @property + def max_limit(self): + """Gets the max_limit of this AutoInvestConfigItem. # noqa: E501 + + InvestmentLimit # noqa: E501 + + :return: The max_limit of this AutoInvestConfigItem. # noqa: E501 + :rtype: str + """ + return self._max_limit + + @max_limit.setter + def max_limit(self, max_limit): + """Sets the max_limit of this AutoInvestConfigItem. + + InvestmentLimit # noqa: E501 + + :param max_limit: The max_limit of this AutoInvestConfigItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and max_limit is None: # noqa: E501 + raise ValueError("Invalid value for `max_limit`, must not be `None`") # noqa: E501 + + self._max_limit = max_limit + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestConfigItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestConfigItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_min_invest_amount.py b/gate_api/models/auto_invest_min_invest_amount.py new file mode 100644 index 00000000..a43122e9 --- /dev/null +++ b/gate_api/models/auto_invest_min_invest_amount.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestMinInvestAmount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'money': 'str', + 'items': 'list[AutoInvestMinInvestAmountItems]' + } + + attribute_map = { + 'money': 'money', + 'items': 'items' + } + + def __init__(self, money=None, items=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[AutoInvestMinInvestAmountItems], Configuration) -> None + """AutoInvestMinInvestAmount - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._money = None + self._items = None + self.discriminator = None + + self.money = money + self.items = items + + @property + def money(self): + """Gets the money of this AutoInvestMinInvestAmount. # noqa: E501 + + Currency, optional: USDT or BTC # noqa: E501 + + :return: The money of this AutoInvestMinInvestAmount. # noqa: E501 + :rtype: str + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this AutoInvestMinInvestAmount. + + Currency, optional: USDT or BTC # noqa: E501 + + :param money: The money of this AutoInvestMinInvestAmount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and money is None: # noqa: E501 + raise ValueError("Invalid value for `money`, must not be `None`") # noqa: E501 + + self._money = money + + @property + def items(self): + """Gets the items of this AutoInvestMinInvestAmount. # noqa: E501 + + + :return: The items of this AutoInvestMinInvestAmount. # noqa: E501 + :rtype: list[AutoInvestMinInvestAmountItems] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this AutoInvestMinInvestAmount. + + + :param items: The items of this AutoInvestMinInvestAmount. # noqa: E501 + :type: list[AutoInvestMinInvestAmountItems] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestMinInvestAmount): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestMinInvestAmount): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_min_invest_amount_items.py b/gate_api/models/auto_invest_min_invest_amount_items.py new file mode 100644 index 00000000..26a05f56 --- /dev/null +++ b/gate_api/models/auto_invest_min_invest_amount_items.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestMinInvestAmountItems(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'ratio': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'ratio': 'ratio' + } + + def __init__(self, asset=None, ratio=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """AutoInvestMinInvestAmountItems - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._ratio = None + self.discriminator = None + + self.asset = asset + self.ratio = ratio + + @property + def asset(self): + """Gets the asset of this AutoInvestMinInvestAmountItems. # noqa: E501 + + Currency # noqa: E501 + + :return: The asset of this AutoInvestMinInvestAmountItems. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this AutoInvestMinInvestAmountItems. + + Currency # noqa: E501 + + :param asset: The asset of this AutoInvestMinInvestAmountItems. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def ratio(self): + """Gets the ratio of this AutoInvestMinInvestAmountItems. # noqa: E501 + + Ratio,e.g.100 # noqa: E501 + + :return: The ratio of this AutoInvestMinInvestAmountItems. # noqa: E501 + :rtype: str + """ + return self._ratio + + @ratio.setter + def ratio(self, ratio): + """Sets the ratio of this AutoInvestMinInvestAmountItems. + + Ratio,e.g.100 # noqa: E501 + + :param ratio: The ratio of this AutoInvestMinInvestAmountItems. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and ratio is None: # noqa: E501 + raise ValueError("Invalid value for `ratio`, must not be `None`") # noqa: E501 + + self._ratio = ratio + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestMinInvestAmountItems): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestMinInvestAmountItems): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_min_invest_amount_resp.py b/gate_api/models/auto_invest_min_invest_amount_resp.py new file mode 100644 index 00000000..07c98cf8 --- /dev/null +++ b/gate_api/models/auto_invest_min_invest_amount_resp.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestMinInvestAmountResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'min_amount': 'str' + } + + attribute_map = { + 'min_amount': 'min_amount' + } + + def __init__(self, min_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """AutoInvestMinInvestAmountResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._min_amount = None + self.discriminator = None + + self.min_amount = min_amount + + @property + def min_amount(self): + """Gets the min_amount of this AutoInvestMinInvestAmountResp. # noqa: E501 + + MinimumAmount # noqa: E501 + + :return: The min_amount of this AutoInvestMinInvestAmountResp. # noqa: E501 + :rtype: str + """ + return self._min_amount + + @min_amount.setter + def min_amount(self, min_amount): + """Sets the min_amount of this AutoInvestMinInvestAmountResp. + + MinimumAmount # noqa: E501 + + :param min_amount: The min_amount of this AutoInvestMinInvestAmountResp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and min_amount is None: # noqa: E501 + raise ValueError("Invalid value for `min_amount`, must not be `None`") # noqa: E501 + + self._min_amount = min_amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestMinInvestAmountResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestMinInvestAmountResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_order_item.py b/gate_api/models/auto_invest_order_item.py new file mode 100644 index 00000000..6ef6f85a --- /dev/null +++ b/gate_api/models/auto_invest_order_item.py @@ -0,0 +1,559 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestOrderItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'type': 'str', + 'amount': 'str', + 'plan_id': 'int', + 'side': 'int', + 'asset': 'str', + 'record_id': 'int', + 'total_money': 'str', + 'market': 'str', + 'price': 'str', + 'create_time': 'int', + 'total': 'str', + 'fund_flow': 'str', + 'error_code': 'int', + 'error_msg': 'str', + 'status': 'int' + } + + attribute_map = { + 'id': 'id', + 'type': 'type', + 'amount': 'amount', + 'plan_id': 'plan_id', + 'side': 'side', + 'asset': 'asset', + 'record_id': 'record_id', + 'total_money': 'total_money', + 'market': 'market', + 'price': 'price', + 'create_time': 'create_time', + 'total': 'total', + 'fund_flow': 'fund_flow', + 'error_code': 'error_code', + 'error_msg': 'error_msg', + 'status': 'status' + } + + def __init__(self, id=None, type=None, amount=None, plan_id=None, side=None, asset=None, record_id=None, total_money=None, market=None, price=None, create_time=None, total=None, fund_flow=None, error_code=None, error_msg=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, int, int, str, int, str, str, str, int, str, str, int, str, int, Configuration) -> None + """AutoInvestOrderItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._type = None + self._amount = None + self._plan_id = None + self._side = None + self._asset = None + self._record_id = None + self._total_money = None + self._market = None + self._price = None + self._create_time = None + self._total = None + self._fund_flow = None + self._error_code = None + self._error_msg = None + self._status = None + self.discriminator = None + + self.id = id + self.type = type + self.amount = amount + self.plan_id = plan_id + self.side = side + self.asset = asset + self.record_id = record_id + self.total_money = total_money + self.market = market + self.price = price + self.create_time = create_time + self.total = total + self.fund_flow = fund_flow + self.error_code = error_code + self.error_msg = error_msg + self.status = status + + @property + def id(self): + """Gets the id of this AutoInvestOrderItem. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this AutoInvestOrderItem. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutoInvestOrderItem. + + Order ID # noqa: E501 + + :param id: The id of this AutoInvestOrderItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def type(self): + """Gets the type of this AutoInvestOrderItem. # noqa: E501 + + Type # noqa: E501 + + :return: The type of this AutoInvestOrderItem. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this AutoInvestOrderItem. + + Type # noqa: E501 + + :param type: The type of this AutoInvestOrderItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + @property + def amount(self): + """Gets the amount of this AutoInvestOrderItem. # noqa: E501 + + Size # noqa: E501 + + :return: The amount of this AutoInvestOrderItem. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this AutoInvestOrderItem. + + Size # noqa: E501 + + :param amount: The amount of this AutoInvestOrderItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def plan_id(self): + """Gets the plan_id of this AutoInvestOrderItem. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The plan_id of this AutoInvestOrderItem. # noqa: E501 + :rtype: int + """ + return self._plan_id + + @plan_id.setter + def plan_id(self, plan_id): + """Sets the plan_id of this AutoInvestOrderItem. + + Plan ID # noqa: E501 + + :param plan_id: The plan_id of this AutoInvestOrderItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and plan_id is None: # noqa: E501 + raise ValueError("Invalid value for `plan_id`, must not be `None`") # noqa: E501 + + self._plan_id = plan_id + + @property + def side(self): + """Gets the side of this AutoInvestOrderItem. # noqa: E501 + + direction # noqa: E501 + + :return: The side of this AutoInvestOrderItem. # noqa: E501 + :rtype: int + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this AutoInvestOrderItem. + + direction # noqa: E501 + + :param side: The side of this AutoInvestOrderItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def asset(self): + """Gets the asset of this AutoInvestOrderItem. # noqa: E501 + + Currency # noqa: E501 + + :return: The asset of this AutoInvestOrderItem. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this AutoInvestOrderItem. + + Currency # noqa: E501 + + :param asset: The asset of this AutoInvestOrderItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def record_id(self): + """Gets the record_id of this AutoInvestOrderItem. # noqa: E501 + + Record ID # noqa: E501 + + :return: The record_id of this AutoInvestOrderItem. # noqa: E501 + :rtype: int + """ + return self._record_id + + @record_id.setter + def record_id(self, record_id): + """Sets the record_id of this AutoInvestOrderItem. + + Record ID # noqa: E501 + + :param record_id: The record_id of this AutoInvestOrderItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and record_id is None: # noqa: E501 + raise ValueError("Invalid value for `record_id`, must not be `None`") # noqa: E501 + + self._record_id = record_id + + @property + def total_money(self): + """Gets the total_money of this AutoInvestOrderItem. # noqa: E501 + + TotalAmount # noqa: E501 + + :return: The total_money of this AutoInvestOrderItem. # noqa: E501 + :rtype: str + """ + return self._total_money + + @total_money.setter + def total_money(self, total_money): + """Sets the total_money of this AutoInvestOrderItem. + + TotalAmount # noqa: E501 + + :param total_money: The total_money of this AutoInvestOrderItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total_money is None: # noqa: E501 + raise ValueError("Invalid value for `total_money`, must not be `None`") # noqa: E501 + + self._total_money = total_money + + @property + def market(self): + """Gets the market of this AutoInvestOrderItem. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The market of this AutoInvestOrderItem. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this AutoInvestOrderItem. + + Currency pair # noqa: E501 + + :param market: The market of this AutoInvestOrderItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def price(self): + """Gets the price of this AutoInvestOrderItem. # noqa: E501 + + Price # noqa: E501 + + :return: The price of this AutoInvestOrderItem. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this AutoInvestOrderItem. + + Price # noqa: E501 + + :param price: The price of this AutoInvestOrderItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price is None: # noqa: E501 + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + @property + def create_time(self): + """Gets the create_time of this AutoInvestOrderItem. # noqa: E501 + + Creation time (Unix timestamp) # noqa: E501 + + :return: The create_time of this AutoInvestOrderItem. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this AutoInvestOrderItem. + + Creation time (Unix timestamp) # noqa: E501 + + :param create_time: The create_time of this AutoInvestOrderItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + @property + def total(self): + """Gets the total of this AutoInvestOrderItem. # noqa: E501 + + Total # noqa: E501 + + :return: The total of this AutoInvestOrderItem. # noqa: E501 + :rtype: str + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this AutoInvestOrderItem. + + Total # noqa: E501 + + :param total: The total of this AutoInvestOrderItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + @property + def fund_flow(self): + """Gets the fund_flow of this AutoInvestOrderItem. # noqa: E501 + + Fund Flow Direction # noqa: E501 + + :return: The fund_flow of this AutoInvestOrderItem. # noqa: E501 + :rtype: str + """ + return self._fund_flow + + @fund_flow.setter + def fund_flow(self, fund_flow): + """Sets the fund_flow of this AutoInvestOrderItem. + + Fund Flow Direction # noqa: E501 + + :param fund_flow: The fund_flow of this AutoInvestOrderItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fund_flow is None: # noqa: E501 + raise ValueError("Invalid value for `fund_flow`, must not be `None`") # noqa: E501 + + self._fund_flow = fund_flow + + @property + def error_code(self): + """Gets the error_code of this AutoInvestOrderItem. # noqa: E501 + + Error code # noqa: E501 + + :return: The error_code of this AutoInvestOrderItem. # noqa: E501 + :rtype: int + """ + return self._error_code + + @error_code.setter + def error_code(self, error_code): + """Sets the error_code of this AutoInvestOrderItem. + + Error code # noqa: E501 + + :param error_code: The error_code of this AutoInvestOrderItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and error_code is None: # noqa: E501 + raise ValueError("Invalid value for `error_code`, must not be `None`") # noqa: E501 + + self._error_code = error_code + + @property + def error_msg(self): + """Gets the error_msg of this AutoInvestOrderItem. # noqa: E501 + + Error message # noqa: E501 + + :return: The error_msg of this AutoInvestOrderItem. # noqa: E501 + :rtype: str + """ + return self._error_msg + + @error_msg.setter + def error_msg(self, error_msg): + """Sets the error_msg of this AutoInvestOrderItem. + + Error message # noqa: E501 + + :param error_msg: The error_msg of this AutoInvestOrderItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and error_msg is None: # noqa: E501 + raise ValueError("Invalid value for `error_msg`, must not be `None`") # noqa: E501 + + self._error_msg = error_msg + + @property + def status(self): + """Gets the status of this AutoInvestOrderItem. # noqa: E501 + + Status # noqa: E501 + + :return: The status of this AutoInvestOrderItem. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AutoInvestOrderItem. + + Status # noqa: E501 + + :param status: The status of this AutoInvestOrderItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestOrderItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestOrderItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_plan_add_position.py b/gate_api/models/auto_invest_plan_add_position.py new file mode 100644 index 00000000..35a249a8 --- /dev/null +++ b/gate_api/models/auto_invest_plan_add_position.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPlanAddPosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'plan_id': 'int', + 'amount': 'str' + } + + attribute_map = { + 'plan_id': 'plan_id', + 'amount': 'amount' + } + + def __init__(self, plan_id=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """AutoInvestPlanAddPosition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._plan_id = None + self._amount = None + self.discriminator = None + + self.plan_id = plan_id + self.amount = amount + + @property + def plan_id(self): + """Gets the plan_id of this AutoInvestPlanAddPosition. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The plan_id of this AutoInvestPlanAddPosition. # noqa: E501 + :rtype: int + """ + return self._plan_id + + @plan_id.setter + def plan_id(self, plan_id): + """Sets the plan_id of this AutoInvestPlanAddPosition. + + Plan ID # noqa: E501 + + :param plan_id: The plan_id of this AutoInvestPlanAddPosition. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and plan_id is None: # noqa: E501 + raise ValueError("Invalid value for `plan_id`, must not be `None`") # noqa: E501 + + self._plan_id = plan_id + + @property + def amount(self): + """Gets the amount of this AutoInvestPlanAddPosition. # noqa: E501 + + Amount # noqa: E501 + + :return: The amount of this AutoInvestPlanAddPosition. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this AutoInvestPlanAddPosition. + + Amount # noqa: E501 + + :param amount: The amount of this AutoInvestPlanAddPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPlanAddPosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPlanAddPosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_plan_create.py b/gate_api/models/auto_invest_plan_create.py new file mode 100644 index 00000000..0eb31937 --- /dev/null +++ b/gate_api/models/auto_invest_plan_create.py @@ -0,0 +1,409 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPlanCreate(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'plan_name': 'str', + 'plan_des': 'str', + 'plan_money': 'str', + 'plan_amount': 'str', + 'plan_period_type': 'str', + 'plan_period_day': 'int', + 'plan_period_hour': 'int', + 'items': 'list[AutoInvestPlanCreateItems]', + 'fund_source': 'str', + 'fund_flow': 'str', + 'type': 'int' + } + + attribute_map = { + 'plan_name': 'plan_name', + 'plan_des': 'plan_des', + 'plan_money': 'plan_money', + 'plan_amount': 'plan_amount', + 'plan_period_type': 'plan_period_type', + 'plan_period_day': 'plan_period_day', + 'plan_period_hour': 'plan_period_hour', + 'items': 'items', + 'fund_source': 'fund_source', + 'fund_flow': 'fund_flow', + 'type': 'type' + } + + def __init__(self, plan_name=None, plan_des=None, plan_money=None, plan_amount=None, plan_period_type=None, plan_period_day=None, plan_period_hour=None, items=None, fund_source=None, fund_flow=None, type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, int, int, list[AutoInvestPlanCreateItems], str, str, int, Configuration) -> None + """AutoInvestPlanCreate - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._plan_name = None + self._plan_des = None + self._plan_money = None + self._plan_amount = None + self._plan_period_type = None + self._plan_period_day = None + self._plan_period_hour = None + self._items = None + self._fund_source = None + self._fund_flow = None + self._type = None + self.discriminator = None + + if plan_name is not None: + self.plan_name = plan_name + if plan_des is not None: + self.plan_des = plan_des + self.plan_money = plan_money + self.plan_amount = plan_amount + self.plan_period_type = plan_period_type + self.plan_period_day = plan_period_day + self.plan_period_hour = plan_period_hour + self.items = items + if fund_source is not None: + self.fund_source = fund_source + if fund_flow is not None: + self.fund_flow = fund_flow + if type is not None: + self.type = type + + @property + def plan_name(self): + """Gets the plan_name of this AutoInvestPlanCreate. # noqa: E501 + + Plan name。Length: 0-50 characters # noqa: E501 + + :return: The plan_name of this AutoInvestPlanCreate. # noqa: E501 + :rtype: str + """ + return self._plan_name + + @plan_name.setter + def plan_name(self, plan_name): + """Sets the plan_name of this AutoInvestPlanCreate. + + Plan name。Length: 0-50 characters # noqa: E501 + + :param plan_name: The plan_name of this AutoInvestPlanCreate. # noqa: E501 + :type: str + """ + + self._plan_name = plan_name + + @property + def plan_des(self): + """Gets the plan_des of this AutoInvestPlanCreate. # noqa: E501 + + Plan description # noqa: E501 + + :return: The plan_des of this AutoInvestPlanCreate. # noqa: E501 + :rtype: str + """ + return self._plan_des + + @plan_des.setter + def plan_des(self, plan_des): + """Sets the plan_des of this AutoInvestPlanCreate. + + Plan description # noqa: E501 + + :param plan_des: The plan_des of this AutoInvestPlanCreate. # noqa: E501 + :type: str + """ + + self._plan_des = plan_des + + @property + def plan_money(self): + """Gets the plan_money of this AutoInvestPlanCreate. # noqa: E501 + + Pricing currency,SupportUSDT,BTC # noqa: E501 + + :return: The plan_money of this AutoInvestPlanCreate. # noqa: E501 + :rtype: str + """ + return self._plan_money + + @plan_money.setter + def plan_money(self, plan_money): + """Sets the plan_money of this AutoInvestPlanCreate. + + Pricing currency,SupportUSDT,BTC # noqa: E501 + + :param plan_money: The plan_money of this AutoInvestPlanCreate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and plan_money is None: # noqa: E501 + raise ValueError("Invalid value for `plan_money`, must not be `None`") # noqa: E501 + + self._plan_money = plan_money + + @property + def plan_amount(self): + """Gets the plan_amount of this AutoInvestPlanCreate. # noqa: E501 + + Per PeriodAuto InvestAmount,Must > 0,and not exceedThePricing currencyConfigurationSingleMaximumAmount # noqa: E501 + + :return: The plan_amount of this AutoInvestPlanCreate. # noqa: E501 + :rtype: str + """ + return self._plan_amount + + @plan_amount.setter + def plan_amount(self, plan_amount): + """Sets the plan_amount of this AutoInvestPlanCreate. + + Per PeriodAuto InvestAmount,Must > 0,and not exceedThePricing currencyConfigurationSingleMaximumAmount # noqa: E501 + + :param plan_amount: The plan_amount of this AutoInvestPlanCreate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and plan_amount is None: # noqa: E501 + raise ValueError("Invalid value for `plan_amount`, must not be `None`") # noqa: E501 + + self._plan_amount = plan_amount + + @property + def plan_period_type(self): + """Gets the plan_period_type of this AutoInvestPlanCreate. # noqa: E501 + + Enum: daily, weekly, biweekly, monthly, hourly, 4-hourly # noqa: E501 + + :return: The plan_period_type of this AutoInvestPlanCreate. # noqa: E501 + :rtype: str + """ + return self._plan_period_type + + @plan_period_type.setter + def plan_period_type(self, plan_period_type): + """Sets the plan_period_type of this AutoInvestPlanCreate. + + Enum: daily, weekly, biweekly, monthly, hourly, 4-hourly # noqa: E501 + + :param plan_period_type: The plan_period_type of this AutoInvestPlanCreate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and plan_period_type is None: # noqa: E501 + raise ValueError("Invalid value for `plan_period_type`, must not be `None`") # noqa: E501 + + self._plan_period_type = plan_period_type + + @property + def plan_period_day(self): + """Gets the plan_period_day of this AutoInvestPlanCreate. # noqa: E501 + + Cycle day. For monthly: day of month (1-30); For weekly/biweekly: day of week (1-7, 1=Monday); For daily/hourly/4-hourly: ignored # noqa: E501 + + :return: The plan_period_day of this AutoInvestPlanCreate. # noqa: E501 + :rtype: int + """ + return self._plan_period_day + + @plan_period_day.setter + def plan_period_day(self, plan_period_day): + """Sets the plan_period_day of this AutoInvestPlanCreate. + + Cycle day. For monthly: day of month (1-30); For weekly/biweekly: day of week (1-7, 1=Monday); For daily/hourly/4-hourly: ignored # noqa: E501 + + :param plan_period_day: The plan_period_day of this AutoInvestPlanCreate. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and plan_period_day is None: # noqa: E501 + raise ValueError("Invalid value for `plan_period_day`, must not be `None`") # noqa: E501 + + self._plan_period_day = plan_period_day + + @property + def plan_period_hour(self): + """Gets the plan_period_hour of this AutoInvestPlanCreate. # noqa: E501 + + Execution hourAuto Invest 0-23 # noqa: E501 + + :return: The plan_period_hour of this AutoInvestPlanCreate. # noqa: E501 + :rtype: int + """ + return self._plan_period_hour + + @plan_period_hour.setter + def plan_period_hour(self, plan_period_hour): + """Sets the plan_period_hour of this AutoInvestPlanCreate. + + Execution hourAuto Invest 0-23 # noqa: E501 + + :param plan_period_hour: The plan_period_hour of this AutoInvestPlanCreate. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and plan_period_hour is None: # noqa: E501 + raise ValueError("Invalid value for `plan_period_hour`, must not be `None`") # noqa: E501 + + self._plan_period_hour = plan_period_hour + + @property + def items(self): + """Gets the items of this AutoInvestPlanCreate. # noqa: E501 + + Investment portfolio, asset cannot be repeated; Sum of all items' ratios must be 100 # noqa: E501 + + :return: The items of this AutoInvestPlanCreate. # noqa: E501 + :rtype: list[AutoInvestPlanCreateItems] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this AutoInvestPlanCreate. + + Investment portfolio, asset cannot be repeated; Sum of all items' ratios must be 100 # noqa: E501 + + :param items: The items of this AutoInvestPlanCreate. # noqa: E501 + :type: list[AutoInvestPlanCreateItems] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def fund_source(self): + """Gets the fund_source of this AutoInvestPlanCreate. # noqa: E501 + + Fund source: spot or earn, default: spot # noqa: E501 + + :return: The fund_source of this AutoInvestPlanCreate. # noqa: E501 + :rtype: str + """ + return self._fund_source + + @fund_source.setter + def fund_source(self, fund_source): + """Sets the fund_source of this AutoInvestPlanCreate. + + Fund source: spot or earn, default: spot # noqa: E501 + + :param fund_source: The fund_source of this AutoInvestPlanCreate. # noqa: E501 + :type: str + """ + + self._fund_source = fund_source + + @property + def fund_flow(self): + """Gets the fund_flow of this AutoInvestPlanCreate. # noqa: E501 + + Fund flow direction: auto_invest or earn, default: auto_invest # noqa: E501 + + :return: The fund_flow of this AutoInvestPlanCreate. # noqa: E501 + :rtype: str + """ + return self._fund_flow + + @fund_flow.setter + def fund_flow(self, fund_flow): + """Sets the fund_flow of this AutoInvestPlanCreate. + + Fund flow direction: auto_invest or earn, default: auto_invest # noqa: E501 + + :param fund_flow: The fund_flow of this AutoInvestPlanCreate. # noqa: E501 + :type: str + """ + + self._fund_flow = fund_flow + + @property + def type(self): + """Gets the type of this AutoInvestPlanCreate. # noqa: E501 + + 0 Normal creation, 1 QuickInvestment # noqa: E501 + + :return: The type of this AutoInvestPlanCreate. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this AutoInvestPlanCreate. + + 0 Normal creation, 1 QuickInvestment # noqa: E501 + + :param type: The type of this AutoInvestPlanCreate. # noqa: E501 + :type: int + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPlanCreate): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPlanCreate): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_plan_create_items.py b/gate_api/models/auto_invest_plan_create_items.py new file mode 100644 index 00000000..b748c4a8 --- /dev/null +++ b/gate_api/models/auto_invest_plan_create_items.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPlanCreateItems(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'ratio': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'ratio': 'ratio' + } + + def __init__(self, asset=None, ratio=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """AutoInvestPlanCreateItems - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._ratio = None + self.discriminator = None + + self.asset = asset + self.ratio = ratio + + @property + def asset(self): + """Gets the asset of this AutoInvestPlanCreateItems. # noqa: E501 + + Investment currency, e.g., BTC; Must be enabled and market exists; Cannot be repeated within the same plan # noqa: E501 + + :return: The asset of this AutoInvestPlanCreateItems. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this AutoInvestPlanCreateItems. + + Investment currency, e.g., BTC; Must be enabled and market exists; Cannot be repeated within the same plan # noqa: E501 + + :param asset: The asset of this AutoInvestPlanCreateItems. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def ratio(self): + """Gets the ratio of this AutoInvestPlanCreateItems. # noqa: E501 + + The proportion of this currency in the portfolio,The sum of all items' ratios must be 100 # noqa: E501 + + :return: The ratio of this AutoInvestPlanCreateItems. # noqa: E501 + :rtype: str + """ + return self._ratio + + @ratio.setter + def ratio(self, ratio): + """Sets the ratio of this AutoInvestPlanCreateItems. + + The proportion of this currency in the portfolio,The sum of all items' ratios must be 100 # noqa: E501 + + :param ratio: The ratio of this AutoInvestPlanCreateItems. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and ratio is None: # noqa: E501 + raise ValueError("Invalid value for `ratio`, must not be `None`") # noqa: E501 + + self._ratio = ratio + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPlanCreateItems): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPlanCreateItems): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_plan_create_resp.py b/gate_api/models/auto_invest_plan_create_resp.py new file mode 100644 index 00000000..3a04a3e7 --- /dev/null +++ b/gate_api/models/auto_invest_plan_create_resp.py @@ -0,0 +1,348 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPlanCreateResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'amount': 'str', + 'money': 'str', + 'next_time': 'int', + 'period_type': 'str', + 'period_day': 'int', + 'period_hour': 'int', + 'fund_flow': 'str', + 'fund_source': 'str' + } + + attribute_map = { + 'id': 'id', + 'amount': 'amount', + 'money': 'money', + 'next_time': 'next_time', + 'period_type': 'period_type', + 'period_day': 'period_day', + 'period_hour': 'period_hour', + 'fund_flow': 'fund_flow', + 'fund_source': 'fund_source' + } + + def __init__(self, id=None, amount=None, money=None, next_time=None, period_type=None, period_day=None, period_hour=None, fund_flow=None, fund_source=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, int, str, int, int, str, str, Configuration) -> None + """AutoInvestPlanCreateResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._amount = None + self._money = None + self._next_time = None + self._period_type = None + self._period_day = None + self._period_hour = None + self._fund_flow = None + self._fund_source = None + self.discriminator = None + + self.id = id + if amount is not None: + self.amount = amount + if money is not None: + self.money = money + if next_time is not None: + self.next_time = next_time + if period_type is not None: + self.period_type = period_type + if period_day is not None: + self.period_day = period_day + if period_hour is not None: + self.period_hour = period_hour + if fund_flow is not None: + self.fund_flow = fund_flow + if fund_source is not None: + self.fund_source = fund_source + + @property + def id(self): + """Gets the id of this AutoInvestPlanCreateResp. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The id of this AutoInvestPlanCreateResp. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutoInvestPlanCreateResp. + + Plan ID # noqa: E501 + + :param id: The id of this AutoInvestPlanCreateResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def amount(self): + """Gets the amount of this AutoInvestPlanCreateResp. # noqa: E501 + + Per PeriodAuto InvestAmount # noqa: E501 + + :return: The amount of this AutoInvestPlanCreateResp. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this AutoInvestPlanCreateResp. + + Per PeriodAuto InvestAmount # noqa: E501 + + :param amount: The amount of this AutoInvestPlanCreateResp. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def money(self): + """Gets the money of this AutoInvestPlanCreateResp. # noqa: E501 + + Quote currency # noqa: E501 + + :return: The money of this AutoInvestPlanCreateResp. # noqa: E501 + :rtype: str + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this AutoInvestPlanCreateResp. + + Quote currency # noqa: E501 + + :param money: The money of this AutoInvestPlanCreateResp. # noqa: E501 + :type: str + """ + + self._money = money + + @property + def next_time(self): + """Gets the next_time of this AutoInvestPlanCreateResp. # noqa: E501 + + Next execution time # noqa: E501 + + :return: The next_time of this AutoInvestPlanCreateResp. # noqa: E501 + :rtype: int + """ + return self._next_time + + @next_time.setter + def next_time(self, next_time): + """Sets the next_time of this AutoInvestPlanCreateResp. + + Next execution time # noqa: E501 + + :param next_time: The next_time of this AutoInvestPlanCreateResp. # noqa: E501 + :type: int + """ + + self._next_time = next_time + + @property + def period_type(self): + """Gets the period_type of this AutoInvestPlanCreateResp. # noqa: E501 + + Cycle type # noqa: E501 + + :return: The period_type of this AutoInvestPlanCreateResp. # noqa: E501 + :rtype: str + """ + return self._period_type + + @period_type.setter + def period_type(self, period_type): + """Sets the period_type of this AutoInvestPlanCreateResp. + + Cycle type # noqa: E501 + + :param period_type: The period_type of this AutoInvestPlanCreateResp. # noqa: E501 + :type: str + """ + + self._period_type = period_type + + @property + def period_day(self): + """Gets the period_day of this AutoInvestPlanCreateResp. # noqa: E501 + + Cycle day # noqa: E501 + + :return: The period_day of this AutoInvestPlanCreateResp. # noqa: E501 + :rtype: int + """ + return self._period_day + + @period_day.setter + def period_day(self, period_day): + """Sets the period_day of this AutoInvestPlanCreateResp. + + Cycle day # noqa: E501 + + :param period_day: The period_day of this AutoInvestPlanCreateResp. # noqa: E501 + :type: int + """ + + self._period_day = period_day + + @property + def period_hour(self): + """Gets the period_hour of this AutoInvestPlanCreateResp. # noqa: E501 + + CycleHours # noqa: E501 + + :return: The period_hour of this AutoInvestPlanCreateResp. # noqa: E501 + :rtype: int + """ + return self._period_hour + + @period_hour.setter + def period_hour(self, period_hour): + """Sets the period_hour of this AutoInvestPlanCreateResp. + + CycleHours # noqa: E501 + + :param period_hour: The period_hour of this AutoInvestPlanCreateResp. # noqa: E501 + :type: int + """ + + self._period_hour = period_hour + + @property + def fund_flow(self): + """Gets the fund_flow of this AutoInvestPlanCreateResp. # noqa: E501 + + Fund Flow Direction # noqa: E501 + + :return: The fund_flow of this AutoInvestPlanCreateResp. # noqa: E501 + :rtype: str + """ + return self._fund_flow + + @fund_flow.setter + def fund_flow(self, fund_flow): + """Sets the fund_flow of this AutoInvestPlanCreateResp. + + Fund Flow Direction # noqa: E501 + + :param fund_flow: The fund_flow of this AutoInvestPlanCreateResp. # noqa: E501 + :type: str + """ + + self._fund_flow = fund_flow + + @property + def fund_source(self): + """Gets the fund_source of this AutoInvestPlanCreateResp. # noqa: E501 + + Fund source # noqa: E501 + + :return: The fund_source of this AutoInvestPlanCreateResp. # noqa: E501 + :rtype: str + """ + return self._fund_source + + @fund_source.setter + def fund_source(self, fund_source): + """Sets the fund_source of this AutoInvestPlanCreateResp. + + Fund source # noqa: E501 + + :param fund_source: The fund_source of this AutoInvestPlanCreateResp. # noqa: E501 + :type: str + """ + + self._fund_source = fund_source + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPlanCreateResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPlanCreateResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_plan_detail.py b/gate_api/models/auto_invest_plan_detail.py new file mode 100644 index 00000000..7fde60ba --- /dev/null +++ b/gate_api/models/auto_invest_plan_detail.py @@ -0,0 +1,558 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPlanDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'version': 'int', + 'name': 'str', + 'create_time': 'int', + 'update_time': 'int', + 'user_id': 'int', + 'money': 'str', + 'amount': 'str', + 'period_type': 'str', + 'period_day': 'int', + 'period_hour': 'int', + 'portfolio': 'list[AutoInvestPortfolioItem]', + 'next_time': 'int', + 'period': 'int', + 'fund_source': 'str', + 'fund_flow': 'str' + } + + attribute_map = { + 'id': 'id', + 'version': 'version', + 'name': 'name', + 'create_time': 'create_time', + 'update_time': 'update_time', + 'user_id': 'user_id', + 'money': 'money', + 'amount': 'amount', + 'period_type': 'period_type', + 'period_day': 'period_day', + 'period_hour': 'period_hour', + 'portfolio': 'portfolio', + 'next_time': 'next_time', + 'period': 'period', + 'fund_source': 'fund_source', + 'fund_flow': 'fund_flow' + } + + def __init__(self, id=None, version=None, name=None, create_time=None, update_time=None, user_id=None, money=None, amount=None, period_type=None, period_day=None, period_hour=None, portfolio=None, next_time=None, period=None, fund_source=None, fund_flow=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, int, int, int, str, str, str, int, int, list[AutoInvestPortfolioItem], int, int, str, str, Configuration) -> None + """AutoInvestPlanDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._version = None + self._name = None + self._create_time = None + self._update_time = None + self._user_id = None + self._money = None + self._amount = None + self._period_type = None + self._period_day = None + self._period_hour = None + self._portfolio = None + self._next_time = None + self._period = None + self._fund_source = None + self._fund_flow = None + self.discriminator = None + + self.id = id + if version is not None: + self.version = version + self.name = name + self.create_time = create_time + self.update_time = update_time + self.user_id = user_id + self.money = money + self.amount = amount + self.period_type = period_type + self.period_day = period_day + self.period_hour = period_hour + self.portfolio = portfolio + self.next_time = next_time + self.period = period + self.fund_source = fund_source + self.fund_flow = fund_flow + + @property + def id(self): + """Gets the id of this AutoInvestPlanDetail. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The id of this AutoInvestPlanDetail. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutoInvestPlanDetail. + + Plan ID # noqa: E501 + + :param id: The id of this AutoInvestPlanDetail. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def version(self): + """Gets the version of this AutoInvestPlanDetail. # noqa: E501 + + PlanVersion # noqa: E501 + + :return: The version of this AutoInvestPlanDetail. # noqa: E501 + :rtype: int + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this AutoInvestPlanDetail. + + PlanVersion # noqa: E501 + + :param version: The version of this AutoInvestPlanDetail. # noqa: E501 + :type: int + """ + + self._version = version + + @property + def name(self): + """Gets the name of this AutoInvestPlanDetail. # noqa: E501 + + Plan name # noqa: E501 + + :return: The name of this AutoInvestPlanDetail. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutoInvestPlanDetail. + + Plan name # noqa: E501 + + :param name: The name of this AutoInvestPlanDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def create_time(self): + """Gets the create_time of this AutoInvestPlanDetail. # noqa: E501 + + Creation time (Unix timestamp) # noqa: E501 + + :return: The create_time of this AutoInvestPlanDetail. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this AutoInvestPlanDetail. + + Creation time (Unix timestamp) # noqa: E501 + + :param create_time: The create_time of this AutoInvestPlanDetail. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this AutoInvestPlanDetail. # noqa: E501 + + Update time (Unix timestamp) # noqa: E501 + + :return: The update_time of this AutoInvestPlanDetail. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this AutoInvestPlanDetail. + + Update time (Unix timestamp) # noqa: E501 + + :param update_time: The update_time of this AutoInvestPlanDetail. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and update_time is None: # noqa: E501 + raise ValueError("Invalid value for `update_time`, must not be `None`") # noqa: E501 + + self._update_time = update_time + + @property + def user_id(self): + """Gets the user_id of this AutoInvestPlanDetail. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this AutoInvestPlanDetail. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this AutoInvestPlanDetail. + + User ID # noqa: E501 + + :param user_id: The user_id of this AutoInvestPlanDetail. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def money(self): + """Gets the money of this AutoInvestPlanDetail. # noqa: E501 + + Quote Currency # noqa: E501 + + :return: The money of this AutoInvestPlanDetail. # noqa: E501 + :rtype: str + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this AutoInvestPlanDetail. + + Quote Currency # noqa: E501 + + :param money: The money of this AutoInvestPlanDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and money is None: # noqa: E501 + raise ValueError("Invalid value for `money`, must not be `None`") # noqa: E501 + + self._money = money + + @property + def amount(self): + """Gets the amount of this AutoInvestPlanDetail. # noqa: E501 + + Per PeriodInvestment amount # noqa: E501 + + :return: The amount of this AutoInvestPlanDetail. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this AutoInvestPlanDetail. + + Per PeriodInvestment amount # noqa: E501 + + :param amount: The amount of this AutoInvestPlanDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def period_type(self): + """Gets the period_type of this AutoInvestPlanDetail. # noqa: E501 + + Cycle type(e.g., monthly) # noqa: E501 + + :return: The period_type of this AutoInvestPlanDetail. # noqa: E501 + :rtype: str + """ + return self._period_type + + @period_type.setter + def period_type(self, period_type): + """Sets the period_type of this AutoInvestPlanDetail. + + Cycle type(e.g., monthly) # noqa: E501 + + :param period_type: The period_type of this AutoInvestPlanDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and period_type is None: # noqa: E501 + raise ValueError("Invalid value for `period_type`, must not be `None`") # noqa: E501 + + self._period_type = period_type + + @property + def period_day(self): + """Gets the period_day of this AutoInvestPlanDetail. # noqa: E501 + + Cycle day # noqa: E501 + + :return: The period_day of this AutoInvestPlanDetail. # noqa: E501 + :rtype: int + """ + return self._period_day + + @period_day.setter + def period_day(self, period_day): + """Sets the period_day of this AutoInvestPlanDetail. + + Cycle day # noqa: E501 + + :param period_day: The period_day of this AutoInvestPlanDetail. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and period_day is None: # noqa: E501 + raise ValueError("Invalid value for `period_day`, must not be `None`") # noqa: E501 + + self._period_day = period_day + + @property + def period_hour(self): + """Gets the period_hour of this AutoInvestPlanDetail. # noqa: E501 + + CycleHours # noqa: E501 + + :return: The period_hour of this AutoInvestPlanDetail. # noqa: E501 + :rtype: int + """ + return self._period_hour + + @period_hour.setter + def period_hour(self, period_hour): + """Sets the period_hour of this AutoInvestPlanDetail. + + CycleHours # noqa: E501 + + :param period_hour: The period_hour of this AutoInvestPlanDetail. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and period_hour is None: # noqa: E501 + raise ValueError("Invalid value for `period_hour`, must not be `None`") # noqa: E501 + + self._period_hour = period_hour + + @property + def portfolio(self): + """Gets the portfolio of this AutoInvestPlanDetail. # noqa: E501 + + Portfolio # noqa: E501 + + :return: The portfolio of this AutoInvestPlanDetail. # noqa: E501 + :rtype: list[AutoInvestPortfolioItem] + """ + return self._portfolio + + @portfolio.setter + def portfolio(self, portfolio): + """Sets the portfolio of this AutoInvestPlanDetail. + + Portfolio # noqa: E501 + + :param portfolio: The portfolio of this AutoInvestPlanDetail. # noqa: E501 + :type: list[AutoInvestPortfolioItem] + """ + if self.local_vars_configuration.client_side_validation and portfolio is None: # noqa: E501 + raise ValueError("Invalid value for `portfolio`, must not be `None`") # noqa: E501 + + self._portfolio = portfolio + + @property + def next_time(self): + """Gets the next_time of this AutoInvestPlanDetail. # noqa: E501 + + Next execution time (Unix timestamp) # noqa: E501 + + :return: The next_time of this AutoInvestPlanDetail. # noqa: E501 + :rtype: int + """ + return self._next_time + + @next_time.setter + def next_time(self, next_time): + """Sets the next_time of this AutoInvestPlanDetail. + + Next execution time (Unix timestamp) # noqa: E501 + + :param next_time: The next_time of this AutoInvestPlanDetail. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and next_time is None: # noqa: E501 + raise ValueError("Invalid value for `next_time`, must not be `None`") # noqa: E501 + + self._next_time = next_time + + @property + def period(self): + """Gets the period of this AutoInvestPlanDetail. # noqa: E501 + + Executed periods # noqa: E501 + + :return: The period of this AutoInvestPlanDetail. # noqa: E501 + :rtype: int + """ + return self._period + + @period.setter + def period(self, period): + """Sets the period of this AutoInvestPlanDetail. + + Executed periods # noqa: E501 + + :param period: The period of this AutoInvestPlanDetail. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and period is None: # noqa: E501 + raise ValueError("Invalid value for `period`, must not be `None`") # noqa: E501 + + self._period = period + + @property + def fund_source(self): + """Gets the fund_source of this AutoInvestPlanDetail. # noqa: E501 + + Fund source(spot/earn) # noqa: E501 + + :return: The fund_source of this AutoInvestPlanDetail. # noqa: E501 + :rtype: str + """ + return self._fund_source + + @fund_source.setter + def fund_source(self, fund_source): + """Sets the fund_source of this AutoInvestPlanDetail. + + Fund source(spot/earn) # noqa: E501 + + :param fund_source: The fund_source of this AutoInvestPlanDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fund_source is None: # noqa: E501 + raise ValueError("Invalid value for `fund_source`, must not be `None`") # noqa: E501 + + self._fund_source = fund_source + + @property + def fund_flow(self): + """Gets the fund_flow of this AutoInvestPlanDetail. # noqa: E501 + + Fund flow direction (auto_invest/earn) # noqa: E501 + + :return: The fund_flow of this AutoInvestPlanDetail. # noqa: E501 + :rtype: str + """ + return self._fund_flow + + @fund_flow.setter + def fund_flow(self, fund_flow): + """Sets the fund_flow of this AutoInvestPlanDetail. + + Fund flow direction (auto_invest/earn) # noqa: E501 + + :param fund_flow: The fund_flow of this AutoInvestPlanDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fund_flow is None: # noqa: E501 + raise ValueError("Invalid value for `fund_flow`, must not be `None`") # noqa: E501 + + self._fund_flow = fund_flow + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPlanDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPlanDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_plan_list_info_resp.py b/gate_api/models/auto_invest_plan_list_info_resp.py new file mode 100644 index 00000000..48aa5192 --- /dev/null +++ b/gate_api/models/auto_invest_plan_list_info_resp.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPlanListInfoResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'page': 'int', + 'page_size': 'int', + 'page_count': 'int', + 'total_count': 'int', + 'list': 'list[AutoInvestPlanDetail]' + } + + attribute_map = { + 'page': 'page', + 'page_size': 'page_size', + 'page_count': 'page_count', + 'total_count': 'total_count', + 'list': 'list' + } + + def __init__(self, page=None, page_size=None, page_count=None, total_count=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, int, list[AutoInvestPlanDetail], Configuration) -> None + """AutoInvestPlanListInfoResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._page = None + self._page_size = None + self._page_count = None + self._total_count = None + self._list = None + self.discriminator = None + + self.page = page + self.page_size = page_size + self.page_count = page_count + self.total_count = total_count + self.list = list + + @property + def page(self): + """Gets the page of this AutoInvestPlanListInfoResp. # noqa: E501 + + page number # noqa: E501 + + :return: The page of this AutoInvestPlanListInfoResp. # noqa: E501 + :rtype: int + """ + return self._page + + @page.setter + def page(self, page): + """Sets the page of this AutoInvestPlanListInfoResp. + + page number # noqa: E501 + + :param page: The page of this AutoInvestPlanListInfoResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page is None: # noqa: E501 + raise ValueError("Invalid value for `page`, must not be `None`") # noqa: E501 + + self._page = page + + @property + def page_size(self): + """Gets the page_size of this AutoInvestPlanListInfoResp. # noqa: E501 + + Items per page # noqa: E501 + + :return: The page_size of this AutoInvestPlanListInfoResp. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this AutoInvestPlanListInfoResp. + + Items per page # noqa: E501 + + :param page_size: The page_size of this AutoInvestPlanListInfoResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page_size is None: # noqa: E501 + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def page_count(self): + """Gets the page_count of this AutoInvestPlanListInfoResp. # noqa: E501 + + Total pages # noqa: E501 + + :return: The page_count of this AutoInvestPlanListInfoResp. # noqa: E501 + :rtype: int + """ + return self._page_count + + @page_count.setter + def page_count(self, page_count): + """Sets the page_count of this AutoInvestPlanListInfoResp. + + Total pages # noqa: E501 + + :param page_count: The page_count of this AutoInvestPlanListInfoResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page_count is None: # noqa: E501 + raise ValueError("Invalid value for `page_count`, must not be `None`") # noqa: E501 + + self._page_count = page_count + + @property + def total_count(self): + """Gets the total_count of this AutoInvestPlanListInfoResp. # noqa: E501 + + Total entries # noqa: E501 + + :return: The total_count of this AutoInvestPlanListInfoResp. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this AutoInvestPlanListInfoResp. + + Total entries # noqa: E501 + + :param total_count: The total_count of this AutoInvestPlanListInfoResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total_count is None: # noqa: E501 + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + @property + def list(self): + """Gets the list of this AutoInvestPlanListInfoResp. # noqa: E501 + + PlanList # noqa: E501 + + :return: The list of this AutoInvestPlanListInfoResp. # noqa: E501 + :rtype: list[AutoInvestPlanDetail] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this AutoInvestPlanListInfoResp. + + PlanList # noqa: E501 + + :param list: The list of this AutoInvestPlanListInfoResp. # noqa: E501 + :type: list[AutoInvestPlanDetail] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPlanListInfoResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPlanListInfoResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_plan_record_item.py b/gate_api/models/auto_invest_plan_record_item.py new file mode 100644 index 00000000..585b01f3 --- /dev/null +++ b/gate_api/models/auto_invest_plan_record_item.py @@ -0,0 +1,528 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPlanRecordItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'type': 'str', + 'money': 'str', + 'user_id': 'int', + 'plan_id': 'int', + 'plan_version': 'int', + 'amount': 'str', + 'create_time': 'int', + 'update_time': 'int', + 'status': 'str', + 'status_type': 'int', + 'side': 'int', + 'status_message': 'str', + 'detail': 'str', + 'asset': 'str' + } + + attribute_map = { + 'id': 'id', + 'type': 'type', + 'money': 'money', + 'user_id': 'user_id', + 'plan_id': 'plan_id', + 'plan_version': 'plan_version', + 'amount': 'amount', + 'create_time': 'create_time', + 'update_time': 'update_time', + 'status': 'status', + 'status_type': 'status_type', + 'side': 'side', + 'status_message': 'status_message', + 'detail': 'detail', + 'asset': 'asset' + } + + def __init__(self, id=None, type=None, money=None, user_id=None, plan_id=None, plan_version=None, amount=None, create_time=None, update_time=None, status=None, status_type=None, side=None, status_message=None, detail=None, asset=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, int, int, int, str, int, int, str, int, int, str, str, str, Configuration) -> None + """AutoInvestPlanRecordItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._type = None + self._money = None + self._user_id = None + self._plan_id = None + self._plan_version = None + self._amount = None + self._create_time = None + self._update_time = None + self._status = None + self._status_type = None + self._side = None + self._status_message = None + self._detail = None + self._asset = None + self.discriminator = None + + self.id = id + self.type = type + self.money = money + self.user_id = user_id + self.plan_id = plan_id + self.plan_version = plan_version + self.amount = amount + self.create_time = create_time + self.update_time = update_time + self.status = status + self.status_type = status_type + self.side = side + self.status_message = status_message + if detail is not None: + self.detail = detail + if asset is not None: + self.asset = asset + + @property + def id(self): + """Gets the id of this AutoInvestPlanRecordItem. # noqa: E501 + + Record ID # noqa: E501 + + :return: The id of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutoInvestPlanRecordItem. + + Record ID # noqa: E501 + + :param id: The id of this AutoInvestPlanRecordItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def type(self): + """Gets the type of this AutoInvestPlanRecordItem. # noqa: E501 + + Type # noqa: E501 + + :return: The type of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this AutoInvestPlanRecordItem. + + Type # noqa: E501 + + :param type: The type of this AutoInvestPlanRecordItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + @property + def money(self): + """Gets the money of this AutoInvestPlanRecordItem. # noqa: E501 + + SourceCurrency # noqa: E501 + + :return: The money of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: str + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this AutoInvestPlanRecordItem. + + SourceCurrency # noqa: E501 + + :param money: The money of this AutoInvestPlanRecordItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and money is None: # noqa: E501 + raise ValueError("Invalid value for `money`, must not be `None`") # noqa: E501 + + self._money = money + + @property + def user_id(self): + """Gets the user_id of this AutoInvestPlanRecordItem. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this AutoInvestPlanRecordItem. + + User ID # noqa: E501 + + :param user_id: The user_id of this AutoInvestPlanRecordItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def plan_id(self): + """Gets the plan_id of this AutoInvestPlanRecordItem. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The plan_id of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: int + """ + return self._plan_id + + @plan_id.setter + def plan_id(self, plan_id): + """Sets the plan_id of this AutoInvestPlanRecordItem. + + Plan ID # noqa: E501 + + :param plan_id: The plan_id of this AutoInvestPlanRecordItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and plan_id is None: # noqa: E501 + raise ValueError("Invalid value for `plan_id`, must not be `None`") # noqa: E501 + + self._plan_id = plan_id + + @property + def plan_version(self): + """Gets the plan_version of this AutoInvestPlanRecordItem. # noqa: E501 + + PlanVersion # noqa: E501 + + :return: The plan_version of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: int + """ + return self._plan_version + + @plan_version.setter + def plan_version(self, plan_version): + """Sets the plan_version of this AutoInvestPlanRecordItem. + + PlanVersion # noqa: E501 + + :param plan_version: The plan_version of this AutoInvestPlanRecordItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and plan_version is None: # noqa: E501 + raise ValueError("Invalid value for `plan_version`, must not be `None`") # noqa: E501 + + self._plan_version = plan_version + + @property + def amount(self): + """Gets the amount of this AutoInvestPlanRecordItem. # noqa: E501 + + Investment amount # noqa: E501 + + :return: The amount of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this AutoInvestPlanRecordItem. + + Investment amount # noqa: E501 + + :param amount: The amount of this AutoInvestPlanRecordItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def create_time(self): + """Gets the create_time of this AutoInvestPlanRecordItem. # noqa: E501 + + Investment time # noqa: E501 + + :return: The create_time of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this AutoInvestPlanRecordItem. + + Investment time # noqa: E501 + + :param create_time: The create_time of this AutoInvestPlanRecordItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this AutoInvestPlanRecordItem. # noqa: E501 + + Update time # noqa: E501 + + :return: The update_time of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this AutoInvestPlanRecordItem. + + Update time # noqa: E501 + + :param update_time: The update_time of this AutoInvestPlanRecordItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and update_time is None: # noqa: E501 + raise ValueError("Invalid value for `update_time`, must not be `None`") # noqa: E501 + + self._update_time = update_time + + @property + def status(self): + """Gets the status of this AutoInvestPlanRecordItem. # noqa: E501 + + Status # noqa: E501 + + :return: The status of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AutoInvestPlanRecordItem. + + Status # noqa: E501 + + :param status: The status of this AutoInvestPlanRecordItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def status_type(self): + """Gets the status_type of this AutoInvestPlanRecordItem. # noqa: E501 + + Status enum # noqa: E501 + + :return: The status_type of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: int + """ + return self._status_type + + @status_type.setter + def status_type(self, status_type): + """Sets the status_type of this AutoInvestPlanRecordItem. + + Status enum # noqa: E501 + + :param status_type: The status_type of this AutoInvestPlanRecordItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and status_type is None: # noqa: E501 + raise ValueError("Invalid value for `status_type`, must not be `None`") # noqa: E501 + + self._status_type = status_type + + @property + def side(self): + """Gets the side of this AutoInvestPlanRecordItem. # noqa: E501 + + 2 = Buy, Other = Sell # noqa: E501 + + :return: The side of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: int + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this AutoInvestPlanRecordItem. + + 2 = Buy, Other = Sell # noqa: E501 + + :param side: The side of this AutoInvestPlanRecordItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def status_message(self): + """Gets the status_message of this AutoInvestPlanRecordItem. # noqa: E501 + + Status description # noqa: E501 + + :return: The status_message of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: str + """ + return self._status_message + + @status_message.setter + def status_message(self, status_message): + """Sets the status_message of this AutoInvestPlanRecordItem. + + Status description # noqa: E501 + + :param status_message: The status_message of this AutoInvestPlanRecordItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and status_message is None: # noqa: E501 + raise ValueError("Invalid value for `status_message`, must not be `None`") # noqa: E501 + + self._status_message = status_message + + @property + def detail(self): + """Gets the detail of this AutoInvestPlanRecordItem. # noqa: E501 + + Details # noqa: E501 + + :return: The detail of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: str + """ + return self._detail + + @detail.setter + def detail(self, detail): + """Sets the detail of this AutoInvestPlanRecordItem. + + Details # noqa: E501 + + :param detail: The detail of this AutoInvestPlanRecordItem. # noqa: E501 + :type: str + """ + + self._detail = detail + + @property + def asset(self): + """Gets the asset of this AutoInvestPlanRecordItem. # noqa: E501 + + Currency # noqa: E501 + + :return: The asset of this AutoInvestPlanRecordItem. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this AutoInvestPlanRecordItem. + + Currency # noqa: E501 + + :param asset: The asset of this AutoInvestPlanRecordItem. # noqa: E501 + :type: str + """ + + self._asset = asset + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPlanRecordItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPlanRecordItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_plan_records_resp.py b/gate_api/models/auto_invest_plan_records_resp.py new file mode 100644 index 00000000..df79781b --- /dev/null +++ b/gate_api/models/auto_invest_plan_records_resp.py @@ -0,0 +1,238 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPlanRecordsResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'page': 'int', + 'page_size': 'int', + 'total_page': 'int', + 'total': 'int', + 'list': 'list[AutoInvestPlanRecordItem]' + } + + attribute_map = { + 'page': 'page', + 'page_size': 'page_size', + 'total_page': 'total_page', + 'total': 'total', + 'list': 'list' + } + + def __init__(self, page=None, page_size=None, total_page=None, total=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, int, list[AutoInvestPlanRecordItem], Configuration) -> None + """AutoInvestPlanRecordsResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._page = None + self._page_size = None + self._total_page = None + self._total = None + self._list = None + self.discriminator = None + + self.page = page + self.page_size = page_size + self.total_page = total_page + self.total = total + self.list = list + + @property + def page(self): + """Gets the page of this AutoInvestPlanRecordsResp. # noqa: E501 + + page number # noqa: E501 + + :return: The page of this AutoInvestPlanRecordsResp. # noqa: E501 + :rtype: int + """ + return self._page + + @page.setter + def page(self, page): + """Sets the page of this AutoInvestPlanRecordsResp. + + page number # noqa: E501 + + :param page: The page of this AutoInvestPlanRecordsResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page is None: # noqa: E501 + raise ValueError("Invalid value for `page`, must not be `None`") # noqa: E501 + + self._page = page + + @property + def page_size(self): + """Gets the page_size of this AutoInvestPlanRecordsResp. # noqa: E501 + + Items per page # noqa: E501 + + :return: The page_size of this AutoInvestPlanRecordsResp. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this AutoInvestPlanRecordsResp. + + Items per page # noqa: E501 + + :param page_size: The page_size of this AutoInvestPlanRecordsResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page_size is None: # noqa: E501 + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def total_page(self): + """Gets the total_page of this AutoInvestPlanRecordsResp. # noqa: E501 + + TotalPage number # noqa: E501 + + :return: The total_page of this AutoInvestPlanRecordsResp. # noqa: E501 + :rtype: int + """ + return self._total_page + + @total_page.setter + def total_page(self, total_page): + """Sets the total_page of this AutoInvestPlanRecordsResp. + + TotalPage number # noqa: E501 + + :param total_page: The total_page of this AutoInvestPlanRecordsResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total_page is None: # noqa: E501 + raise ValueError("Invalid value for `total_page`, must not be `None`") # noqa: E501 + + self._total_page = total_page + + @property + def total(self): + """Gets the total of this AutoInvestPlanRecordsResp. # noqa: E501 + + Total entries # noqa: E501 + + :return: The total of this AutoInvestPlanRecordsResp. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this AutoInvestPlanRecordsResp. + + Total entries # noqa: E501 + + :param total: The total of this AutoInvestPlanRecordsResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + @property + def list(self): + """Gets the list of this AutoInvestPlanRecordsResp. # noqa: E501 + + + :return: The list of this AutoInvestPlanRecordsResp. # noqa: E501 + :rtype: list[AutoInvestPlanRecordItem] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this AutoInvestPlanRecordsResp. + + + :param list: The list of this AutoInvestPlanRecordsResp. # noqa: E501 + :type: list[AutoInvestPlanRecordItem] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPlanRecordsResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPlanRecordsResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_plan_stop.py b/gate_api/models/auto_invest_plan_stop.py new file mode 100644 index 00000000..e5cdcbbc --- /dev/null +++ b/gate_api/models/auto_invest_plan_stop.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPlanStop(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'plan_id': 'int' + } + + attribute_map = { + 'plan_id': 'plan_id' + } + + def __init__(self, plan_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """AutoInvestPlanStop - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._plan_id = None + self.discriminator = None + + self.plan_id = plan_id + + @property + def plan_id(self): + """Gets the plan_id of this AutoInvestPlanStop. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The plan_id of this AutoInvestPlanStop. # noqa: E501 + :rtype: int + """ + return self._plan_id + + @plan_id.setter + def plan_id(self, plan_id): + """Sets the plan_id of this AutoInvestPlanStop. + + Plan ID # noqa: E501 + + :param plan_id: The plan_id of this AutoInvestPlanStop. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and plan_id is None: # noqa: E501 + raise ValueError("Invalid value for `plan_id`, must not be `None`") # noqa: E501 + + self._plan_id = plan_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPlanStop): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPlanStop): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_plan_update.py b/gate_api/models/auto_invest_plan_update.py new file mode 100644 index 00000000..244e60db --- /dev/null +++ b/gate_api/models/auto_invest_plan_update.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPlanUpdate(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'plan_id': 'int', + 'fund_source': 'str', + 'fund_flow': 'str' + } + + attribute_map = { + 'plan_id': 'plan_id', + 'fund_source': 'fund_source', + 'fund_flow': 'fund_flow' + } + + def __init__(self, plan_id=None, fund_source=None, fund_flow=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, Configuration) -> None + """AutoInvestPlanUpdate - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._plan_id = None + self._fund_source = None + self._fund_flow = None + self.discriminator = None + + self.plan_id = plan_id + if fund_source is not None: + self.fund_source = fund_source + if fund_flow is not None: + self.fund_flow = fund_flow + + @property + def plan_id(self): + """Gets the plan_id of this AutoInvestPlanUpdate. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The plan_id of this AutoInvestPlanUpdate. # noqa: E501 + :rtype: int + """ + return self._plan_id + + @plan_id.setter + def plan_id(self, plan_id): + """Sets the plan_id of this AutoInvestPlanUpdate. + + Plan ID # noqa: E501 + + :param plan_id: The plan_id of this AutoInvestPlanUpdate. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and plan_id is None: # noqa: E501 + raise ValueError("Invalid value for `plan_id`, must not be `None`") # noqa: E501 + + self._plan_id = plan_id + + @property + def fund_source(self): + """Gets the fund_source of this AutoInvestPlanUpdate. # noqa: E501 + + Fund source Spotspot or Flexible Savingsearn,Default spot # noqa: E501 + + :return: The fund_source of this AutoInvestPlanUpdate. # noqa: E501 + :rtype: str + """ + return self._fund_source + + @fund_source.setter + def fund_source(self, fund_source): + """Sets the fund_source of this AutoInvestPlanUpdate. + + Fund source Spotspot or Flexible Savingsearn,Default spot # noqa: E501 + + :param fund_source: The fund_source of this AutoInvestPlanUpdate. # noqa: E501 + :type: str + """ + + self._fund_source = fund_source + + @property + def fund_flow(self): + """Gets the fund_flow of this AutoInvestPlanUpdate. # noqa: E501 + + Fund Flow Direction Spotauto_invest or Flexible Savingsearn,Default auto_invest # noqa: E501 + + :return: The fund_flow of this AutoInvestPlanUpdate. # noqa: E501 + :rtype: str + """ + return self._fund_flow + + @fund_flow.setter + def fund_flow(self, fund_flow): + """Sets the fund_flow of this AutoInvestPlanUpdate. + + Fund Flow Direction Spotauto_invest or Flexible Savingsearn,Default auto_invest # noqa: E501 + + :param fund_flow: The fund_flow of this AutoInvestPlanUpdate. # noqa: E501 + :type: str + """ + + self._fund_flow = fund_flow + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPlanUpdate): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPlanUpdate): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/auto_invest_portfolio_item.py b/gate_api/models/auto_invest_portfolio_item.py new file mode 100644 index 00000000..25110d73 --- /dev/null +++ b/gate_api/models/auto_invest_portfolio_item.py @@ -0,0 +1,327 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class AutoInvestPortfolioItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'ratio': 'str', + 'cum_invest': 'str', + 'cum_hold': 'str', + 'cum_redeem': 'str', + 'avg_price': 'str', + 'redeem_status': 'int', + 'lend_amount': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'ratio': 'ratio', + 'cum_invest': 'cum_invest', + 'cum_hold': 'cum_hold', + 'cum_redeem': 'cum_redeem', + 'avg_price': 'avg_price', + 'redeem_status': 'redeem_status', + 'lend_amount': 'lend_amount' + } + + def __init__(self, asset=None, ratio=None, cum_invest=None, cum_hold=None, cum_redeem=None, avg_price=None, redeem_status=None, lend_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, int, str, Configuration) -> None + """AutoInvestPortfolioItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._ratio = None + self._cum_invest = None + self._cum_hold = None + self._cum_redeem = None + self._avg_price = None + self._redeem_status = None + self._lend_amount = None + self.discriminator = None + + self.asset = asset + self.ratio = ratio + self.cum_invest = cum_invest + self.cum_hold = cum_hold + self.cum_redeem = cum_redeem + self.avg_price = avg_price + self.redeem_status = redeem_status + self.lend_amount = lend_amount + + @property + def asset(self): + """Gets the asset of this AutoInvestPortfolioItem. # noqa: E501 + + Currency # noqa: E501 + + :return: The asset of this AutoInvestPortfolioItem. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this AutoInvestPortfolioItem. + + Currency # noqa: E501 + + :param asset: The asset of this AutoInvestPortfolioItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def ratio(self): + """Gets the ratio of this AutoInvestPortfolioItem. # noqa: E501 + + Ratio # noqa: E501 + + :return: The ratio of this AutoInvestPortfolioItem. # noqa: E501 + :rtype: str + """ + return self._ratio + + @ratio.setter + def ratio(self, ratio): + """Sets the ratio of this AutoInvestPortfolioItem. + + Ratio # noqa: E501 + + :param ratio: The ratio of this AutoInvestPortfolioItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and ratio is None: # noqa: E501 + raise ValueError("Invalid value for `ratio`, must not be `None`") # noqa: E501 + + self._ratio = ratio + + @property + def cum_invest(self): + """Gets the cum_invest of this AutoInvestPortfolioItem. # noqa: E501 + + Accumulated investment # noqa: E501 + + :return: The cum_invest of this AutoInvestPortfolioItem. # noqa: E501 + :rtype: str + """ + return self._cum_invest + + @cum_invest.setter + def cum_invest(self, cum_invest): + """Sets the cum_invest of this AutoInvestPortfolioItem. + + Accumulated investment # noqa: E501 + + :param cum_invest: The cum_invest of this AutoInvestPortfolioItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and cum_invest is None: # noqa: E501 + raise ValueError("Invalid value for `cum_invest`, must not be `None`") # noqa: E501 + + self._cum_invest = cum_invest + + @property + def cum_hold(self): + """Gets the cum_hold of this AutoInvestPortfolioItem. # noqa: E501 + + AccumulatedPosition # noqa: E501 + + :return: The cum_hold of this AutoInvestPortfolioItem. # noqa: E501 + :rtype: str + """ + return self._cum_hold + + @cum_hold.setter + def cum_hold(self, cum_hold): + """Sets the cum_hold of this AutoInvestPortfolioItem. + + AccumulatedPosition # noqa: E501 + + :param cum_hold: The cum_hold of this AutoInvestPortfolioItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and cum_hold is None: # noqa: E501 + raise ValueError("Invalid value for `cum_hold`, must not be `None`") # noqa: E501 + + self._cum_hold = cum_hold + + @property + def cum_redeem(self): + """Gets the cum_redeem of this AutoInvestPortfolioItem. # noqa: E501 + + Accumulated redemption # noqa: E501 + + :return: The cum_redeem of this AutoInvestPortfolioItem. # noqa: E501 + :rtype: str + """ + return self._cum_redeem + + @cum_redeem.setter + def cum_redeem(self, cum_redeem): + """Sets the cum_redeem of this AutoInvestPortfolioItem. + + Accumulated redemption # noqa: E501 + + :param cum_redeem: The cum_redeem of this AutoInvestPortfolioItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and cum_redeem is None: # noqa: E501 + raise ValueError("Invalid value for `cum_redeem`, must not be `None`") # noqa: E501 + + self._cum_redeem = cum_redeem + + @property + def avg_price(self): + """Gets the avg_price of this AutoInvestPortfolioItem. # noqa: E501 + + Average Cost Price # noqa: E501 + + :return: The avg_price of this AutoInvestPortfolioItem. # noqa: E501 + :rtype: str + """ + return self._avg_price + + @avg_price.setter + def avg_price(self, avg_price): + """Sets the avg_price of this AutoInvestPortfolioItem. + + Average Cost Price # noqa: E501 + + :param avg_price: The avg_price of this AutoInvestPortfolioItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and avg_price is None: # noqa: E501 + raise ValueError("Invalid value for `avg_price`, must not be `None`") # noqa: E501 + + self._avg_price = avg_price + + @property + def redeem_status(self): + """Gets the redeem_status of this AutoInvestPortfolioItem. # noqa: E501 + + Redemption status # noqa: E501 + + :return: The redeem_status of this AutoInvestPortfolioItem. # noqa: E501 + :rtype: int + """ + return self._redeem_status + + @redeem_status.setter + def redeem_status(self, redeem_status): + """Sets the redeem_status of this AutoInvestPortfolioItem. + + Redemption status # noqa: E501 + + :param redeem_status: The redeem_status of this AutoInvestPortfolioItem. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and redeem_status is None: # noqa: E501 + raise ValueError("Invalid value for `redeem_status`, must not be `None`") # noqa: E501 + + self._redeem_status = redeem_status + + @property + def lend_amount(self): + """Gets the lend_amount of this AutoInvestPortfolioItem. # noqa: E501 + + LendingQuantity # noqa: E501 + + :return: The lend_amount of this AutoInvestPortfolioItem. # noqa: E501 + :rtype: str + """ + return self._lend_amount + + @lend_amount.setter + def lend_amount(self, lend_amount): + """Sets the lend_amount of this AutoInvestPortfolioItem. + + LendingQuantity # noqa: E501 + + :param lend_amount: The lend_amount of this AutoInvestPortfolioItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and lend_amount is None: # noqa: E501 + raise ValueError("Invalid value for `lend_amount`, must not be `None`") # noqa: E501 + + self._lend_amount = lend_amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutoInvestPortfolioItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AutoInvestPortfolioItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/award_list_struct_list.py b/gate_api/models/award_list_struct_list.py index b911f6dd..1d689116 100644 --- a/gate_api/models/award_list_struct_list.py +++ b/gate_api/models/award_list_struct_list.py @@ -238,7 +238,7 @@ def fee(self, fee): def status(self): """Gets the status of this AwardListStructList. # noqa: E501 - Status # noqa: E501 + Status. 4 - success # noqa: E501 :return: The status of this AwardListStructList. # noqa: E501 :rtype: int @@ -249,7 +249,7 @@ def status(self): def status(self, status): """Sets the status of this AwardListStructList. - Status # noqa: E501 + Status. 4 - success # noqa: E501 :param status: The status of this AwardListStructList. # noqa: E501 :type: int diff --git a/gate_api/models/base_response.py b/gate_api/models/base_response.py new file mode 100644 index 00000000..3419d245 --- /dev/null +++ b/gate_api/models/base_response.py @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class BaseResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, object, int, Configuration) -> None + """BaseResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this BaseResponse. # noqa: E501 + + Error Code, 0 Indicates Success # noqa: E501 + + :return: The code of this BaseResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this BaseResponse. + + Error Code, 0 Indicates Success # noqa: E501 + + :param code: The code of this BaseResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this BaseResponse. # noqa: E501 + + Error message description # noqa: E501 + + :return: The message of this BaseResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this BaseResponse. + + Error message description # noqa: E501 + + :param message: The message of this BaseResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this BaseResponse. # noqa: E501 + + Response data # noqa: E501 + + :return: The data of this BaseResponse. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this BaseResponse. + + Response data # noqa: E501 + + :param data: The data of this BaseResponse. # noqa: E501 + :type: object + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this BaseResponse. # noqa: E501 + + Unix timestamp # noqa: E501 + + :return: The timestamp of this BaseResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this BaseResponse. + + Unix timestamp # noqa: E501 + + :param timestamp: The timestamp of this BaseResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BaseResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BaseResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/batch_amend_item.py b/gate_api/models/batch_amend_item.py index 7125ac04..995a64b3 100644 --- a/gate_api/models/batch_amend_item.py +++ b/gate_api/models/batch_amend_item.py @@ -39,7 +39,9 @@ class BatchAmendItem(object): 'amount': 'str', 'price': 'str', 'amend_text': 'str', - 'action_mode': 'str' + 'action_mode': 'str', + 'stop_profit': 'SpotOrderStopProfit', + 'stop_loss': 'SpotOrderStopLoss' } attribute_map = { @@ -49,11 +51,13 @@ class BatchAmendItem(object): 'amount': 'amount', 'price': 'price', 'amend_text': 'amend_text', - 'action_mode': 'action_mode' + 'action_mode': 'action_mode', + 'stop_profit': 'stop_profit', + 'stop_loss': 'stop_loss' } - def __init__(self, order_id=None, currency_pair=None, account=None, amount=None, price=None, amend_text=None, action_mode=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, str, str, Configuration) -> None + def __init__(self, order_id=None, currency_pair=None, account=None, amount=None, price=None, amend_text=None, action_mode=None, stop_profit=None, stop_loss=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, SpotOrderStopProfit, SpotOrderStopLoss, Configuration) -> None """BatchAmendItem - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -66,6 +70,8 @@ def __init__(self, order_id=None, currency_pair=None, account=None, amount=None, self._price = None self._amend_text = None self._action_mode = None + self._stop_profit = None + self._stop_loss = None self.discriminator = None self.order_id = order_id @@ -80,6 +86,10 @@ def __init__(self, order_id=None, currency_pair=None, account=None, amount=None, self.amend_text = amend_text if action_mode is not None: self.action_mode = action_mode + if stop_profit is not None: + self.stop_profit = stop_profit + if stop_loss is not None: + self.stop_loss = stop_loss @property def order_id(self): @@ -249,6 +259,48 @@ def action_mode(self, action_mode): self._action_mode = action_mode + @property + def stop_profit(self): + """Gets the stop_profit of this BatchAmendItem. # noqa: E501 + + + :return: The stop_profit of this BatchAmendItem. # noqa: E501 + :rtype: SpotOrderStopProfit + """ + return self._stop_profit + + @stop_profit.setter + def stop_profit(self, stop_profit): + """Sets the stop_profit of this BatchAmendItem. + + + :param stop_profit: The stop_profit of this BatchAmendItem. # noqa: E501 + :type: SpotOrderStopProfit + """ + + self._stop_profit = stop_profit + + @property + def stop_loss(self): + """Gets the stop_loss of this BatchAmendItem. # noqa: E501 + + + :return: The stop_loss of this BatchAmendItem. # noqa: E501 + :rtype: SpotOrderStopLoss + """ + return self._stop_loss + + @stop_loss.setter + def stop_loss(self, stop_loss): + """Sets the stop_loss of this BatchAmendItem. + + + :param stop_loss: The stop_loss of this BatchAmendItem. # noqa: E501 + :type: SpotOrderStopLoss + """ + + self._stop_loss = stop_loss + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/batch_amend_order_req.py b/gate_api/models/batch_amend_order_req.py index 26a4662a..faa5efa1 100644 --- a/gate_api/models/batch_amend_order_req.py +++ b/gate_api/models/batch_amend_order_req.py @@ -37,7 +37,8 @@ class BatchAmendOrderReq(object): 'text': 'str', 'size': 'str', 'price': 'str', - 'amend_text': 'str' + 'amend_text': 'str', + 'action_mode': 'str' } attribute_map = { @@ -45,11 +46,12 @@ class BatchAmendOrderReq(object): 'text': 'text', 'size': 'size', 'price': 'price', - 'amend_text': 'amend_text' + 'amend_text': 'amend_text', + 'action_mode': 'action_mode' } - def __init__(self, order_id=None, text=None, size=None, price=None, amend_text=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, str, str, str, Configuration) -> None + def __init__(self, order_id=None, text=None, size=None, price=None, amend_text=None, action_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, Configuration) -> None """BatchAmendOrderReq - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -60,6 +62,7 @@ def __init__(self, order_id=None, text=None, size=None, price=None, amend_text=N self._size = None self._price = None self._amend_text = None + self._action_mode = None self.discriminator = None if order_id is not None: @@ -72,6 +75,8 @@ def __init__(self, order_id=None, text=None, size=None, price=None, amend_text=N self.price = price if amend_text is not None: self.amend_text = amend_text + if action_mode is not None: + self.action_mode = action_mode @property def order_id(self): @@ -188,6 +193,29 @@ def amend_text(self, amend_text): self._amend_text = amend_text + @property + def action_mode(self): + """Gets the action_mode of this BatchAmendOrderReq. # noqa: E501 + + Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) # noqa: E501 + + :return: The action_mode of this BatchAmendOrderReq. # noqa: E501 + :rtype: str + """ + return self._action_mode + + @action_mode.setter + def action_mode(self, action_mode): + """Sets the action_mode of this BatchAmendOrderReq. + + Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) # noqa: E501 + + :param action_mode: The action_mode of this BatchAmendOrderReq. # noqa: E501 + :type: str + """ + + self._action_mode = action_mode + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/batch_funding_rates_request.py b/gate_api/models/batch_funding_rates_request.py new file mode 100644 index 00000000..f0afc9f1 --- /dev/null +++ b/gate_api/models/batch_funding_rates_request.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class BatchFundingRatesRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'contracts': 'list[str]' + } + + attribute_map = { + 'contracts': 'contracts' + } + + def __init__(self, contracts=None, local_vars_configuration=None): # noqa: E501 + # type: (list[str], Configuration) -> None + """BatchFundingRatesRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._contracts = None + self.discriminator = None + + self.contracts = contracts + + @property + def contracts(self): + """Gets the contracts of this BatchFundingRatesRequest. # noqa: E501 + + Array of Contract Names # noqa: E501 + + :return: The contracts of this BatchFundingRatesRequest. # noqa: E501 + :rtype: list[str] + """ + return self._contracts + + @contracts.setter + def contracts(self, contracts): + """Sets the contracts of this BatchFundingRatesRequest. + + Array of Contract Names # noqa: E501 + + :param contracts: The contracts of this BatchFundingRatesRequest. # noqa: E501 + :type: list[str] + """ + if self.local_vars_configuration.client_side_validation and contracts is None: # noqa: E501 + raise ValueError("Invalid value for `contracts`, must not be `None`") # noqa: E501 + + self._contracts = contracts + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchFundingRatesRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchFundingRatesRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/batch_funding_rates_response.py b/gate_api/models/batch_funding_rates_response.py new file mode 100644 index 00000000..e707aa69 --- /dev/null +++ b/gate_api/models/batch_funding_rates_response.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class BatchFundingRatesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'contract': 'str', + 'data': 'list[FundingRateRecord]' + } + + attribute_map = { + 'contract': 'contract', + 'data': 'data' + } + + def __init__(self, contract=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[FundingRateRecord], Configuration) -> None + """BatchFundingRatesResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._contract = None + self._data = None + self.discriminator = None + + if contract is not None: + self.contract = contract + if data is not None: + self.data = data + + @property + def contract(self): + """Gets the contract of this BatchFundingRatesResponse. # noqa: E501 + + Contract name # noqa: E501 + + :return: The contract of this BatchFundingRatesResponse. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this BatchFundingRatesResponse. + + Contract name # noqa: E501 + + :param contract: The contract of this BatchFundingRatesResponse. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def data(self): + """Gets the data of this BatchFundingRatesResponse. # noqa: E501 + + Array of Funding Rates # noqa: E501 + + :return: The data of this BatchFundingRatesResponse. # noqa: E501 + :rtype: list[FundingRateRecord] + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this BatchFundingRatesResponse. + + Array of Funding Rates # noqa: E501 + + :param data: The data of this BatchFundingRatesResponse. # noqa: E501 + :type: list[FundingRateRecord] + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BatchFundingRatesResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BatchFundingRatesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/batch_order.py b/gate_api/models/batch_order.py index 52f5d009..50a0b037 100644 --- a/gate_api/models/batch_order.py +++ b/gate_api/models/batch_order.py @@ -70,7 +70,9 @@ class BatchOrder(object): 'stp_id': 'int', 'stp_act': 'str', 'finish_as': 'str', - 'slippage': 'str' + 'slippage': 'str', + 'stop_profit': 'SpotOrderStopProfit', + 'stop_loss': 'SpotOrderStopLoss' } attribute_map = { @@ -111,11 +113,13 @@ class BatchOrder(object): 'stp_id': 'stp_id', 'stp_act': 'stp_act', 'finish_as': 'finish_as', - 'slippage': 'slippage' + 'slippage': 'slippage', + 'stop_profit': 'stop_profit', + 'stop_loss': 'stop_loss' } - def __init__(self, order_id=None, amend_text=None, text=None, succeeded=None, label=None, message=None, id=None, create_time=None, update_time=None, create_time_ms=None, update_time_ms=None, status=None, currency_pair=None, type='limit', account='spot', side=None, amount=None, price=None, time_in_force='gtc', iceberg=None, auto_borrow=None, auto_repay=None, left=None, filled_amount=None, fill_price=None, filled_total=None, avg_deal_price=None, fee=None, fee_currency=None, point_fee=None, gt_fee=None, gt_discount=None, rebated_fee=None, rebated_fee_currency=None, stp_id=None, stp_act=None, finish_as=None, slippage=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, bool, str, str, str, str, str, int, int, str, str, str, str, str, str, str, str, str, bool, bool, str, str, str, str, str, str, str, str, str, bool, str, str, int, str, str, str, Configuration) -> None + def __init__(self, order_id=None, amend_text=None, text=None, succeeded=None, label=None, message=None, id=None, create_time=None, update_time=None, create_time_ms=None, update_time_ms=None, status=None, currency_pair=None, type='limit', account='spot', side=None, amount=None, price=None, time_in_force='gtc', iceberg=None, auto_borrow=None, auto_repay=None, left=None, filled_amount=None, fill_price=None, filled_total=None, avg_deal_price=None, fee=None, fee_currency=None, point_fee=None, gt_fee=None, gt_discount=None, rebated_fee=None, rebated_fee_currency=None, stp_id=None, stp_act=None, finish_as=None, slippage=None, stop_profit=None, stop_loss=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, bool, str, str, str, str, str, int, int, str, str, str, str, str, str, str, str, str, bool, bool, str, str, str, str, str, str, str, str, str, bool, str, str, int, str, str, str, SpotOrderStopProfit, SpotOrderStopLoss, Configuration) -> None """BatchOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -159,6 +163,8 @@ def __init__(self, order_id=None, amend_text=None, text=None, succeeded=None, la self._stp_act = None self._finish_as = None self._slippage = None + self._stop_profit = None + self._stop_loss = None self.discriminator = None if order_id is not None: @@ -237,6 +243,10 @@ def __init__(self, order_id=None, amend_text=None, text=None, succeeded=None, la self.finish_as = finish_as if slippage is not None: self.slippage = slippage + if stop_profit is not None: + self.stop_profit = stop_profit + if stop_loss is not None: + self.stop_loss = stop_loss @property def order_id(self): @@ -495,7 +505,7 @@ def update_time_ms(self, update_time_ms): def status(self): """Gets the status of this BatchOrder. # noqa: E501 - Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled # noqa: E501 + Order status - `open`: to be filled - `closed`: closed order - `cancelled`: cancelled # noqa: E501 :return: The status of this BatchOrder. # noqa: E501 :rtype: str @@ -506,7 +516,7 @@ def status(self): def status(self, status): """Sets the status of this BatchOrder. - Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled # noqa: E501 + Order status - `open`: to be filled - `closed`: closed order - `cancelled`: cancelled # noqa: E501 :param status: The status of this BatchOrder. # noqa: E501 :type: str @@ -1106,7 +1116,7 @@ def stp_act(self, stp_act): def finish_as(self): """Gets the finish_as of this BatchOrder. # noqa: E501 - How the order was finished. - open: processing - filled: filled totally - cancelled: manually cancelled - ioc: time in force is `IOC`, finish immediately - stp: cancelled because self trade prevention # noqa: E501 + How the order finished: - open: Pending processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled by liquidation - small: Order size too small - depth_not_enough: Cancelled due to insufficient order book depth - trader_not_enough: Cancelled due to insufficient counterparty liquidity - ioc: Not filled immediately because time-in-force is IOC - poc: Post-only requirement not met because time-in-force is set to poc (maker-only); rejected after being detected as taker - fok: Not fully filled immediately because time-in-force is FOK - stp: Cancelled due to self-trade prevention - price_protect_cancelled: Cancelled due to price protection - unknown: Unknown # noqa: E501 :return: The finish_as of this BatchOrder. # noqa: E501 :rtype: str @@ -1117,12 +1127,12 @@ def finish_as(self): def finish_as(self, finish_as): """Sets the finish_as of this BatchOrder. - How the order was finished. - open: processing - filled: filled totally - cancelled: manually cancelled - ioc: time in force is `IOC`, finish immediately - stp: cancelled because self trade prevention # noqa: E501 + How the order finished: - open: Pending processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled by liquidation - small: Order size too small - depth_not_enough: Cancelled due to insufficient order book depth - trader_not_enough: Cancelled due to insufficient counterparty liquidity - ioc: Not filled immediately because time-in-force is IOC - poc: Post-only requirement not met because time-in-force is set to poc (maker-only); rejected after being detected as taker - fok: Not fully filled immediately because time-in-force is FOK - stp: Cancelled due to self-trade prevention - price_protect_cancelled: Cancelled due to price protection - unknown: Unknown # noqa: E501 :param finish_as: The finish_as of this BatchOrder. # noqa: E501 :type: str """ - allowed_values = ["open", "filled", "cancelled", "ioc", "stp"] # noqa: E501 + allowed_values = ["open", "filled", "cancelled", "liquidate_cancelled", "depth_not_enough", "trader_not_enough", "small", "ioc", "poc", "fok", "stp", "price_protect_cancelled", "unknown"] # noqa: E501 if self.local_vars_configuration.client_side_validation and finish_as not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `finish_as` ({0}), must be one of {1}" # noqa: E501 @@ -1135,7 +1145,7 @@ def finish_as(self, finish_as): def slippage(self): """Gets the slippage of this BatchOrder. # noqa: E501 - Slippage, default limit range 0.0001-0.05, converted to percentage is 0.01%-5%, indicating the acceptable price difference for market order transactions # noqa: E501 + Maximum supported slippage ratio for Spot Market Order Placement, calculated based on the latest market price at the time of order placement as the benchmark (Example: 0.03 means 3%) # noqa: E501 :return: The slippage of this BatchOrder. # noqa: E501 :rtype: str @@ -1146,7 +1156,7 @@ def slippage(self): def slippage(self, slippage): """Sets the slippage of this BatchOrder. - Slippage, default limit range 0.0001-0.05, converted to percentage is 0.01%-5%, indicating the acceptable price difference for market order transactions # noqa: E501 + Maximum supported slippage ratio for Spot Market Order Placement, calculated based on the latest market price at the time of order placement as the benchmark (Example: 0.03 means 3%) # noqa: E501 :param slippage: The slippage of this BatchOrder. # noqa: E501 :type: str @@ -1154,6 +1164,48 @@ def slippage(self, slippage): self._slippage = slippage + @property + def stop_profit(self): + """Gets the stop_profit of this BatchOrder. # noqa: E501 + + + :return: The stop_profit of this BatchOrder. # noqa: E501 + :rtype: SpotOrderStopProfit + """ + return self._stop_profit + + @stop_profit.setter + def stop_profit(self, stop_profit): + """Sets the stop_profit of this BatchOrder. + + + :param stop_profit: The stop_profit of this BatchOrder. # noqa: E501 + :type: SpotOrderStopProfit + """ + + self._stop_profit = stop_profit + + @property + def stop_loss(self): + """Gets the stop_loss of this BatchOrder. # noqa: E501 + + + :return: The stop_loss of this BatchOrder. # noqa: E501 + :rtype: SpotOrderStopLoss + """ + return self._stop_loss + + @stop_loss.setter + def stop_loss(self, stop_loss): + """Sets the stop_loss of this BatchOrder. + + + :param stop_loss: The stop_loss of this BatchOrder. # noqa: E501 + :type: SpotOrderStopLoss + """ + + self._stop_loss = stop_loss + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/broker_commission.py b/gate_api/models/broker_commission.py index cc6e70ab..3b0147be 100644 --- a/gate_api/models/broker_commission.py +++ b/gate_api/models/broker_commission.py @@ -34,7 +34,7 @@ class BrokerCommission(object): """ openapi_types = { 'total': 'int', - 'list': 'list[BrokerCommission1]' + 'list': 'list[BrokerCommissionItem]' } attribute_map = { @@ -43,7 +43,7 @@ class BrokerCommission(object): } def __init__(self, total=None, list=None, local_vars_configuration=None): # noqa: E501 - # type: (int, list[BrokerCommission1], Configuration) -> None + # type: (int, list[BrokerCommissionItem], Configuration) -> None """BrokerCommission - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -88,7 +88,7 @@ def list(self): List of commission history # noqa: E501 :return: The list of this BrokerCommission. # noqa: E501 - :rtype: list[BrokerCommission1] + :rtype: list[BrokerCommissionItem] """ return self._list @@ -99,7 +99,7 @@ def list(self, list): List of commission history # noqa: E501 :param list: The list of this BrokerCommission. # noqa: E501 - :type: list[BrokerCommission1] + :type: list[BrokerCommissionItem] """ self._list = list diff --git a/gate_api/models/broker_commission1.py b/gate_api/models/broker_commission_item.py similarity index 76% rename from gate_api/models/broker_commission1.py rename to gate_api/models/broker_commission_item.py index 71474fc5..d7178c2c 100644 --- a/gate_api/models/broker_commission1.py +++ b/gate_api/models/broker_commission_item.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class BrokerCommission1(object): +class BrokerCommissionItem(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -62,7 +62,7 @@ class BrokerCommission1(object): def __init__(self, commission_time=None, user_id=None, group_name=None, amount=None, fee=None, fee_asset=None, rebate_fee=None, source=None, currency_pair=None, sub_broker_info=None, alpha_contract_addr=None, local_vars_configuration=None): # noqa: E501 # type: (int, int, str, str, str, str, str, str, str, BrokerCommissionSubBrokerInfo, str, Configuration) -> None - """BrokerCommission1 - a model defined in OpenAPI""" # noqa: E501 + """BrokerCommissionItem - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration @@ -105,22 +105,22 @@ def __init__(self, commission_time=None, user_id=None, group_name=None, amount=N @property def commission_time(self): - """Gets the commission_time of this BrokerCommission1. # noqa: E501 + """Gets the commission_time of this BrokerCommissionItem. # noqa: E501 Commission time (Unix timestamp in seconds) # noqa: E501 - :return: The commission_time of this BrokerCommission1. # noqa: E501 + :return: The commission_time of this BrokerCommissionItem. # noqa: E501 :rtype: int """ return self._commission_time @commission_time.setter def commission_time(self, commission_time): - """Sets the commission_time of this BrokerCommission1. + """Sets the commission_time of this BrokerCommissionItem. Commission time (Unix timestamp in seconds) # noqa: E501 - :param commission_time: The commission_time of this BrokerCommission1. # noqa: E501 + :param commission_time: The commission_time of this BrokerCommissionItem. # noqa: E501 :type: int """ @@ -128,22 +128,22 @@ def commission_time(self, commission_time): @property def user_id(self): - """Gets the user_id of this BrokerCommission1. # noqa: E501 + """Gets the user_id of this BrokerCommissionItem. # noqa: E501 User ID # noqa: E501 - :return: The user_id of this BrokerCommission1. # noqa: E501 + :return: The user_id of this BrokerCommissionItem. # noqa: E501 :rtype: int """ return self._user_id @user_id.setter def user_id(self, user_id): - """Sets the user_id of this BrokerCommission1. + """Sets the user_id of this BrokerCommissionItem. User ID # noqa: E501 - :param user_id: The user_id of this BrokerCommission1. # noqa: E501 + :param user_id: The user_id of this BrokerCommissionItem. # noqa: E501 :type: int """ @@ -151,22 +151,22 @@ def user_id(self, user_id): @property def group_name(self): - """Gets the group_name of this BrokerCommission1. # noqa: E501 + """Gets the group_name of this BrokerCommissionItem. # noqa: E501 Group name # noqa: E501 - :return: The group_name of this BrokerCommission1. # noqa: E501 + :return: The group_name of this BrokerCommissionItem. # noqa: E501 :rtype: str """ return self._group_name @group_name.setter def group_name(self, group_name): - """Sets the group_name of this BrokerCommission1. + """Sets the group_name of this BrokerCommissionItem. Group name # noqa: E501 - :param group_name: The group_name of this BrokerCommission1. # noqa: E501 + :param group_name: The group_name of this BrokerCommissionItem. # noqa: E501 :type: str """ @@ -174,22 +174,22 @@ def group_name(self, group_name): @property def amount(self): - """Gets the amount of this BrokerCommission1. # noqa: E501 + """Gets the amount of this BrokerCommissionItem. # noqa: E501 The amount of commission rebates # noqa: E501 - :return: The amount of this BrokerCommission1. # noqa: E501 + :return: The amount of this BrokerCommissionItem. # noqa: E501 :rtype: str """ return self._amount @amount.setter def amount(self, amount): - """Sets the amount of this BrokerCommission1. + """Sets the amount of this BrokerCommissionItem. The amount of commission rebates # noqa: E501 - :param amount: The amount of this BrokerCommission1. # noqa: E501 + :param amount: The amount of this BrokerCommissionItem. # noqa: E501 :type: str """ @@ -197,22 +197,22 @@ def amount(self, amount): @property def fee(self): - """Gets the fee of this BrokerCommission1. # noqa: E501 + """Gets the fee of this BrokerCommissionItem. # noqa: E501 Fee # noqa: E501 - :return: The fee of this BrokerCommission1. # noqa: E501 + :return: The fee of this BrokerCommissionItem. # noqa: E501 :rtype: str """ return self._fee @fee.setter def fee(self, fee): - """Sets the fee of this BrokerCommission1. + """Sets the fee of this BrokerCommissionItem. Fee # noqa: E501 - :param fee: The fee of this BrokerCommission1. # noqa: E501 + :param fee: The fee of this BrokerCommissionItem. # noqa: E501 :type: str """ @@ -220,22 +220,22 @@ def fee(self, fee): @property def fee_asset(self): - """Gets the fee_asset of this BrokerCommission1. # noqa: E501 + """Gets the fee_asset of this BrokerCommissionItem. # noqa: E501 Fee currency # noqa: E501 - :return: The fee_asset of this BrokerCommission1. # noqa: E501 + :return: The fee_asset of this BrokerCommissionItem. # noqa: E501 :rtype: str """ return self._fee_asset @fee_asset.setter def fee_asset(self, fee_asset): - """Sets the fee_asset of this BrokerCommission1. + """Sets the fee_asset of this BrokerCommissionItem. Fee currency # noqa: E501 - :param fee_asset: The fee_asset of this BrokerCommission1. # noqa: E501 + :param fee_asset: The fee_asset of this BrokerCommissionItem. # noqa: E501 :type: str """ @@ -243,22 +243,22 @@ def fee_asset(self, fee_asset): @property def rebate_fee(self): - """Gets the rebate_fee of this BrokerCommission1. # noqa: E501 + """Gets the rebate_fee of this BrokerCommissionItem. # noqa: E501 The income from rebates, converted to USDT # noqa: E501 - :return: The rebate_fee of this BrokerCommission1. # noqa: E501 + :return: The rebate_fee of this BrokerCommissionItem. # noqa: E501 :rtype: str """ return self._rebate_fee @rebate_fee.setter def rebate_fee(self, rebate_fee): - """Sets the rebate_fee of this BrokerCommission1. + """Sets the rebate_fee of this BrokerCommissionItem. The income from rebates, converted to USDT # noqa: E501 - :param rebate_fee: The rebate_fee of this BrokerCommission1. # noqa: E501 + :param rebate_fee: The rebate_fee of this BrokerCommissionItem. # noqa: E501 :type: str """ @@ -266,22 +266,22 @@ def rebate_fee(self, rebate_fee): @property def source(self): - """Gets the source of this BrokerCommission1. # noqa: E501 + """Gets the source of this BrokerCommissionItem. # noqa: E501 - Commission transaction type: Spot, Futures, Options, Alpha # noqa: E501 + Commission transaction type: Spot, Futures, Options, Alpha、TradFi # noqa: E501 - :return: The source of this BrokerCommission1. # noqa: E501 + :return: The source of this BrokerCommissionItem. # noqa: E501 :rtype: str """ return self._source @source.setter def source(self, source): - """Sets the source of this BrokerCommission1. + """Sets the source of this BrokerCommissionItem. - Commission transaction type: Spot, Futures, Options, Alpha # noqa: E501 + Commission transaction type: Spot, Futures, Options, Alpha、TradFi # noqa: E501 - :param source: The source of this BrokerCommission1. # noqa: E501 + :param source: The source of this BrokerCommissionItem. # noqa: E501 :type: str """ @@ -289,22 +289,22 @@ def source(self, source): @property def currency_pair(self): - """Gets the currency_pair of this BrokerCommission1. # noqa: E501 + """Gets the currency_pair of this BrokerCommissionItem. # noqa: E501 Currency pair # noqa: E501 - :return: The currency_pair of this BrokerCommission1. # noqa: E501 + :return: The currency_pair of this BrokerCommissionItem. # noqa: E501 :rtype: str """ return self._currency_pair @currency_pair.setter def currency_pair(self, currency_pair): - """Sets the currency_pair of this BrokerCommission1. + """Sets the currency_pair of this BrokerCommissionItem. Currency pair # noqa: E501 - :param currency_pair: The currency_pair of this BrokerCommission1. # noqa: E501 + :param currency_pair: The currency_pair of this BrokerCommissionItem. # noqa: E501 :type: str """ @@ -312,20 +312,20 @@ def currency_pair(self, currency_pair): @property def sub_broker_info(self): - """Gets the sub_broker_info of this BrokerCommission1. # noqa: E501 + """Gets the sub_broker_info of this BrokerCommissionItem. # noqa: E501 - :return: The sub_broker_info of this BrokerCommission1. # noqa: E501 + :return: The sub_broker_info of this BrokerCommissionItem. # noqa: E501 :rtype: BrokerCommissionSubBrokerInfo """ return self._sub_broker_info @sub_broker_info.setter def sub_broker_info(self, sub_broker_info): - """Sets the sub_broker_info of this BrokerCommission1. + """Sets the sub_broker_info of this BrokerCommissionItem. - :param sub_broker_info: The sub_broker_info of this BrokerCommission1. # noqa: E501 + :param sub_broker_info: The sub_broker_info of this BrokerCommissionItem. # noqa: E501 :type: BrokerCommissionSubBrokerInfo """ @@ -333,22 +333,22 @@ def sub_broker_info(self, sub_broker_info): @property def alpha_contract_addr(self): - """Gets the alpha_contract_addr of this BrokerCommission1. # noqa: E501 + """Gets the alpha_contract_addr of this BrokerCommissionItem. # noqa: E501 Alpha contract address # noqa: E501 - :return: The alpha_contract_addr of this BrokerCommission1. # noqa: E501 + :return: The alpha_contract_addr of this BrokerCommissionItem. # noqa: E501 :rtype: str """ return self._alpha_contract_addr @alpha_contract_addr.setter def alpha_contract_addr(self, alpha_contract_addr): - """Sets the alpha_contract_addr of this BrokerCommission1. + """Sets the alpha_contract_addr of this BrokerCommissionItem. Alpha contract address # noqa: E501 - :param alpha_contract_addr: The alpha_contract_addr of this BrokerCommission1. # noqa: E501 + :param alpha_contract_addr: The alpha_contract_addr of this BrokerCommissionItem. # noqa: E501 :type: str """ @@ -388,14 +388,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, BrokerCommission1): + if not isinstance(other, BrokerCommissionItem): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, BrokerCommission1): + if not isinstance(other, BrokerCommissionItem): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/broker_transaction.py b/gate_api/models/broker_transaction.py index 0a85977d..42d5020d 100644 --- a/gate_api/models/broker_transaction.py +++ b/gate_api/models/broker_transaction.py @@ -33,76 +33,298 @@ class BrokerTransaction(object): and the value is json key in definition. """ openapi_types = { - 'total': 'int', - 'list': 'list[BrokerTransaction1]' + 'transaction_time': 'int', + 'user_id': 'int', + 'group_name': 'str', + 'fee': 'str', + 'currency_pair': 'str', + 'amount': 'str', + 'fee_asset': 'str', + 'source': 'str', + 'sub_broker_info': 'BrokerCommissionSubBrokerInfo', + 'alpha_contract_addr': 'str' } attribute_map = { - 'total': 'total', - 'list': 'list' + 'transaction_time': 'transaction_time', + 'user_id': 'user_id', + 'group_name': 'group_name', + 'fee': 'fee', + 'currency_pair': 'currency_pair', + 'amount': 'amount', + 'fee_asset': 'fee_asset', + 'source': 'source', + 'sub_broker_info': 'sub_broker_info', + 'alpha_contract_addr': 'alpha_contract_addr' } - def __init__(self, total=None, list=None, local_vars_configuration=None): # noqa: E501 - # type: (int, list[BrokerTransaction1], Configuration) -> None + def __init__(self, transaction_time=None, user_id=None, group_name=None, fee=None, currency_pair=None, amount=None, fee_asset=None, source=None, sub_broker_info=None, alpha_contract_addr=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, str, str, str, BrokerCommissionSubBrokerInfo, str, Configuration) -> None """BrokerTransaction - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration - self._total = None - self._list = None + self._transaction_time = None + self._user_id = None + self._group_name = None + self._fee = None + self._currency_pair = None + self._amount = None + self._fee_asset = None + self._source = None + self._sub_broker_info = None + self._alpha_contract_addr = None self.discriminator = None - if total is not None: - self.total = total - if list is not None: - self.list = list + if transaction_time is not None: + self.transaction_time = transaction_time + if user_id is not None: + self.user_id = user_id + if group_name is not None: + self.group_name = group_name + if fee is not None: + self.fee = fee + if currency_pair is not None: + self.currency_pair = currency_pair + if amount is not None: + self.amount = amount + if fee_asset is not None: + self.fee_asset = fee_asset + if source is not None: + self.source = source + if sub_broker_info is not None: + self.sub_broker_info = sub_broker_info + if alpha_contract_addr is not None: + self.alpha_contract_addr = alpha_contract_addr @property - def total(self): - """Gets the total of this BrokerTransaction. # noqa: E501 + def transaction_time(self): + """Gets the transaction_time of this BrokerTransaction. # noqa: E501 - Total # noqa: E501 + Transaction Time. (unix timestamp) # noqa: E501 - :return: The total of this BrokerTransaction. # noqa: E501 + :return: The transaction_time of this BrokerTransaction. # noqa: E501 :rtype: int """ - return self._total + return self._transaction_time - @total.setter - def total(self, total): - """Sets the total of this BrokerTransaction. + @transaction_time.setter + def transaction_time(self, transaction_time): + """Sets the transaction_time of this BrokerTransaction. - Total # noqa: E501 + Transaction Time. (unix timestamp) # noqa: E501 - :param total: The total of this BrokerTransaction. # noqa: E501 + :param transaction_time: The transaction_time of this BrokerTransaction. # noqa: E501 :type: int """ - self._total = total + self._transaction_time = transaction_time @property - def list(self): - """Gets the list of this BrokerTransaction. # noqa: E501 + def user_id(self): + """Gets the user_id of this BrokerTransaction. # noqa: E501 - List of transaction history # noqa: E501 + User ID # noqa: E501 - :return: The list of this BrokerTransaction. # noqa: E501 - :rtype: list[BrokerTransaction1] + :return: The user_id of this BrokerTransaction. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this BrokerTransaction. + + User ID # noqa: E501 + + :param user_id: The user_id of this BrokerTransaction. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def group_name(self): + """Gets the group_name of this BrokerTransaction. # noqa: E501 + + Group name # noqa: E501 + + :return: The group_name of this BrokerTransaction. # noqa: E501 + :rtype: str + """ + return self._group_name + + @group_name.setter + def group_name(self, group_name): + """Sets the group_name of this BrokerTransaction. + + Group name # noqa: E501 + + :param group_name: The group_name of this BrokerTransaction. # noqa: E501 + :type: str + """ + + self._group_name = group_name + + @property + def fee(self): + """Gets the fee of this BrokerTransaction. # noqa: E501 + + Fee amount (USDT) # noqa: E501 + + :return: The fee of this BrokerTransaction. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this BrokerTransaction. + + Fee amount (USDT) # noqa: E501 + + :param fee: The fee of this BrokerTransaction. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def currency_pair(self): + """Gets the currency_pair of this BrokerTransaction. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this BrokerTransaction. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this BrokerTransaction. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this BrokerTransaction. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def amount(self): + """Gets the amount of this BrokerTransaction. # noqa: E501 + + Transaction amount # noqa: E501 + + :return: The amount of this BrokerTransaction. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this BrokerTransaction. + + Transaction amount # noqa: E501 + + :param amount: The amount of this BrokerTransaction. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def fee_asset(self): + """Gets the fee_asset of this BrokerTransaction. # noqa: E501 + + Fee currency # noqa: E501 + + :return: The fee_asset of this BrokerTransaction. # noqa: E501 + :rtype: str + """ + return self._fee_asset + + @fee_asset.setter + def fee_asset(self, fee_asset): + """Sets the fee_asset of this BrokerTransaction. + + Fee currency # noqa: E501 + + :param fee_asset: The fee_asset of this BrokerTransaction. # noqa: E501 + :type: str + """ + + self._fee_asset = fee_asset + + @property + def source(self): + """Gets the source of this BrokerTransaction. # noqa: E501 + + Commission transaction type: Spot, Futures, Options, Alpha、TradFi # noqa: E501 + + :return: The source of this BrokerTransaction. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this BrokerTransaction. + + Commission transaction type: Spot, Futures, Options, Alpha、TradFi # noqa: E501 + + :param source: The source of this BrokerTransaction. # noqa: E501 + :type: str + """ + + self._source = source + + @property + def sub_broker_info(self): + """Gets the sub_broker_info of this BrokerTransaction. # noqa: E501 + + + :return: The sub_broker_info of this BrokerTransaction. # noqa: E501 + :rtype: BrokerCommissionSubBrokerInfo + """ + return self._sub_broker_info + + @sub_broker_info.setter + def sub_broker_info(self, sub_broker_info): + """Sets the sub_broker_info of this BrokerTransaction. + + + :param sub_broker_info: The sub_broker_info of this BrokerTransaction. # noqa: E501 + :type: BrokerCommissionSubBrokerInfo + """ + + self._sub_broker_info = sub_broker_info + + @property + def alpha_contract_addr(self): + """Gets the alpha_contract_addr of this BrokerTransaction. # noqa: E501 + + Alpha contract address # noqa: E501 + + :return: The alpha_contract_addr of this BrokerTransaction. # noqa: E501 + :rtype: str """ - return self._list + return self._alpha_contract_addr - @list.setter - def list(self, list): - """Sets the list of this BrokerTransaction. + @alpha_contract_addr.setter + def alpha_contract_addr(self, alpha_contract_addr): + """Sets the alpha_contract_addr of this BrokerTransaction. - List of transaction history # noqa: E501 + Alpha contract address # noqa: E501 - :param list: The list of this BrokerTransaction. # noqa: E501 - :type: list[BrokerTransaction1] + :param alpha_contract_addr: The alpha_contract_addr of this BrokerTransaction. # noqa: E501 + :type: str """ - self._list = list + self._alpha_contract_addr = alpha_contract_addr def to_dict(self): """Returns the model properties as a dict""" diff --git a/gate_api/models/broker_transaction1.py b/gate_api/models/broker_transaction1.py deleted file mode 100644 index 87a12d06..00000000 --- a/gate_api/models/broker_transaction1.py +++ /dev/null @@ -1,373 +0,0 @@ -# coding: utf-8 - -""" - Gate API - - Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - - Contact: support@mail.gate.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class BrokerTransaction1(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'transaction_time': 'int', - 'user_id': 'int', - 'group_name': 'str', - 'fee': 'str', - 'currency_pair': 'str', - 'amount': 'str', - 'fee_asset': 'str', - 'source': 'str', - 'sub_broker_info': 'BrokerCommissionSubBrokerInfo', - 'alpha_contract_addr': 'str' - } - - attribute_map = { - 'transaction_time': 'transaction_time', - 'user_id': 'user_id', - 'group_name': 'group_name', - 'fee': 'fee', - 'currency_pair': 'currency_pair', - 'amount': 'amount', - 'fee_asset': 'fee_asset', - 'source': 'source', - 'sub_broker_info': 'sub_broker_info', - 'alpha_contract_addr': 'alpha_contract_addr' - } - - def __init__(self, transaction_time=None, user_id=None, group_name=None, fee=None, currency_pair=None, amount=None, fee_asset=None, source=None, sub_broker_info=None, alpha_contract_addr=None, local_vars_configuration=None): # noqa: E501 - # type: (int, int, str, str, str, str, str, str, BrokerCommissionSubBrokerInfo, str, Configuration) -> None - """BrokerTransaction1 - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._transaction_time = None - self._user_id = None - self._group_name = None - self._fee = None - self._currency_pair = None - self._amount = None - self._fee_asset = None - self._source = None - self._sub_broker_info = None - self._alpha_contract_addr = None - self.discriminator = None - - if transaction_time is not None: - self.transaction_time = transaction_time - if user_id is not None: - self.user_id = user_id - if group_name is not None: - self.group_name = group_name - if fee is not None: - self.fee = fee - if currency_pair is not None: - self.currency_pair = currency_pair - if amount is not None: - self.amount = amount - if fee_asset is not None: - self.fee_asset = fee_asset - if source is not None: - self.source = source - if sub_broker_info is not None: - self.sub_broker_info = sub_broker_info - if alpha_contract_addr is not None: - self.alpha_contract_addr = alpha_contract_addr - - @property - def transaction_time(self): - """Gets the transaction_time of this BrokerTransaction1. # noqa: E501 - - Transaction Time. (unix timestamp) # noqa: E501 - - :return: The transaction_time of this BrokerTransaction1. # noqa: E501 - :rtype: int - """ - return self._transaction_time - - @transaction_time.setter - def transaction_time(self, transaction_time): - """Sets the transaction_time of this BrokerTransaction1. - - Transaction Time. (unix timestamp) # noqa: E501 - - :param transaction_time: The transaction_time of this BrokerTransaction1. # noqa: E501 - :type: int - """ - - self._transaction_time = transaction_time - - @property - def user_id(self): - """Gets the user_id of this BrokerTransaction1. # noqa: E501 - - User ID # noqa: E501 - - :return: The user_id of this BrokerTransaction1. # noqa: E501 - :rtype: int - """ - return self._user_id - - @user_id.setter - def user_id(self, user_id): - """Sets the user_id of this BrokerTransaction1. - - User ID # noqa: E501 - - :param user_id: The user_id of this BrokerTransaction1. # noqa: E501 - :type: int - """ - - self._user_id = user_id - - @property - def group_name(self): - """Gets the group_name of this BrokerTransaction1. # noqa: E501 - - Group name # noqa: E501 - - :return: The group_name of this BrokerTransaction1. # noqa: E501 - :rtype: str - """ - return self._group_name - - @group_name.setter - def group_name(self, group_name): - """Sets the group_name of this BrokerTransaction1. - - Group name # noqa: E501 - - :param group_name: The group_name of this BrokerTransaction1. # noqa: E501 - :type: str - """ - - self._group_name = group_name - - @property - def fee(self): - """Gets the fee of this BrokerTransaction1. # noqa: E501 - - Fee amount (USDT) # noqa: E501 - - :return: The fee of this BrokerTransaction1. # noqa: E501 - :rtype: str - """ - return self._fee - - @fee.setter - def fee(self, fee): - """Sets the fee of this BrokerTransaction1. - - Fee amount (USDT) # noqa: E501 - - :param fee: The fee of this BrokerTransaction1. # noqa: E501 - :type: str - """ - - self._fee = fee - - @property - def currency_pair(self): - """Gets the currency_pair of this BrokerTransaction1. # noqa: E501 - - Currency pair # noqa: E501 - - :return: The currency_pair of this BrokerTransaction1. # noqa: E501 - :rtype: str - """ - return self._currency_pair - - @currency_pair.setter - def currency_pair(self, currency_pair): - """Sets the currency_pair of this BrokerTransaction1. - - Currency pair # noqa: E501 - - :param currency_pair: The currency_pair of this BrokerTransaction1. # noqa: E501 - :type: str - """ - - self._currency_pair = currency_pair - - @property - def amount(self): - """Gets the amount of this BrokerTransaction1. # noqa: E501 - - Transaction amount # noqa: E501 - - :return: The amount of this BrokerTransaction1. # noqa: E501 - :rtype: str - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this BrokerTransaction1. - - Transaction amount # noqa: E501 - - :param amount: The amount of this BrokerTransaction1. # noqa: E501 - :type: str - """ - - self._amount = amount - - @property - def fee_asset(self): - """Gets the fee_asset of this BrokerTransaction1. # noqa: E501 - - Fee currency # noqa: E501 - - :return: The fee_asset of this BrokerTransaction1. # noqa: E501 - :rtype: str - """ - return self._fee_asset - - @fee_asset.setter - def fee_asset(self, fee_asset): - """Sets the fee_asset of this BrokerTransaction1. - - Fee currency # noqa: E501 - - :param fee_asset: The fee_asset of this BrokerTransaction1. # noqa: E501 - :type: str - """ - - self._fee_asset = fee_asset - - @property - def source(self): - """Gets the source of this BrokerTransaction1. # noqa: E501 - - Commission transaction type: Spot, Futures, Options, Alpha # noqa: E501 - - :return: The source of this BrokerTransaction1. # noqa: E501 - :rtype: str - """ - return self._source - - @source.setter - def source(self, source): - """Sets the source of this BrokerTransaction1. - - Commission transaction type: Spot, Futures, Options, Alpha # noqa: E501 - - :param source: The source of this BrokerTransaction1. # noqa: E501 - :type: str - """ - - self._source = source - - @property - def sub_broker_info(self): - """Gets the sub_broker_info of this BrokerTransaction1. # noqa: E501 - - - :return: The sub_broker_info of this BrokerTransaction1. # noqa: E501 - :rtype: BrokerCommissionSubBrokerInfo - """ - return self._sub_broker_info - - @sub_broker_info.setter - def sub_broker_info(self, sub_broker_info): - """Sets the sub_broker_info of this BrokerTransaction1. - - - :param sub_broker_info: The sub_broker_info of this BrokerTransaction1. # noqa: E501 - :type: BrokerCommissionSubBrokerInfo - """ - - self._sub_broker_info = sub_broker_info - - @property - def alpha_contract_addr(self): - """Gets the alpha_contract_addr of this BrokerTransaction1. # noqa: E501 - - Alpha contract address # noqa: E501 - - :return: The alpha_contract_addr of this BrokerTransaction1. # noqa: E501 - :rtype: str - """ - return self._alpha_contract_addr - - @alpha_contract_addr.setter - def alpha_contract_addr(self, alpha_contract_addr): - """Sets the alpha_contract_addr of this BrokerTransaction1. - - Alpha contract address # noqa: E501 - - :param alpha_contract_addr: The alpha_contract_addr of this BrokerTransaction1. # noqa: E501 - :type: str - """ - - self._alpha_contract_addr = alpha_contract_addr - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, BrokerTransaction1): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, BrokerTransaction1): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/broker_transaction_history.py b/gate_api/models/broker_transaction_history.py new file mode 100644 index 00000000..e9136236 --- /dev/null +++ b/gate_api/models/broker_transaction_history.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class BrokerTransactionHistory(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'total': 'int', + 'list': 'list[BrokerTransaction]' + } + + attribute_map = { + 'total': 'total', + 'list': 'list' + } + + def __init__(self, total=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[BrokerTransaction], Configuration) -> None + """BrokerTransactionHistory - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._list = None + self.discriminator = None + + if total is not None: + self.total = total + if list is not None: + self.list = list + + @property + def total(self): + """Gets the total of this BrokerTransactionHistory. # noqa: E501 + + Total # noqa: E501 + + :return: The total of this BrokerTransactionHistory. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this BrokerTransactionHistory. + + Total # noqa: E501 + + :param total: The total of this BrokerTransactionHistory. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def list(self): + """Gets the list of this BrokerTransactionHistory. # noqa: E501 + + List of transaction history # noqa: E501 + + :return: The list of this BrokerTransactionHistory. # noqa: E501 + :rtype: list[BrokerTransaction] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this BrokerTransactionHistory. + + List of transaction history # noqa: E501 + + :param list: The list of this BrokerTransactionHistory. # noqa: E501 + :type: list[BrokerTransaction] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BrokerTransactionHistory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, BrokerTransactionHistory): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/cancel_order.py b/gate_api/models/cancel_order.py new file mode 100644 index 00000000..215f0f7f --- /dev/null +++ b/gate_api/models/cancel_order.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CancelOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'txid': 'str', + 'reason_id': 'str', + 'reason_memo': 'str' + } + + attribute_map = { + 'txid': 'txid', + 'reason_id': 'reason_id', + 'reason_memo': 'reason_memo' + } + + def __init__(self, txid=None, reason_id=None, reason_memo=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """CancelOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._txid = None + self._reason_id = None + self._reason_memo = None + self.discriminator = None + + self.txid = txid + if reason_id is not None: + self.reason_id = reason_id + if reason_memo is not None: + self.reason_memo = reason_memo + + @property + def txid(self): + """Gets the txid of this CancelOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this CancelOrder. # noqa: E501 + :rtype: str + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this CancelOrder. + + Order ID # noqa: E501 + + :param txid: The txid of this CancelOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and txid is None: # noqa: E501 + raise ValueError("Invalid value for `txid`, must not be `None`") # noqa: E501 + + self._txid = txid + + @property + def reason_id(self): + """Gets the reason_id of this CancelOrder. # noqa: E501 + + Cancel reason ID. `1` no longer want to buy; `2` cannot reach seller; `3` will not pay; `4` seller account not real; `5` payout account issue; `6` price mismatch; `7` mutually agreed cancel; `8` poor communication; `9` other; `10` seller cannot release with refund; `11` terms not met; `12` seller payout risk-controlled. # noqa: E501 + + :return: The reason_id of this CancelOrder. # noqa: E501 + :rtype: str + """ + return self._reason_id + + @reason_id.setter + def reason_id(self, reason_id): + """Sets the reason_id of this CancelOrder. + + Cancel reason ID. `1` no longer want to buy; `2` cannot reach seller; `3` will not pay; `4` seller account not real; `5` payout account issue; `6` price mismatch; `7` mutually agreed cancel; `8` poor communication; `9` other; `10` seller cannot release with refund; `11` terms not met; `12` seller payout risk-controlled. # noqa: E501 + + :param reason_id: The reason_id of this CancelOrder. # noqa: E501 + :type: str + """ + + self._reason_id = reason_id + + @property + def reason_memo(self): + """Gets the reason_memo of this CancelOrder. # noqa: E501 + + Extra cancel notes when `reason_id` is `9` or explanation is required. # noqa: E501 + + :return: The reason_memo of this CancelOrder. # noqa: E501 + :rtype: str + """ + return self._reason_memo + + @reason_memo.setter + def reason_memo(self, reason_memo): + """Sets the reason_memo of this CancelOrder. + + Extra cancel notes when `reason_id` is `9` or explanation is required. # noqa: E501 + + :param reason_memo: The reason_memo of this CancelOrder. # noqa: E501 + :type: str + """ + + self._reason_memo = reason_memo + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CancelOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CancelOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/categories.py b/gate_api/models/categories.py new file mode 100644 index 00000000..5da5ebb7 --- /dev/null +++ b/gate_api/models/categories.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Categories(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'CategoriesData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, CategoriesData, Configuration) -> None + """Categories - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this Categories. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this Categories. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this Categories. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this Categories. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this Categories. # noqa: E501 + + + :return: The data of this Categories. # noqa: E501 + :rtype: CategoriesData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this Categories. + + + :param data: The data of this Categories. # noqa: E501 + :type: CategoriesData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Categories): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Categories): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/categories_data.py b/gate_api/models/categories_data.py new file mode 100644 index 00000000..c45cfc5f --- /dev/null +++ b/gate_api/models/categories_data.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CategoriesData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[CategoriesDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[CategoriesDataList], Configuration) -> None + """CategoriesData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this CategoriesData. # noqa: E501 + + + :return: The list of this CategoriesData. # noqa: E501 + :rtype: list[CategoriesDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this CategoriesData. + + + :param list: The list of this CategoriesData. # noqa: E501 + :type: list[CategoriesDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CategoriesData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CategoriesData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/categories_data_list.py b/gate_api/models/categories_data_list.py new file mode 100644 index 00000000..7b4ee0fe --- /dev/null +++ b/gate_api/models/categories_data_list.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CategoriesDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'category_id': 'int', + 'is_favorite': 'bool', + 'category_name': 'str' + } + + attribute_map = { + 'category_id': 'category_id', + 'is_favorite': 'is_favorite', + 'category_name': 'category_name' + } + + def __init__(self, category_id=None, is_favorite=None, category_name=None, local_vars_configuration=None): # noqa: E501 + # type: (int, bool, str, Configuration) -> None + """CategoriesDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._category_id = None + self._is_favorite = None + self._category_name = None + self.discriminator = None + + if category_id is not None: + self.category_id = category_id + if is_favorite is not None: + self.is_favorite = is_favorite + if category_name is not None: + self.category_name = category_name + + @property + def category_id(self): + """Gets the category_id of this CategoriesDataList. # noqa: E501 + + Category ID # noqa: E501 + + :return: The category_id of this CategoriesDataList. # noqa: E501 + :rtype: int + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """Sets the category_id of this CategoriesDataList. + + Category ID # noqa: E501 + + :param category_id: The category_id of this CategoriesDataList. # noqa: E501 + :type: int + """ + + self._category_id = category_id + + @property + def is_favorite(self): + """Gets the is_favorite of this CategoriesDataList. # noqa: E501 + + Whether it is a custom category, generally no need to pay attention # noqa: E501 + + :return: The is_favorite of this CategoriesDataList. # noqa: E501 + :rtype: bool + """ + return self._is_favorite + + @is_favorite.setter + def is_favorite(self, is_favorite): + """Sets the is_favorite of this CategoriesDataList. + + Whether it is a custom category, generally no need to pay attention # noqa: E501 + + :param is_favorite: The is_favorite of this CategoriesDataList. # noqa: E501 + :type: bool + """ + + self._is_favorite = is_favorite + + @property + def category_name(self): + """Gets the category_name of this CategoriesDataList. # noqa: E501 + + Category name # noqa: E501 + + :return: The category_name of this CategoriesDataList. # noqa: E501 + :rtype: str + """ + return self._category_name + + @category_name.setter + def category_name(self, category_name): + """Sets the category_name of this CategoriesDataList. + + Category name # noqa: E501 + + :param category_name: The category_name of this CategoriesDataList. # noqa: E501 + :type: str + """ + + self._category_name = category_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CategoriesDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CategoriesDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/chase_order.py b/gate_api/models/chase_order.py new file mode 100644 index 00000000..6630afb3 --- /dev/null +++ b/gate_api/models/chase_order.py @@ -0,0 +1,1015 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ChaseOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'user': 'str', + 'contract': 'str', + 'settle': 'str', + 'amount': 'str', + 'price_limit': 'str', + 'reduce_only': 'bool', + 'text': 'str', + 'create_time': 'int', + 'finish_time': 'int', + 'original_status': 'int', + 'status': 'str', + 'reason': 'str', + 'fill_amount': 'str', + 'average_fill_price': 'str', + 'suborder_id': 'str', + 'is_dual_mode': 'bool', + 'side_label': 'str', + 'position_side_output': 'str', + 'chase_price': 'str', + 'interval_sec': 'int', + 'updated_at': 'int', + 'suborder_price': 'str', + 'suborder_ongoing': 'bool', + 'suborder_finish_as': 'str', + 'price_type': 'int', + 'price_gap_type': 'str', + 'price_gap_value': 'str', + 'status_code': 'str', + 'create_time_precise': 'str', + 'finish_time_precise': 'str', + 'pos_margin_mode': 'str', + 'position_mode': 'str', + 'leverage': 'str', + 'error_label': 'str' + } + + attribute_map = { + 'id': 'id', + 'user': 'user', + 'contract': 'contract', + 'settle': 'settle', + 'amount': 'amount', + 'price_limit': 'price_limit', + 'reduce_only': 'reduce_only', + 'text': 'text', + 'create_time': 'create_time', + 'finish_time': 'finish_time', + 'original_status': 'original_status', + 'status': 'status', + 'reason': 'reason', + 'fill_amount': 'fill_amount', + 'average_fill_price': 'average_fill_price', + 'suborder_id': 'suborder_id', + 'is_dual_mode': 'is_dual_mode', + 'side_label': 'side_label', + 'position_side_output': 'position_side_output', + 'chase_price': 'chase_price', + 'interval_sec': 'interval_sec', + 'updated_at': 'updated_at', + 'suborder_price': 'suborder_price', + 'suborder_ongoing': 'suborder_ongoing', + 'suborder_finish_as': 'suborder_finish_as', + 'price_type': 'price_type', + 'price_gap_type': 'price_gap_type', + 'price_gap_value': 'price_gap_value', + 'status_code': 'status_code', + 'create_time_precise': 'create_time_precise', + 'finish_time_precise': 'finish_time_precise', + 'pos_margin_mode': 'pos_margin_mode', + 'position_mode': 'position_mode', + 'leverage': 'leverage', + 'error_label': 'error_label' + } + + def __init__(self, id=None, user=None, contract=None, settle=None, amount=None, price_limit=None, reduce_only=None, text=None, create_time=None, finish_time=None, original_status=None, status=None, reason=None, fill_amount=None, average_fill_price=None, suborder_id=None, is_dual_mode=None, side_label=None, position_side_output=None, chase_price=None, interval_sec=None, updated_at=None, suborder_price=None, suborder_ongoing=None, suborder_finish_as=None, price_type=None, price_gap_type=None, price_gap_value=None, status_code=None, create_time_precise=None, finish_time_precise=None, pos_margin_mode=None, position_mode=None, leverage=None, error_label=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, bool, str, int, int, int, str, str, str, str, str, bool, str, str, str, int, int, str, bool, str, int, str, str, str, str, str, str, str, str, str, Configuration) -> None + """ChaseOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._user = None + self._contract = None + self._settle = None + self._amount = None + self._price_limit = None + self._reduce_only = None + self._text = None + self._create_time = None + self._finish_time = None + self._original_status = None + self._status = None + self._reason = None + self._fill_amount = None + self._average_fill_price = None + self._suborder_id = None + self._is_dual_mode = None + self._side_label = None + self._position_side_output = None + self._chase_price = None + self._interval_sec = None + self._updated_at = None + self._suborder_price = None + self._suborder_ongoing = None + self._suborder_finish_as = None + self._price_type = None + self._price_gap_type = None + self._price_gap_value = None + self._status_code = None + self._create_time_precise = None + self._finish_time_precise = None + self._pos_margin_mode = None + self._position_mode = None + self._leverage = None + self._error_label = None + self.discriminator = None + + if id is not None: + self.id = id + if user is not None: + self.user = user + if contract is not None: + self.contract = contract + if settle is not None: + self.settle = settle + if amount is not None: + self.amount = amount + if price_limit is not None: + self.price_limit = price_limit + if reduce_only is not None: + self.reduce_only = reduce_only + if text is not None: + self.text = text + if create_time is not None: + self.create_time = create_time + if finish_time is not None: + self.finish_time = finish_time + if original_status is not None: + self.original_status = original_status + if status is not None: + self.status = status + if reason is not None: + self.reason = reason + if fill_amount is not None: + self.fill_amount = fill_amount + if average_fill_price is not None: + self.average_fill_price = average_fill_price + if suborder_id is not None: + self.suborder_id = suborder_id + if is_dual_mode is not None: + self.is_dual_mode = is_dual_mode + if side_label is not None: + self.side_label = side_label + if position_side_output is not None: + self.position_side_output = position_side_output + if chase_price is not None: + self.chase_price = chase_price + if interval_sec is not None: + self.interval_sec = interval_sec + if updated_at is not None: + self.updated_at = updated_at + if suborder_price is not None: + self.suborder_price = suborder_price + if suborder_ongoing is not None: + self.suborder_ongoing = suborder_ongoing + if suborder_finish_as is not None: + self.suborder_finish_as = suborder_finish_as + if price_type is not None: + self.price_type = price_type + if price_gap_type is not None: + self.price_gap_type = price_gap_type + if price_gap_value is not None: + self.price_gap_value = price_gap_value + if status_code is not None: + self.status_code = status_code + if create_time_precise is not None: + self.create_time_precise = create_time_precise + if finish_time_precise is not None: + self.finish_time_precise = finish_time_precise + if pos_margin_mode is not None: + self.pos_margin_mode = pos_margin_mode + if position_mode is not None: + self.position_mode = position_mode + if leverage is not None: + self.leverage = leverage + if error_label is not None: + self.error_label = error_label + + @property + def id(self): + """Gets the id of this ChaseOrder. # noqa: E501 + + + :return: The id of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ChaseOrder. + + + :param id: The id of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def user(self): + """Gets the user of this ChaseOrder. # noqa: E501 + + + :return: The user of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this ChaseOrder. + + + :param user: The user of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._user = user + + @property + def contract(self): + """Gets the contract of this ChaseOrder. # noqa: E501 + + + :return: The contract of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this ChaseOrder. + + + :param contract: The contract of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def settle(self): + """Gets the settle of this ChaseOrder. # noqa: E501 + + + :return: The settle of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._settle + + @settle.setter + def settle(self, settle): + """Sets the settle of this ChaseOrder. + + + :param settle: The settle of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._settle = settle + + @property + def amount(self): + """Gets the amount of this ChaseOrder. # noqa: E501 + + Total size in contracts; positive for buy, negative for sell # noqa: E501 + + :return: The amount of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this ChaseOrder. + + Total size in contracts; positive for buy, negative for sell # noqa: E501 + + :param amount: The amount of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def price_limit(self): + """Gets the price_limit of this ChaseOrder. # noqa: E501 + + + :return: The price_limit of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._price_limit + + @price_limit.setter + def price_limit(self, price_limit): + """Sets the price_limit of this ChaseOrder. + + + :param price_limit: The price_limit of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._price_limit = price_limit + + @property + def reduce_only(self): + """Gets the reduce_only of this ChaseOrder. # noqa: E501 + + + :return: The reduce_only of this ChaseOrder. # noqa: E501 + :rtype: bool + """ + return self._reduce_only + + @reduce_only.setter + def reduce_only(self, reduce_only): + """Sets the reduce_only of this ChaseOrder. + + + :param reduce_only: The reduce_only of this ChaseOrder. # noqa: E501 + :type: bool + """ + + self._reduce_only = reduce_only + + @property + def text(self): + """Gets the text of this ChaseOrder. # noqa: E501 + + + :return: The text of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this ChaseOrder. + + + :param text: The text of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def create_time(self): + """Gets the create_time of this ChaseOrder. # noqa: E501 + + + :return: The create_time of this ChaseOrder. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this ChaseOrder. + + + :param create_time: The create_time of this ChaseOrder. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def finish_time(self): + """Gets the finish_time of this ChaseOrder. # noqa: E501 + + + :return: The finish_time of this ChaseOrder. # noqa: E501 + :rtype: int + """ + return self._finish_time + + @finish_time.setter + def finish_time(self, finish_time): + """Sets the finish_time of this ChaseOrder. + + + :param finish_time: The finish_time of this ChaseOrder. # noqa: E501 + :type: int + """ + + self._finish_time = finish_time + + @property + def original_status(self): + """Gets the original_status of this ChaseOrder. # noqa: E501 + + Raw status enum # noqa: E501 + + :return: The original_status of this ChaseOrder. # noqa: E501 + :rtype: int + """ + return self._original_status + + @original_status.setter + def original_status(self, original_status): + """Sets the original_status of this ChaseOrder. + + Raw status enum # noqa: E501 + + :param original_status: The original_status of this ChaseOrder. # noqa: E501 + :type: int + """ + + self._original_status = original_status + + @property + def status(self): + """Gets the status of this ChaseOrder. # noqa: E501 + + Simplified status, e.g. open / finished # noqa: E501 + + :return: The status of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ChaseOrder. + + Simplified status, e.g. open / finished # noqa: E501 + + :param status: The status of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def reason(self): + """Gets the reason of this ChaseOrder. # noqa: E501 + + + :return: The reason of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this ChaseOrder. + + + :param reason: The reason of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._reason = reason + + @property + def fill_amount(self): + """Gets the fill_amount of this ChaseOrder. # noqa: E501 + + + :return: The fill_amount of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._fill_amount + + @fill_amount.setter + def fill_amount(self, fill_amount): + """Sets the fill_amount of this ChaseOrder. + + + :param fill_amount: The fill_amount of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._fill_amount = fill_amount + + @property + def average_fill_price(self): + """Gets the average_fill_price of this ChaseOrder. # noqa: E501 + + + :return: The average_fill_price of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._average_fill_price + + @average_fill_price.setter + def average_fill_price(self, average_fill_price): + """Sets the average_fill_price of this ChaseOrder. + + + :param average_fill_price: The average_fill_price of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._average_fill_price = average_fill_price + + @property + def suborder_id(self): + """Gets the suborder_id of this ChaseOrder. # noqa: E501 + + + :return: The suborder_id of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._suborder_id + + @suborder_id.setter + def suborder_id(self, suborder_id): + """Sets the suborder_id of this ChaseOrder. + + + :param suborder_id: The suborder_id of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._suborder_id = suborder_id + + @property + def is_dual_mode(self): + """Gets the is_dual_mode of this ChaseOrder. # noqa: E501 + + + :return: The is_dual_mode of this ChaseOrder. # noqa: E501 + :rtype: bool + """ + return self._is_dual_mode + + @is_dual_mode.setter + def is_dual_mode(self, is_dual_mode): + """Sets the is_dual_mode of this ChaseOrder. + + + :param is_dual_mode: The is_dual_mode of this ChaseOrder. # noqa: E501 + :type: bool + """ + + self._is_dual_mode = is_dual_mode + + @property + def side_label(self): + """Gets the side_label of this ChaseOrder. # noqa: E501 + + + :return: The side_label of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._side_label + + @side_label.setter + def side_label(self, side_label): + """Sets the side_label of this ChaseOrder. + + + :param side_label: The side_label of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._side_label = side_label + + @property + def position_side_output(self): + """Gets the position_side_output of this ChaseOrder. # noqa: E501 + + + :return: The position_side_output of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._position_side_output + + @position_side_output.setter + def position_side_output(self, position_side_output): + """Sets the position_side_output of this ChaseOrder. + + + :param position_side_output: The position_side_output of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._position_side_output = position_side_output + + @property + def chase_price(self): + """Gets the chase_price of this ChaseOrder. # noqa: E501 + + + :return: The chase_price of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._chase_price + + @chase_price.setter + def chase_price(self, chase_price): + """Sets the chase_price of this ChaseOrder. + + + :param chase_price: The chase_price of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._chase_price = chase_price + + @property + def interval_sec(self): + """Gets the interval_sec of this ChaseOrder. # noqa: E501 + + + :return: The interval_sec of this ChaseOrder. # noqa: E501 + :rtype: int + """ + return self._interval_sec + + @interval_sec.setter + def interval_sec(self, interval_sec): + """Sets the interval_sec of this ChaseOrder. + + + :param interval_sec: The interval_sec of this ChaseOrder. # noqa: E501 + :type: int + """ + + self._interval_sec = interval_sec + + @property + def updated_at(self): + """Gets the updated_at of this ChaseOrder. # noqa: E501 + + + :return: The updated_at of this ChaseOrder. # noqa: E501 + :rtype: int + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this ChaseOrder. + + + :param updated_at: The updated_at of this ChaseOrder. # noqa: E501 + :type: int + """ + + self._updated_at = updated_at + + @property + def suborder_price(self): + """Gets the suborder_price of this ChaseOrder. # noqa: E501 + + + :return: The suborder_price of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._suborder_price + + @suborder_price.setter + def suborder_price(self, suborder_price): + """Sets the suborder_price of this ChaseOrder. + + + :param suborder_price: The suborder_price of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._suborder_price = suborder_price + + @property + def suborder_ongoing(self): + """Gets the suborder_ongoing of this ChaseOrder. # noqa: E501 + + + :return: The suborder_ongoing of this ChaseOrder. # noqa: E501 + :rtype: bool + """ + return self._suborder_ongoing + + @suborder_ongoing.setter + def suborder_ongoing(self, suborder_ongoing): + """Sets the suborder_ongoing of this ChaseOrder. + + + :param suborder_ongoing: The suborder_ongoing of this ChaseOrder. # noqa: E501 + :type: bool + """ + + self._suborder_ongoing = suborder_ongoing + + @property + def suborder_finish_as(self): + """Gets the suborder_finish_as of this ChaseOrder. # noqa: E501 + + + :return: The suborder_finish_as of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._suborder_finish_as + + @suborder_finish_as.setter + def suborder_finish_as(self, suborder_finish_as): + """Sets the suborder_finish_as of this ChaseOrder. + + + :param suborder_finish_as: The suborder_finish_as of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._suborder_finish_as = suborder_finish_as + + @property + def price_type(self): + """Gets the price_type of this ChaseOrder. # noqa: E501 + + PriceType enum: 1 latest, 2 index, 3 mark # noqa: E501 + + :return: The price_type of this ChaseOrder. # noqa: E501 + :rtype: int + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this ChaseOrder. + + PriceType enum: 1 latest, 2 index, 3 mark # noqa: E501 + + :param price_type: The price_type of this ChaseOrder. # noqa: E501 + :type: int + """ + + self._price_type = price_type + + @property + def price_gap_type(self): + """Gets the price_gap_type of this ChaseOrder. # noqa: E501 + + + :return: The price_gap_type of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._price_gap_type + + @price_gap_type.setter + def price_gap_type(self, price_gap_type): + """Sets the price_gap_type of this ChaseOrder. + + + :param price_gap_type: The price_gap_type of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._price_gap_type = price_gap_type + + @property + def price_gap_value(self): + """Gets the price_gap_value of this ChaseOrder. # noqa: E501 + + + :return: The price_gap_value of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._price_gap_value + + @price_gap_value.setter + def price_gap_value(self, price_gap_value): + """Sets the price_gap_value of this ChaseOrder. + + + :param price_gap_value: The price_gap_value of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._price_gap_value = price_gap_value + + @property + def status_code(self): + """Gets the status_code of this ChaseOrder. # noqa: E501 + + + :return: The status_code of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._status_code + + @status_code.setter + def status_code(self, status_code): + """Sets the status_code of this ChaseOrder. + + + :param status_code: The status_code of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._status_code = status_code + + @property + def create_time_precise(self): + """Gets the create_time_precise of this ChaseOrder. # noqa: E501 + + Creation time (seconds.microseconds) # noqa: E501 + + :return: The create_time_precise of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._create_time_precise + + @create_time_precise.setter + def create_time_precise(self, create_time_precise): + """Sets the create_time_precise of this ChaseOrder. + + Creation time (seconds.microseconds) # noqa: E501 + + :param create_time_precise: The create_time_precise of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._create_time_precise = create_time_precise + + @property + def finish_time_precise(self): + """Gets the finish_time_precise of this ChaseOrder. # noqa: E501 + + + :return: The finish_time_precise of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._finish_time_precise + + @finish_time_precise.setter + def finish_time_precise(self, finish_time_precise): + """Sets the finish_time_precise of this ChaseOrder. + + + :param finish_time_precise: The finish_time_precise of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._finish_time_precise = finish_time_precise + + @property + def pos_margin_mode(self): + """Gets the pos_margin_mode of this ChaseOrder. # noqa: E501 + + + :return: The pos_margin_mode of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._pos_margin_mode + + @pos_margin_mode.setter + def pos_margin_mode(self, pos_margin_mode): + """Sets the pos_margin_mode of this ChaseOrder. + + + :param pos_margin_mode: The pos_margin_mode of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._pos_margin_mode = pos_margin_mode + + @property + def position_mode(self): + """Gets the position_mode of this ChaseOrder. # noqa: E501 + + + :return: The position_mode of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._position_mode + + @position_mode.setter + def position_mode(self, position_mode): + """Sets the position_mode of this ChaseOrder. + + + :param position_mode: The position_mode of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._position_mode = position_mode + + @property + def leverage(self): + """Gets the leverage of this ChaseOrder. # noqa: E501 + + + :return: The leverage of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this ChaseOrder. + + + :param leverage: The leverage of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + @property + def error_label(self): + """Gets the error_label of this ChaseOrder. # noqa: E501 + + + :return: The error_label of this ChaseOrder. # noqa: E501 + :rtype: str + """ + return self._error_label + + @error_label.setter + def error_label(self, error_label): + """Sets the error_label of this ChaseOrder. + + + :param error_label: The error_label of this ChaseOrder. # noqa: E501 + :type: str + """ + + self._error_label = error_label + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ChaseOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ChaseOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/claim_reward_error.py b/gate_api/models/claim_reward_error.py new file mode 100644 index 00000000..8ec448d3 --- /dev/null +++ b/gate_api/models/claim_reward_error.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ClaimRewardError(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label': 'str', + 'message': 'str' + } + + attribute_map = { + 'label': 'label', + 'message': 'message' + } + + def __init__(self, label=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """ClaimRewardError - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._label = None + self._message = None + self.discriminator = None + + if label is not None: + self.label = label + if message is not None: + self.message = message + + @property + def label(self): + """Gets the label of this ClaimRewardError. # noqa: E501 + + Error identifier code # noqa: E501 + + :return: The label of this ClaimRewardError. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ClaimRewardError. + + Error identifier code # noqa: E501 + + :param label: The label of this ClaimRewardError. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ClaimRewardError. # noqa: E501 + + Error details # noqa: E501 + + :return: The message of this ClaimRewardError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ClaimRewardError. + + Error details # noqa: E501 + + :param message: The message of this ClaimRewardError. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ClaimRewardError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ClaimRewardError): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/claim_task_error.py b/gate_api/models/claim_task_error.py new file mode 100644 index 00000000..2392fe7e --- /dev/null +++ b/gate_api/models/claim_task_error.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ClaimTaskError(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label': 'str', + 'message': 'str' + } + + attribute_map = { + 'label': 'label', + 'message': 'message' + } + + def __init__(self, label=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """ClaimTaskError - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._label = None + self._message = None + self.discriminator = None + + if label is not None: + self.label = label + if message is not None: + self.message = message + + @property + def label(self): + """Gets the label of this ClaimTaskError. # noqa: E501 + + Error identifier code # noqa: E501 + + :return: The label of this ClaimTaskError. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ClaimTaskError. + + Error identifier code # noqa: E501 + + :param label: The label of this ClaimTaskError. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ClaimTaskError. # noqa: E501 + + Error details # noqa: E501 + + :return: The message of this ClaimTaskError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ClaimTaskError. + + Error details # noqa: E501 + + :param message: The message of this ClaimTaskError. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ClaimTaskError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ClaimTaskError): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/close_position.py b/gate_api/models/close_position.py new file mode 100644 index 00000000..9d7d1925 --- /dev/null +++ b/gate_api/models/close_position.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ClosePosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'ClosePositionData', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (ClosePositionData, int, Configuration) -> None + """ClosePosition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this ClosePosition. # noqa: E501 + + + :return: The data of this ClosePosition. # noqa: E501 + :rtype: ClosePositionData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ClosePosition. + + + :param data: The data of this ClosePosition. # noqa: E501 + :type: ClosePositionData + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ClosePosition. # noqa: E501 + + + :return: The timestamp of this ClosePosition. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ClosePosition. + + + :param timestamp: The timestamp of this ClosePosition. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ClosePosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ClosePosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/close_position_data.py b/gate_api/models/close_position_data.py new file mode 100644 index 00000000..520cc1e3 --- /dev/null +++ b/gate_api/models/close_position_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ClosePositionData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'int' + } + + attribute_map = { + 'order_id': 'order_id' + } + + def __init__(self, order_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """ClosePositionData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + + @property + def order_id(self): + """Gets the order_id of this ClosePositionData. # noqa: E501 + + Close order ID # noqa: E501 + + :return: The order_id of this ClosePositionData. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this ClosePositionData. + + Close order ID # noqa: E501 + + :param order_id: The order_id of this ClosePositionData. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ClosePositionData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ClosePositionData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_align.py b/gate_api/models/collateral_align.py deleted file mode 100644 index 3bc31925..00000000 --- a/gate_api/models/collateral_align.py +++ /dev/null @@ -1,211 +0,0 @@ -# coding: utf-8 - -""" - Gate API - - Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - - Contact: support@mail.gate.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class CollateralAlign(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'order_id': 'int', - 'collateral_currency': 'str', - 'collateral_amount': 'str', - 'type': 'str' - } - - attribute_map = { - 'order_id': 'order_id', - 'collateral_currency': 'collateral_currency', - 'collateral_amount': 'collateral_amount', - 'type': 'type' - } - - def __init__(self, order_id=None, collateral_currency=None, collateral_amount=None, type=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, str, str, Configuration) -> None - """CollateralAlign - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._order_id = None - self._collateral_currency = None - self._collateral_amount = None - self._type = None - self.discriminator = None - - self.order_id = order_id - self.collateral_currency = collateral_currency - self.collateral_amount = collateral_amount - self.type = type - - @property - def order_id(self): - """Gets the order_id of this CollateralAlign. # noqa: E501 - - Order ID # noqa: E501 - - :return: The order_id of this CollateralAlign. # noqa: E501 - :rtype: int - """ - return self._order_id - - @order_id.setter - def order_id(self, order_id): - """Sets the order_id of this CollateralAlign. - - Order ID # noqa: E501 - - :param order_id: The order_id of this CollateralAlign. # noqa: E501 - :type: int - """ - if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 - raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 - - self._order_id = order_id - - @property - def collateral_currency(self): - """Gets the collateral_currency of this CollateralAlign. # noqa: E501 - - Collateral currency # noqa: E501 - - :return: The collateral_currency of this CollateralAlign. # noqa: E501 - :rtype: str - """ - return self._collateral_currency - - @collateral_currency.setter - def collateral_currency(self, collateral_currency): - """Sets the collateral_currency of this CollateralAlign. - - Collateral currency # noqa: E501 - - :param collateral_currency: The collateral_currency of this CollateralAlign. # noqa: E501 - :type: str - """ - if self.local_vars_configuration.client_side_validation and collateral_currency is None: # noqa: E501 - raise ValueError("Invalid value for `collateral_currency`, must not be `None`") # noqa: E501 - - self._collateral_currency = collateral_currency - - @property - def collateral_amount(self): - """Gets the collateral_amount of this CollateralAlign. # noqa: E501 - - Collateral amount # noqa: E501 - - :return: The collateral_amount of this CollateralAlign. # noqa: E501 - :rtype: str - """ - return self._collateral_amount - - @collateral_amount.setter - def collateral_amount(self, collateral_amount): - """Sets the collateral_amount of this CollateralAlign. - - Collateral amount # noqa: E501 - - :param collateral_amount: The collateral_amount of this CollateralAlign. # noqa: E501 - :type: str - """ - if self.local_vars_configuration.client_side_validation and collateral_amount is None: # noqa: E501 - raise ValueError("Invalid value for `collateral_amount`, must not be `None`") # noqa: E501 - - self._collateral_amount = collateral_amount - - @property - def type(self): - """Gets the type of this CollateralAlign. # noqa: E501 - - Operation type: append - add collateral, redeem - withdraw collateral # noqa: E501 - - :return: The type of this CollateralAlign. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this CollateralAlign. - - Operation type: append - add collateral, redeem - withdraw collateral # noqa: E501 - - :param type: The type of this CollateralAlign. # noqa: E501 - :type: str - """ - if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CollateralAlign): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CollateralAlign): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_order.py b/gate_api/models/collateral_order.py deleted file mode 100644 index f6cac73f..00000000 --- a/gate_api/models/collateral_order.py +++ /dev/null @@ -1,543 +0,0 @@ -# coding: utf-8 - -""" - Gate API - - Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - - Contact: support@mail.gate.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class CollateralOrder(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'order_id': 'int', - 'collateral_currency': 'str', - 'collateral_amount': 'str', - 'borrow_currency': 'str', - 'borrow_amount': 'str', - 'repaid_amount': 'str', - 'repaid_principal': 'str', - 'repaid_interest': 'str', - 'init_ltv': 'str', - 'current_ltv': 'str', - 'liquidate_ltv': 'str', - 'status': 'str', - 'borrow_time': 'int', - 'left_repay_total': 'str', - 'left_repay_principal': 'str', - 'left_repay_interest': 'str' - } - - attribute_map = { - 'order_id': 'order_id', - 'collateral_currency': 'collateral_currency', - 'collateral_amount': 'collateral_amount', - 'borrow_currency': 'borrow_currency', - 'borrow_amount': 'borrow_amount', - 'repaid_amount': 'repaid_amount', - 'repaid_principal': 'repaid_principal', - 'repaid_interest': 'repaid_interest', - 'init_ltv': 'init_ltv', - 'current_ltv': 'current_ltv', - 'liquidate_ltv': 'liquidate_ltv', - 'status': 'status', - 'borrow_time': 'borrow_time', - 'left_repay_total': 'left_repay_total', - 'left_repay_principal': 'left_repay_principal', - 'left_repay_interest': 'left_repay_interest' - } - - def __init__(self, order_id=None, collateral_currency=None, collateral_amount=None, borrow_currency=None, borrow_amount=None, repaid_amount=None, repaid_principal=None, repaid_interest=None, init_ltv=None, current_ltv=None, liquidate_ltv=None, status=None, borrow_time=None, left_repay_total=None, left_repay_principal=None, left_repay_interest=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, str, str, str, str, str, str, str, str, str, str, int, str, str, str, Configuration) -> None - """CollateralOrder - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._order_id = None - self._collateral_currency = None - self._collateral_amount = None - self._borrow_currency = None - self._borrow_amount = None - self._repaid_amount = None - self._repaid_principal = None - self._repaid_interest = None - self._init_ltv = None - self._current_ltv = None - self._liquidate_ltv = None - self._status = None - self._borrow_time = None - self._left_repay_total = None - self._left_repay_principal = None - self._left_repay_interest = None - self.discriminator = None - - if order_id is not None: - self.order_id = order_id - if collateral_currency is not None: - self.collateral_currency = collateral_currency - if collateral_amount is not None: - self.collateral_amount = collateral_amount - if borrow_currency is not None: - self.borrow_currency = borrow_currency - if borrow_amount is not None: - self.borrow_amount = borrow_amount - if repaid_amount is not None: - self.repaid_amount = repaid_amount - if repaid_principal is not None: - self.repaid_principal = repaid_principal - if repaid_interest is not None: - self.repaid_interest = repaid_interest - if init_ltv is not None: - self.init_ltv = init_ltv - if current_ltv is not None: - self.current_ltv = current_ltv - if liquidate_ltv is not None: - self.liquidate_ltv = liquidate_ltv - if status is not None: - self.status = status - if borrow_time is not None: - self.borrow_time = borrow_time - if left_repay_total is not None: - self.left_repay_total = left_repay_total - if left_repay_principal is not None: - self.left_repay_principal = left_repay_principal - if left_repay_interest is not None: - self.left_repay_interest = left_repay_interest - - @property - def order_id(self): - """Gets the order_id of this CollateralOrder. # noqa: E501 - - Order ID # noqa: E501 - - :return: The order_id of this CollateralOrder. # noqa: E501 - :rtype: int - """ - return self._order_id - - @order_id.setter - def order_id(self, order_id): - """Sets the order_id of this CollateralOrder. - - Order ID # noqa: E501 - - :param order_id: The order_id of this CollateralOrder. # noqa: E501 - :type: int - """ - - self._order_id = order_id - - @property - def collateral_currency(self): - """Gets the collateral_currency of this CollateralOrder. # noqa: E501 - - Collateral currency # noqa: E501 - - :return: The collateral_currency of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._collateral_currency - - @collateral_currency.setter - def collateral_currency(self, collateral_currency): - """Sets the collateral_currency of this CollateralOrder. - - Collateral currency # noqa: E501 - - :param collateral_currency: The collateral_currency of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._collateral_currency = collateral_currency - - @property - def collateral_amount(self): - """Gets the collateral_amount of this CollateralOrder. # noqa: E501 - - Collateral amount # noqa: E501 - - :return: The collateral_amount of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._collateral_amount - - @collateral_amount.setter - def collateral_amount(self, collateral_amount): - """Sets the collateral_amount of this CollateralOrder. - - Collateral amount # noqa: E501 - - :param collateral_amount: The collateral_amount of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._collateral_amount = collateral_amount - - @property - def borrow_currency(self): - """Gets the borrow_currency of this CollateralOrder. # noqa: E501 - - Borrowed currency # noqa: E501 - - :return: The borrow_currency of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._borrow_currency - - @borrow_currency.setter - def borrow_currency(self, borrow_currency): - """Sets the borrow_currency of this CollateralOrder. - - Borrowed currency # noqa: E501 - - :param borrow_currency: The borrow_currency of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._borrow_currency = borrow_currency - - @property - def borrow_amount(self): - """Gets the borrow_amount of this CollateralOrder. # noqa: E501 - - Borrowed amount # noqa: E501 - - :return: The borrow_amount of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._borrow_amount - - @borrow_amount.setter - def borrow_amount(self, borrow_amount): - """Sets the borrow_amount of this CollateralOrder. - - Borrowed amount # noqa: E501 - - :param borrow_amount: The borrow_amount of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._borrow_amount = borrow_amount - - @property - def repaid_amount(self): - """Gets the repaid_amount of this CollateralOrder. # noqa: E501 - - Repaid amount # noqa: E501 - - :return: The repaid_amount of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._repaid_amount - - @repaid_amount.setter - def repaid_amount(self, repaid_amount): - """Sets the repaid_amount of this CollateralOrder. - - Repaid amount # noqa: E501 - - :param repaid_amount: The repaid_amount of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._repaid_amount = repaid_amount - - @property - def repaid_principal(self): - """Gets the repaid_principal of this CollateralOrder. # noqa: E501 - - Repaid principal # noqa: E501 - - :return: The repaid_principal of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._repaid_principal - - @repaid_principal.setter - def repaid_principal(self, repaid_principal): - """Sets the repaid_principal of this CollateralOrder. - - Repaid principal # noqa: E501 - - :param repaid_principal: The repaid_principal of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._repaid_principal = repaid_principal - - @property - def repaid_interest(self): - """Gets the repaid_interest of this CollateralOrder. # noqa: E501 - - Repaid interest # noqa: E501 - - :return: The repaid_interest of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._repaid_interest - - @repaid_interest.setter - def repaid_interest(self, repaid_interest): - """Sets the repaid_interest of this CollateralOrder. - - Repaid interest # noqa: E501 - - :param repaid_interest: The repaid_interest of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._repaid_interest = repaid_interest - - @property - def init_ltv(self): - """Gets the init_ltv of this CollateralOrder. # noqa: E501 - - Initial collateralization rate # noqa: E501 - - :return: The init_ltv of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._init_ltv - - @init_ltv.setter - def init_ltv(self, init_ltv): - """Sets the init_ltv of this CollateralOrder. - - Initial collateralization rate # noqa: E501 - - :param init_ltv: The init_ltv of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._init_ltv = init_ltv - - @property - def current_ltv(self): - """Gets the current_ltv of this CollateralOrder. # noqa: E501 - - Current collateralization rate # noqa: E501 - - :return: The current_ltv of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._current_ltv - - @current_ltv.setter - def current_ltv(self, current_ltv): - """Sets the current_ltv of this CollateralOrder. - - Current collateralization rate # noqa: E501 - - :param current_ltv: The current_ltv of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._current_ltv = current_ltv - - @property - def liquidate_ltv(self): - """Gets the liquidate_ltv of this CollateralOrder. # noqa: E501 - - Liquidation collateralization rate # noqa: E501 - - :return: The liquidate_ltv of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._liquidate_ltv - - @liquidate_ltv.setter - def liquidate_ltv(self, liquidate_ltv): - """Sets the liquidate_ltv of this CollateralOrder. - - Liquidation collateralization rate # noqa: E501 - - :param liquidate_ltv: The liquidate_ltv of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._liquidate_ltv = liquidate_ltv - - @property - def status(self): - """Gets the status of this CollateralOrder. # noqa: E501 - - Order status: - initial: Initial state after placing the order - collateral_deducted: Collateral deduction successful - collateral_returning: Loan failed - Collateral return pending - lent: Loan successful - repaying: Repayment in progress - liquidating: Liquidation in progress - finished: Order completed - closed_liquidated: Liquidation and repayment completed # noqa: E501 - - :return: The status of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this CollateralOrder. - - Order status: - initial: Initial state after placing the order - collateral_deducted: Collateral deduction successful - collateral_returning: Loan failed - Collateral return pending - lent: Loan successful - repaying: Repayment in progress - liquidating: Liquidation in progress - finished: Order completed - closed_liquidated: Liquidation and repayment completed # noqa: E501 - - :param status: The status of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._status = status - - @property - def borrow_time(self): - """Gets the borrow_time of this CollateralOrder. # noqa: E501 - - Borrowing time, timestamp in seconds # noqa: E501 - - :return: The borrow_time of this CollateralOrder. # noqa: E501 - :rtype: int - """ - return self._borrow_time - - @borrow_time.setter - def borrow_time(self, borrow_time): - """Sets the borrow_time of this CollateralOrder. - - Borrowing time, timestamp in seconds # noqa: E501 - - :param borrow_time: The borrow_time of this CollateralOrder. # noqa: E501 - :type: int - """ - - self._borrow_time = borrow_time - - @property - def left_repay_total(self): - """Gets the left_repay_total of this CollateralOrder. # noqa: E501 - - Outstanding principal and interest (outstanding principal + outstanding interest) # noqa: E501 - - :return: The left_repay_total of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._left_repay_total - - @left_repay_total.setter - def left_repay_total(self, left_repay_total): - """Sets the left_repay_total of this CollateralOrder. - - Outstanding principal and interest (outstanding principal + outstanding interest) # noqa: E501 - - :param left_repay_total: The left_repay_total of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._left_repay_total = left_repay_total - - @property - def left_repay_principal(self): - """Gets the left_repay_principal of this CollateralOrder. # noqa: E501 - - Outstanding principal # noqa: E501 - - :return: The left_repay_principal of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._left_repay_principal - - @left_repay_principal.setter - def left_repay_principal(self, left_repay_principal): - """Sets the left_repay_principal of this CollateralOrder. - - Outstanding principal # noqa: E501 - - :param left_repay_principal: The left_repay_principal of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._left_repay_principal = left_repay_principal - - @property - def left_repay_interest(self): - """Gets the left_repay_interest of this CollateralOrder. # noqa: E501 - - Outstanding interest # noqa: E501 - - :return: The left_repay_interest of this CollateralOrder. # noqa: E501 - :rtype: str - """ - return self._left_repay_interest - - @left_repay_interest.setter - def left_repay_interest(self, left_repay_interest): - """Sets the left_repay_interest of this CollateralOrder. - - Outstanding interest # noqa: E501 - - :param left_repay_interest: The left_repay_interest of this CollateralOrder. # noqa: E501 - :type: str - """ - - self._left_repay_interest = left_repay_interest - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CollateralOrder): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CollateralOrder): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/collateral_record.py b/gate_api/models/collateral_record.py deleted file mode 100644 index b5eeb096..00000000 --- a/gate_api/models/collateral_record.py +++ /dev/null @@ -1,375 +0,0 @@ -# coding: utf-8 - -""" - Gate API - - Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - - Contact: support@mail.gate.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class CollateralRecord(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'order_id': 'int', - 'record_id': 'int', - 'borrow_currency': 'str', - 'borrow_amount': 'str', - 'collateral_currency': 'str', - 'before_collateral': 'str', - 'after_collateral': 'str', - 'before_ltv': 'str', - 'after_ltv': 'str', - 'operate_time': 'int' - } - - attribute_map = { - 'order_id': 'order_id', - 'record_id': 'record_id', - 'borrow_currency': 'borrow_currency', - 'borrow_amount': 'borrow_amount', - 'collateral_currency': 'collateral_currency', - 'before_collateral': 'before_collateral', - 'after_collateral': 'after_collateral', - 'before_ltv': 'before_ltv', - 'after_ltv': 'after_ltv', - 'operate_time': 'operate_time' - } - - def __init__(self, order_id=None, record_id=None, borrow_currency=None, borrow_amount=None, collateral_currency=None, before_collateral=None, after_collateral=None, before_ltv=None, after_ltv=None, operate_time=None, local_vars_configuration=None): # noqa: E501 - # type: (int, int, str, str, str, str, str, str, str, int, Configuration) -> None - """CollateralRecord - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._order_id = None - self._record_id = None - self._borrow_currency = None - self._borrow_amount = None - self._collateral_currency = None - self._before_collateral = None - self._after_collateral = None - self._before_ltv = None - self._after_ltv = None - self._operate_time = None - self.discriminator = None - - if order_id is not None: - self.order_id = order_id - if record_id is not None: - self.record_id = record_id - if borrow_currency is not None: - self.borrow_currency = borrow_currency - if borrow_amount is not None: - self.borrow_amount = borrow_amount - if collateral_currency is not None: - self.collateral_currency = collateral_currency - if before_collateral is not None: - self.before_collateral = before_collateral - if after_collateral is not None: - self.after_collateral = after_collateral - if before_ltv is not None: - self.before_ltv = before_ltv - if after_ltv is not None: - self.after_ltv = after_ltv - if operate_time is not None: - self.operate_time = operate_time - - @property - def order_id(self): - """Gets the order_id of this CollateralRecord. # noqa: E501 - - Order ID # noqa: E501 - - :return: The order_id of this CollateralRecord. # noqa: E501 - :rtype: int - """ - return self._order_id - - @order_id.setter - def order_id(self, order_id): - """Sets the order_id of this CollateralRecord. - - Order ID # noqa: E501 - - :param order_id: The order_id of this CollateralRecord. # noqa: E501 - :type: int - """ - - self._order_id = order_id - - @property - def record_id(self): - """Gets the record_id of this CollateralRecord. # noqa: E501 - - Collateral record ID # noqa: E501 - - :return: The record_id of this CollateralRecord. # noqa: E501 - :rtype: int - """ - return self._record_id - - @record_id.setter - def record_id(self, record_id): - """Sets the record_id of this CollateralRecord. - - Collateral record ID # noqa: E501 - - :param record_id: The record_id of this CollateralRecord. # noqa: E501 - :type: int - """ - - self._record_id = record_id - - @property - def borrow_currency(self): - """Gets the borrow_currency of this CollateralRecord. # noqa: E501 - - Borrowed currency # noqa: E501 - - :return: The borrow_currency of this CollateralRecord. # noqa: E501 - :rtype: str - """ - return self._borrow_currency - - @borrow_currency.setter - def borrow_currency(self, borrow_currency): - """Sets the borrow_currency of this CollateralRecord. - - Borrowed currency # noqa: E501 - - :param borrow_currency: The borrow_currency of this CollateralRecord. # noqa: E501 - :type: str - """ - - self._borrow_currency = borrow_currency - - @property - def borrow_amount(self): - """Gets the borrow_amount of this CollateralRecord. # noqa: E501 - - Borrowed amount # noqa: E501 - - :return: The borrow_amount of this CollateralRecord. # noqa: E501 - :rtype: str - """ - return self._borrow_amount - - @borrow_amount.setter - def borrow_amount(self, borrow_amount): - """Sets the borrow_amount of this CollateralRecord. - - Borrowed amount # noqa: E501 - - :param borrow_amount: The borrow_amount of this CollateralRecord. # noqa: E501 - :type: str - """ - - self._borrow_amount = borrow_amount - - @property - def collateral_currency(self): - """Gets the collateral_currency of this CollateralRecord. # noqa: E501 - - Collateral currency # noqa: E501 - - :return: The collateral_currency of this CollateralRecord. # noqa: E501 - :rtype: str - """ - return self._collateral_currency - - @collateral_currency.setter - def collateral_currency(self, collateral_currency): - """Sets the collateral_currency of this CollateralRecord. - - Collateral currency # noqa: E501 - - :param collateral_currency: The collateral_currency of this CollateralRecord. # noqa: E501 - :type: str - """ - - self._collateral_currency = collateral_currency - - @property - def before_collateral(self): - """Gets the before_collateral of this CollateralRecord. # noqa: E501 - - Collateral amount before adjustment # noqa: E501 - - :return: The before_collateral of this CollateralRecord. # noqa: E501 - :rtype: str - """ - return self._before_collateral - - @before_collateral.setter - def before_collateral(self, before_collateral): - """Sets the before_collateral of this CollateralRecord. - - Collateral amount before adjustment # noqa: E501 - - :param before_collateral: The before_collateral of this CollateralRecord. # noqa: E501 - :type: str - """ - - self._before_collateral = before_collateral - - @property - def after_collateral(self): - """Gets the after_collateral of this CollateralRecord. # noqa: E501 - - Collateral amount after adjustment # noqa: E501 - - :return: The after_collateral of this CollateralRecord. # noqa: E501 - :rtype: str - """ - return self._after_collateral - - @after_collateral.setter - def after_collateral(self, after_collateral): - """Sets the after_collateral of this CollateralRecord. - - Collateral amount after adjustment # noqa: E501 - - :param after_collateral: The after_collateral of this CollateralRecord. # noqa: E501 - :type: str - """ - - self._after_collateral = after_collateral - - @property - def before_ltv(self): - """Gets the before_ltv of this CollateralRecord. # noqa: E501 - - Collateral ratio before adjustment # noqa: E501 - - :return: The before_ltv of this CollateralRecord. # noqa: E501 - :rtype: str - """ - return self._before_ltv - - @before_ltv.setter - def before_ltv(self, before_ltv): - """Sets the before_ltv of this CollateralRecord. - - Collateral ratio before adjustment # noqa: E501 - - :param before_ltv: The before_ltv of this CollateralRecord. # noqa: E501 - :type: str - """ - - self._before_ltv = before_ltv - - @property - def after_ltv(self): - """Gets the after_ltv of this CollateralRecord. # noqa: E501 - - Collateral ratio after adjustment # noqa: E501 - - :return: The after_ltv of this CollateralRecord. # noqa: E501 - :rtype: str - """ - return self._after_ltv - - @after_ltv.setter - def after_ltv(self, after_ltv): - """Sets the after_ltv of this CollateralRecord. - - Collateral ratio after adjustment # noqa: E501 - - :param after_ltv: The after_ltv of this CollateralRecord. # noqa: E501 - :type: str - """ - - self._after_ltv = after_ltv - - @property - def operate_time(self): - """Gets the operate_time of this CollateralRecord. # noqa: E501 - - Operation time, timestamp in seconds # noqa: E501 - - :return: The operate_time of this CollateralRecord. # noqa: E501 - :rtype: int - """ - return self._operate_time - - @operate_time.setter - def operate_time(self, operate_time): - """Sets the operate_time of this CollateralRecord. - - Operation time, timestamp in seconds # noqa: E501 - - :param operate_time: The operate_time of this CollateralRecord. # noqa: E501 - :type: int - """ - - self._operate_time = operate_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CollateralRecord): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CollateralRecord): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/confirm_payment.py b/gate_api/models/confirm_payment.py new file mode 100644 index 00000000..9f0d48c6 --- /dev/null +++ b/gate_api/models/confirm_payment.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ConfirmPayment(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'txid': 'str', + 'payment_method': 'str' + } + + attribute_map = { + 'txid': 'txid', + 'payment_method': 'payment_method' + } + + def __init__(self, txid=None, payment_method=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """ConfirmPayment - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._txid = None + self._payment_method = None + self.discriminator = None + + self.txid = txid + if payment_method is not None: + self.payment_method = payment_method + + @property + def txid(self): + """Gets the txid of this ConfirmPayment. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this ConfirmPayment. # noqa: E501 + :rtype: str + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this ConfirmPayment. + + Order ID # noqa: E501 + + :param txid: The txid of this ConfirmPayment. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and txid is None: # noqa: E501 + raise ValueError("Invalid value for `txid`, must not be `None`") # noqa: E501 + + self._txid = txid + + @property + def payment_method(self): + """Gets the payment_method of this ConfirmPayment. # noqa: E501 + + Payment type used for this payment; optional but must be among order-supported types. Use `supported_pay_types` on the order or `pay_type` list, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. # noqa: E501 + + :return: The payment_method of this ConfirmPayment. # noqa: E501 + :rtype: str + """ + return self._payment_method + + @payment_method.setter + def payment_method(self, payment_method): + """Sets the payment_method of this ConfirmPayment. + + Payment type used for this payment; optional but must be among order-supported types. Use `supported_pay_types` on the order or `pay_type` list, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. # noqa: E501 + + :param payment_method: The payment_method of this ConfirmPayment. # noqa: E501 + :type: str + """ + + self._payment_method = payment_method + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConfirmPayment): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ConfirmPayment): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/confirm_receipt.py b/gate_api/models/confirm_receipt.py new file mode 100644 index 00000000..6b486cc4 --- /dev/null +++ b/gate_api/models/confirm_receipt.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ConfirmReceipt(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'txid': 'str' + } + + attribute_map = { + 'txid': 'txid' + } + + def __init__(self, txid=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """ConfirmReceipt - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._txid = None + self.discriminator = None + + self.txid = txid + + @property + def txid(self): + """Gets the txid of this ConfirmReceipt. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this ConfirmReceipt. # noqa: E501 + :rtype: str + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this ConfirmReceipt. + + Order ID # noqa: E501 + + :param txid: The txid of this ConfirmReceipt. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and txid is None: # noqa: E501 + raise ValueError("Invalid value for `txid`, must not be `None`") # noqa: E501 + + self._txid = txid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConfirmReceipt): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ConfirmReceipt): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/contract.py b/gate_api/models/contract.py index 8baceff5..5b6a01a2 100644 --- a/gate_api/models/contract.py +++ b/gate_api/models/contract.py @@ -51,9 +51,11 @@ class Contract(object): 'funding_interval': 'int', 'funding_next_apply': 'float', 'risk_limit_base': 'str', + 'interest_rate': 'str', 'risk_limit_step': 'str', 'risk_limit_max': 'str', 'order_size_min': 'str', + 'enable_decimal': 'bool', 'order_size_max': 'str', 'order_price_deviate': 'str', 'ref_discount_rate': 'str', @@ -75,7 +77,10 @@ class Contract(object): 'delisted_time': 'int', 'market_order_slip_ratio': 'str', 'market_order_size_max': 'str', - 'funding_rate_limit': 'str' + 'funding_rate_limit': 'str', + 'contract_type': 'str', + 'funding_impact_value': 'str', + 'enable_circuit_breaker': 'bool' } attribute_map = { @@ -97,9 +102,11 @@ class Contract(object): 'funding_interval': 'funding_interval', 'funding_next_apply': 'funding_next_apply', 'risk_limit_base': 'risk_limit_base', + 'interest_rate': 'interest_rate', 'risk_limit_step': 'risk_limit_step', 'risk_limit_max': 'risk_limit_max', 'order_size_min': 'order_size_min', + 'enable_decimal': 'enable_decimal', 'order_size_max': 'order_size_max', 'order_price_deviate': 'order_price_deviate', 'ref_discount_rate': 'ref_discount_rate', @@ -121,11 +128,14 @@ class Contract(object): 'delisted_time': 'delisted_time', 'market_order_slip_ratio': 'market_order_slip_ratio', 'market_order_size_max': 'market_order_size_max', - 'funding_rate_limit': 'funding_rate_limit' + 'funding_rate_limit': 'funding_rate_limit', + 'contract_type': 'contract_type', + 'funding_impact_value': 'funding_impact_value', + 'enable_circuit_breaker': 'enable_circuit_breaker' } - def __init__(self, name=None, type=None, quanto_multiplier=None, leverage_min=None, leverage_max=None, maintenance_rate=None, mark_type=None, mark_price=None, index_price=None, last_price=None, maker_fee_rate=None, taker_fee_rate=None, order_price_round=None, mark_price_round=None, funding_rate=None, funding_interval=None, funding_next_apply=None, risk_limit_base=None, risk_limit_step=None, risk_limit_max=None, order_size_min=None, order_size_max=None, order_price_deviate=None, ref_discount_rate=None, ref_rebate_rate=None, orderbook_id=None, trade_id=None, trade_size=None, position_size=None, config_change_time=None, in_delisting=None, orders_limit=None, enable_bonus=None, enable_credit=None, create_time=None, funding_cap_ratio=None, status=None, launch_time=None, delisting_time=None, delisted_time=None, market_order_slip_ratio=None, market_order_size_max=None, funding_rate_limit=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, float, str, str, str, str, str, str, str, str, int, int, str, str, float, bool, int, bool, bool, float, str, str, int, int, int, str, str, str, Configuration) -> None + def __init__(self, name=None, type=None, quanto_multiplier=None, leverage_min=None, leverage_max=None, maintenance_rate=None, mark_type=None, mark_price=None, index_price=None, last_price=None, maker_fee_rate=None, taker_fee_rate=None, order_price_round=None, mark_price_round=None, funding_rate=None, funding_interval=None, funding_next_apply=None, risk_limit_base=None, interest_rate=None, risk_limit_step=None, risk_limit_max=None, order_size_min=None, enable_decimal=None, order_size_max=None, order_price_deviate=None, ref_discount_rate=None, ref_rebate_rate=None, orderbook_id=None, trade_id=None, trade_size=None, position_size=None, config_change_time=None, in_delisting=None, orders_limit=None, enable_bonus=None, enable_credit=None, create_time=None, funding_cap_ratio=None, status=None, launch_time=None, delisting_time=None, delisted_time=None, market_order_slip_ratio=None, market_order_size_max=None, funding_rate_limit=None, contract_type=None, funding_impact_value=None, enable_circuit_breaker=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, float, str, str, str, str, str, bool, str, str, str, str, int, int, str, str, float, bool, int, bool, bool, float, str, str, int, int, int, str, str, str, str, str, bool, Configuration) -> None """Contract - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -149,9 +159,11 @@ def __init__(self, name=None, type=None, quanto_multiplier=None, leverage_min=No self._funding_interval = None self._funding_next_apply = None self._risk_limit_base = None + self._interest_rate = None self._risk_limit_step = None self._risk_limit_max = None self._order_size_min = None + self._enable_decimal = None self._order_size_max = None self._order_price_deviate = None self._ref_discount_rate = None @@ -174,6 +186,9 @@ def __init__(self, name=None, type=None, quanto_multiplier=None, leverage_min=No self._market_order_slip_ratio = None self._market_order_size_max = None self._funding_rate_limit = None + self._contract_type = None + self._funding_impact_value = None + self._enable_circuit_breaker = None self.discriminator = None if name is not None: @@ -212,12 +227,16 @@ def __init__(self, name=None, type=None, quanto_multiplier=None, leverage_min=No self.funding_next_apply = funding_next_apply if risk_limit_base is not None: self.risk_limit_base = risk_limit_base + if interest_rate is not None: + self.interest_rate = interest_rate if risk_limit_step is not None: self.risk_limit_step = risk_limit_step if risk_limit_max is not None: self.risk_limit_max = risk_limit_max if order_size_min is not None: self.order_size_min = order_size_min + if enable_decimal is not None: + self.enable_decimal = enable_decimal if order_size_max is not None: self.order_size_max = order_size_max if order_price_deviate is not None: @@ -262,6 +281,12 @@ def __init__(self, name=None, type=None, quanto_multiplier=None, leverage_min=No self.market_order_size_max = market_order_size_max if funding_rate_limit is not None: self.funding_rate_limit = funding_rate_limit + if contract_type is not None: + self.contract_type = contract_type + if funding_impact_value is not None: + self.funding_impact_value = funding_impact_value + if enable_circuit_breaker is not None: + self.enable_circuit_breaker = enable_circuit_breaker @property def name(self): @@ -689,6 +714,29 @@ def risk_limit_base(self, risk_limit_base): self._risk_limit_base = risk_limit_base + @property + def interest_rate(self): + """Gets the interest_rate of this Contract. # noqa: E501 + + Interest rate parameter used in funding rate and premium-related calculations for perpetual contracts. Returned as a string decimal ratio (e.g. `0.0003`), same convention as `funding_rate` (ratio, not percent). # noqa: E501 + + :return: The interest_rate of this Contract. # noqa: E501 + :rtype: str + """ + return self._interest_rate + + @interest_rate.setter + def interest_rate(self, interest_rate): + """Sets the interest_rate of this Contract. + + Interest rate parameter used in funding rate and premium-related calculations for perpetual contracts. Returned as a string decimal ratio (e.g. `0.0003`), same convention as `funding_rate` (ratio, not percent). # noqa: E501 + + :param interest_rate: The interest_rate of this Contract. # noqa: E501 + :type: str + """ + + self._interest_rate = interest_rate + @property def risk_limit_step(self): """Gets the risk_limit_step of this Contract. # noqa: E501 @@ -739,7 +787,7 @@ def risk_limit_max(self, risk_limit_max): def order_size_min(self): """Gets the order_size_min of this Contract. # noqa: E501 - Minimum order size allowed by the contract # noqa: E501 + Minimum order quantity # noqa: E501 :return: The order_size_min of this Contract. # noqa: E501 :rtype: str @@ -750,7 +798,7 @@ def order_size_min(self): def order_size_min(self, order_size_min): """Sets the order_size_min of this Contract. - Minimum order size allowed by the contract # noqa: E501 + Minimum order quantity # noqa: E501 :param order_size_min: The order_size_min of this Contract. # noqa: E501 :type: str @@ -758,11 +806,34 @@ def order_size_min(self, order_size_min): self._order_size_min = order_size_min + @property + def enable_decimal(self): + """Gets the enable_decimal of this Contract. # noqa: E501 + + Whether decimal string type is supported for contract lot size. When this field is set to `true`, it indicates that the contract supports decimal lot sizes (i.e., the `size` field can use a decimal string type); when set to `false`, it indicates that the contract does not support decimal lot sizes (i.e., the `size` field can only use an integer type). # noqa: E501 + + :return: The enable_decimal of this Contract. # noqa: E501 + :rtype: bool + """ + return self._enable_decimal + + @enable_decimal.setter + def enable_decimal(self, enable_decimal): + """Sets the enable_decimal of this Contract. + + Whether decimal string type is supported for contract lot size. When this field is set to `true`, it indicates that the contract supports decimal lot sizes (i.e., the `size` field can use a decimal string type); when set to `false`, it indicates that the contract does not support decimal lot sizes (i.e., the `size` field can only use an integer type). # noqa: E501 + + :param enable_decimal: The enable_decimal of this Contract. # noqa: E501 + :type: bool + """ + + self._enable_decimal = enable_decimal + @property def order_size_max(self): """Gets the order_size_max of this Contract. # noqa: E501 - Maximum order size allowed by the contract # noqa: E501 + Maximum order quantity # noqa: E501 :return: The order_size_max of this Contract. # noqa: E501 :rtype: str @@ -773,7 +844,7 @@ def order_size_max(self): def order_size_max(self, order_size_max): """Sets the order_size_max of this Contract. - Maximum order size allowed by the contract # noqa: E501 + Maximum order quantity # noqa: E501 :param order_size_max: The order_size_max of this Contract. # noqa: E501 :type: str @@ -1264,6 +1335,75 @@ def funding_rate_limit(self, funding_rate_limit): self._funding_rate_limit = funding_rate_limit + @property + def contract_type(self): + """Gets the contract_type of this Contract. # noqa: E501 + + Contract classification type, e.g. stocks, metals, indices, forex, commodities, etc. # noqa: E501 + + :return: The contract_type of this Contract. # noqa: E501 + :rtype: str + """ + return self._contract_type + + @contract_type.setter + def contract_type(self, contract_type): + """Sets the contract_type of this Contract. + + Contract classification type, e.g. stocks, metals, indices, forex, commodities, etc. # noqa: E501 + + :param contract_type: The contract_type of this Contract. # noqa: E501 + :type: str + """ + + self._contract_type = contract_type + + @property + def funding_impact_value(self): + """Gets the funding_impact_value of this Contract. # noqa: E501 + + Funding rate depth impact value # noqa: E501 + + :return: The funding_impact_value of this Contract. # noqa: E501 + :rtype: str + """ + return self._funding_impact_value + + @funding_impact_value.setter + def funding_impact_value(self, funding_impact_value): + """Sets the funding_impact_value of this Contract. + + Funding rate depth impact value # noqa: E501 + + :param funding_impact_value: The funding_impact_value of this Contract. # noqa: E501 + :type: str + """ + + self._funding_impact_value = funding_impact_value + + @property + def enable_circuit_breaker(self): + """Gets the enable_circuit_breaker of this Contract. # noqa: E501 + + Whether the newly launched contract activates mark price circuit breaker (If the platform intends to activate this mechanism for a newly launched contract market to prevent significant price fluctuations and excessive liquidations after launch, an advance announcement will be made). # noqa: E501 + + :return: The enable_circuit_breaker of this Contract. # noqa: E501 + :rtype: bool + """ + return self._enable_circuit_breaker + + @enable_circuit_breaker.setter + def enable_circuit_breaker(self, enable_circuit_breaker): + """Sets the enable_circuit_breaker of this Contract. + + Whether the newly launched contract activates mark price circuit breaker (If the platform intends to activate this mechanism for a newly launched contract market to prevent significant price fluctuations and excessive liquidations after launch, an advance announcement will be made). # noqa: E501 + + :param enable_circuit_breaker: The enable_circuit_breaker of this Contract. # noqa: E501 + :type: bool + """ + + self._enable_circuit_breaker = enable_circuit_breaker + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/contract_detail.py b/gate_api/models/contract_detail.py new file mode 100644 index 00000000..775e425b --- /dev/null +++ b/gate_api/models/contract_detail.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ContractDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'ContractDetailData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, ContractDetailData, Configuration) -> None + """ContractDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this ContractDetail. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ContractDetail. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ContractDetail. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ContractDetail. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this ContractDetail. # noqa: E501 + + + :return: The data of this ContractDetail. # noqa: E501 + :rtype: ContractDetailData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ContractDetail. + + + :param data: The data of this ContractDetail. # noqa: E501 + :type: ContractDetailData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ContractDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ContractDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/contract_detail_data.py b/gate_api/models/contract_detail_data.py new file mode 100644 index 00000000..fba93d9e --- /dev/null +++ b/gate_api/models/contract_detail_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ContractDetailData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[ContractDetailDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[ContractDetailDataList], Configuration) -> None + """ContractDetailData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this ContractDetailData. # noqa: E501 + + Contract Details List # noqa: E501 + + :return: The list of this ContractDetailData. # noqa: E501 + :rtype: list[ContractDetailDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this ContractDetailData. + + Contract Details List # noqa: E501 + + :param list: The list of this ContractDetailData. # noqa: E501 + :type: list[ContractDetailDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ContractDetailData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ContractDetailData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/contract_detail_data_list.py b/gate_api/models/contract_detail_data_list.py new file mode 100644 index 00000000..d0c83c9a --- /dev/null +++ b/gate_api/models/contract_detail_data_list.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ContractDetailDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'symbol_desc': 'str', + 'category_name': 'str', + 'contract_volume': 'str', + 'settlement_currency': 'str', + 'max_order_volume': 'str', + 'min_order_volume': 'str', + 'leverage': 'str', + 'price_precision': 'int', + 'price_sl_level': 'str', + 'swap_cost_type': 'str', + 'buy_swap_cost_rate': 'str', + 'sell_swap_cost_rate': 'str', + 'swap_cost_3day': 'str', + 'trade_timezone': 'str', + 'trade_mode': 'str', + 'icon_link': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'symbol_desc': 'symbol_desc', + 'category_name': 'category_name', + 'contract_volume': 'contract_volume', + 'settlement_currency': 'settlement_currency', + 'max_order_volume': 'max_order_volume', + 'min_order_volume': 'min_order_volume', + 'leverage': 'leverage', + 'price_precision': 'price_precision', + 'price_sl_level': 'price_sl_level', + 'swap_cost_type': 'swap_cost_type', + 'buy_swap_cost_rate': 'buy_swap_cost_rate', + 'sell_swap_cost_rate': 'sell_swap_cost_rate', + 'swap_cost_3day': 'swap_cost_3day', + 'trade_timezone': 'trade_timezone', + 'trade_mode': 'trade_mode', + 'icon_link': 'icon_link' + } + + def __init__(self, symbol=None, symbol_desc=None, category_name=None, contract_volume=None, settlement_currency=None, max_order_volume=None, min_order_volume=None, leverage=None, price_precision=None, price_sl_level=None, swap_cost_type=None, buy_swap_cost_rate=None, sell_swap_cost_rate=None, swap_cost_3day=None, trade_timezone=None, trade_mode=None, icon_link=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, int, str, str, str, str, str, str, str, str, Configuration) -> None + """ContractDetailDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._symbol_desc = None + self._category_name = None + self._contract_volume = None + self._settlement_currency = None + self._max_order_volume = None + self._min_order_volume = None + self._leverage = None + self._price_precision = None + self._price_sl_level = None + self._swap_cost_type = None + self._buy_swap_cost_rate = None + self._sell_swap_cost_rate = None + self._swap_cost_3day = None + self._trade_timezone = None + self._trade_mode = None + self._icon_link = None + self.discriminator = None + + if symbol is not None: + self.symbol = symbol + if symbol_desc is not None: + self.symbol_desc = symbol_desc + if category_name is not None: + self.category_name = category_name + if contract_volume is not None: + self.contract_volume = contract_volume + if settlement_currency is not None: + self.settlement_currency = settlement_currency + if max_order_volume is not None: + self.max_order_volume = max_order_volume + if min_order_volume is not None: + self.min_order_volume = min_order_volume + if leverage is not None: + self.leverage = leverage + if price_precision is not None: + self.price_precision = price_precision + if price_sl_level is not None: + self.price_sl_level = price_sl_level + if swap_cost_type is not None: + self.swap_cost_type = swap_cost_type + if buy_swap_cost_rate is not None: + self.buy_swap_cost_rate = buy_swap_cost_rate + if sell_swap_cost_rate is not None: + self.sell_swap_cost_rate = sell_swap_cost_rate + if swap_cost_3day is not None: + self.swap_cost_3day = swap_cost_3day + if trade_timezone is not None: + self.trade_timezone = trade_timezone + if trade_mode is not None: + self.trade_mode = trade_mode + if icon_link is not None: + self.icon_link = icon_link + + @property + def symbol(self): + """Gets the symbol of this ContractDetailDataList. # noqa: E501 + + Trading symbol code # noqa: E501 + + :return: The symbol of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this ContractDetailDataList. + + Trading symbol code # noqa: E501 + + :param symbol: The symbol of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def symbol_desc(self): + """Gets the symbol_desc of this ContractDetailDataList. # noqa: E501 + + Trading symbol description # noqa: E501 + + :return: The symbol_desc of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._symbol_desc + + @symbol_desc.setter + def symbol_desc(self, symbol_desc): + """Sets the symbol_desc of this ContractDetailDataList. + + Trading symbol description # noqa: E501 + + :param symbol_desc: The symbol_desc of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._symbol_desc = symbol_desc + + @property + def category_name(self): + """Gets the category_name of this ContractDetailDataList. # noqa: E501 + + Category name # noqa: E501 + + :return: The category_name of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._category_name + + @category_name.setter + def category_name(self, category_name): + """Sets the category_name of this ContractDetailDataList. + + Category name # noqa: E501 + + :param category_name: The category_name of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._category_name = category_name + + @property + def contract_volume(self): + """Gets the contract_volume of this ContractDetailDataList. # noqa: E501 + + Contract Volume # noqa: E501 + + :return: The contract_volume of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._contract_volume + + @contract_volume.setter + def contract_volume(self, contract_volume): + """Sets the contract_volume of this ContractDetailDataList. + + Contract Volume # noqa: E501 + + :param contract_volume: The contract_volume of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._contract_volume = contract_volume + + @property + def settlement_currency(self): + """Gets the settlement_currency of this ContractDetailDataList. # noqa: E501 + + Settle currency # noqa: E501 + + :return: The settlement_currency of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._settlement_currency + + @settlement_currency.setter + def settlement_currency(self, settlement_currency): + """Sets the settlement_currency of this ContractDetailDataList. + + Settle currency # noqa: E501 + + :param settlement_currency: The settlement_currency of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._settlement_currency = settlement_currency + + @property + def max_order_volume(self): + """Gets the max_order_volume of this ContractDetailDataList. # noqa: E501 + + Maximum Order Volume # noqa: E501 + + :return: The max_order_volume of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._max_order_volume + + @max_order_volume.setter + def max_order_volume(self, max_order_volume): + """Sets the max_order_volume of this ContractDetailDataList. + + Maximum Order Volume # noqa: E501 + + :param max_order_volume: The max_order_volume of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._max_order_volume = max_order_volume + + @property + def min_order_volume(self): + """Gets the min_order_volume of this ContractDetailDataList. # noqa: E501 + + Minimum Order Volume # noqa: E501 + + :return: The min_order_volume of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._min_order_volume + + @min_order_volume.setter + def min_order_volume(self, min_order_volume): + """Sets the min_order_volume of this ContractDetailDataList. + + Minimum Order Volume # noqa: E501 + + :param min_order_volume: The min_order_volume of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._min_order_volume = min_order_volume + + @property + def leverage(self): + """Gets the leverage of this ContractDetailDataList. # noqa: E501 + + Leverage multiplier # noqa: E501 + + :return: The leverage of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this ContractDetailDataList. + + Leverage multiplier # noqa: E501 + + :param leverage: The leverage of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + @property + def price_precision(self): + """Gets the price_precision of this ContractDetailDataList. # noqa: E501 + + Price precision (decimal places) # noqa: E501 + + :return: The price_precision of this ContractDetailDataList. # noqa: E501 + :rtype: int + """ + return self._price_precision + + @price_precision.setter + def price_precision(self, price_precision): + """Sets the price_precision of this ContractDetailDataList. + + Price precision (decimal places) # noqa: E501 + + :param price_precision: The price_precision of this ContractDetailDataList. # noqa: E501 + :type: int + """ + + self._price_precision = price_precision + + @property + def price_sl_level(self): + """Gets the price_sl_level of this ContractDetailDataList. # noqa: E501 + + Stop Loss Price Level # noqa: E501 + + :return: The price_sl_level of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._price_sl_level + + @price_sl_level.setter + def price_sl_level(self, price_sl_level): + """Sets the price_sl_level of this ContractDetailDataList. + + Stop Loss Price Level # noqa: E501 + + :param price_sl_level: The price_sl_level of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._price_sl_level = price_sl_level + + @property + def swap_cost_type(self): + """Gets the swap_cost_type of this ContractDetailDataList. # noqa: E501 + + Swap Cost Type # noqa: E501 + + :return: The swap_cost_type of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._swap_cost_type + + @swap_cost_type.setter + def swap_cost_type(self, swap_cost_type): + """Sets the swap_cost_type of this ContractDetailDataList. + + Swap Cost Type # noqa: E501 + + :param swap_cost_type: The swap_cost_type of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._swap_cost_type = swap_cost_type + + @property + def buy_swap_cost_rate(self): + """Gets the buy_swap_cost_rate of this ContractDetailDataList. # noqa: E501 + + Buy Swap Cost Rate # noqa: E501 + + :return: The buy_swap_cost_rate of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._buy_swap_cost_rate + + @buy_swap_cost_rate.setter + def buy_swap_cost_rate(self, buy_swap_cost_rate): + """Sets the buy_swap_cost_rate of this ContractDetailDataList. + + Buy Swap Cost Rate # noqa: E501 + + :param buy_swap_cost_rate: The buy_swap_cost_rate of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._buy_swap_cost_rate = buy_swap_cost_rate + + @property + def sell_swap_cost_rate(self): + """Gets the sell_swap_cost_rate of this ContractDetailDataList. # noqa: E501 + + Sell Swap Cost Rate # noqa: E501 + + :return: The sell_swap_cost_rate of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._sell_swap_cost_rate + + @sell_swap_cost_rate.setter + def sell_swap_cost_rate(self, sell_swap_cost_rate): + """Sets the sell_swap_cost_rate of this ContractDetailDataList. + + Sell Swap Cost Rate # noqa: E501 + + :param sell_swap_cost_rate: The sell_swap_cost_rate of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._sell_swap_cost_rate = sell_swap_cost_rate + + @property + def swap_cost_3day(self): + """Gets the swap_cost_3day of this ContractDetailDataList. # noqa: E501 + + 3-Day Swap Cost # noqa: E501 + + :return: The swap_cost_3day of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._swap_cost_3day + + @swap_cost_3day.setter + def swap_cost_3day(self, swap_cost_3day): + """Sets the swap_cost_3day of this ContractDetailDataList. + + 3-Day Swap Cost # noqa: E501 + + :param swap_cost_3day: The swap_cost_3day of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._swap_cost_3day = swap_cost_3day + + @property + def trade_timezone(self): + """Gets the trade_timezone of this ContractDetailDataList. # noqa: E501 + + Trading Timezone # noqa: E501 + + :return: The trade_timezone of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._trade_timezone + + @trade_timezone.setter + def trade_timezone(self, trade_timezone): + """Sets the trade_timezone of this ContractDetailDataList. + + Trading Timezone # noqa: E501 + + :param trade_timezone: The trade_timezone of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._trade_timezone = trade_timezone + + @property + def trade_mode(self): + """Gets the trade_mode of this ContractDetailDataList. # noqa: E501 + + Trading mode code (0=disabled, 1=long only, 2=short only, 3=close only, 4=full trading access) # noqa: E501 + + :return: The trade_mode of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._trade_mode + + @trade_mode.setter + def trade_mode(self, trade_mode): + """Sets the trade_mode of this ContractDetailDataList. + + Trading mode code (0=disabled, 1=long only, 2=short only, 3=close only, 4=full trading access) # noqa: E501 + + :param trade_mode: The trade_mode of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._trade_mode = trade_mode + + @property + def icon_link(self): + """Gets the icon_link of this ContractDetailDataList. # noqa: E501 + + Symbol icon URL # noqa: E501 + + :return: The icon_link of this ContractDetailDataList. # noqa: E501 + :rtype: str + """ + return self._icon_link + + @icon_link.setter + def icon_link(self, icon_link): + """Sets the icon_link of this ContractDetailDataList. + + Symbol icon URL # noqa: E501 + + :param icon_link: The icon_link of this ContractDetailDataList. # noqa: E501 + :type: str + """ + + self._icon_link = icon_link + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ContractDetailDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ContractDetailDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/contract_martingale_create_params.py b/gate_api/models/contract_martingale_create_params.py new file mode 100644 index 00000000..61745acb --- /dev/null +++ b/gate_api/models/contract_martingale_create_params.py @@ -0,0 +1,316 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ContractMartingaleCreateParams(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'invest_amount': 'str', + 'price_deviation': 'str', + 'max_orders': 'int', + 'take_profit_ratio': 'str', + 'direction': 'ContractMartingaleDirection', + 'leverage': 'str', + 'stop_loss_price': 'str', + 'profit_sharing_ratio': 'str' + } + + attribute_map = { + 'invest_amount': 'invest_amount', + 'price_deviation': 'price_deviation', + 'max_orders': 'max_orders', + 'take_profit_ratio': 'take_profit_ratio', + 'direction': 'direction', + 'leverage': 'leverage', + 'stop_loss_price': 'stop_loss_price', + 'profit_sharing_ratio': 'profit_sharing_ratio' + } + + def __init__(self, invest_amount=None, price_deviation=None, max_orders=None, take_profit_ratio=None, direction=None, leverage=None, stop_loss_price=None, profit_sharing_ratio=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, str, ContractMartingaleDirection, str, str, str, Configuration) -> None + """ContractMartingaleCreateParams - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._invest_amount = None + self._price_deviation = None + self._max_orders = None + self._take_profit_ratio = None + self._direction = None + self._leverage = None + self._stop_loss_price = None + self._profit_sharing_ratio = None + self.discriminator = None + + self.invest_amount = invest_amount + self.price_deviation = price_deviation + self.max_orders = max_orders + self.take_profit_ratio = take_profit_ratio + self.direction = direction + self.leverage = leverage + if stop_loss_price is not None: + self.stop_loss_price = stop_loss_price + if profit_sharing_ratio is not None: + self.profit_sharing_ratio = profit_sharing_ratio + + @property + def invest_amount(self): + """Gets the invest_amount of this ContractMartingaleCreateParams. # noqa: E501 + + Margin allocated; the server converts it to initial contract size using live contract price, contract multiplier, and minimum lot size. # noqa: E501 + + :return: The invest_amount of this ContractMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._invest_amount + + @invest_amount.setter + def invest_amount(self, invest_amount): + """Sets the invest_amount of this ContractMartingaleCreateParams. + + Margin allocated; the server converts it to initial contract size using live contract price, contract multiplier, and minimum lot size. # noqa: E501 + + :param invest_amount: The invest_amount of this ContractMartingaleCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and invest_amount is None: # noqa: E501 + raise ValueError("Invalid value for `invest_amount`, must not be `None`") # noqa: E501 + + self._invest_amount = invest_amount + + @property + def price_deviation(self): + """Gets the price_deviation of this ContractMartingaleCreateParams. # noqa: E501 + + + :return: The price_deviation of this ContractMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._price_deviation + + @price_deviation.setter + def price_deviation(self, price_deviation): + """Sets the price_deviation of this ContractMartingaleCreateParams. + + + :param price_deviation: The price_deviation of this ContractMartingaleCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price_deviation is None: # noqa: E501 + raise ValueError("Invalid value for `price_deviation`, must not be `None`") # noqa: E501 + + self._price_deviation = price_deviation + + @property + def max_orders(self): + """Gets the max_orders of this ContractMartingaleCreateParams. # noqa: E501 + + + :return: The max_orders of this ContractMartingaleCreateParams. # noqa: E501 + :rtype: int + """ + return self._max_orders + + @max_orders.setter + def max_orders(self, max_orders): + """Sets the max_orders of this ContractMartingaleCreateParams. + + + :param max_orders: The max_orders of this ContractMartingaleCreateParams. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and max_orders is None: # noqa: E501 + raise ValueError("Invalid value for `max_orders`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + max_orders is not None and max_orders < 1): # noqa: E501 + raise ValueError("Invalid value for `max_orders`, must be a value greater than or equal to `1`") # noqa: E501 + + self._max_orders = max_orders + + @property + def take_profit_ratio(self): + """Gets the take_profit_ratio of this ContractMartingaleCreateParams. # noqa: E501 + + + :return: The take_profit_ratio of this ContractMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._take_profit_ratio + + @take_profit_ratio.setter + def take_profit_ratio(self, take_profit_ratio): + """Sets the take_profit_ratio of this ContractMartingaleCreateParams. + + + :param take_profit_ratio: The take_profit_ratio of this ContractMartingaleCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and take_profit_ratio is None: # noqa: E501 + raise ValueError("Invalid value for `take_profit_ratio`, must not be `None`") # noqa: E501 + + self._take_profit_ratio = take_profit_ratio + + @property + def direction(self): + """Gets the direction of this ContractMartingaleCreateParams. # noqa: E501 + + + :return: The direction of this ContractMartingaleCreateParams. # noqa: E501 + :rtype: ContractMartingaleDirection + """ + return self._direction + + @direction.setter + def direction(self, direction): + """Sets the direction of this ContractMartingaleCreateParams. + + + :param direction: The direction of this ContractMartingaleCreateParams. # noqa: E501 + :type: ContractMartingaleDirection + """ + if self.local_vars_configuration.client_side_validation and direction is None: # noqa: E501 + raise ValueError("Invalid value for `direction`, must not be `None`") # noqa: E501 + + self._direction = direction + + @property + def leverage(self): + """Gets the leverage of this ContractMartingaleCreateParams. # noqa: E501 + + + :return: The leverage of this ContractMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this ContractMartingaleCreateParams. + + + :param leverage: The leverage of this ContractMartingaleCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and leverage is None: # noqa: E501 + raise ValueError("Invalid value for `leverage`, must not be `None`") # noqa: E501 + + self._leverage = leverage + + @property + def stop_loss_price(self): + """Gets the stop_loss_price of this ContractMartingaleCreateParams. # noqa: E501 + + Legacy field name. The AIHub `contract_martingale` creation path does not map this field today; follow contract martingale rules from the underlying API. MCP tooling must match bot-service behavior. # noqa: E501 + + :return: The stop_loss_price of this ContractMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._stop_loss_price + + @stop_loss_price.setter + def stop_loss_price(self, stop_loss_price): + """Sets the stop_loss_price of this ContractMartingaleCreateParams. + + Legacy field name. The AIHub `contract_martingale` creation path does not map this field today; follow contract martingale rules from the underlying API. MCP tooling must match bot-service behavior. # noqa: E501 + + :param stop_loss_price: The stop_loss_price of this ContractMartingaleCreateParams. # noqa: E501 + :type: str + """ + + self._stop_loss_price = stop_loss_price + + @property + def profit_sharing_ratio(self): + """Gets the profit_sharing_ratio of this ContractMartingaleCreateParams. # noqa: E501 + + + :return: The profit_sharing_ratio of this ContractMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._profit_sharing_ratio + + @profit_sharing_ratio.setter + def profit_sharing_ratio(self, profit_sharing_ratio): + """Sets the profit_sharing_ratio of this ContractMartingaleCreateParams. + + + :param profit_sharing_ratio: The profit_sharing_ratio of this ContractMartingaleCreateParams. # noqa: E501 + :type: str + """ + + self._profit_sharing_ratio = profit_sharing_ratio + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ContractMartingaleCreateParams): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ContractMartingaleCreateParams): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/contract_martingale_create_request.py b/gate_api/models/contract_martingale_create_request.py new file mode 100644 index 00000000..2a7ed095 --- /dev/null +++ b/gate_api/models/contract_martingale_create_request.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ContractMartingaleCreateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_type': 'str', + 'market': 'str', + 'create_params': 'ContractMartingaleCreateParams' + } + + attribute_map = { + 'strategy_type': 'strategy_type', + 'market': 'market', + 'create_params': 'create_params' + } + + def __init__(self, strategy_type=None, market=None, create_params=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, ContractMartingaleCreateParams, Configuration) -> None + """ContractMartingaleCreateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_type = None + self._market = None + self._create_params = None + self.discriminator = None + + self.strategy_type = strategy_type + self.market = market + self.create_params = create_params + + @property + def strategy_type(self): + """Gets the strategy_type of this ContractMartingaleCreateRequest. # noqa: E501 + + + :return: The strategy_type of this ContractMartingaleCreateRequest. # noqa: E501 + :rtype: str + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this ContractMartingaleCreateRequest. + + + :param strategy_type: The strategy_type of this ContractMartingaleCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + allowed_values = ["contract_martingale"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and strategy_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `strategy_type` ({0}), must be one of {1}" # noqa: E501 + .format(strategy_type, allowed_values) + ) + + self._strategy_type = strategy_type + + @property + def market(self): + """Gets the market of this ContractMartingaleCreateRequest. # noqa: E501 + + + :return: The market of this ContractMartingaleCreateRequest. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this ContractMartingaleCreateRequest. + + + :param market: The market of this ContractMartingaleCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def create_params(self): + """Gets the create_params of this ContractMartingaleCreateRequest. # noqa: E501 + + + :return: The create_params of this ContractMartingaleCreateRequest. # noqa: E501 + :rtype: ContractMartingaleCreateParams + """ + return self._create_params + + @create_params.setter + def create_params(self, create_params): + """Sets the create_params of this ContractMartingaleCreateRequest. + + + :param create_params: The create_params of this ContractMartingaleCreateRequest. # noqa: E501 + :type: ContractMartingaleCreateParams + """ + if self.local_vars_configuration.client_side_validation and create_params is None: # noqa: E501 + raise ValueError("Invalid value for `create_params`, must not be `None`") # noqa: E501 + + self._create_params = create_params + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ContractMartingaleCreateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ContractMartingaleCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/contract_martingale_direction.py b/gate_api/models/contract_martingale_direction.py new file mode 100644 index 00000000..7dcc56e8 --- /dev/null +++ b/gate_api/models/contract_martingale_direction.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ContractMartingaleDirection(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + BUY = "buy" + SELL = "sell" + + allowable_values = [BUY, SELL] # noqa: E501 + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self, local_vars_configuration=None): # noqa: E501 + # type: (Configuration) -> None + """ContractMartingaleDirection - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ContractMartingaleDirection): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ContractMartingaleDirection): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/contract_stat.py b/gate_api/models/contract_stat.py index 11d37d04..5c5a0164 100644 --- a/gate_api/models/contract_stat.py +++ b/gate_api/models/contract_stat.py @@ -39,14 +39,24 @@ class ContractStat(object): 'long_liq_size': 'str', 'long_liq_amount': 'float', 'long_liq_usd': 'float', + 'long_liq_usd_new': 'float', 'short_liq_size': 'str', 'short_liq_amount': 'float', 'short_liq_usd': 'float', + 'short_liq_usd_new': 'float', 'open_interest': 'str', 'open_interest_usd': 'float', 'top_lsr_account': 'float', 'top_lsr_size': 'str', - 'mark_price': 'float' + 'mark_price': 'float', + 'top_long_size': 'str', + 'top_short_size': 'str', + 'long_taker_size': 'str', + 'short_taker_size': 'str', + 'top_long_account': 'int', + 'top_short_account': 'int', + 'long_users': 'int', + 'short_users': 'int' } attribute_map = { @@ -56,18 +66,28 @@ class ContractStat(object): 'long_liq_size': 'long_liq_size', 'long_liq_amount': 'long_liq_amount', 'long_liq_usd': 'long_liq_usd', + 'long_liq_usd_new': 'long_liq_usd_new', 'short_liq_size': 'short_liq_size', 'short_liq_amount': 'short_liq_amount', 'short_liq_usd': 'short_liq_usd', + 'short_liq_usd_new': 'short_liq_usd_new', 'open_interest': 'open_interest', 'open_interest_usd': 'open_interest_usd', 'top_lsr_account': 'top_lsr_account', 'top_lsr_size': 'top_lsr_size', - 'mark_price': 'mark_price' + 'mark_price': 'mark_price', + 'top_long_size': 'top_long_size', + 'top_short_size': 'top_short_size', + 'long_taker_size': 'long_taker_size', + 'short_taker_size': 'short_taker_size', + 'top_long_account': 'top_long_account', + 'top_short_account': 'top_short_account', + 'long_users': 'long_users', + 'short_users': 'short_users' } - def __init__(self, time=None, lsr_taker=None, lsr_account=None, long_liq_size=None, long_liq_amount=None, long_liq_usd=None, short_liq_size=None, short_liq_amount=None, short_liq_usd=None, open_interest=None, open_interest_usd=None, top_lsr_account=None, top_lsr_size=None, mark_price=None, local_vars_configuration=None): # noqa: E501 - # type: (int, float, float, str, float, float, str, float, float, str, float, float, str, float, Configuration) -> None + def __init__(self, time=None, lsr_taker=None, lsr_account=None, long_liq_size=None, long_liq_amount=None, long_liq_usd=None, long_liq_usd_new=None, short_liq_size=None, short_liq_amount=None, short_liq_usd=None, short_liq_usd_new=None, open_interest=None, open_interest_usd=None, top_lsr_account=None, top_lsr_size=None, mark_price=None, top_long_size=None, top_short_size=None, long_taker_size=None, short_taker_size=None, top_long_account=None, top_short_account=None, long_users=None, short_users=None, local_vars_configuration=None): # noqa: E501 + # type: (int, float, float, str, float, float, float, str, float, float, float, str, float, float, str, float, str, str, str, str, int, int, int, int, Configuration) -> None """ContractStat - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -79,14 +99,24 @@ def __init__(self, time=None, lsr_taker=None, lsr_account=None, long_liq_size=No self._long_liq_size = None self._long_liq_amount = None self._long_liq_usd = None + self._long_liq_usd_new = None self._short_liq_size = None self._short_liq_amount = None self._short_liq_usd = None + self._short_liq_usd_new = None self._open_interest = None self._open_interest_usd = None self._top_lsr_account = None self._top_lsr_size = None self._mark_price = None + self._top_long_size = None + self._top_short_size = None + self._long_taker_size = None + self._short_taker_size = None + self._top_long_account = None + self._top_short_account = None + self._long_users = None + self._short_users = None self.discriminator = None if time is not None: @@ -101,12 +131,16 @@ def __init__(self, time=None, lsr_taker=None, lsr_account=None, long_liq_size=No self.long_liq_amount = long_liq_amount if long_liq_usd is not None: self.long_liq_usd = long_liq_usd + if long_liq_usd_new is not None: + self.long_liq_usd_new = long_liq_usd_new if short_liq_size is not None: self.short_liq_size = short_liq_size if short_liq_amount is not None: self.short_liq_amount = short_liq_amount if short_liq_usd is not None: self.short_liq_usd = short_liq_usd + if short_liq_usd_new is not None: + self.short_liq_usd_new = short_liq_usd_new if open_interest is not None: self.open_interest = open_interest if open_interest_usd is not None: @@ -117,6 +151,22 @@ def __init__(self, time=None, lsr_taker=None, lsr_account=None, long_liq_size=No self.top_lsr_size = top_lsr_size if mark_price is not None: self.mark_price = mark_price + if top_long_size is not None: + self.top_long_size = top_long_size + if top_short_size is not None: + self.top_short_size = top_short_size + if long_taker_size is not None: + self.long_taker_size = long_taker_size + if short_taker_size is not None: + self.short_taker_size = short_taker_size + if top_long_account is not None: + self.top_long_account = top_long_account + if top_short_account is not None: + self.top_short_account = top_short_account + if long_users is not None: + self.long_users = long_users + if short_users is not None: + self.short_users = short_users @property def time(self): @@ -256,6 +306,29 @@ def long_liq_usd(self, long_liq_usd): self._long_liq_usd = long_liq_usd + @property + def long_liq_usd_new(self): + """Gets the long_liq_usd_new of this ContractStat. # noqa: E501 + + Long liquidations in quote currency; USDT settlement: long_liq_size × multiplier × mark price # noqa: E501 + + :return: The long_liq_usd_new of this ContractStat. # noqa: E501 + :rtype: float + """ + return self._long_liq_usd_new + + @long_liq_usd_new.setter + def long_liq_usd_new(self, long_liq_usd_new): + """Sets the long_liq_usd_new of this ContractStat. + + Long liquidations in quote currency; USDT settlement: long_liq_size × multiplier × mark price # noqa: E501 + + :param long_liq_usd_new: The long_liq_usd_new of this ContractStat. # noqa: E501 + :type: float + """ + + self._long_liq_usd_new = long_liq_usd_new + @property def short_liq_size(self): """Gets the short_liq_size of this ContractStat. # noqa: E501 @@ -325,6 +398,29 @@ def short_liq_usd(self, short_liq_usd): self._short_liq_usd = short_liq_usd + @property + def short_liq_usd_new(self): + """Gets the short_liq_usd_new of this ContractStat. # noqa: E501 + + Short liquidations in quote currency; USDT settlement: short_liq_size × multiplier × mark price # noqa: E501 + + :return: The short_liq_usd_new of this ContractStat. # noqa: E501 + :rtype: float + """ + return self._short_liq_usd_new + + @short_liq_usd_new.setter + def short_liq_usd_new(self, short_liq_usd_new): + """Sets the short_liq_usd_new of this ContractStat. + + Short liquidations in quote currency; USDT settlement: short_liq_size × multiplier × mark price # noqa: E501 + + :param short_liq_usd_new: The short_liq_usd_new of this ContractStat. # noqa: E501 + :type: float + """ + + self._short_liq_usd_new = short_liq_usd_new + @property def open_interest(self): """Gets the open_interest of this ContractStat. # noqa: E501 @@ -440,6 +536,190 @@ def mark_price(self, mark_price): self._mark_price = mark_price + @property + def top_long_size(self): + """Gets the top_long_size of this ContractStat. # noqa: E501 + + Top long open interest (contracts) # noqa: E501 + + :return: The top_long_size of this ContractStat. # noqa: E501 + :rtype: str + """ + return self._top_long_size + + @top_long_size.setter + def top_long_size(self, top_long_size): + """Sets the top_long_size of this ContractStat. + + Top long open interest (contracts) # noqa: E501 + + :param top_long_size: The top_long_size of this ContractStat. # noqa: E501 + :type: str + """ + + self._top_long_size = top_long_size + + @property + def top_short_size(self): + """Gets the top_short_size of this ContractStat. # noqa: E501 + + Top short open interest (contracts) # noqa: E501 + + :return: The top_short_size of this ContractStat. # noqa: E501 + :rtype: str + """ + return self._top_short_size + + @top_short_size.setter + def top_short_size(self, top_short_size): + """Sets the top_short_size of this ContractStat. + + Top short open interest (contracts) # noqa: E501 + + :param top_short_size: The top_short_size of this ContractStat. # noqa: E501 + :type: str + """ + + self._top_short_size = top_short_size + + @property + def long_taker_size(self): + """Gets the long_taker_size of this ContractStat. # noqa: E501 + + Long taker trade volume (contracts) # noqa: E501 + + :return: The long_taker_size of this ContractStat. # noqa: E501 + :rtype: str + """ + return self._long_taker_size + + @long_taker_size.setter + def long_taker_size(self, long_taker_size): + """Sets the long_taker_size of this ContractStat. + + Long taker trade volume (contracts) # noqa: E501 + + :param long_taker_size: The long_taker_size of this ContractStat. # noqa: E501 + :type: str + """ + + self._long_taker_size = long_taker_size + + @property + def short_taker_size(self): + """Gets the short_taker_size of this ContractStat. # noqa: E501 + + Short taker trade volume (contracts) # noqa: E501 + + :return: The short_taker_size of this ContractStat. # noqa: E501 + :rtype: str + """ + return self._short_taker_size + + @short_taker_size.setter + def short_taker_size(self, short_taker_size): + """Sets the short_taker_size of this ContractStat. + + Short taker trade volume (contracts) # noqa: E501 + + :param short_taker_size: The short_taker_size of this ContractStat. # noqa: E501 + :type: str + """ + + self._short_taker_size = short_taker_size + + @property + def top_long_account(self): + """Gets the top_long_account of this ContractStat. # noqa: E501 + + Number of top long accounts (large holders) # noqa: E501 + + :return: The top_long_account of this ContractStat. # noqa: E501 + :rtype: int + """ + return self._top_long_account + + @top_long_account.setter + def top_long_account(self, top_long_account): + """Sets the top_long_account of this ContractStat. + + Number of top long accounts (large holders) # noqa: E501 + + :param top_long_account: The top_long_account of this ContractStat. # noqa: E501 + :type: int + """ + + self._top_long_account = top_long_account + + @property + def top_short_account(self): + """Gets the top_short_account of this ContractStat. # noqa: E501 + + Number of top short accounts (large holders) # noqa: E501 + + :return: The top_short_account of this ContractStat. # noqa: E501 + :rtype: int + """ + return self._top_short_account + + @top_short_account.setter + def top_short_account(self, top_short_account): + """Sets the top_short_account of this ContractStat. + + Number of top short accounts (large holders) # noqa: E501 + + :param top_short_account: The top_short_account of this ContractStat. # noqa: E501 + :type: int + """ + + self._top_short_account = top_short_account + + @property + def long_users(self): + """Gets the long_users of this ContractStat. # noqa: E501 + + Number of users holding long positions # noqa: E501 + + :return: The long_users of this ContractStat. # noqa: E501 + :rtype: int + """ + return self._long_users + + @long_users.setter + def long_users(self, long_users): + """Sets the long_users of this ContractStat. + + Number of users holding long positions # noqa: E501 + + :param long_users: The long_users of this ContractStat. # noqa: E501 + :type: int + """ + + self._long_users = long_users + + @property + def short_users(self): + """Gets the short_users of this ContractStat. # noqa: E501 + + Number of users holding short positions # noqa: E501 + + :return: The short_users of this ContractStat. # noqa: E501 + :rtype: int + """ + return self._short_users + + @short_users.setter + def short_users(self, short_users): + """Sets the short_users of this ContractStat. + + Number of users holding short positions # noqa: E501 + + :param short_users: The short_users of this ContractStat. # noqa: E501 + :type: int + """ + + self._short_users = short_users + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/convert_currencies_v2_item.py b/gate_api/models/convert_currencies_v2_item.py new file mode 100644 index 00000000..117f454f --- /dev/null +++ b/gate_api/models/convert_currencies_v2_item.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ConvertCurrenciesV2Item(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'icon_url': 'str', + 'name': 'str', + 'priority': 'int' + } + + attribute_map = { + 'icon_url': 'icon_url', + 'name': 'name', + 'priority': 'priority' + } + + def __init__(self, icon_url=None, name=None, priority=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, Configuration) -> None + """ConvertCurrenciesV2Item - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._icon_url = None + self._name = None + self._priority = None + self.discriminator = None + + if icon_url is not None: + self.icon_url = icon_url + self.name = name + self.priority = priority + + @property + def icon_url(self): + """Gets the icon_url of this ConvertCurrenciesV2Item. # noqa: E501 + + + :return: The icon_url of this ConvertCurrenciesV2Item. # noqa: E501 + :rtype: str + """ + return self._icon_url + + @icon_url.setter + def icon_url(self, icon_url): + """Sets the icon_url of this ConvertCurrenciesV2Item. + + + :param icon_url: The icon_url of this ConvertCurrenciesV2Item. # noqa: E501 + :type: str + """ + + self._icon_url = icon_url + + @property + def name(self): + """Gets the name of this ConvertCurrenciesV2Item. # noqa: E501 + + + :return: The name of this ConvertCurrenciesV2Item. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConvertCurrenciesV2Item. + + + :param name: The name of this ConvertCurrenciesV2Item. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def priority(self): + """Gets the priority of this ConvertCurrenciesV2Item. # noqa: E501 + + + :return: The priority of this ConvertCurrenciesV2Item. # noqa: E501 + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this ConvertCurrenciesV2Item. + + + :param priority: The priority of this ConvertCurrenciesV2Item. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and priority is None: # noqa: E501 + raise ValueError("Invalid value for `priority`, must not be `None`") # noqa: E501 + + self._priority = priority + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConvertCurrenciesV2Item): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ConvertCurrenciesV2Item): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_chase_order_req.py b/gate_api/models/create_chase_order_req.py new file mode 100644 index 00000000..ead8008a --- /dev/null +++ b/gate_api/models/create_chase_order_req.py @@ -0,0 +1,462 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateChaseOrderReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'contract': 'str', + 'settle': 'str', + 'amount': 'str', + 'price_limit': 'str', + 'offset_limit': 'str', + 'reduce_only': 'bool', + 'text': 'str', + 'is_dual_mode': 'bool', + 'price_type': 'int', + 'price_gap_type': 'int', + 'price_gap_value': 'str', + 'pos_margin_mode': 'str', + 'position_mode': 'str' + } + + attribute_map = { + 'contract': 'contract', + 'settle': 'settle', + 'amount': 'amount', + 'price_limit': 'price_limit', + 'offset_limit': 'offset_limit', + 'reduce_only': 'reduce_only', + 'text': 'text', + 'is_dual_mode': 'is_dual_mode', + 'price_type': 'price_type', + 'price_gap_type': 'price_gap_type', + 'price_gap_value': 'price_gap_value', + 'pos_margin_mode': 'pos_margin_mode', + 'position_mode': 'position_mode' + } + + def __init__(self, contract=None, settle=None, amount=None, price_limit=None, offset_limit=None, reduce_only=None, text=None, is_dual_mode=None, price_type=None, price_gap_type=None, price_gap_value=None, pos_margin_mode=None, position_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, bool, str, bool, int, int, str, str, str, Configuration) -> None + """CreateChaseOrderReq - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._contract = None + self._settle = None + self._amount = None + self._price_limit = None + self._offset_limit = None + self._reduce_only = None + self._text = None + self._is_dual_mode = None + self._price_type = None + self._price_gap_type = None + self._price_gap_value = None + self._pos_margin_mode = None + self._position_mode = None + self.discriminator = None + + self.contract = contract + if settle is not None: + self.settle = settle + self.amount = amount + self.price_limit = price_limit + if offset_limit is not None: + self.offset_limit = offset_limit + if reduce_only is not None: + self.reduce_only = reduce_only + if text is not None: + self.text = text + if is_dual_mode is not None: + self.is_dual_mode = is_dual_mode + if price_type is not None: + self.price_type = price_type + if price_gap_type is not None: + self.price_gap_type = price_gap_type + if price_gap_value is not None: + self.price_gap_value = price_gap_value + if pos_margin_mode is not None: + self.pos_margin_mode = pos_margin_mode + if position_mode is not None: + self.position_mode = position_mode + + @property + def contract(self): + """Gets the contract of this CreateChaseOrderReq. # noqa: E501 + + Contract name; server-side converted to uppercase # noqa: E501 + + :return: The contract of this CreateChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this CreateChaseOrderReq. + + Contract name; server-side converted to uppercase # noqa: E501 + + :param contract: The contract of this CreateChaseOrderReq. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and contract is None: # noqa: E501 + raise ValueError("Invalid value for `contract`, must not be `None`") # noqa: E501 + + self._contract = contract + + @property + def settle(self): + """Gets the settle of this CreateChaseOrderReq. # noqa: E501 + + Settle currency, overridden by the path parameter and converted to lowercase # noqa: E501 + + :return: The settle of this CreateChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._settle + + @settle.setter + def settle(self, settle): + """Sets the settle of this CreateChaseOrderReq. + + Settle currency, overridden by the path parameter and converted to lowercase # noqa: E501 + + :param settle: The settle of this CreateChaseOrderReq. # noqa: E501 + :type: str + """ + + self._settle = settle + + @property + def amount(self): + """Gets the amount of this CreateChaseOrderReq. # noqa: E501 + + Total order size in contracts, decimal string. Positive for buy, negative for sell. Cannot be 0 # noqa: E501 + + :return: The amount of this CreateChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this CreateChaseOrderReq. + + Total order size in contracts, decimal string. Positive for buy, negative for sell. Cannot be 0 # noqa: E501 + + :param amount: The amount of this CreateChaseOrderReq. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def price_limit(self): + """Gets the price_limit of this CreateChaseOrderReq. # noqa: E501 + + 最高追逐价,合法十进制字符串;未设置限价时请传 \"0\" # noqa: E501 + + :return: The price_limit of this CreateChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._price_limit + + @price_limit.setter + def price_limit(self, price_limit): + """Sets the price_limit of this CreateChaseOrderReq. + + 最高追逐价,合法十进制字符串;未设置限价时请传 \"0\" # noqa: E501 + + :param price_limit: The price_limit of this CreateChaseOrderReq. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price_limit is None: # noqa: E501 + raise ValueError("Invalid value for `price_limit`, must not be `None`") # noqa: E501 + + self._price_limit = price_limit + + @property + def offset_limit(self): + """Gets the offset_limit of this CreateChaseOrderReq. # noqa: E501 + + Maximum chasing distance from the best price, mutually exclusive with price_limit # noqa: E501 + + :return: The offset_limit of this CreateChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._offset_limit + + @offset_limit.setter + def offset_limit(self, offset_limit): + """Sets the offset_limit of this CreateChaseOrderReq. + + Maximum chasing distance from the best price, mutually exclusive with price_limit # noqa: E501 + + :param offset_limit: The offset_limit of this CreateChaseOrderReq. # noqa: E501 + :type: str + """ + + self._offset_limit = offset_limit + + @property + def reduce_only(self): + """Gets the reduce_only of this CreateChaseOrderReq. # noqa: E501 + + Whether reduce only # noqa: E501 + + :return: The reduce_only of this CreateChaseOrderReq. # noqa: E501 + :rtype: bool + """ + return self._reduce_only + + @reduce_only.setter + def reduce_only(self, reduce_only): + """Sets the reduce_only of this CreateChaseOrderReq. + + Whether reduce only # noqa: E501 + + :param reduce_only: The reduce_only of this CreateChaseOrderReq. # noqa: E501 + :type: bool + """ + + self._reduce_only = reduce_only + + @property + def text(self): + """Gets the text of this CreateChaseOrderReq. # noqa: E501 + + Optional custom tag # noqa: E501 + + :return: The text of this CreateChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CreateChaseOrderReq. + + Optional custom tag # noqa: E501 + + :param text: The text of this CreateChaseOrderReq. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def is_dual_mode(self): + """Gets the is_dual_mode of this CreateChaseOrderReq. # noqa: E501 + + Whether dual-position mode is enabled # noqa: E501 + + :return: The is_dual_mode of this CreateChaseOrderReq. # noqa: E501 + :rtype: bool + """ + return self._is_dual_mode + + @is_dual_mode.setter + def is_dual_mode(self, is_dual_mode): + """Sets the is_dual_mode of this CreateChaseOrderReq. + + Whether dual-position mode is enabled # noqa: E501 + + :param is_dual_mode: The is_dual_mode of this CreateChaseOrderReq. # noqa: E501 + :type: bool + """ + + self._is_dual_mode = is_dual_mode + + @property + def price_type(self): + """Gets the price_type of this CreateChaseOrderReq. # noqa: E501 + + Price type: 1 best bid/ask, 2 distance from best bid/ask # noqa: E501 + + :return: The price_type of this CreateChaseOrderReq. # noqa: E501 + :rtype: int + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this CreateChaseOrderReq. + + Price type: 1 best bid/ask, 2 distance from best bid/ask # noqa: E501 + + :param price_type: The price_type of this CreateChaseOrderReq. # noqa: E501 + :type: int + """ + + self._price_type = price_type + + @property + def price_gap_type(self): + """Gets the price_gap_type of this CreateChaseOrderReq. # noqa: E501 + + Used when price_type == 2: 1 absolute price gap, 2 percentage # noqa: E501 + + :return: The price_gap_type of this CreateChaseOrderReq. # noqa: E501 + :rtype: int + """ + return self._price_gap_type + + @price_gap_type.setter + def price_gap_type(self, price_gap_type): + """Sets the price_gap_type of this CreateChaseOrderReq. + + Used when price_type == 2: 1 absolute price gap, 2 percentage # noqa: E501 + + :param price_gap_type: The price_gap_type of this CreateChaseOrderReq. # noqa: E501 + :type: int + """ + + self._price_gap_type = price_gap_type + + @property + def price_gap_value(self): + """Gets the price_gap_value of this CreateChaseOrderReq. # noqa: E501 + + Price gap value paired with price_gap_type # noqa: E501 + + :return: The price_gap_value of this CreateChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._price_gap_value + + @price_gap_value.setter + def price_gap_value(self, price_gap_value): + """Sets the price_gap_value of this CreateChaseOrderReq. + + Price gap value paired with price_gap_type # noqa: E501 + + :param price_gap_value: The price_gap_value of this CreateChaseOrderReq. # noqa: E501 + :type: str + """ + + self._price_gap_value = price_gap_value + + @property + def pos_margin_mode(self): + """Gets the pos_margin_mode of this CreateChaseOrderReq. # noqa: E501 + + Position margin mode, e.g. isolated or cross # noqa: E501 + + :return: The pos_margin_mode of this CreateChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._pos_margin_mode + + @pos_margin_mode.setter + def pos_margin_mode(self, pos_margin_mode): + """Sets the pos_margin_mode of this CreateChaseOrderReq. + + Position margin mode, e.g. isolated or cross # noqa: E501 + + :param pos_margin_mode: The pos_margin_mode of this CreateChaseOrderReq. # noqa: E501 + :type: str + """ + + self._pos_margin_mode = pos_margin_mode + + @property + def position_mode(self): + """Gets the position_mode of this CreateChaseOrderReq. # noqa: E501 + + Position mode (e.g. single, dual, dual_plus) # noqa: E501 + + :return: The position_mode of this CreateChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._position_mode + + @position_mode.setter + def position_mode(self, position_mode): + """Sets the position_mode of this CreateChaseOrderReq. + + Position mode (e.g. single, dual, dual_plus) # noqa: E501 + + :param position_mode: The position_mode of this CreateChaseOrderReq. # noqa: E501 + :type: str + """ + + self._position_mode = position_mode + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateChaseOrderReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateChaseOrderReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_chase_order_resp.py b/gate_api/models/create_chase_order_resp.py new file mode 100644 index 00000000..c3079a2b --- /dev/null +++ b/gate_api/models/create_chase_order_resp.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateChaseOrderResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str' + } + + attribute_map = { + 'id': 'id' + } + + def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """CreateChaseOrderResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self.discriminator = None + + if id is not None: + self.id = id + + @property + def id(self): + """Gets the id of this CreateChaseOrderResp. # noqa: E501 + + ID of the newly created order # noqa: E501 + + :return: The id of this CreateChaseOrderResp. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CreateChaseOrderResp. + + ID of the newly created order # noqa: E501 + + :param id: The id of this CreateChaseOrderResp. # noqa: E501 + :type: str + """ + + self._id = id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateChaseOrderResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateChaseOrderResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_collateral_order.py b/gate_api/models/create_collateral_order.py deleted file mode 100644 index f5705868..00000000 --- a/gate_api/models/create_collateral_order.py +++ /dev/null @@ -1,211 +0,0 @@ -# coding: utf-8 - -""" - Gate API - - Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - - Contact: support@mail.gate.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class CreateCollateralOrder(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'collateral_amount': 'str', - 'collateral_currency': 'str', - 'borrow_amount': 'str', - 'borrow_currency': 'str' - } - - attribute_map = { - 'collateral_amount': 'collateral_amount', - 'collateral_currency': 'collateral_currency', - 'borrow_amount': 'borrow_amount', - 'borrow_currency': 'borrow_currency' - } - - def __init__(self, collateral_amount=None, collateral_currency=None, borrow_amount=None, borrow_currency=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, Configuration) -> None - """CreateCollateralOrder - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._collateral_amount = None - self._collateral_currency = None - self._borrow_amount = None - self._borrow_currency = None - self.discriminator = None - - self.collateral_amount = collateral_amount - self.collateral_currency = collateral_currency - self.borrow_amount = borrow_amount - self.borrow_currency = borrow_currency - - @property - def collateral_amount(self): - """Gets the collateral_amount of this CreateCollateralOrder. # noqa: E501 - - Collateral amount # noqa: E501 - - :return: The collateral_amount of this CreateCollateralOrder. # noqa: E501 - :rtype: str - """ - return self._collateral_amount - - @collateral_amount.setter - def collateral_amount(self, collateral_amount): - """Sets the collateral_amount of this CreateCollateralOrder. - - Collateral amount # noqa: E501 - - :param collateral_amount: The collateral_amount of this CreateCollateralOrder. # noqa: E501 - :type: str - """ - if self.local_vars_configuration.client_side_validation and collateral_amount is None: # noqa: E501 - raise ValueError("Invalid value for `collateral_amount`, must not be `None`") # noqa: E501 - - self._collateral_amount = collateral_amount - - @property - def collateral_currency(self): - """Gets the collateral_currency of this CreateCollateralOrder. # noqa: E501 - - Collateral currency # noqa: E501 - - :return: The collateral_currency of this CreateCollateralOrder. # noqa: E501 - :rtype: str - """ - return self._collateral_currency - - @collateral_currency.setter - def collateral_currency(self, collateral_currency): - """Sets the collateral_currency of this CreateCollateralOrder. - - Collateral currency # noqa: E501 - - :param collateral_currency: The collateral_currency of this CreateCollateralOrder. # noqa: E501 - :type: str - """ - if self.local_vars_configuration.client_side_validation and collateral_currency is None: # noqa: E501 - raise ValueError("Invalid value for `collateral_currency`, must not be `None`") # noqa: E501 - - self._collateral_currency = collateral_currency - - @property - def borrow_amount(self): - """Gets the borrow_amount of this CreateCollateralOrder. # noqa: E501 - - Borrowed amount # noqa: E501 - - :return: The borrow_amount of this CreateCollateralOrder. # noqa: E501 - :rtype: str - """ - return self._borrow_amount - - @borrow_amount.setter - def borrow_amount(self, borrow_amount): - """Sets the borrow_amount of this CreateCollateralOrder. - - Borrowed amount # noqa: E501 - - :param borrow_amount: The borrow_amount of this CreateCollateralOrder. # noqa: E501 - :type: str - """ - if self.local_vars_configuration.client_side_validation and borrow_amount is None: # noqa: E501 - raise ValueError("Invalid value for `borrow_amount`, must not be `None`") # noqa: E501 - - self._borrow_amount = borrow_amount - - @property - def borrow_currency(self): - """Gets the borrow_currency of this CreateCollateralOrder. # noqa: E501 - - Borrowed currency # noqa: E501 - - :return: The borrow_currency of this CreateCollateralOrder. # noqa: E501 - :rtype: str - """ - return self._borrow_currency - - @borrow_currency.setter - def borrow_currency(self, borrow_currency): - """Sets the borrow_currency of this CreateCollateralOrder. - - Borrowed currency # noqa: E501 - - :param borrow_currency: The borrow_currency of this CreateCollateralOrder. # noqa: E501 - :type: str - """ - if self.local_vars_configuration.client_side_validation and borrow_currency is None: # noqa: E501 - raise ValueError("Invalid value for `borrow_currency`, must not be `None`") # noqa: E501 - - self._borrow_currency = borrow_currency - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CreateCollateralOrder): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CreateCollateralOrder): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_earn_fixed_term_lend_response.py b/gate_api/models/create_earn_fixed_term_lend_response.py new file mode 100644 index 00000000..c50286ef --- /dev/null +++ b/gate_api/models/create_earn_fixed_term_lend_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateEarnFixedTermLendResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'CreateEarnFixedTermLendResponseData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, CreateEarnFixedTermLendResponseData, int, Configuration) -> None + """CreateEarnFixedTermLendResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this CreateEarnFixedTermLendResponse. # noqa: E501 + + Return code, 0 means success # noqa: E501 + + :return: The code of this CreateEarnFixedTermLendResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this CreateEarnFixedTermLendResponse. + + Return code, 0 means success # noqa: E501 + + :param code: The code of this CreateEarnFixedTermLendResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this CreateEarnFixedTermLendResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this CreateEarnFixedTermLendResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this CreateEarnFixedTermLendResponse. + + Response message # noqa: E501 + + :param message: The message of this CreateEarnFixedTermLendResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this CreateEarnFixedTermLendResponse. # noqa: E501 + + + :return: The data of this CreateEarnFixedTermLendResponse. # noqa: E501 + :rtype: CreateEarnFixedTermLendResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this CreateEarnFixedTermLendResponse. + + + :param data: The data of this CreateEarnFixedTermLendResponse. # noqa: E501 + :type: CreateEarnFixedTermLendResponseData + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this CreateEarnFixedTermLendResponse. # noqa: E501 + + Response timestamp (in seconds) # noqa: E501 + + :return: The timestamp of this CreateEarnFixedTermLendResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this CreateEarnFixedTermLendResponse. + + Response timestamp (in seconds) # noqa: E501 + + :param timestamp: The timestamp of this CreateEarnFixedTermLendResponse. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateEarnFixedTermLendResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateEarnFixedTermLendResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_earn_fixed_term_lend_response_data.py b/gate_api/models/create_earn_fixed_term_lend_response_data.py new file mode 100644 index 00000000..416e9db3 --- /dev/null +++ b/gate_api/models/create_earn_fixed_term_lend_response_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateEarnFixedTermLendResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'int' + } + + attribute_map = { + 'order_id': 'order_id' + } + + def __init__(self, order_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """CreateEarnFixedTermLendResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + + @property + def order_id(self): + """Gets the order_id of this CreateEarnFixedTermLendResponseData. # noqa: E501 + + Subscription order ID # noqa: E501 + + :return: The order_id of this CreateEarnFixedTermLendResponseData. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this CreateEarnFixedTermLendResponseData. + + Subscription order ID # noqa: E501 + + :param order_id: The order_id of this CreateEarnFixedTermLendResponseData. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateEarnFixedTermLendResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateEarnFixedTermLendResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_earn_fixed_term_pre_redeem_response.py b/gate_api/models/create_earn_fixed_term_pre_redeem_response.py new file mode 100644 index 00000000..c73a6280 --- /dev/null +++ b/gate_api/models/create_earn_fixed_term_pre_redeem_response.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateEarnFixedTermPreRedeemResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, object, int, Configuration) -> None + """CreateEarnFixedTermPreRedeemResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + + Return code, 0 means success # noqa: E501 + + :return: The code of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this CreateEarnFixedTermPreRedeemResponse. + + Return code, 0 means success # noqa: E501 + + :param code: The code of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this CreateEarnFixedTermPreRedeemResponse. + + Response message # noqa: E501 + + :param message: The message of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + + Redemption result (empty object on success) # noqa: E501 + + :return: The data of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this CreateEarnFixedTermPreRedeemResponse. + + Redemption result (empty object on success) # noqa: E501 + + :param data: The data of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + + Response timestamp (in seconds) # noqa: E501 + + :return: The timestamp of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this CreateEarnFixedTermPreRedeemResponse. + + Response timestamp (in seconds) # noqa: E501 + + :param timestamp: The timestamp of this CreateEarnFixedTermPreRedeemResponse. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateEarnFixedTermPreRedeemResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateEarnFixedTermPreRedeemResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_order.py b/gate_api/models/create_order.py new file mode 100644 index 00000000..b1874a15 --- /dev/null +++ b/gate_api/models/create_order.py @@ -0,0 +1,338 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'user_id': 'int', + '_from': 'list[CreateOrderDetail]', + 'to': 'list[CreateOrderDetail]', + 'source': 'str', + 'app_id': 'str', + 'client_req_id': 'str', + 'status': 'int', + 'create_time': 'int' + } + + attribute_map = { + 'id': 'id', + 'user_id': 'user_id', + '_from': 'from', + 'to': 'to', + 'source': 'source', + 'app_id': 'app_id', + 'client_req_id': 'client_req_id', + 'status': 'status', + 'create_time': 'create_time' + } + + def __init__(self, id=None, user_id=None, _from=None, to=None, source=None, app_id=None, client_req_id=None, status=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, list[CreateOrderDetail], list[CreateOrderDetail], str, str, str, int, int, Configuration) -> None + """CreateOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._user_id = None + self.__from = None + self._to = None + self._source = None + self._app_id = None + self._client_req_id = None + self._status = None + self._create_time = None + self.discriminator = None + + self.id = id + self.user_id = user_id + self._from = _from + self.to = to + self.source = source + self.app_id = app_id + self.client_req_id = client_req_id + self.status = status + self.create_time = create_time + + @property + def id(self): + """Gets the id of this CreateOrder. # noqa: E501 + + + :return: The id of this CreateOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CreateOrder. + + + :param id: The id of this CreateOrder. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def user_id(self): + """Gets the user_id of this CreateOrder. # noqa: E501 + + + :return: The user_id of this CreateOrder. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CreateOrder. + + + :param user_id: The user_id of this CreateOrder. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def _from(self): + """Gets the _from of this CreateOrder. # noqa: E501 + + + :return: The _from of this CreateOrder. # noqa: E501 + :rtype: list[CreateOrderDetail] + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this CreateOrder. + + + :param _from: The _from of this CreateOrder. # noqa: E501 + :type: list[CreateOrderDetail] + """ + if self.local_vars_configuration.client_side_validation and _from is None: # noqa: E501 + raise ValueError("Invalid value for `_from`, must not be `None`") # noqa: E501 + + self.__from = _from + + @property + def to(self): + """Gets the to of this CreateOrder. # noqa: E501 + + + :return: The to of this CreateOrder. # noqa: E501 + :rtype: list[CreateOrderDetail] + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this CreateOrder. + + + :param to: The to of this CreateOrder. # noqa: E501 + :type: list[CreateOrderDetail] + """ + if self.local_vars_configuration.client_side_validation and to is None: # noqa: E501 + raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501 + + self._to = to + + @property + def source(self): + """Gets the source of this CreateOrder. # noqa: E501 + + + :return: The source of this CreateOrder. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this CreateOrder. + + + :param source: The source of this CreateOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and source is None: # noqa: E501 + raise ValueError("Invalid value for `source`, must not be `None`") # noqa: E501 + + self._source = source + + @property + def app_id(self): + """Gets the app_id of this CreateOrder. # noqa: E501 + + + :return: The app_id of this CreateOrder. # noqa: E501 + :rtype: str + """ + return self._app_id + + @app_id.setter + def app_id(self, app_id): + """Sets the app_id of this CreateOrder. + + + :param app_id: The app_id of this CreateOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and app_id is None: # noqa: E501 + raise ValueError("Invalid value for `app_id`, must not be `None`") # noqa: E501 + + self._app_id = app_id + + @property + def client_req_id(self): + """Gets the client_req_id of this CreateOrder. # noqa: E501 + + + :return: The client_req_id of this CreateOrder. # noqa: E501 + :rtype: str + """ + return self._client_req_id + + @client_req_id.setter + def client_req_id(self, client_req_id): + """Sets the client_req_id of this CreateOrder. + + + :param client_req_id: The client_req_id of this CreateOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and client_req_id is None: # noqa: E501 + raise ValueError("Invalid value for `client_req_id`, must not be `None`") # noqa: E501 + + self._client_req_id = client_req_id + + @property + def status(self): + """Gets the status of this CreateOrder. # noqa: E501 + + + :return: The status of this CreateOrder. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this CreateOrder. + + + :param status: The status of this CreateOrder. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def create_time(self): + """Gets the create_time of this CreateOrder. # noqa: E501 + + + :return: The create_time of this CreateOrder. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CreateOrder. + + + :param create_time: The create_time of this CreateOrder. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_order2.py b/gate_api/models/create_order2.py new file mode 100644 index 00000000..8890acd0 --- /dev/null +++ b/gate_api/models/create_order2.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateOrder2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'CreateOrder2Data' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, CreateOrder2Data, Configuration) -> None + """CreateOrder2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this CreateOrder2. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this CreateOrder2. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this CreateOrder2. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this CreateOrder2. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this CreateOrder2. # noqa: E501 + + + :return: The data of this CreateOrder2. # noqa: E501 + :rtype: CreateOrder2Data + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this CreateOrder2. + + + :param data: The data of this CreateOrder2. # noqa: E501 + :type: CreateOrder2Data + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateOrder2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateOrder2): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_order2_data.py b/gate_api/models/create_order2_data.py new file mode 100644 index 00000000..91da9f23 --- /dev/null +++ b/gate_api/models/create_order2_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateOrder2Data(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str' + } + + attribute_map = { + 'id': 'id' + } + + def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """CreateOrder2Data - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self.discriminator = None + + if id is not None: + self.id = id + + @property + def id(self): + """Gets the id of this CreateOrder2Data. # noqa: E501 + + Queue Task ID (not task ID) # noqa: E501 + + :return: The id of this CreateOrder2Data. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CreateOrder2Data. + + Queue Task ID (not task ID) # noqa: E501 + + :param id: The id of this CreateOrder2Data. # noqa: E501 + :type: str + """ + + self._id = id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateOrder2Data): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateOrder2Data): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_order_detail.py b/gate_api/models/create_order_detail.py new file mode 100644 index 00000000..b79e8965 --- /dev/null +++ b/gate_api/models/create_order_detail.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateOrderDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'icon_url': 'str', + 'amount': 'str', + 'amount_show': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'icon_url': 'icon_url', + 'amount': 'amount', + 'amount_show': 'amount_show' + } + + def __init__(self, asset=None, icon_url=None, amount=None, amount_show=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """CreateOrderDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._icon_url = None + self._amount = None + self._amount_show = None + self.discriminator = None + + self.asset = asset + self.icon_url = icon_url + self.amount = amount + self.amount_show = amount_show + + @property + def asset(self): + """Gets the asset of this CreateOrderDetail. # noqa: E501 + + + :return: The asset of this CreateOrderDetail. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this CreateOrderDetail. + + + :param asset: The asset of this CreateOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def icon_url(self): + """Gets the icon_url of this CreateOrderDetail. # noqa: E501 + + + :return: The icon_url of this CreateOrderDetail. # noqa: E501 + :rtype: str + """ + return self._icon_url + + @icon_url.setter + def icon_url(self, icon_url): + """Sets the icon_url of this CreateOrderDetail. + + + :param icon_url: The icon_url of this CreateOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and icon_url is None: # noqa: E501 + raise ValueError("Invalid value for `icon_url`, must not be `None`") # noqa: E501 + + self._icon_url = icon_url + + @property + def amount(self): + """Gets the amount of this CreateOrderDetail. # noqa: E501 + + + :return: The amount of this CreateOrderDetail. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this CreateOrderDetail. + + + :param amount: The amount of this CreateOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def amount_show(self): + """Gets the amount_show of this CreateOrderDetail. # noqa: E501 + + + :return: The amount_show of this CreateOrderDetail. # noqa: E501 + :rtype: str + """ + return self._amount_show + + @amount_show.setter + def amount_show(self, amount_show): + """Sets the amount_show of this CreateOrderDetail. + + + :param amount_show: The amount_show of this CreateOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount_show is None: # noqa: E501 + raise ValueError("Invalid value for `amount_show`, must not be `None`") # noqa: E501 + + self._amount_show = amount_show + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateOrderDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateOrderDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_param.py b/gate_api/models/create_param.py new file mode 100644 index 00000000..5b3ea809 --- /dev/null +++ b/gate_api/models/create_param.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateParam(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'amount': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'amount': 'amount' + } + + def __init__(self, asset=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CreateParam - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._amount = None + self.discriminator = None + + self.asset = asset + self.amount = amount + + @property + def asset(self): + """Gets the asset of this CreateParam. # noqa: E501 + + Currency symbol, consistent with `GET /asset-swap/asset/list` and business support scope. # noqa: E501 + + :return: The asset of this CreateParam. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this CreateParam. + + Currency symbol, consistent with `GET /asset-swap/asset/list` and business support scope. # noqa: E501 + + :param asset: The asset of this CreateParam. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def amount(self): + """Gets the amount of this CreateParam. # noqa: E501 + + The quantity of this currency on this side, **decimal string** (non-scientific notation). `from` represents the selling quantity, and `to` represents the target side quantity. Different from preview interface `to[].ratio`. # noqa: E501 + + :return: The amount of this CreateParam. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this CreateParam. + + The quantity of this currency on this side, **decimal string** (non-scientific notation). `from` represents the selling quantity, and `to` represents the target side quantity. Different from preview interface `to[].ratio`. # noqa: E501 + + :param amount: The amount of this CreateParam. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateParam): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateParam): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_trail_order.py b/gate_api/models/create_trail_order.py new file mode 100644 index 00000000..0655e8f2 --- /dev/null +++ b/gate_api/models/create_trail_order.py @@ -0,0 +1,411 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateTrailOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'contract': 'str', + 'amount': 'str', + 'activation_price': 'str', + 'is_gte': 'bool', + 'price_type': 'int', + 'price_offset': 'str', + 'reduce_only': 'bool', + 'position_related': 'bool', + 'text': 'str', + 'pos_margin_mode': 'str', + 'position_mode': 'str' + } + + attribute_map = { + 'contract': 'contract', + 'amount': 'amount', + 'activation_price': 'activation_price', + 'is_gte': 'is_gte', + 'price_type': 'price_type', + 'price_offset': 'price_offset', + 'reduce_only': 'reduce_only', + 'position_related': 'position_related', + 'text': 'text', + 'pos_margin_mode': 'pos_margin_mode', + 'position_mode': 'position_mode' + } + + def __init__(self, contract=None, amount=None, activation_price='0', is_gte=None, price_type=None, price_offset=None, reduce_only=False, position_related=False, text='apiv4', pos_margin_mode=None, position_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, bool, int, str, bool, bool, str, str, str, Configuration) -> None + """CreateTrailOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._contract = None + self._amount = None + self._activation_price = None + self._is_gte = None + self._price_type = None + self._price_offset = None + self._reduce_only = None + self._position_related = None + self._text = None + self._pos_margin_mode = None + self._position_mode = None + self.discriminator = None + + self.contract = contract + self.amount = amount + if activation_price is not None: + self.activation_price = activation_price + if is_gte is not None: + self.is_gte = is_gte + if price_type is not None: + self.price_type = price_type + if price_offset is not None: + self.price_offset = price_offset + if reduce_only is not None: + self.reduce_only = reduce_only + if position_related is not None: + self.position_related = position_related + if text is not None: + self.text = text + if pos_margin_mode is not None: + self.pos_margin_mode = pos_margin_mode + if position_mode is not None: + self.position_mode = position_mode + + @property + def contract(self): + """Gets the contract of this CreateTrailOrder. # noqa: E501 + + Contract name # noqa: E501 + + :return: The contract of this CreateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this CreateTrailOrder. + + Contract name # noqa: E501 + + :param contract: The contract of this CreateTrailOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and contract is None: # noqa: E501 + raise ValueError("Invalid value for `contract`, must not be `None`") # noqa: E501 + + self._contract = contract + + @property + def amount(self): + """Gets the amount of this CreateTrailOrder. # noqa: E501 + + Trading quantity in contracts, positive for buy, negative for sell # noqa: E501 + + :return: The amount of this CreateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this CreateTrailOrder. + + Trading quantity in contracts, positive for buy, negative for sell # noqa: E501 + + :param amount: The amount of this CreateTrailOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def activation_price(self): + """Gets the activation_price of this CreateTrailOrder. # noqa: E501 + + Activation price, 0 means trigger immediately # noqa: E501 + + :return: The activation_price of this CreateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._activation_price + + @activation_price.setter + def activation_price(self, activation_price): + """Sets the activation_price of this CreateTrailOrder. + + Activation price, 0 means trigger immediately # noqa: E501 + + :param activation_price: The activation_price of this CreateTrailOrder. # noqa: E501 + :type: str + """ + + self._activation_price = activation_price + + @property + def is_gte(self): + """Gets the is_gte of this CreateTrailOrder. # noqa: E501 + + true: activate when market price >= activation price, false: <= activation price # noqa: E501 + + :return: The is_gte of this CreateTrailOrder. # noqa: E501 + :rtype: bool + """ + return self._is_gte + + @is_gte.setter + def is_gte(self, is_gte): + """Sets the is_gte of this CreateTrailOrder. + + true: activate when market price >= activation price, false: <= activation price # noqa: E501 + + :param is_gte: The is_gte of this CreateTrailOrder. # noqa: E501 + :type: bool + """ + + self._is_gte = is_gte + + @property + def price_type(self): + """Gets the price_type of this CreateTrailOrder. # noqa: E501 + + Activation price type: 1-latest price, 2-index price, 3-mark price # noqa: E501 + + :return: The price_type of this CreateTrailOrder. # noqa: E501 + :rtype: int + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this CreateTrailOrder. + + Activation price type: 1-latest price, 2-index price, 3-mark price # noqa: E501 + + :param price_type: The price_type of this CreateTrailOrder. # noqa: E501 + :type: int + """ + allowed_values = [1, 2, 3] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def price_offset(self): + """Gets the price_offset of this CreateTrailOrder. # noqa: E501 + + Callback ratio or price distance, e.g., `0.1` or `0.1%` # noqa: E501 + + :return: The price_offset of this CreateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._price_offset + + @price_offset.setter + def price_offset(self, price_offset): + """Sets the price_offset of this CreateTrailOrder. + + Callback ratio or price distance, e.g., `0.1` or `0.1%` # noqa: E501 + + :param price_offset: The price_offset of this CreateTrailOrder. # noqa: E501 + :type: str + """ + + self._price_offset = price_offset + + @property + def reduce_only(self): + """Gets the reduce_only of this CreateTrailOrder. # noqa: E501 + + Whether reduce only # noqa: E501 + + :return: The reduce_only of this CreateTrailOrder. # noqa: E501 + :rtype: bool + """ + return self._reduce_only + + @reduce_only.setter + def reduce_only(self, reduce_only): + """Sets the reduce_only of this CreateTrailOrder. + + Whether reduce only # noqa: E501 + + :param reduce_only: The reduce_only of this CreateTrailOrder. # noqa: E501 + :type: bool + """ + + self._reduce_only = reduce_only + + @property + def position_related(self): + """Gets the position_related of this CreateTrailOrder. # noqa: E501 + + Whether bound to a position (if position_related = true (position-related), then reduce_only must also be true) # noqa: E501 + + :return: The position_related of this CreateTrailOrder. # noqa: E501 + :rtype: bool + """ + return self._position_related + + @position_related.setter + def position_related(self, position_related): + """Sets the position_related of this CreateTrailOrder. + + Whether bound to a position (if position_related = true (position-related), then reduce_only must also be true) # noqa: E501 + + :param position_related: The position_related of this CreateTrailOrder. # noqa: E501 + :type: bool + """ + + self._position_related = position_related + + @property + def text(self): + """Gets the text of this CreateTrailOrder. # noqa: E501 + + Order custom information, optional field. Used to identify the order source or set a user-defined ID. If non-empty, it must meet one of the following rules: 1. Internal Reserved Fields (identifying order source): - `apiv4`: API call 2. User-defined Fields (setting custom ID): - Must start with `t-` - The content after `t-` must not exceed 28 bytes in length - Can only contain: numbers, letters, underscores (_), hyphens (-), or dots (.) - Examples: `t-my-order-001`, `t-trail_2024.01` Note: User-defined fields must not conflict with internal reserved fields. # noqa: E501 + + :return: The text of this CreateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CreateTrailOrder. + + Order custom information, optional field. Used to identify the order source or set a user-defined ID. If non-empty, it must meet one of the following rules: 1. Internal Reserved Fields (identifying order source): - `apiv4`: API call 2. User-defined Fields (setting custom ID): - Must start with `t-` - The content after `t-` must not exceed 28 bytes in length - Can only contain: numbers, letters, underscores (_), hyphens (-), or dots (.) - Examples: `t-my-order-001`, `t-trail_2024.01` Note: User-defined fields must not conflict with internal reserved fields. # noqa: E501 + + :param text: The text of this CreateTrailOrder. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def pos_margin_mode(self): + """Gets the pos_margin_mode of this CreateTrailOrder. # noqa: E501 + + Position margin mode: isolated/cross # noqa: E501 + + :return: The pos_margin_mode of this CreateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._pos_margin_mode + + @pos_margin_mode.setter + def pos_margin_mode(self, pos_margin_mode): + """Sets the pos_margin_mode of this CreateTrailOrder. + + Position margin mode: isolated/cross # noqa: E501 + + :param pos_margin_mode: The pos_margin_mode of this CreateTrailOrder. # noqa: E501 + :type: str + """ + + self._pos_margin_mode = pos_margin_mode + + @property + def position_mode(self): + """Gets the position_mode of this CreateTrailOrder. # noqa: E501 + + Position mode: single, dual, and dual_plus # noqa: E501 + + :return: The position_mode of this CreateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._position_mode + + @position_mode.setter + def position_mode(self, position_mode): + """Sets the position_mode of this CreateTrailOrder. + + Position mode: single, dual, and dual_plus # noqa: E501 + + :param position_mode: The position_mode of this CreateTrailOrder. # noqa: E501 + :type: str + """ + + self._position_mode = position_mode + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateTrailOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateTrailOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_trail_order_response.py b/gate_api/models/create_trail_order_response.py new file mode 100644 index 00000000..53414f2d --- /dev/null +++ b/gate_api/models/create_trail_order_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateTrailOrderResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'CreateTrailOrderResult', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, CreateTrailOrderResult, int, Configuration) -> None + """CreateTrailOrderResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this CreateTrailOrderResponse. # noqa: E501 + + Status code, 0 means success # noqa: E501 + + :return: The code of this CreateTrailOrderResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this CreateTrailOrderResponse. + + Status code, 0 means success # noqa: E501 + + :param code: The code of this CreateTrailOrderResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this CreateTrailOrderResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this CreateTrailOrderResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this CreateTrailOrderResponse. + + Response message # noqa: E501 + + :param message: The message of this CreateTrailOrderResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this CreateTrailOrderResponse. # noqa: E501 + + + :return: The data of this CreateTrailOrderResponse. # noqa: E501 + :rtype: CreateTrailOrderResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this CreateTrailOrderResponse. + + + :param data: The data of this CreateTrailOrderResponse. # noqa: E501 + :type: CreateTrailOrderResult + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this CreateTrailOrderResponse. # noqa: E501 + + Response timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this CreateTrailOrderResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this CreateTrailOrderResponse. + + Response timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this CreateTrailOrderResponse. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateTrailOrderResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateTrailOrderResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_trail_order_result.py b/gate_api/models/create_trail_order_result.py new file mode 100644 index 00000000..81af4970 --- /dev/null +++ b/gate_api/models/create_trail_order_result.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateTrailOrderResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str' + } + + attribute_map = { + 'id': 'id' + } + + def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """CreateTrailOrderResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self.discriminator = None + + if id is not None: + self.id = id + + @property + def id(self): + """Gets the id of this CreateTrailOrderResult. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this CreateTrailOrderResult. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CreateTrailOrderResult. + + Order ID # noqa: E501 + + :param id: The id of this CreateTrailOrderResult. # noqa: E501 + :type: str + """ + + self._id = id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateTrailOrderResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateTrailOrderResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_transaction.py b/gate_api/models/create_transaction.py new file mode 100644 index 00000000..93a2e2be --- /dev/null +++ b/gate_api/models/create_transaction.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateTransaction(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'object' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, object, Configuration) -> None + """CreateTransaction - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this CreateTransaction. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this CreateTransaction. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this CreateTransaction. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this CreateTransaction. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this CreateTransaction. # noqa: E501 + + + :return: The data of this CreateTransaction. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this CreateTransaction. + + + :param data: The data of this CreateTransaction. # noqa: E501 + :type: object + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateTransaction): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateTransaction): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_transaction2.py b/gate_api/models/create_transaction2.py new file mode 100644 index 00000000..f3e03caf --- /dev/null +++ b/gate_api/models/create_transaction2.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateTransaction2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (object, int, Configuration) -> None + """CreateTransaction2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this CreateTransaction2. # noqa: E501 + + Returns empty object on success # noqa: E501 + + :return: The data of this CreateTransaction2. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this CreateTransaction2. + + Returns empty object on success # noqa: E501 + + :param data: The data of this CreateTransaction2. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this CreateTransaction2. # noqa: E501 + + + :return: The timestamp of this CreateTransaction2. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this CreateTransaction2. + + + :param timestamp: The timestamp of this CreateTransaction2. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateTransaction2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateTransaction2): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_user_resp.py b/gate_api/models/create_user_resp.py new file mode 100644 index 00000000..21f85dc1 --- /dev/null +++ b/gate_api/models/create_user_resp.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateUserResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'CreateUserRespData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, CreateUserRespData, Configuration) -> None + """CreateUserResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this CreateUserResp. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this CreateUserResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this CreateUserResp. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this CreateUserResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this CreateUserResp. # noqa: E501 + + + :return: The data of this CreateUserResp. # noqa: E501 + :rtype: CreateUserRespData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this CreateUserResp. + + + :param data: The data of this CreateUserResp. # noqa: E501 + :type: CreateUserRespData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateUserResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateUserResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/create_user_resp_data.py b/gate_api/models/create_user_resp_data.py new file mode 100644 index 00000000..ac1b1b22 --- /dev/null +++ b/gate_api/models/create_user_resp_data.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CreateUserRespData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'status': 'int', + 'leverage': 'int', + 'mt5_uid': 'str' + } + + attribute_map = { + 'status': 'status', + 'leverage': 'leverage', + 'mt5_uid': 'mt5_uid' + } + + def __init__(self, status=None, leverage=None, mt5_uid=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, Configuration) -> None + """CreateUserRespData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._status = None + self._leverage = None + self._mt5_uid = None + self.discriminator = None + + if status is not None: + self.status = status + if leverage is not None: + self.leverage = leverage + if mt5_uid is not None: + self.mt5_uid = mt5_uid + + @property + def status(self): + """Gets the status of this CreateUserRespData. # noqa: E501 + + Status (1=not opened, 2=pending review, 3=opened) # noqa: E501 + + :return: The status of this CreateUserRespData. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this CreateUserRespData. + + Status (1=not opened, 2=pending review, 3=opened) # noqa: E501 + + :param status: The status of this CreateUserRespData. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def leverage(self): + """Gets the leverage of this CreateUserRespData. # noqa: E501 + + Leverage # noqa: E501 + + :return: The leverage of this CreateUserRespData. # noqa: E501 + :rtype: int + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this CreateUserRespData. + + Leverage # noqa: E501 + + :param leverage: The leverage of this CreateUserRespData. # noqa: E501 + :type: int + """ + + self._leverage = leverage + + @property + def mt5_uid(self): + """Gets the mt5_uid of this CreateUserRespData. # noqa: E501 + + mt5uid # noqa: E501 + + :return: The mt5_uid of this CreateUserRespData. # noqa: E501 + :rtype: str + """ + return self._mt5_uid + + @mt5_uid.setter + def mt5_uid(self, mt5_uid): + """Sets the mt5_uid of this CreateUserRespData. + + mt5uid # noqa: E501 + + :param mt5_uid: The mt5_uid of this CreateUserRespData. # noqa: E501 + :type: str + """ + + self._mt5_uid = mt5_uid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateUserRespData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateUserRespData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_account.py b/gate_api/models/crossex_account.py new file mode 100644 index 00000000..54f208df --- /dev/null +++ b/gate_api/models/crossex_account.py @@ -0,0 +1,498 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexAccount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_id': 'str', + 'available_margin': 'str', + 'margin_balance': 'str', + 'initial_margin': 'str', + 'maintenance_margin': 'str', + 'initial_margin_rate': 'str', + 'maintenance_margin_rate': 'str', + 'position_mode': 'str', + 'account_limit': 'str', + 'create_time': 'str', + 'update_time': 'str', + 'account_mode': 'str', + 'exchange_type': 'str', + 'assets': 'list[CrossexAccountAsset]' + } + + attribute_map = { + 'user_id': 'user_id', + 'available_margin': 'available_margin', + 'margin_balance': 'margin_balance', + 'initial_margin': 'initial_margin', + 'maintenance_margin': 'maintenance_margin', + 'initial_margin_rate': 'initial_margin_rate', + 'maintenance_margin_rate': 'maintenance_margin_rate', + 'position_mode': 'position_mode', + 'account_limit': 'account_limit', + 'create_time': 'create_time', + 'update_time': 'update_time', + 'account_mode': 'account_mode', + 'exchange_type': 'exchange_type', + 'assets': 'assets' + } + + def __init__(self, user_id=None, available_margin=None, margin_balance=None, initial_margin=None, maintenance_margin=None, initial_margin_rate=None, maintenance_margin_rate=None, position_mode=None, account_limit=None, create_time=None, update_time=None, account_mode=None, exchange_type=None, assets=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, list[CrossexAccountAsset], Configuration) -> None + """CrossexAccount - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_id = None + self._available_margin = None + self._margin_balance = None + self._initial_margin = None + self._maintenance_margin = None + self._initial_margin_rate = None + self._maintenance_margin_rate = None + self._position_mode = None + self._account_limit = None + self._create_time = None + self._update_time = None + self._account_mode = None + self._exchange_type = None + self._assets = None + self.discriminator = None + + self.user_id = user_id + self.available_margin = available_margin + self.margin_balance = margin_balance + self.initial_margin = initial_margin + self.maintenance_margin = maintenance_margin + self.initial_margin_rate = initial_margin_rate + self.maintenance_margin_rate = maintenance_margin_rate + self.position_mode = position_mode + if account_limit is not None: + self.account_limit = account_limit + self.create_time = create_time + self.update_time = update_time + if account_mode is not None: + self.account_mode = account_mode + if exchange_type is not None: + self.exchange_type = exchange_type + self.assets = assets + + @property + def user_id(self): + """Gets the user_id of this CrossexAccount. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexAccount. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def available_margin(self): + """Gets the available_margin of this CrossexAccount. # noqa: E501 + + Available Margin # noqa: E501 + + :return: The available_margin of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._available_margin + + @available_margin.setter + def available_margin(self, available_margin): + """Sets the available_margin of this CrossexAccount. + + Available Margin # noqa: E501 + + :param available_margin: The available_margin of this CrossexAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and available_margin is None: # noqa: E501 + raise ValueError("Invalid value for `available_margin`, must not be `None`") # noqa: E501 + + self._available_margin = available_margin + + @property + def margin_balance(self): + """Gets the margin_balance of this CrossexAccount. # noqa: E501 + + marginbalance # noqa: E501 + + :return: The margin_balance of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._margin_balance + + @margin_balance.setter + def margin_balance(self, margin_balance): + """Sets the margin_balance of this CrossexAccount. + + marginbalance # noqa: E501 + + :param margin_balance: The margin_balance of this CrossexAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and margin_balance is None: # noqa: E501 + raise ValueError("Invalid value for `margin_balance`, must not be `None`") # noqa: E501 + + self._margin_balance = margin_balance + + @property + def initial_margin(self): + """Gets the initial_margin of this CrossexAccount. # noqa: E501 + + Initial Margin # noqa: E501 + + :return: The initial_margin of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._initial_margin + + @initial_margin.setter + def initial_margin(self, initial_margin): + """Sets the initial_margin of this CrossexAccount. + + Initial Margin # noqa: E501 + + :param initial_margin: The initial_margin of this CrossexAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and initial_margin is None: # noqa: E501 + raise ValueError("Invalid value for `initial_margin`, must not be `None`") # noqa: E501 + + self._initial_margin = initial_margin + + @property + def maintenance_margin(self): + """Gets the maintenance_margin of this CrossexAccount. # noqa: E501 + + Maintenance margin # noqa: E501 + + :return: The maintenance_margin of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._maintenance_margin + + @maintenance_margin.setter + def maintenance_margin(self, maintenance_margin): + """Sets the maintenance_margin of this CrossexAccount. + + Maintenance margin # noqa: E501 + + :param maintenance_margin: The maintenance_margin of this CrossexAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and maintenance_margin is None: # noqa: E501 + raise ValueError("Invalid value for `maintenance_margin`, must not be `None`") # noqa: E501 + + self._maintenance_margin = maintenance_margin + + @property + def initial_margin_rate(self): + """Gets the initial_margin_rate of this CrossexAccount. # noqa: E501 + + Initial margin rate # noqa: E501 + + :return: The initial_margin_rate of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._initial_margin_rate + + @initial_margin_rate.setter + def initial_margin_rate(self, initial_margin_rate): + """Sets the initial_margin_rate of this CrossexAccount. + + Initial margin rate # noqa: E501 + + :param initial_margin_rate: The initial_margin_rate of this CrossexAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and initial_margin_rate is None: # noqa: E501 + raise ValueError("Invalid value for `initial_margin_rate`, must not be `None`") # noqa: E501 + + self._initial_margin_rate = initial_margin_rate + + @property + def maintenance_margin_rate(self): + """Gets the maintenance_margin_rate of this CrossexAccount. # noqa: E501 + + Maintenance margin rate # noqa: E501 + + :return: The maintenance_margin_rate of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._maintenance_margin_rate + + @maintenance_margin_rate.setter + def maintenance_margin_rate(self, maintenance_margin_rate): + """Sets the maintenance_margin_rate of this CrossexAccount. + + Maintenance margin rate # noqa: E501 + + :param maintenance_margin_rate: The maintenance_margin_rate of this CrossexAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and maintenance_margin_rate is None: # noqa: E501 + raise ValueError("Invalid value for `maintenance_margin_rate`, must not be `None`") # noqa: E501 + + self._maintenance_margin_rate = maintenance_margin_rate + + @property + def position_mode(self): + """Gets the position_mode of this CrossexAccount. # noqa: E501 + + Contract Position Mode # noqa: E501 + + :return: The position_mode of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._position_mode + + @position_mode.setter + def position_mode(self, position_mode): + """Sets the position_mode of this CrossexAccount. + + Contract Position Mode # noqa: E501 + + :param position_mode: The position_mode of this CrossexAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and position_mode is None: # noqa: E501 + raise ValueError("Invalid value for `position_mode`, must not be `None`") # noqa: E501 + + self._position_mode = position_mode + + @property + def account_limit(self): + """Gets the account_limit of this CrossexAccount. # noqa: E501 + + Account limit # noqa: E501 + + :return: The account_limit of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._account_limit + + @account_limit.setter + def account_limit(self, account_limit): + """Sets the account_limit of this CrossexAccount. + + Account limit # noqa: E501 + + :param account_limit: The account_limit of this CrossexAccount. # noqa: E501 + :type: str + """ + + self._account_limit = account_limit + + @property + def create_time(self): + """Gets the create_time of this CrossexAccount. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CrossexAccount. + + Created time # noqa: E501 + + :param create_time: The create_time of this CrossexAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this CrossexAccount. # noqa: E501 + + Update time # noqa: E501 + + :return: The update_time of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this CrossexAccount. + + Update time # noqa: E501 + + :param update_time: The update_time of this CrossexAccount. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and update_time is None: # noqa: E501 + raise ValueError("Invalid value for `update_time`, must not be `None`") # noqa: E501 + + self._update_time = update_time + + @property + def account_mode(self): + """Gets the account_mode of this CrossexAccount. # noqa: E501 + + Account Mode. CROSS_EXCHANGE: Cross-Exchange Mode; ISOLATED_EXCHANGE: Split-Exchange Mode # noqa: E501 + + :return: The account_mode of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._account_mode + + @account_mode.setter + def account_mode(self, account_mode): + """Sets the account_mode of this CrossexAccount. + + Account Mode. CROSS_EXCHANGE: Cross-Exchange Mode; ISOLATED_EXCHANGE: Split-Exchange Mode # noqa: E501 + + :param account_mode: The account_mode of this CrossexAccount. # noqa: E501 + :type: str + """ + + self._account_mode = account_mode + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexAccount. # noqa: E501 + + Exchange Type. When account_mode is CROSS_EXCHANGE, it must be CROSSEX; otherwise, it is another exchange. # noqa: E501 + + :return: The exchange_type of this CrossexAccount. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexAccount. + + Exchange Type. When account_mode is CROSS_EXCHANGE, it must be CROSSEX; otherwise, it is another exchange. # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexAccount. # noqa: E501 + :type: str + """ + + self._exchange_type = exchange_type + + @property + def assets(self): + """Gets the assets of this CrossexAccount. # noqa: E501 + + Asset list: grouped by exchange and currency, returning per-account balances, margin, and PnL details # noqa: E501 + + :return: The assets of this CrossexAccount. # noqa: E501 + :rtype: list[CrossexAccountAsset] + """ + return self._assets + + @assets.setter + def assets(self, assets): + """Sets the assets of this CrossexAccount. + + Asset list: grouped by exchange and currency, returning per-account balances, margin, and PnL details # noqa: E501 + + :param assets: The assets of this CrossexAccount. # noqa: E501 + :type: list[CrossexAccountAsset] + """ + if self.local_vars_configuration.client_side_validation and assets is None: # noqa: E501 + raise ValueError("Invalid value for `assets`, must not be `None`") # noqa: E501 + + self._assets = assets + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexAccount): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexAccount): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_account_asset.py b/gate_api/models/crossex_account_asset.py new file mode 100644 index 00000000..441106f2 --- /dev/null +++ b/gate_api/models/crossex_account_asset.py @@ -0,0 +1,433 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexAccountAsset(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_id': 'str', + 'coin': 'str', + 'exchange_type': 'str', + 'balance': 'str', + 'upnl': 'str', + 'equity': 'str', + 'futures_initial_margin': 'str', + 'futures_maintenance_margin': 'str', + 'borrowing_initial_margin': 'str', + 'borrowing_maintenance_margin': 'str', + 'available_balance': 'str', + 'liability': 'str' + } + + attribute_map = { + 'user_id': 'user_id', + 'coin': 'coin', + 'exchange_type': 'exchange_type', + 'balance': 'balance', + 'upnl': 'upnl', + 'equity': 'equity', + 'futures_initial_margin': 'futures_initial_margin', + 'futures_maintenance_margin': 'futures_maintenance_margin', + 'borrowing_initial_margin': 'borrowing_initial_margin', + 'borrowing_maintenance_margin': 'borrowing_maintenance_margin', + 'available_balance': 'available_balance', + 'liability': 'liability' + } + + def __init__(self, user_id=None, coin=None, exchange_type=None, balance=None, upnl=None, equity=None, futures_initial_margin=None, futures_maintenance_margin=None, borrowing_initial_margin=None, borrowing_maintenance_margin=None, available_balance=None, liability=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """CrossexAccountAsset - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_id = None + self._coin = None + self._exchange_type = None + self._balance = None + self._upnl = None + self._equity = None + self._futures_initial_margin = None + self._futures_maintenance_margin = None + self._borrowing_initial_margin = None + self._borrowing_maintenance_margin = None + self._available_balance = None + self._liability = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if coin is not None: + self.coin = coin + if exchange_type is not None: + self.exchange_type = exchange_type + if balance is not None: + self.balance = balance + if upnl is not None: + self.upnl = upnl + if equity is not None: + self.equity = equity + if futures_initial_margin is not None: + self.futures_initial_margin = futures_initial_margin + if futures_maintenance_margin is not None: + self.futures_maintenance_margin = futures_maintenance_margin + self.borrowing_initial_margin = borrowing_initial_margin + self.borrowing_maintenance_margin = borrowing_maintenance_margin + if available_balance is not None: + self.available_balance = available_balance + if liability is not None: + self.liability = liability + + @property + def user_id(self): + """Gets the user_id of this CrossexAccountAsset. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexAccountAsset. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + + self._user_id = user_id + + @property + def coin(self): + """Gets the coin of this CrossexAccountAsset. # noqa: E501 + + Currency # noqa: E501 + + :return: The coin of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._coin + + @coin.setter + def coin(self, coin): + """Sets the coin of this CrossexAccountAsset. + + Currency # noqa: E501 + + :param coin: The coin of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + + self._coin = coin + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexAccountAsset. # noqa: E501 + + Exchange # noqa: E501 + + :return: The exchange_type of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexAccountAsset. + + Exchange # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + + self._exchange_type = exchange_type + + @property + def balance(self): + """Gets the balance of this CrossexAccountAsset. # noqa: E501 + + Balance # noqa: E501 + + :return: The balance of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this CrossexAccountAsset. + + Balance # noqa: E501 + + :param balance: The balance of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + + self._balance = balance + + @property + def upnl(self): + """Gets the upnl of this CrossexAccountAsset. # noqa: E501 + + Unrealized P&L # noqa: E501 + + :return: The upnl of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._upnl + + @upnl.setter + def upnl(self, upnl): + """Sets the upnl of this CrossexAccountAsset. + + Unrealized P&L # noqa: E501 + + :param upnl: The upnl of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + + self._upnl = upnl + + @property + def equity(self): + """Gets the equity of this CrossexAccountAsset. # noqa: E501 + + Equity (only USDT has a value; other assets are 0) # noqa: E501 + + :return: The equity of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._equity + + @equity.setter + def equity(self, equity): + """Sets the equity of this CrossexAccountAsset. + + Equity (only USDT has a value; other assets are 0) # noqa: E501 + + :param equity: The equity of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + + self._equity = equity + + @property + def futures_initial_margin(self): + """Gets the futures_initial_margin of this CrossexAccountAsset. # noqa: E501 + + Futures initial margin (only USDT has a value; other assets are 0) # noqa: E501 + + :return: The futures_initial_margin of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._futures_initial_margin + + @futures_initial_margin.setter + def futures_initial_margin(self, futures_initial_margin): + """Sets the futures_initial_margin of this CrossexAccountAsset. + + Futures initial margin (only USDT has a value; other assets are 0) # noqa: E501 + + :param futures_initial_margin: The futures_initial_margin of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + + self._futures_initial_margin = futures_initial_margin + + @property + def futures_maintenance_margin(self): + """Gets the futures_maintenance_margin of this CrossexAccountAsset. # noqa: E501 + + Futures maintenance margin (only USDT has a value; other assets are 0) # noqa: E501 + + :return: The futures_maintenance_margin of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._futures_maintenance_margin + + @futures_maintenance_margin.setter + def futures_maintenance_margin(self, futures_maintenance_margin): + """Sets the futures_maintenance_margin of this CrossexAccountAsset. + + Futures maintenance margin (only USDT has a value; other assets are 0) # noqa: E501 + + :param futures_maintenance_margin: The futures_maintenance_margin of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + + self._futures_maintenance_margin = futures_maintenance_margin + + @property + def borrowing_initial_margin(self): + """Gets the borrowing_initial_margin of this CrossexAccountAsset. # noqa: E501 + + Margin trading initial margin (only USDT has a value; other assets are 0) # noqa: E501 + + :return: The borrowing_initial_margin of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._borrowing_initial_margin + + @borrowing_initial_margin.setter + def borrowing_initial_margin(self, borrowing_initial_margin): + """Sets the borrowing_initial_margin of this CrossexAccountAsset. + + Margin trading initial margin (only USDT has a value; other assets are 0) # noqa: E501 + + :param borrowing_initial_margin: The borrowing_initial_margin of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and borrowing_initial_margin is None: # noqa: E501 + raise ValueError("Invalid value for `borrowing_initial_margin`, must not be `None`") # noqa: E501 + + self._borrowing_initial_margin = borrowing_initial_margin + + @property + def borrowing_maintenance_margin(self): + """Gets the borrowing_maintenance_margin of this CrossexAccountAsset. # noqa: E501 + + Margin trading maintenance margin (only USDT has a value; other assets are 0) # noqa: E501 + + :return: The borrowing_maintenance_margin of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._borrowing_maintenance_margin + + @borrowing_maintenance_margin.setter + def borrowing_maintenance_margin(self, borrowing_maintenance_margin): + """Sets the borrowing_maintenance_margin of this CrossexAccountAsset. + + Margin trading maintenance margin (only USDT has a value; other assets are 0) # noqa: E501 + + :param borrowing_maintenance_margin: The borrowing_maintenance_margin of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and borrowing_maintenance_margin is None: # noqa: E501 + raise ValueError("Invalid value for `borrowing_maintenance_margin`, must not be `None`") # noqa: E501 + + self._borrowing_maintenance_margin = borrowing_maintenance_margin + + @property + def available_balance(self): + """Gets the available_balance of this CrossexAccountAsset. # noqa: E501 + + Available Balance # noqa: E501 + + :return: The available_balance of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._available_balance + + @available_balance.setter + def available_balance(self, available_balance): + """Sets the available_balance of this CrossexAccountAsset. + + Available Balance # noqa: E501 + + :param available_balance: The available_balance of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + + self._available_balance = available_balance + + @property + def liability(self): + """Gets the liability of this CrossexAccountAsset. # noqa: E501 + + Liabilities (only meaningful in isolated exchange mode; always 0 in cross-exchange mode) # noqa: E501 + + :return: The liability of this CrossexAccountAsset. # noqa: E501 + :rtype: str + """ + return self._liability + + @liability.setter + def liability(self, liability): + """Sets the liability of this CrossexAccountAsset. + + Liabilities (only meaningful in isolated exchange mode; always 0 in cross-exchange mode) # noqa: E501 + + :param liability: The liability of this CrossexAccountAsset. # noqa: E501 + :type: str + """ + + self._liability = liability + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexAccountAsset): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexAccountAsset): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_account_book_record.py b/gate_api/models/crossex_account_book_record.py new file mode 100644 index 00000000..b00e4455 --- /dev/null +++ b/gate_api/models/crossex_account_book_record.py @@ -0,0 +1,384 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexAccountBookRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'user_id': 'str', + 'business_id': 'str', + 'statement_type': 'str', + 'exchange_type': 'str', + 'coin': 'str', + 'symbol': 'str', + 'change': 'str', + 'balance': 'str', + 'create_time': 'str' + } + + attribute_map = { + 'id': 'id', + 'user_id': 'user_id', + 'business_id': 'business_id', + 'statement_type': 'statement_type', + 'exchange_type': 'exchange_type', + 'coin': 'coin', + 'symbol': 'symbol', + 'change': 'change', + 'balance': 'balance', + 'create_time': 'create_time' + } + + def __init__(self, id=None, user_id=None, business_id=None, statement_type=None, exchange_type=None, coin=None, symbol=None, change=None, balance=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """CrossexAccountBookRecord - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._user_id = None + self._business_id = None + self._statement_type = None + self._exchange_type = None + self._coin = None + self._symbol = None + self._change = None + self._balance = None + self._create_time = None + self.discriminator = None + + self.id = id + self.user_id = user_id + self.business_id = business_id + self.statement_type = statement_type + self.exchange_type = exchange_type + self.coin = coin + if symbol is not None: + self.symbol = symbol + self.change = change + self.balance = balance + self.create_time = create_time + + @property + def id(self): + """Gets the id of this CrossexAccountBookRecord. # noqa: E501 + + Account Change Record ID # noqa: E501 + + :return: The id of this CrossexAccountBookRecord. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CrossexAccountBookRecord. + + Account Change Record ID # noqa: E501 + + :param id: The id of this CrossexAccountBookRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def user_id(self): + """Gets the user_id of this CrossexAccountBookRecord. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexAccountBookRecord. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexAccountBookRecord. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexAccountBookRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def business_id(self): + """Gets the business_id of this CrossexAccountBookRecord. # noqa: E501 + + Business ID. Its meaning varies by `statement_type`. `TRANSACTION`: order ID. `TRADING_FEE`: order ID. `LIQUIDATION_FEE`: liquidation order ID. `FUNDING_FEE`: position ID and funding fee settlement time. For other types, it is a system-generated processing ID with no business meaning. # noqa: E501 + + :return: The business_id of this CrossexAccountBookRecord. # noqa: E501 + :rtype: str + """ + return self._business_id + + @business_id.setter + def business_id(self, business_id): + """Sets the business_id of this CrossexAccountBookRecord. + + Business ID. Its meaning varies by `statement_type`. `TRANSACTION`: order ID. `TRADING_FEE`: order ID. `LIQUIDATION_FEE`: liquidation order ID. `FUNDING_FEE`: position ID and funding fee settlement time. For other types, it is a system-generated processing ID with no business meaning. # noqa: E501 + + :param business_id: The business_id of this CrossexAccountBookRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and business_id is None: # noqa: E501 + raise ValueError("Invalid value for `business_id`, must not be `None`") # noqa: E501 + + self._business_id = business_id + + @property + def statement_type(self): + """Gets the statement_type of this CrossexAccountBookRecord. # noqa: E501 + + Bill entry type. `TRANSACTION` trade `TRADING_FEE` fee `FUNDING_FEE` funding `LIQUIDATION_FEE` liquidation `TRANSFER_IN` deposit `TRANSFER_OUT` withdrawal `BANKRUPT_COMPENSATION` bankruptcy subsidy `AUTO_REPAY` margin auto-repay `INTEREST_ISOLATED` isolated-venue interest entry `ACCOUNT_MODE_CHANGE` account mode switch entry `KRAKEN_CONVERSION` conversion of other margin coins to cover a negative KRAKEN_USD balance `OTHER` other # noqa: E501 + + :return: The statement_type of this CrossexAccountBookRecord. # noqa: E501 + :rtype: str + """ + return self._statement_type + + @statement_type.setter + def statement_type(self, statement_type): + """Sets the statement_type of this CrossexAccountBookRecord. + + Bill entry type. `TRANSACTION` trade `TRADING_FEE` fee `FUNDING_FEE` funding `LIQUIDATION_FEE` liquidation `TRANSFER_IN` deposit `TRANSFER_OUT` withdrawal `BANKRUPT_COMPENSATION` bankruptcy subsidy `AUTO_REPAY` margin auto-repay `INTEREST_ISOLATED` isolated-venue interest entry `ACCOUNT_MODE_CHANGE` account mode switch entry `KRAKEN_CONVERSION` conversion of other margin coins to cover a negative KRAKEN_USD balance `OTHER` other # noqa: E501 + + :param statement_type: The statement_type of this CrossexAccountBookRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and statement_type is None: # noqa: E501 + raise ValueError("Invalid value for `statement_type`, must not be `None`") # noqa: E501 + + self._statement_type = statement_type + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexAccountBookRecord. # noqa: E501 + + Exchange # noqa: E501 + + :return: The exchange_type of this CrossexAccountBookRecord. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexAccountBookRecord. + + Exchange # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexAccountBookRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and exchange_type is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_type`, must not be `None`") # noqa: E501 + + self._exchange_type = exchange_type + + @property + def coin(self): + """Gets the coin of this CrossexAccountBookRecord. # noqa: E501 + + Currency # noqa: E501 + + :return: The coin of this CrossexAccountBookRecord. # noqa: E501 + :rtype: str + """ + return self._coin + + @coin.setter + def coin(self, coin): + """Sets the coin of this CrossexAccountBookRecord. + + Currency # noqa: E501 + + :param coin: The coin of this CrossexAccountBookRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and coin is None: # noqa: E501 + raise ValueError("Invalid value for `coin`, must not be `None`") # noqa: E501 + + self._coin = coin + + @property + def symbol(self): + """Gets the symbol of this CrossexAccountBookRecord. # noqa: E501 + + Trading Pair # noqa: E501 + + :return: The symbol of this CrossexAccountBookRecord. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexAccountBookRecord. + + Trading Pair # noqa: E501 + + :param symbol: The symbol of this CrossexAccountBookRecord. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def change(self): + """Gets the change of this CrossexAccountBookRecord. # noqa: E501 + + Change amount (positive indicates transfer in; negative indicates transfer out) # noqa: E501 + + :return: The change of this CrossexAccountBookRecord. # noqa: E501 + :rtype: str + """ + return self._change + + @change.setter + def change(self, change): + """Sets the change of this CrossexAccountBookRecord. + + Change amount (positive indicates transfer in; negative indicates transfer out) # noqa: E501 + + :param change: The change of this CrossexAccountBookRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and change is None: # noqa: E501 + raise ValueError("Invalid value for `change`, must not be `None`") # noqa: E501 + + self._change = change + + @property + def balance(self): + """Gets the balance of this CrossexAccountBookRecord. # noqa: E501 + + Balance after change # noqa: E501 + + :return: The balance of this CrossexAccountBookRecord. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this CrossexAccountBookRecord. + + Balance after change # noqa: E501 + + :param balance: The balance of this CrossexAccountBookRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and balance is None: # noqa: E501 + raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 + + self._balance = balance + + @property + def create_time(self): + """Gets the create_time of this CrossexAccountBookRecord. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this CrossexAccountBookRecord. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CrossexAccountBookRecord. + + Created time # noqa: E501 + + :param create_time: The create_time of this CrossexAccountBookRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexAccountBookRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexAccountBookRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_account_update_request.py b/gate_api/models/crossex_account_update_request.py new file mode 100644 index 00000000..1b9ad177 --- /dev/null +++ b/gate_api/models/crossex_account_update_request.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexAccountUpdateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'position_mode': 'str', + 'account_mode': 'str', + 'exchange_type': 'str' + } + + attribute_map = { + 'position_mode': 'position_mode', + 'account_mode': 'account_mode', + 'exchange_type': 'exchange_type' + } + + def __init__(self, position_mode=None, account_mode=None, exchange_type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """CrossexAccountUpdateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._position_mode = None + self._account_mode = None + self._exchange_type = None + self.discriminator = None + + if position_mode is not None: + self.position_mode = position_mode + if account_mode is not None: + self.account_mode = account_mode + if exchange_type is not None: + self.exchange_type = exchange_type + + @property + def position_mode(self): + """Gets the position_mode of this CrossexAccountUpdateRequest. # noqa: E501 + + Futures position mode (SINGLE/DUAL) # noqa: E501 + + :return: The position_mode of this CrossexAccountUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._position_mode + + @position_mode.setter + def position_mode(self, position_mode): + """Sets the position_mode of this CrossexAccountUpdateRequest. + + Futures position mode (SINGLE/DUAL) # noqa: E501 + + :param position_mode: The position_mode of this CrossexAccountUpdateRequest. # noqa: E501 + :type: str + """ + + self._position_mode = position_mode + + @property + def account_mode(self): + """Gets the account_mode of this CrossexAccountUpdateRequest. # noqa: E501 + + Account mode (CROSS_EXCHANGE/ISOLATED_EXCHANGE, default: CROSS_EXCHANGE) # noqa: E501 + + :return: The account_mode of this CrossexAccountUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._account_mode + + @account_mode.setter + def account_mode(self, account_mode): + """Sets the account_mode of this CrossexAccountUpdateRequest. + + Account mode (CROSS_EXCHANGE/ISOLATED_EXCHANGE, default: CROSS_EXCHANGE) # noqa: E501 + + :param account_mode: The account_mode of this CrossexAccountUpdateRequest. # noqa: E501 + :type: str + """ + + self._account_mode = account_mode + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexAccountUpdateRequest. # noqa: E501 + + Exchange (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT` / `CROSSEX`). When account mode is `ISOLATED_EXCHANGE`, the exchange must be specified to adjust futures position mode. # noqa: E501 + + :return: The exchange_type of this CrossexAccountUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexAccountUpdateRequest. + + Exchange (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT` / `CROSSEX`). When account mode is `ISOLATED_EXCHANGE`, the exchange must be specified to adjust futures position mode. # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexAccountUpdateRequest. # noqa: E501 + :type: str + """ + + self._exchange_type = exchange_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexAccountUpdateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexAccountUpdateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_account_update_response.py b/gate_api/models/crossex_account_update_response.py new file mode 100644 index 00000000..edb3cb58 --- /dev/null +++ b/gate_api/models/crossex_account_update_response.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexAccountUpdateResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'position_mode': 'str', + 'account_mode': 'str', + 'exchange_type': 'str' + } + + attribute_map = { + 'position_mode': 'position_mode', + 'account_mode': 'account_mode', + 'exchange_type': 'exchange_type' + } + + def __init__(self, position_mode=None, account_mode=None, exchange_type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """CrossexAccountUpdateResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._position_mode = None + self._account_mode = None + self._exchange_type = None + self.discriminator = None + + if position_mode is not None: + self.position_mode = position_mode + if account_mode is not None: + self.account_mode = account_mode + if exchange_type is not None: + self.exchange_type = exchange_type + + @property + def position_mode(self): + """Gets the position_mode of this CrossexAccountUpdateResponse. # noqa: E501 + + Requested futures position mode to modify (SINGLE/DUAL) # noqa: E501 + + :return: The position_mode of this CrossexAccountUpdateResponse. # noqa: E501 + :rtype: str + """ + return self._position_mode + + @position_mode.setter + def position_mode(self, position_mode): + """Sets the position_mode of this CrossexAccountUpdateResponse. + + Requested futures position mode to modify (SINGLE/DUAL) # noqa: E501 + + :param position_mode: The position_mode of this CrossexAccountUpdateResponse. # noqa: E501 + :type: str + """ + + self._position_mode = position_mode + + @property + def account_mode(self): + """Gets the account_mode of this CrossexAccountUpdateResponse. # noqa: E501 + + Requested account mode to modify (CROSS_EXCHANGE/ISOLATED_EXCHANGE, default: CROSS_EXCHANGE) # noqa: E501 + + :return: The account_mode of this CrossexAccountUpdateResponse. # noqa: E501 + :rtype: str + """ + return self._account_mode + + @account_mode.setter + def account_mode(self, account_mode): + """Sets the account_mode of this CrossexAccountUpdateResponse. + + Requested account mode to modify (CROSS_EXCHANGE/ISOLATED_EXCHANGE, default: CROSS_EXCHANGE) # noqa: E501 + + :param account_mode: The account_mode of this CrossexAccountUpdateResponse. # noqa: E501 + :type: str + """ + + self._account_mode = account_mode + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexAccountUpdateResponse. # noqa: E501 + + Exchange targeted by the requested change (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT` / `CROSSEX`). When account mode is `ISOLATED_EXCHANGE`, the exchange must be specified to change futures position mode. # noqa: E501 + + :return: The exchange_type of this CrossexAccountUpdateResponse. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexAccountUpdateResponse. + + Exchange targeted by the requested change (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT` / `CROSSEX`). When account mode is `ISOLATED_EXCHANGE`, the exchange must be specified to change futures position mode. # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexAccountUpdateResponse. # noqa: E501 + :type: str + """ + + self._exchange_type = exchange_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexAccountUpdateResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexAccountUpdateResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_adl_rank.py b/gate_api/models/crossex_adl_rank.py new file mode 100644 index 00000000..35ea49e5 --- /dev/null +++ b/gate_api/models/crossex_adl_rank.py @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexAdlRank(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_id': 'str', + 'symbol': 'str', + 'crossex_adl_rank': 'str', + 'exchange_adl_rank': 'str' + } + + attribute_map = { + 'user_id': 'user_id', + 'symbol': 'symbol', + 'crossex_adl_rank': 'crossex_adl_rank', + 'exchange_adl_rank': 'exchange_adl_rank' + } + + def __init__(self, user_id=None, symbol=None, crossex_adl_rank=None, exchange_adl_rank=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """CrossexAdlRank - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_id = None + self._symbol = None + self._crossex_adl_rank = None + self._exchange_adl_rank = None + self.discriminator = None + + self.user_id = user_id + self.symbol = symbol + self.crossex_adl_rank = crossex_adl_rank + self.exchange_adl_rank = exchange_adl_rank + + @property + def user_id(self): + """Gets the user_id of this CrossexAdlRank. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexAdlRank. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexAdlRank. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexAdlRank. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def symbol(self): + """Gets the symbol of this CrossexAdlRank. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this CrossexAdlRank. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexAdlRank. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this CrossexAdlRank. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def crossex_adl_rank(self): + """Gets the crossex_adl_rank of this CrossexAdlRank. # noqa: E501 + + CROSSEX position-reduction indicator ranking (1–5, higher value ranks higher) # noqa: E501 + + :return: The crossex_adl_rank of this CrossexAdlRank. # noqa: E501 + :rtype: str + """ + return self._crossex_adl_rank + + @crossex_adl_rank.setter + def crossex_adl_rank(self, crossex_adl_rank): + """Sets the crossex_adl_rank of this CrossexAdlRank. + + CROSSEX position-reduction indicator ranking (1–5, higher value ranks higher) # noqa: E501 + + :param crossex_adl_rank: The crossex_adl_rank of this CrossexAdlRank. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and crossex_adl_rank is None: # noqa: E501 + raise ValueError("Invalid value for `crossex_adl_rank`, must not be `None`") # noqa: E501 + + self._crossex_adl_rank = crossex_adl_rank + + @property + def exchange_adl_rank(self): + """Gets the exchange_adl_rank of this CrossexAdlRank. # noqa: E501 + + Exchange raw information (BINANCE: 0-4, larger numbers rank higher; OKX: 0-5, larger numbers rank higher; GATE: 1-5, smaller numbers rank higher; Kraken: 20, 40, 80, 100, smaller numbers rank higher; BYBIT: 0-5, larger numbers rank higher) # noqa: E501 + + :return: The exchange_adl_rank of this CrossexAdlRank. # noqa: E501 + :rtype: str + """ + return self._exchange_adl_rank + + @exchange_adl_rank.setter + def exchange_adl_rank(self, exchange_adl_rank): + """Sets the exchange_adl_rank of this CrossexAdlRank. + + Exchange raw information (BINANCE: 0-4, larger numbers rank higher; OKX: 0-5, larger numbers rank higher; GATE: 1-5, smaller numbers rank higher; Kraken: 20, 40, 80, 100, smaller numbers rank higher; BYBIT: 0-5, larger numbers rank higher) # noqa: E501 + + :param exchange_adl_rank: The exchange_adl_rank of this CrossexAdlRank. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and exchange_adl_rank is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_adl_rank`, must not be `None`") # noqa: E501 + + self._exchange_adl_rank = exchange_adl_rank + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexAdlRank): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexAdlRank): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_batch_cancel_order_request.py b/gate_api/models/crossex_batch_cancel_order_request.py new file mode 100644 index 00000000..c99f0011 --- /dev/null +++ b/gate_api/models/crossex_batch_cancel_order_request.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexBatchCancelOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'text': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'text': 'text' + } + + def __init__(self, order_id=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexBatchCancelOrderRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._text = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if text is not None: + self.text = text + + @property + def order_id(self): + """Gets the order_id of this CrossexBatchCancelOrderRequest. # noqa: E501 + + Order ID; either this field or text is required # noqa: E501 + + :return: The order_id of this CrossexBatchCancelOrderRequest. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this CrossexBatchCancelOrderRequest. + + Order ID; either this field or text is required # noqa: E501 + + :param order_id: The order_id of this CrossexBatchCancelOrderRequest. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def text(self): + """Gets the text of this CrossexBatchCancelOrderRequest. # noqa: E501 + + Custom ID specified by the user when creating the order; either this field or order_id is required # noqa: E501 + + :return: The text of this CrossexBatchCancelOrderRequest. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CrossexBatchCancelOrderRequest. + + Custom ID specified by the user when creating the order; either this field or order_id is required # noqa: E501 + + :param text: The text of this CrossexBatchCancelOrderRequest. # noqa: E501 + :type: str + """ + + self._text = text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexBatchCancelOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexBatchCancelOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_batch_cancel_order_response.py b/gate_api/models/crossex_batch_cancel_order_response.py new file mode 100644 index 00000000..dd1d9d8f --- /dev/null +++ b/gate_api/models/crossex_batch_cancel_order_response.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexBatchCancelOrderResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'text': 'str', + 'accepted': 'str', + 'label': 'str', + 'message': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'text': 'text', + 'accepted': 'accepted', + 'label': 'label', + 'message': 'message' + } + + def __init__(self, order_id=None, text=None, accepted=None, label=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """CrossexBatchCancelOrderResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._text = None + self._accepted = None + self._label = None + self._message = None + self.discriminator = None + + self.order_id = order_id + self.text = text + self.accepted = accepted + self.label = label + self.message = message + + @property + def order_id(self): + """Gets the order_id of this CrossexBatchCancelOrderResponse. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this CrossexBatchCancelOrderResponse. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this CrossexBatchCancelOrderResponse. + + Order ID # noqa: E501 + + :param order_id: The order_id of this CrossexBatchCancelOrderResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 + raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 + + self._order_id = order_id + + @property + def text(self): + """Gets the text of this CrossexBatchCancelOrderResponse. # noqa: E501 + + Custom ID specified by the user when creating the order # noqa: E501 + + :return: The text of this CrossexBatchCancelOrderResponse. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CrossexBatchCancelOrderResponse. + + Custom ID specified by the user when creating the order # noqa: E501 + + :param text: The text of this CrossexBatchCancelOrderResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and text is None: # noqa: E501 + raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501 + + self._text = text + + @property + def accepted(self): + """Gets the accepted of this CrossexBatchCancelOrderResponse. # noqa: E501 + + Whether the request was accepted, as the string true or false # noqa: E501 + + :return: The accepted of this CrossexBatchCancelOrderResponse. # noqa: E501 + :rtype: str + """ + return self._accepted + + @accepted.setter + def accepted(self, accepted): + """Sets the accepted of this CrossexBatchCancelOrderResponse. + + Whether the request was accepted, as the string true or false # noqa: E501 + + :param accepted: The accepted of this CrossexBatchCancelOrderResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and accepted is None: # noqa: E501 + raise ValueError("Invalid value for `accepted`, must not be `None`") # noqa: E501 + + self._accepted = accepted + + @property + def label(self): + """Gets the label of this CrossexBatchCancelOrderResponse. # noqa: E501 + + Error label when the request is not accepted; empty on success # noqa: E501 + + :return: The label of this CrossexBatchCancelOrderResponse. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this CrossexBatchCancelOrderResponse. + + Error label when the request is not accepted; empty on success # noqa: E501 + + :param label: The label of this CrossexBatchCancelOrderResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and label is None: # noqa: E501 + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + + @property + def message(self): + """Gets the message of this CrossexBatchCancelOrderResponse. # noqa: E501 + + Error message when the request is not accepted; empty on success # noqa: E501 + + :return: The message of this CrossexBatchCancelOrderResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this CrossexBatchCancelOrderResponse. + + Error message when the request is not accepted; empty on success # noqa: E501 + + :param message: The message of this CrossexBatchCancelOrderResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexBatchCancelOrderResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexBatchCancelOrderResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_close_position_request.py b/gate_api/models/crossex_close_position_request.py new file mode 100644 index 00000000..52679578 --- /dev/null +++ b/gate_api/models/crossex_close_position_request.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexClosePositionRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'position_side': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'position_side': 'position_side' + } + + def __init__(self, symbol=None, position_side=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexClosePositionRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._position_side = None + self.discriminator = None + + self.symbol = symbol + if position_side is not None: + self.position_side = position_side + + @property + def symbol(self): + """Gets the symbol of this CrossexClosePositionRequest. # noqa: E501 + + Trading Pair 1. Supports leveraged trading pairs, e.g., BINANCE_MARGIN_SOL_USDT 2. Supports contract trading pairs, e.g., OKX_FUTURE_ETH_USDT # noqa: E501 + + :return: The symbol of this CrossexClosePositionRequest. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexClosePositionRequest. + + Trading Pair 1. Supports leveraged trading pairs, e.g., BINANCE_MARGIN_SOL_USDT 2. Supports contract trading pairs, e.g., OKX_FUTURE_ETH_USDT # noqa: E501 + + :param symbol: The symbol of this CrossexClosePositionRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def position_side(self): + """Gets the position_side of this CrossexClosePositionRequest. # noqa: E501 + + Position Direction 1. For leveraged positions, this parameter must be passed 2. For contract positions, pass selectively based on your contract holding method # noqa: E501 + + :return: The position_side of this CrossexClosePositionRequest. # noqa: E501 + :rtype: str + """ + return self._position_side + + @position_side.setter + def position_side(self, position_side): + """Sets the position_side of this CrossexClosePositionRequest. + + Position Direction 1. For leveraged positions, this parameter must be passed 2. For contract positions, pass selectively based on your contract holding method # noqa: E501 + + :param position_side: The position_side of this CrossexClosePositionRequest. # noqa: E501 + :type: str + """ + + self._position_side = position_side + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexClosePositionRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexClosePositionRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_coin_discount_rate.py b/gate_api/models/crossex_coin_discount_rate.py new file mode 100644 index 00000000..1c7c0242 --- /dev/null +++ b/gate_api/models/crossex_coin_discount_rate.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexCoinDiscountRate(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'coin': 'str', + 'exchange_type': 'str', + 'tier': 'str', + 'min_value': 'str', + 'max_value': 'str', + 'discount_rate': 'str' + } + + attribute_map = { + 'coin': 'coin', + 'exchange_type': 'exchange_type', + 'tier': 'tier', + 'min_value': 'min_value', + 'max_value': 'max_value', + 'discount_rate': 'discount_rate' + } + + def __init__(self, coin=None, exchange_type=None, tier=None, min_value=None, max_value=None, discount_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """CrossexCoinDiscountRate - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._coin = None + self._exchange_type = None + self._tier = None + self._min_value = None + self._max_value = None + self._discount_rate = None + self.discriminator = None + + self.coin = coin + self.exchange_type = exchange_type + self.tier = tier + self.min_value = min_value + self.max_value = max_value + self.discount_rate = discount_rate + + @property + def coin(self): + """Gets the coin of this CrossexCoinDiscountRate. # noqa: E501 + + Currency # noqa: E501 + + :return: The coin of this CrossexCoinDiscountRate. # noqa: E501 + :rtype: str + """ + return self._coin + + @coin.setter + def coin(self, coin): + """Sets the coin of this CrossexCoinDiscountRate. + + Currency # noqa: E501 + + :param coin: The coin of this CrossexCoinDiscountRate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and coin is None: # noqa: E501 + raise ValueError("Invalid value for `coin`, must not be `None`") # noqa: E501 + + self._coin = coin + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexCoinDiscountRate. # noqa: E501 + + Exchange # noqa: E501 + + :return: The exchange_type of this CrossexCoinDiscountRate. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexCoinDiscountRate. + + Exchange # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexCoinDiscountRate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and exchange_type is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_type`, must not be `None`") # noqa: E501 + + self._exchange_type = exchange_type + + @property + def tier(self): + """Gets the tier of this CrossexCoinDiscountRate. # noqa: E501 + + Tier # noqa: E501 + + :return: The tier of this CrossexCoinDiscountRate. # noqa: E501 + :rtype: str + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this CrossexCoinDiscountRate. + + Tier # noqa: E501 + + :param tier: The tier of this CrossexCoinDiscountRate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and tier is None: # noqa: E501 + raise ValueError("Invalid value for `tier`, must not be `None`") # noqa: E501 + + self._tier = tier + + @property + def min_value(self): + """Gets the min_value of this CrossexCoinDiscountRate. # noqa: E501 + + Minimum value # noqa: E501 + + :return: The min_value of this CrossexCoinDiscountRate. # noqa: E501 + :rtype: str + """ + return self._min_value + + @min_value.setter + def min_value(self, min_value): + """Sets the min_value of this CrossexCoinDiscountRate. + + Minimum value # noqa: E501 + + :param min_value: The min_value of this CrossexCoinDiscountRate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and min_value is None: # noqa: E501 + raise ValueError("Invalid value for `min_value`, must not be `None`") # noqa: E501 + + self._min_value = min_value + + @property + def max_value(self): + """Gets the max_value of this CrossexCoinDiscountRate. # noqa: E501 + + Maximum value # noqa: E501 + + :return: The max_value of this CrossexCoinDiscountRate. # noqa: E501 + :rtype: str + """ + return self._max_value + + @max_value.setter + def max_value(self, max_value): + """Sets the max_value of this CrossexCoinDiscountRate. + + Maximum value # noqa: E501 + + :param max_value: The max_value of this CrossexCoinDiscountRate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and max_value is None: # noqa: E501 + raise ValueError("Invalid value for `max_value`, must not be `None`") # noqa: E501 + + self._max_value = max_value + + @property + def discount_rate(self): + """Gets the discount_rate of this CrossexCoinDiscountRate. # noqa: E501 + + Discount rate # noqa: E501 + + :return: The discount_rate of this CrossexCoinDiscountRate. # noqa: E501 + :rtype: str + """ + return self._discount_rate + + @discount_rate.setter + def discount_rate(self, discount_rate): + """Sets the discount_rate of this CrossexCoinDiscountRate. + + Discount rate # noqa: E501 + + :param discount_rate: The discount_rate of this CrossexCoinDiscountRate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and discount_rate is None: # noqa: E501 + raise ValueError("Invalid value for `discount_rate`, must not be `None`") # noqa: E501 + + self._discount_rate = discount_rate + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexCoinDiscountRate): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexCoinDiscountRate): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_convert_order_request.py b/gate_api/models/crossex_convert_order_request.py new file mode 100644 index 00000000..7b64075a --- /dev/null +++ b/gate_api/models/crossex_convert_order_request.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexConvertOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'quote_id': 'str' + } + + attribute_map = { + 'quote_id': 'quote_id' + } + + def __init__(self, quote_id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """CrossexConvertOrderRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._quote_id = None + self.discriminator = None + + self.quote_id = quote_id + + @property + def quote_id(self): + """Gets the quote_id of this CrossexConvertOrderRequest. # noqa: E501 + + Inquiry ID # noqa: E501 + + :return: The quote_id of this CrossexConvertOrderRequest. # noqa: E501 + :rtype: str + """ + return self._quote_id + + @quote_id.setter + def quote_id(self, quote_id): + """Sets the quote_id of this CrossexConvertOrderRequest. + + Inquiry ID # noqa: E501 + + :param quote_id: The quote_id of this CrossexConvertOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and quote_id is None: # noqa: E501 + raise ValueError("Invalid value for `quote_id`, must not be `None`") # noqa: E501 + + self._quote_id = quote_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexConvertOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexConvertOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_convert_order_response.py b/gate_api/models/crossex_convert_order_response.py new file mode 100644 index 00000000..bdb012bf --- /dev/null +++ b/gate_api/models/crossex_convert_order_response.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexConvertOrderResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'text': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'text': 'text' + } + + def __init__(self, order_id=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexConvertOrderResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._text = None + self.discriminator = None + + self.order_id = order_id + self.text = text + + @property + def order_id(self): + """Gets the order_id of this CrossexConvertOrderResponse. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this CrossexConvertOrderResponse. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this CrossexConvertOrderResponse. + + Order ID # noqa: E501 + + :param order_id: The order_id of this CrossexConvertOrderResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 + raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 + + self._order_id = order_id + + @property + def text(self): + """Gets the text of this CrossexConvertOrderResponse. # noqa: E501 + + Order ID (cannot be customized) # noqa: E501 + + :return: The text of this CrossexConvertOrderResponse. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CrossexConvertOrderResponse. + + Order ID (cannot be customized) # noqa: E501 + + :param text: The text of this CrossexConvertOrderResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and text is None: # noqa: E501 + raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501 + + self._text = text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexConvertOrderResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexConvertOrderResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_convert_quote_request.py b/gate_api/models/crossex_convert_quote_request.py new file mode 100644 index 00000000..9fca40a4 --- /dev/null +++ b/gate_api/models/crossex_convert_quote_request.py @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexConvertQuoteRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'exchange_type': 'str', + 'from_coin': 'str', + 'to_coin': 'str', + 'from_amount': 'str' + } + + attribute_map = { + 'exchange_type': 'exchange_type', + 'from_coin': 'from_coin', + 'to_coin': 'to_coin', + 'from_amount': 'from_amount' + } + + def __init__(self, exchange_type=None, from_coin=None, to_coin=None, from_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """CrossexConvertQuoteRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._exchange_type = None + self._from_coin = None + self._to_coin = None + self._from_amount = None + self.discriminator = None + + self.exchange_type = exchange_type + self.from_coin = from_coin + self.to_coin = to_coin + self.from_amount = from_amount + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexConvertQuoteRequest. # noqa: E501 + + Exchange Type # noqa: E501 + + :return: The exchange_type of this CrossexConvertQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexConvertQuoteRequest. + + Exchange Type # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexConvertQuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and exchange_type is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_type`, must not be `None`") # noqa: E501 + + self._exchange_type = exchange_type + + @property + def from_coin(self): + """Gets the from_coin of this CrossexConvertQuoteRequest. # noqa: E501 + + Asset Sold # noqa: E501 + + :return: The from_coin of this CrossexConvertQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._from_coin + + @from_coin.setter + def from_coin(self, from_coin): + """Sets the from_coin of this CrossexConvertQuoteRequest. + + Asset Sold # noqa: E501 + + :param from_coin: The from_coin of this CrossexConvertQuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and from_coin is None: # noqa: E501 + raise ValueError("Invalid value for `from_coin`, must not be `None`") # noqa: E501 + + self._from_coin = from_coin + + @property + def to_coin(self): + """Gets the to_coin of this CrossexConvertQuoteRequest. # noqa: E501 + + Asset name to buy (OKX and GATE only allow BTC, ETH, USDT; BN only allows USDT) # noqa: E501 + + :return: The to_coin of this CrossexConvertQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._to_coin + + @to_coin.setter + def to_coin(self, to_coin): + """Sets the to_coin of this CrossexConvertQuoteRequest. + + Asset name to buy (OKX and GATE only allow BTC, ETH, USDT; BN only allows USDT) # noqa: E501 + + :param to_coin: The to_coin of this CrossexConvertQuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and to_coin is None: # noqa: E501 + raise ValueError("Invalid value for `to_coin`, must not be `None`") # noqa: E501 + + self._to_coin = to_coin + + @property + def from_amount(self): + """Gets the from_amount of this CrossexConvertQuoteRequest. # noqa: E501 + + Amount to sell # noqa: E501 + + :return: The from_amount of this CrossexConvertQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._from_amount + + @from_amount.setter + def from_amount(self, from_amount): + """Sets the from_amount of this CrossexConvertQuoteRequest. + + Amount to sell # noqa: E501 + + :param from_amount: The from_amount of this CrossexConvertQuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and from_amount is None: # noqa: E501 + raise ValueError("Invalid value for `from_amount`, must not be `None`") # noqa: E501 + + self._from_amount = from_amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexConvertQuoteRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexConvertQuoteRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_convert_quote_response.py b/gate_api/models/crossex_convert_quote_response.py new file mode 100644 index 00000000..5bf704af --- /dev/null +++ b/gate_api/models/crossex_convert_quote_response.py @@ -0,0 +1,298 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexConvertQuoteResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'quote_id': 'str', + 'valid_ms': 'str', + 'from_coin': 'str', + 'to_coin': 'str', + 'from_amount': 'str', + 'to_amount': 'str', + 'price': 'str' + } + + attribute_map = { + 'quote_id': 'quote_id', + 'valid_ms': 'valid_ms', + 'from_coin': 'from_coin', + 'to_coin': 'to_coin', + 'from_amount': 'from_amount', + 'to_amount': 'to_amount', + 'price': 'price' + } + + def __init__(self, quote_id=None, valid_ms=None, from_coin=None, to_coin=None, from_amount=None, to_amount=None, price=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, Configuration) -> None + """CrossexConvertQuoteResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._quote_id = None + self._valid_ms = None + self._from_coin = None + self._to_coin = None + self._from_amount = None + self._to_amount = None + self._price = None + self.discriminator = None + + self.quote_id = quote_id + self.valid_ms = valid_ms + self.from_coin = from_coin + self.to_coin = to_coin + self.from_amount = from_amount + self.to_amount = to_amount + self.price = price + + @property + def quote_id(self): + """Gets the quote_id of this CrossexConvertQuoteResponse. # noqa: E501 + + Quote ID # noqa: E501 + + :return: The quote_id of this CrossexConvertQuoteResponse. # noqa: E501 + :rtype: str + """ + return self._quote_id + + @quote_id.setter + def quote_id(self, quote_id): + """Sets the quote_id of this CrossexConvertQuoteResponse. + + Quote ID # noqa: E501 + + :param quote_id: The quote_id of this CrossexConvertQuoteResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and quote_id is None: # noqa: E501 + raise ValueError("Invalid value for `quote_id`, must not be `None`") # noqa: E501 + + self._quote_id = quote_id + + @property + def valid_ms(self): + """Gets the valid_ms of this CrossexConvertQuoteResponse. # noqa: E501 + + Valid time (milliseconds timestamp) # noqa: E501 + + :return: The valid_ms of this CrossexConvertQuoteResponse. # noqa: E501 + :rtype: str + """ + return self._valid_ms + + @valid_ms.setter + def valid_ms(self, valid_ms): + """Sets the valid_ms of this CrossexConvertQuoteResponse. + + Valid time (milliseconds timestamp) # noqa: E501 + + :param valid_ms: The valid_ms of this CrossexConvertQuoteResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and valid_ms is None: # noqa: E501 + raise ValueError("Invalid value for `valid_ms`, must not be `None`") # noqa: E501 + + self._valid_ms = valid_ms + + @property + def from_coin(self): + """Gets the from_coin of this CrossexConvertQuoteResponse. # noqa: E501 + + Asset Sold # noqa: E501 + + :return: The from_coin of this CrossexConvertQuoteResponse. # noqa: E501 + :rtype: str + """ + return self._from_coin + + @from_coin.setter + def from_coin(self, from_coin): + """Sets the from_coin of this CrossexConvertQuoteResponse. + + Asset Sold # noqa: E501 + + :param from_coin: The from_coin of this CrossexConvertQuoteResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and from_coin is None: # noqa: E501 + raise ValueError("Invalid value for `from_coin`, must not be `None`") # noqa: E501 + + self._from_coin = from_coin + + @property + def to_coin(self): + """Gets the to_coin of this CrossexConvertQuoteResponse. # noqa: E501 + + Asset Bought # noqa: E501 + + :return: The to_coin of this CrossexConvertQuoteResponse. # noqa: E501 + :rtype: str + """ + return self._to_coin + + @to_coin.setter + def to_coin(self, to_coin): + """Sets the to_coin of this CrossexConvertQuoteResponse. + + Asset Bought # noqa: E501 + + :param to_coin: The to_coin of this CrossexConvertQuoteResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and to_coin is None: # noqa: E501 + raise ValueError("Invalid value for `to_coin`, must not be `None`") # noqa: E501 + + self._to_coin = to_coin + + @property + def from_amount(self): + """Gets the from_amount of this CrossexConvertQuoteResponse. # noqa: E501 + + Amount to sell # noqa: E501 + + :return: The from_amount of this CrossexConvertQuoteResponse. # noqa: E501 + :rtype: str + """ + return self._from_amount + + @from_amount.setter + def from_amount(self, from_amount): + """Sets the from_amount of this CrossexConvertQuoteResponse. + + Amount to sell # noqa: E501 + + :param from_amount: The from_amount of this CrossexConvertQuoteResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and from_amount is None: # noqa: E501 + raise ValueError("Invalid value for `from_amount`, must not be `None`") # noqa: E501 + + self._from_amount = from_amount + + @property + def to_amount(self): + """Gets the to_amount of this CrossexConvertQuoteResponse. # noqa: E501 + + Amount to buy # noqa: E501 + + :return: The to_amount of this CrossexConvertQuoteResponse. # noqa: E501 + :rtype: str + """ + return self._to_amount + + @to_amount.setter + def to_amount(self, to_amount): + """Sets the to_amount of this CrossexConvertQuoteResponse. + + Amount to buy # noqa: E501 + + :param to_amount: The to_amount of this CrossexConvertQuoteResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and to_amount is None: # noqa: E501 + raise ValueError("Invalid value for `to_amount`, must not be `None`") # noqa: E501 + + self._to_amount = to_amount + + @property + def price(self): + """Gets the price of this CrossexConvertQuoteResponse. # noqa: E501 + + Price # noqa: E501 + + :return: The price of this CrossexConvertQuoteResponse. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this CrossexConvertQuoteResponse. + + Price # noqa: E501 + + :param price: The price of this CrossexConvertQuoteResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price is None: # noqa: E501 + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexConvertQuoteResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexConvertQuoteResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_historical_margin_position.py b/gate_api/models/crossex_historical_margin_position.py new file mode 100644 index 00000000..469ffa97 --- /dev/null +++ b/gate_api/models/crossex_historical_margin_position.py @@ -0,0 +1,601 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexHistoricalMarginPosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'position_id': 'str', + 'user_id': 'str', + 'symbol': 'str', + 'closed_type': 'str', + 'closed_pnl': 'str', + 'closed_pnl_rate': 'str', + 'open_avg_price': 'str', + 'closed_avg_price': 'str', + 'max_position_qty': 'str', + 'closed_qty': 'str', + 'closed_value': 'str', + 'liq_fee': 'str', + 'position_side': 'str', + 'leverage': 'str', + 'interest': 'str', + 'business_type': 'str', + 'create_time': 'str', + 'update_time': 'str' + } + + attribute_map = { + 'position_id': 'position_id', + 'user_id': 'user_id', + 'symbol': 'symbol', + 'closed_type': 'closed_type', + 'closed_pnl': 'closed_pnl', + 'closed_pnl_rate': 'closed_pnl_rate', + 'open_avg_price': 'open_avg_price', + 'closed_avg_price': 'closed_avg_price', + 'max_position_qty': 'max_position_qty', + 'closed_qty': 'closed_qty', + 'closed_value': 'closed_value', + 'liq_fee': 'liq_fee', + 'position_side': 'position_side', + 'leverage': 'leverage', + 'interest': 'interest', + 'business_type': 'business_type', + 'create_time': 'create_time', + 'update_time': 'update_time' + } + + def __init__(self, position_id=None, user_id=None, symbol=None, closed_type=None, closed_pnl=None, closed_pnl_rate=None, open_avg_price=None, closed_avg_price=None, max_position_qty=None, closed_qty=None, closed_value=None, liq_fee=None, position_side=None, leverage=None, interest=None, business_type=None, create_time=None, update_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """CrossexHistoricalMarginPosition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._position_id = None + self._user_id = None + self._symbol = None + self._closed_type = None + self._closed_pnl = None + self._closed_pnl_rate = None + self._open_avg_price = None + self._closed_avg_price = None + self._max_position_qty = None + self._closed_qty = None + self._closed_value = None + self._liq_fee = None + self._position_side = None + self._leverage = None + self._interest = None + self._business_type = None + self._create_time = None + self._update_time = None + self.discriminator = None + + if position_id is not None: + self.position_id = position_id + if user_id is not None: + self.user_id = user_id + if symbol is not None: + self.symbol = symbol + if closed_type is not None: + self.closed_type = closed_type + if closed_pnl is not None: + self.closed_pnl = closed_pnl + if closed_pnl_rate is not None: + self.closed_pnl_rate = closed_pnl_rate + if open_avg_price is not None: + self.open_avg_price = open_avg_price + if closed_avg_price is not None: + self.closed_avg_price = closed_avg_price + if max_position_qty is not None: + self.max_position_qty = max_position_qty + if closed_qty is not None: + self.closed_qty = closed_qty + if closed_value is not None: + self.closed_value = closed_value + if liq_fee is not None: + self.liq_fee = liq_fee + if position_side is not None: + self.position_side = position_side + if leverage is not None: + self.leverage = leverage + self.interest = interest + self.business_type = business_type + if create_time is not None: + self.create_time = create_time + if update_time is not None: + self.update_time = update_time + + @property + def position_id(self): + """Gets the position_id of this CrossexHistoricalMarginPosition. # noqa: E501 + + Position ID # noqa: E501 + + :return: The position_id of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._position_id + + @position_id.setter + def position_id(self, position_id): + """Sets the position_id of this CrossexHistoricalMarginPosition. + + Position ID # noqa: E501 + + :param position_id: The position_id of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._position_id = position_id + + @property + def user_id(self): + """Gets the user_id of this CrossexHistoricalMarginPosition. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexHistoricalMarginPosition. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._user_id = user_id + + @property + def symbol(self): + """Gets the symbol of this CrossexHistoricalMarginPosition. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexHistoricalMarginPosition. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def closed_type(self): + """Gets the closed_type of this CrossexHistoricalMarginPosition. # noqa: E501 + + Position close type (PARTIAL_CLOSED: partially closed; COMPLETE_CLOSED: fully closed) # noqa: E501 + + :return: The closed_type of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._closed_type + + @closed_type.setter + def closed_type(self, closed_type): + """Sets the closed_type of this CrossexHistoricalMarginPosition. + + Position close type (PARTIAL_CLOSED: partially closed; COMPLETE_CLOSED: fully closed) # noqa: E501 + + :param closed_type: The closed_type of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._closed_type = closed_type + + @property + def closed_pnl(self): + """Gets the closed_pnl of this CrossexHistoricalMarginPosition. # noqa: E501 + + Close Position P&L # noqa: E501 + + :return: The closed_pnl of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._closed_pnl + + @closed_pnl.setter + def closed_pnl(self, closed_pnl): + """Sets the closed_pnl of this CrossexHistoricalMarginPosition. + + Close Position P&L # noqa: E501 + + :param closed_pnl: The closed_pnl of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._closed_pnl = closed_pnl + + @property + def closed_pnl_rate(self): + """Gets the closed_pnl_rate of this CrossexHistoricalMarginPosition. # noqa: E501 + + Close Position P&L Ratio # noqa: E501 + + :return: The closed_pnl_rate of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._closed_pnl_rate + + @closed_pnl_rate.setter + def closed_pnl_rate(self, closed_pnl_rate): + """Sets the closed_pnl_rate of this CrossexHistoricalMarginPosition. + + Close Position P&L Ratio # noqa: E501 + + :param closed_pnl_rate: The closed_pnl_rate of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._closed_pnl_rate = closed_pnl_rate + + @property + def open_avg_price(self): + """Gets the open_avg_price of this CrossexHistoricalMarginPosition. # noqa: E501 + + Average Opening Price # noqa: E501 + + :return: The open_avg_price of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._open_avg_price + + @open_avg_price.setter + def open_avg_price(self, open_avg_price): + """Sets the open_avg_price of this CrossexHistoricalMarginPosition. + + Average Opening Price # noqa: E501 + + :param open_avg_price: The open_avg_price of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._open_avg_price = open_avg_price + + @property + def closed_avg_price(self): + """Gets the closed_avg_price of this CrossexHistoricalMarginPosition. # noqa: E501 + + Average Close Price # noqa: E501 + + :return: The closed_avg_price of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._closed_avg_price + + @closed_avg_price.setter + def closed_avg_price(self, closed_avg_price): + """Sets the closed_avg_price of this CrossexHistoricalMarginPosition. + + Average Close Price # noqa: E501 + + :param closed_avg_price: The closed_avg_price of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._closed_avg_price = closed_avg_price + + @property + def max_position_qty(self): + """Gets the max_position_qty of this CrossexHistoricalMarginPosition. # noqa: E501 + + Max Trade Size # noqa: E501 + + :return: The max_position_qty of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._max_position_qty + + @max_position_qty.setter + def max_position_qty(self, max_position_qty): + """Sets the max_position_qty of this CrossexHistoricalMarginPosition. + + Max Trade Size # noqa: E501 + + :param max_position_qty: The max_position_qty of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._max_position_qty = max_position_qty + + @property + def closed_qty(self): + """Gets the closed_qty of this CrossexHistoricalMarginPosition. # noqa: E501 + + Close Position Quantity # noqa: E501 + + :return: The closed_qty of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._closed_qty + + @closed_qty.setter + def closed_qty(self, closed_qty): + """Sets the closed_qty of this CrossexHistoricalMarginPosition. + + Close Position Quantity # noqa: E501 + + :param closed_qty: The closed_qty of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._closed_qty = closed_qty + + @property + def closed_value(self): + """Gets the closed_value of this CrossexHistoricalMarginPosition. # noqa: E501 + + Close Position Value # noqa: E501 + + :return: The closed_value of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._closed_value + + @closed_value.setter + def closed_value(self, closed_value): + """Sets the closed_value of this CrossexHistoricalMarginPosition. + + Close Position Value # noqa: E501 + + :param closed_value: The closed_value of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._closed_value = closed_value + + @property + def liq_fee(self): + """Gets the liq_fee of this CrossexHistoricalMarginPosition. # noqa: E501 + + Liquidation Fee # noqa: E501 + + :return: The liq_fee of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._liq_fee + + @liq_fee.setter + def liq_fee(self, liq_fee): + """Sets the liq_fee of this CrossexHistoricalMarginPosition. + + Liquidation Fee # noqa: E501 + + :param liq_fee: The liq_fee of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._liq_fee = liq_fee + + @property + def position_side(self): + """Gets the position_side of this CrossexHistoricalMarginPosition. # noqa: E501 + + Position Direction Before Close # noqa: E501 + + :return: The position_side of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._position_side + + @position_side.setter + def position_side(self, position_side): + """Sets the position_side of this CrossexHistoricalMarginPosition. + + Position Direction Before Close # noqa: E501 + + :param position_side: The position_side of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._position_side = position_side + + @property + def leverage(self): + """Gets the leverage of this CrossexHistoricalMarginPosition. # noqa: E501 + + Leverage at Close # noqa: E501 + + :return: The leverage of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this CrossexHistoricalMarginPosition. + + Leverage at Close # noqa: E501 + + :param leverage: The leverage of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + @property + def interest(self): + """Gets the interest of this CrossexHistoricalMarginPosition. # noqa: E501 + + Total Deducted Interest # noqa: E501 + + :return: The interest of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._interest + + @interest.setter + def interest(self, interest): + """Sets the interest of this CrossexHistoricalMarginPosition. + + Total Deducted Interest # noqa: E501 + + :param interest: The interest of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and interest is None: # noqa: E501 + raise ValueError("Invalid value for `interest`, must not be `None`") # noqa: E501 + + self._interest = interest + + @property + def business_type(self): + """Gets the business_type of this CrossexHistoricalMarginPosition. # noqa: E501 + + Position Business Type # noqa: E501 + + :return: The business_type of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._business_type + + @business_type.setter + def business_type(self, business_type): + """Sets the business_type of this CrossexHistoricalMarginPosition. + + Position Business Type # noqa: E501 + + :param business_type: The business_type of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and business_type is None: # noqa: E501 + raise ValueError("Invalid value for `business_type`, must not be `None`") # noqa: E501 + + self._business_type = business_type + + @property + def create_time(self): + """Gets the create_time of this CrossexHistoricalMarginPosition. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CrossexHistoricalMarginPosition. + + Created time # noqa: E501 + + :param create_time: The create_time of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this CrossexHistoricalMarginPosition. # noqa: E501 + + Update time # noqa: E501 + + :return: The update_time of this CrossexHistoricalMarginPosition. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this CrossexHistoricalMarginPosition. + + Update time # noqa: E501 + + :param update_time: The update_time of this CrossexHistoricalMarginPosition. # noqa: E501 + :type: str + """ + + self._update_time = update_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexHistoricalMarginPosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexHistoricalMarginPosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_historical_position.py b/gate_api/models/crossex_historical_position.py new file mode 100644 index 00000000..ad190e6f --- /dev/null +++ b/gate_api/models/crossex_historical_position.py @@ -0,0 +1,656 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexHistoricalPosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'position_id': 'str', + 'user_id': 'str', + 'symbol': 'str', + 'closed_type': 'str', + 'closed_pnl': 'str', + 'closed_pnl_rate': 'str', + 'open_avg_price': 'str', + 'closed_avg_price': 'str', + 'max_position_qty': 'str', + 'closed_qty': 'str', + 'closed_value': 'str', + 'fee': 'str', + 'liq_fee': 'str', + 'funding_fee': 'str', + 'position_side': 'str', + 'position_mode': 'str', + 'leverage': 'str', + 'business_type': 'str', + 'create_time': 'str', + 'update_time': 'str' + } + + attribute_map = { + 'position_id': 'position_id', + 'user_id': 'user_id', + 'symbol': 'symbol', + 'closed_type': 'closed_type', + 'closed_pnl': 'closed_pnl', + 'closed_pnl_rate': 'closed_pnl_rate', + 'open_avg_price': 'open_avg_price', + 'closed_avg_price': 'closed_avg_price', + 'max_position_qty': 'max_position_qty', + 'closed_qty': 'closed_qty', + 'closed_value': 'closed_value', + 'fee': 'fee', + 'liq_fee': 'liq_fee', + 'funding_fee': 'funding_fee', + 'position_side': 'position_side', + 'position_mode': 'position_mode', + 'leverage': 'leverage', + 'business_type': 'business_type', + 'create_time': 'create_time', + 'update_time': 'update_time' + } + + def __init__(self, position_id=None, user_id=None, symbol=None, closed_type=None, closed_pnl=None, closed_pnl_rate=None, open_avg_price=None, closed_avg_price=None, max_position_qty=None, closed_qty=None, closed_value=None, fee=None, liq_fee=None, funding_fee=None, position_side=None, position_mode=None, leverage=None, business_type=None, create_time=None, update_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """CrossexHistoricalPosition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._position_id = None + self._user_id = None + self._symbol = None + self._closed_type = None + self._closed_pnl = None + self._closed_pnl_rate = None + self._open_avg_price = None + self._closed_avg_price = None + self._max_position_qty = None + self._closed_qty = None + self._closed_value = None + self._fee = None + self._liq_fee = None + self._funding_fee = None + self._position_side = None + self._position_mode = None + self._leverage = None + self._business_type = None + self._create_time = None + self._update_time = None + self.discriminator = None + + if position_id is not None: + self.position_id = position_id + if user_id is not None: + self.user_id = user_id + if symbol is not None: + self.symbol = symbol + if closed_type is not None: + self.closed_type = closed_type + if closed_pnl is not None: + self.closed_pnl = closed_pnl + if closed_pnl_rate is not None: + self.closed_pnl_rate = closed_pnl_rate + if open_avg_price is not None: + self.open_avg_price = open_avg_price + if closed_avg_price is not None: + self.closed_avg_price = closed_avg_price + if max_position_qty is not None: + self.max_position_qty = max_position_qty + if closed_qty is not None: + self.closed_qty = closed_qty + if closed_value is not None: + self.closed_value = closed_value + if fee is not None: + self.fee = fee + if liq_fee is not None: + self.liq_fee = liq_fee + if funding_fee is not None: + self.funding_fee = funding_fee + if position_side is not None: + self.position_side = position_side + if position_mode is not None: + self.position_mode = position_mode + if leverage is not None: + self.leverage = leverage + self.business_type = business_type + if create_time is not None: + self.create_time = create_time + if update_time is not None: + self.update_time = update_time + + @property + def position_id(self): + """Gets the position_id of this CrossexHistoricalPosition. # noqa: E501 + + Position ID # noqa: E501 + + :return: The position_id of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._position_id + + @position_id.setter + def position_id(self, position_id): + """Sets the position_id of this CrossexHistoricalPosition. + + Position ID # noqa: E501 + + :param position_id: The position_id of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._position_id = position_id + + @property + def user_id(self): + """Gets the user_id of this CrossexHistoricalPosition. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexHistoricalPosition. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._user_id = user_id + + @property + def symbol(self): + """Gets the symbol of this CrossexHistoricalPosition. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexHistoricalPosition. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def closed_type(self): + """Gets the closed_type of this CrossexHistoricalPosition. # noqa: E501 + + Position close type (PARTIAL_CLOSED: partially closed; COMPLETE_CLOSED: fully closed) # noqa: E501 + + :return: The closed_type of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._closed_type + + @closed_type.setter + def closed_type(self, closed_type): + """Sets the closed_type of this CrossexHistoricalPosition. + + Position close type (PARTIAL_CLOSED: partially closed; COMPLETE_CLOSED: fully closed) # noqa: E501 + + :param closed_type: The closed_type of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._closed_type = closed_type + + @property + def closed_pnl(self): + """Gets the closed_pnl of this CrossexHistoricalPosition. # noqa: E501 + + Close Position P&L # noqa: E501 + + :return: The closed_pnl of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._closed_pnl + + @closed_pnl.setter + def closed_pnl(self, closed_pnl): + """Sets the closed_pnl of this CrossexHistoricalPosition. + + Close Position P&L # noqa: E501 + + :param closed_pnl: The closed_pnl of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._closed_pnl = closed_pnl + + @property + def closed_pnl_rate(self): + """Gets the closed_pnl_rate of this CrossexHistoricalPosition. # noqa: E501 + + Close Position P&L Ratio # noqa: E501 + + :return: The closed_pnl_rate of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._closed_pnl_rate + + @closed_pnl_rate.setter + def closed_pnl_rate(self, closed_pnl_rate): + """Sets the closed_pnl_rate of this CrossexHistoricalPosition. + + Close Position P&L Ratio # noqa: E501 + + :param closed_pnl_rate: The closed_pnl_rate of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._closed_pnl_rate = closed_pnl_rate + + @property + def open_avg_price(self): + """Gets the open_avg_price of this CrossexHistoricalPosition. # noqa: E501 + + Average Opening Price # noqa: E501 + + :return: The open_avg_price of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._open_avg_price + + @open_avg_price.setter + def open_avg_price(self, open_avg_price): + """Sets the open_avg_price of this CrossexHistoricalPosition. + + Average Opening Price # noqa: E501 + + :param open_avg_price: The open_avg_price of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._open_avg_price = open_avg_price + + @property + def closed_avg_price(self): + """Gets the closed_avg_price of this CrossexHistoricalPosition. # noqa: E501 + + Average Close Price # noqa: E501 + + :return: The closed_avg_price of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._closed_avg_price + + @closed_avg_price.setter + def closed_avg_price(self, closed_avg_price): + """Sets the closed_avg_price of this CrossexHistoricalPosition. + + Average Close Price # noqa: E501 + + :param closed_avg_price: The closed_avg_price of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._closed_avg_price = closed_avg_price + + @property + def max_position_qty(self): + """Gets the max_position_qty of this CrossexHistoricalPosition. # noqa: E501 + + Max Trade Size # noqa: E501 + + :return: The max_position_qty of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._max_position_qty + + @max_position_qty.setter + def max_position_qty(self, max_position_qty): + """Sets the max_position_qty of this CrossexHistoricalPosition. + + Max Trade Size # noqa: E501 + + :param max_position_qty: The max_position_qty of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._max_position_qty = max_position_qty + + @property + def closed_qty(self): + """Gets the closed_qty of this CrossexHistoricalPosition. # noqa: E501 + + Close Position Quantity # noqa: E501 + + :return: The closed_qty of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._closed_qty + + @closed_qty.setter + def closed_qty(self, closed_qty): + """Sets the closed_qty of this CrossexHistoricalPosition. + + Close Position Quantity # noqa: E501 + + :param closed_qty: The closed_qty of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._closed_qty = closed_qty + + @property + def closed_value(self): + """Gets the closed_value of this CrossexHistoricalPosition. # noqa: E501 + + Close Position Value # noqa: E501 + + :return: The closed_value of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._closed_value + + @closed_value.setter + def closed_value(self, closed_value): + """Sets the closed_value of this CrossexHistoricalPosition. + + Close Position Value # noqa: E501 + + :param closed_value: The closed_value of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._closed_value = closed_value + + @property + def fee(self): + """Gets the fee of this CrossexHistoricalPosition. # noqa: E501 + + Position Accumulated Fees # noqa: E501 + + :return: The fee of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this CrossexHistoricalPosition. + + Position Accumulated Fees # noqa: E501 + + :param fee: The fee of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def liq_fee(self): + """Gets the liq_fee of this CrossexHistoricalPosition. # noqa: E501 + + Liquidation Fee # noqa: E501 + + :return: The liq_fee of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._liq_fee + + @liq_fee.setter + def liq_fee(self, liq_fee): + """Sets the liq_fee of this CrossexHistoricalPosition. + + Liquidation Fee # noqa: E501 + + :param liq_fee: The liq_fee of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._liq_fee = liq_fee + + @property + def funding_fee(self): + """Gets the funding_fee of this CrossexHistoricalPosition. # noqa: E501 + + Funding Fee # noqa: E501 + + :return: The funding_fee of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._funding_fee + + @funding_fee.setter + def funding_fee(self, funding_fee): + """Sets the funding_fee of this CrossexHistoricalPosition. + + Funding Fee # noqa: E501 + + :param funding_fee: The funding_fee of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._funding_fee = funding_fee + + @property + def position_side(self): + """Gets the position_side of this CrossexHistoricalPosition. # noqa: E501 + + Position Direction Before Close # noqa: E501 + + :return: The position_side of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._position_side + + @position_side.setter + def position_side(self, position_side): + """Sets the position_side of this CrossexHistoricalPosition. + + Position Direction Before Close # noqa: E501 + + :param position_side: The position_side of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._position_side = position_side + + @property + def position_mode(self): + """Gets the position_mode of this CrossexHistoricalPosition. # noqa: E501 + + Position Mode at Close # noqa: E501 + + :return: The position_mode of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._position_mode + + @position_mode.setter + def position_mode(self, position_mode): + """Sets the position_mode of this CrossexHistoricalPosition. + + Position Mode at Close # noqa: E501 + + :param position_mode: The position_mode of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._position_mode = position_mode + + @property + def leverage(self): + """Gets the leverage of this CrossexHistoricalPosition. # noqa: E501 + + Leverage at Close # noqa: E501 + + :return: The leverage of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this CrossexHistoricalPosition. + + Leverage at Close # noqa: E501 + + :param leverage: The leverage of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + @property + def business_type(self): + """Gets the business_type of this CrossexHistoricalPosition. # noqa: E501 + + Business Type # noqa: E501 + + :return: The business_type of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._business_type + + @business_type.setter + def business_type(self, business_type): + """Sets the business_type of this CrossexHistoricalPosition. + + Business Type # noqa: E501 + + :param business_type: The business_type of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and business_type is None: # noqa: E501 + raise ValueError("Invalid value for `business_type`, must not be `None`") # noqa: E501 + + self._business_type = business_type + + @property + def create_time(self): + """Gets the create_time of this CrossexHistoricalPosition. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CrossexHistoricalPosition. + + Created time # noqa: E501 + + :param create_time: The create_time of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this CrossexHistoricalPosition. # noqa: E501 + + Update time # noqa: E501 + + :return: The update_time of this CrossexHistoricalPosition. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this CrossexHistoricalPosition. + + Update time # noqa: E501 + + :param update_time: The update_time of this CrossexHistoricalPosition. # noqa: E501 + :type: str + """ + + self._update_time = update_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexHistoricalPosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexHistoricalPosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_interest_rate.py b/gate_api/models/crossex_interest_rate.py new file mode 100644 index 00000000..75c99a0f --- /dev/null +++ b/gate_api/models/crossex_interest_rate.py @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexInterestRate(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'coin': 'str', + 'exchange_type': 'str', + 'hour_interest_rate': 'str', + 'time': 'str' + } + + attribute_map = { + 'coin': 'coin', + 'exchange_type': 'exchange_type', + 'hour_interest_rate': 'hour_interest_rate', + 'time': 'time' + } + + def __init__(self, coin=None, exchange_type=None, hour_interest_rate=None, time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """CrossexInterestRate - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._coin = None + self._exchange_type = None + self._hour_interest_rate = None + self._time = None + self.discriminator = None + + self.coin = coin + self.exchange_type = exchange_type + self.hour_interest_rate = hour_interest_rate + self.time = time + + @property + def coin(self): + """Gets the coin of this CrossexInterestRate. # noqa: E501 + + Currency # noqa: E501 + + :return: The coin of this CrossexInterestRate. # noqa: E501 + :rtype: str + """ + return self._coin + + @coin.setter + def coin(self, coin): + """Sets the coin of this CrossexInterestRate. + + Currency # noqa: E501 + + :param coin: The coin of this CrossexInterestRate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and coin is None: # noqa: E501 + raise ValueError("Invalid value for `coin`, must not be `None`") # noqa: E501 + + self._coin = coin + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexInterestRate. # noqa: E501 + + Exchange # noqa: E501 + + :return: The exchange_type of this CrossexInterestRate. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexInterestRate. + + Exchange # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexInterestRate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and exchange_type is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_type`, must not be `None`") # noqa: E501 + + self._exchange_type = exchange_type + + @property + def hour_interest_rate(self): + """Gets the hour_interest_rate of this CrossexInterestRate. # noqa: E501 + + Hourly Interest Rate # noqa: E501 + + :return: The hour_interest_rate of this CrossexInterestRate. # noqa: E501 + :rtype: str + """ + return self._hour_interest_rate + + @hour_interest_rate.setter + def hour_interest_rate(self, hour_interest_rate): + """Sets the hour_interest_rate of this CrossexInterestRate. + + Hourly Interest Rate # noqa: E501 + + :param hour_interest_rate: The hour_interest_rate of this CrossexInterestRate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and hour_interest_rate is None: # noqa: E501 + raise ValueError("Invalid value for `hour_interest_rate`, must not be `None`") # noqa: E501 + + self._hour_interest_rate = hour_interest_rate + + @property + def time(self): + """Gets the time of this CrossexInterestRate. # noqa: E501 + + Millisecond Timestamp # noqa: E501 + + :return: The time of this CrossexInterestRate. # noqa: E501 + :rtype: str + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this CrossexInterestRate. + + Millisecond Timestamp # noqa: E501 + + :param time: The time of this CrossexInterestRate. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and time is None: # noqa: E501 + raise ValueError("Invalid value for `time`, must not be `None`") # noqa: E501 + + self._time = time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexInterestRate): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexInterestRate): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_isolated_margin_request.py b/gate_api/models/crossex_isolated_margin_request.py new file mode 100644 index 00000000..d5ca4111 --- /dev/null +++ b/gate_api/models/crossex_isolated_margin_request.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexIsolatedMarginRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'margin': 'str', + 'position_side': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'margin': 'margin', + 'position_side': 'position_side' + } + + def __init__(self, symbol=None, margin=None, position_side=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """CrossexIsolatedMarginRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._margin = None + self._position_side = None + self.discriminator = None + + self.symbol = symbol + self.margin = margin + if position_side is not None: + self.position_side = position_side + + @property + def symbol(self): + """Gets the symbol of this CrossexIsolatedMarginRequest. # noqa: E501 + + Hyperliquid futures trading pair # noqa: E501 + + :return: The symbol of this CrossexIsolatedMarginRequest. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexIsolatedMarginRequest. + + Hyperliquid futures trading pair # noqa: E501 + + :param symbol: The symbol of this CrossexIsolatedMarginRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def margin(self): + """Gets the margin of this CrossexIsolatedMarginRequest. # noqa: E501 + + Margin adjustment amount. Positive values increase margin, while negative values decrease margin. Values with more than two decimal places are truncated to two decimal places # noqa: E501 + + :return: The margin of this CrossexIsolatedMarginRequest. # noqa: E501 + :rtype: str + """ + return self._margin + + @margin.setter + def margin(self, margin): + """Sets the margin of this CrossexIsolatedMarginRequest. + + Margin adjustment amount. Positive values increase margin, while negative values decrease margin. Values with more than two decimal places are truncated to two decimal places # noqa: E501 + + :param margin: The margin of this CrossexIsolatedMarginRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and margin is None: # noqa: E501 + raise ValueError("Invalid value for `margin`, must not be `None`") # noqa: E501 + + self._margin = margin + + @property + def position_side(self): + """Gets the position_side of this CrossexIsolatedMarginRequest. # noqa: E501 + + Position side (NONE/LONG/SHORT). Defaults to NONE for one-way positions if omitted # noqa: E501 + + :return: The position_side of this CrossexIsolatedMarginRequest. # noqa: E501 + :rtype: str + """ + return self._position_side + + @position_side.setter + def position_side(self, position_side): + """Sets the position_side of this CrossexIsolatedMarginRequest. + + Position side (NONE/LONG/SHORT). Defaults to NONE for one-way positions if omitted # noqa: E501 + + :param position_side: The position_side of this CrossexIsolatedMarginRequest. # noqa: E501 + :type: str + """ + allowed_values = ["NONE", "LONG", "SHORT"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and position_side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `position_side` ({0}), must be one of {1}" # noqa: E501 + .format(position_side, allowed_values) + ) + + self._position_side = position_side + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexIsolatedMarginRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexIsolatedMarginRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_isolated_margin_response.py b/gate_api/models/crossex_isolated_margin_response.py new file mode 100644 index 00000000..ad781363 --- /dev/null +++ b/gate_api/models/crossex_isolated_margin_response.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexIsolatedMarginResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'margin': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'margin': 'margin' + } + + def __init__(self, symbol=None, margin=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexIsolatedMarginResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._margin = None + self.discriminator = None + + self.symbol = symbol + self.margin = margin + + @property + def symbol(self): + """Gets the symbol of this CrossexIsolatedMarginResponse. # noqa: E501 + + Futures trading pair # noqa: E501 + + :return: The symbol of this CrossexIsolatedMarginResponse. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexIsolatedMarginResponse. + + Futures trading pair # noqa: E501 + + :param symbol: The symbol of this CrossexIsolatedMarginResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def margin(self): + """Gets the margin of this CrossexIsolatedMarginResponse. # noqa: E501 + + Amount of isolated margin increased or decreased in this request # noqa: E501 + + :return: The margin of this CrossexIsolatedMarginResponse. # noqa: E501 + :rtype: str + """ + return self._margin + + @margin.setter + def margin(self, margin): + """Sets the margin of this CrossexIsolatedMarginResponse. + + Amount of isolated margin increased or decreased in this request # noqa: E501 + + :param margin: The margin of this CrossexIsolatedMarginResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and margin is None: # noqa: E501 + raise ValueError("Invalid value for `margin`, must not be `None`") # noqa: E501 + + self._margin = margin + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexIsolatedMarginResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexIsolatedMarginResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_leverage_request.py b/gate_api/models/crossex_leverage_request.py new file mode 100644 index 00000000..83fd73b3 --- /dev/null +++ b/gate_api/models/crossex_leverage_request.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexLeverageRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'leverage': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'leverage': 'leverage' + } + + def __init__(self, symbol=None, leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexLeverageRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._leverage = None + self.discriminator = None + + self.symbol = symbol + self.leverage = leverage + + @property + def symbol(self): + """Gets the symbol of this CrossexLeverageRequest. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this CrossexLeverageRequest. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexLeverageRequest. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this CrossexLeverageRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def leverage(self): + """Gets the leverage of this CrossexLeverageRequest. # noqa: E501 + + Leverage # noqa: E501 + + :return: The leverage of this CrossexLeverageRequest. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this CrossexLeverageRequest. + + Leverage # noqa: E501 + + :param leverage: The leverage of this CrossexLeverageRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and leverage is None: # noqa: E501 + raise ValueError("Invalid value for `leverage`, must not be `None`") # noqa: E501 + + self._leverage = leverage + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexLeverageRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexLeverageRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_leverage_response.py b/gate_api/models/crossex_leverage_response.py new file mode 100644 index 00000000..57b035d0 --- /dev/null +++ b/gate_api/models/crossex_leverage_response.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexLeverageResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'leverage': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'leverage': 'leverage' + } + + def __init__(self, symbol=None, leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexLeverageResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._leverage = None + self.discriminator = None + + self.symbol = symbol + self.leverage = leverage + + @property + def symbol(self): + """Gets the symbol of this CrossexLeverageResponse. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this CrossexLeverageResponse. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexLeverageResponse. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this CrossexLeverageResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def leverage(self): + """Gets the leverage of this CrossexLeverageResponse. # noqa: E501 + + Requested Modified Leverage # noqa: E501 + + :return: The leverage of this CrossexLeverageResponse. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this CrossexLeverageResponse. + + Requested Modified Leverage # noqa: E501 + + :param leverage: The leverage of this CrossexLeverageResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and leverage is None: # noqa: E501 + raise ValueError("Invalid value for `leverage`, must not be `None`") # noqa: E501 + + self._leverage = leverage + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexLeverageResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexLeverageResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_margin_interest_record.py b/gate_api/models/crossex_margin_interest_record.py new file mode 100644 index 00000000..1a638902 --- /dev/null +++ b/gate_api/models/crossex_margin_interest_record.py @@ -0,0 +1,414 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexMarginInterestRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_id': 'str', + 'symbol': 'str', + 'interest_id': 'str', + 'liability_id': 'str', + 'liability': 'str', + 'liability_coin': 'str', + 'interest': 'str', + 'interest_rate': 'str', + 'interest_type': 'str', + 'create_time': 'str', + 'exchange_type': 'str' + } + + attribute_map = { + 'user_id': 'userId', + 'symbol': 'symbol', + 'interest_id': 'interest_id', + 'liability_id': 'liability_id', + 'liability': 'liability', + 'liability_coin': 'liability_coin', + 'interest': 'interest', + 'interest_rate': 'interest_rate', + 'interest_type': 'interest_type', + 'create_time': 'create_time', + 'exchange_type': 'exchange_type' + } + + def __init__(self, user_id=None, symbol=None, interest_id=None, liability_id=None, liability=None, liability_coin=None, interest=None, interest_rate=None, interest_type=None, create_time=None, exchange_type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """CrossexMarginInterestRecord - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_id = None + self._symbol = None + self._interest_id = None + self._liability_id = None + self._liability = None + self._liability_coin = None + self._interest = None + self._interest_rate = None + self._interest_type = None + self._create_time = None + self._exchange_type = None + self.discriminator = None + + self.user_id = user_id + self.symbol = symbol + self.interest_id = interest_id + self.liability_id = liability_id + self.liability = liability + self.liability_coin = liability_coin + self.interest = interest + self.interest_rate = interest_rate + self.interest_type = interest_type + self.create_time = create_time + self.exchange_type = exchange_type + + @property + def user_id(self): + """Gets the user_id of this CrossexMarginInterestRecord. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexMarginInterestRecord. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def symbol(self): + """Gets the symbol of this CrossexMarginInterestRecord. # noqa: E501 + + Trading Pair # noqa: E501 + + :return: The symbol of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexMarginInterestRecord. + + Trading Pair # noqa: E501 + + :param symbol: The symbol of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def interest_id(self): + """Gets the interest_id of this CrossexMarginInterestRecord. # noqa: E501 + + Interest Deduction ID # noqa: E501 + + :return: The interest_id of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._interest_id + + @interest_id.setter + def interest_id(self, interest_id): + """Sets the interest_id of this CrossexMarginInterestRecord. + + Interest Deduction ID # noqa: E501 + + :param interest_id: The interest_id of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and interest_id is None: # noqa: E501 + raise ValueError("Invalid value for `interest_id`, must not be `None`") # noqa: E501 + + self._interest_id = interest_id + + @property + def liability_id(self): + """Gets the liability_id of this CrossexMarginInterestRecord. # noqa: E501 + + Debt Source ID, can be Order ID or Position ID # noqa: E501 + + :return: The liability_id of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._liability_id + + @liability_id.setter + def liability_id(self, liability_id): + """Sets the liability_id of this CrossexMarginInterestRecord. + + Debt Source ID, can be Order ID or Position ID # noqa: E501 + + :param liability_id: The liability_id of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and liability_id is None: # noqa: E501 + raise ValueError("Invalid value for `liability_id`, must not be `None`") # noqa: E501 + + self._liability_id = liability_id + + @property + def liability(self): + """Gets the liability of this CrossexMarginInterestRecord. # noqa: E501 + + Debt Quantity # noqa: E501 + + :return: The liability of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._liability + + @liability.setter + def liability(self, liability): + """Sets the liability of this CrossexMarginInterestRecord. + + Debt Quantity # noqa: E501 + + :param liability: The liability of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and liability is None: # noqa: E501 + raise ValueError("Invalid value for `liability`, must not be `None`") # noqa: E501 + + self._liability = liability + + @property + def liability_coin(self): + """Gets the liability_coin of this CrossexMarginInterestRecord. # noqa: E501 + + Debt Currency # noqa: E501 + + :return: The liability_coin of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._liability_coin + + @liability_coin.setter + def liability_coin(self, liability_coin): + """Sets the liability_coin of this CrossexMarginInterestRecord. + + Debt Currency # noqa: E501 + + :param liability_coin: The liability_coin of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and liability_coin is None: # noqa: E501 + raise ValueError("Invalid value for `liability_coin`, must not be `None`") # noqa: E501 + + self._liability_coin = liability_coin + + @property + def interest(self): + """Gets the interest of this CrossexMarginInterestRecord. # noqa: E501 + + Interest # noqa: E501 + + :return: The interest of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._interest + + @interest.setter + def interest(self, interest): + """Sets the interest of this CrossexMarginInterestRecord. + + Interest # noqa: E501 + + :param interest: The interest of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and interest is None: # noqa: E501 + raise ValueError("Invalid value for `interest`, must not be `None`") # noqa: E501 + + self._interest = interest + + @property + def interest_rate(self): + """Gets the interest_rate of this CrossexMarginInterestRecord. # noqa: E501 + + interest rate # noqa: E501 + + :return: The interest_rate of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._interest_rate + + @interest_rate.setter + def interest_rate(self, interest_rate): + """Sets the interest_rate of this CrossexMarginInterestRecord. + + interest rate # noqa: E501 + + :param interest_rate: The interest_rate of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and interest_rate is None: # noqa: E501 + raise ValueError("Invalid value for `interest_rate`, must not be `None`") # noqa: E501 + + self._interest_rate = interest_rate + + @property + def interest_type(self): + """Gets the interest_type of this CrossexMarginInterestRecord. # noqa: E501 + + Interest deduction type (`PERIODIC_POSITION` hourly interest on position, `PERIODIC_OPEN_ORDER` hourly interest on open orders, `IMMEDIATE_OPEN_ORDER` interest charged on order placement, `PERIODIC_ISOLATED` hourly interest on debt) # noqa: E501 + + :return: The interest_type of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._interest_type + + @interest_type.setter + def interest_type(self, interest_type): + """Sets the interest_type of this CrossexMarginInterestRecord. + + Interest deduction type (`PERIODIC_POSITION` hourly interest on position, `PERIODIC_OPEN_ORDER` hourly interest on open orders, `IMMEDIATE_OPEN_ORDER` interest charged on order placement, `PERIODIC_ISOLATED` hourly interest on debt) # noqa: E501 + + :param interest_type: The interest_type of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and interest_type is None: # noqa: E501 + raise ValueError("Invalid value for `interest_type`, must not be `None`") # noqa: E501 + + self._interest_type = interest_type + + @property + def create_time(self): + """Gets the create_time of this CrossexMarginInterestRecord. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CrossexMarginInterestRecord. + + Created time # noqa: E501 + + :param create_time: The create_time of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexMarginInterestRecord. # noqa: E501 + + Exchange # noqa: E501 + + :return: The exchange_type of this CrossexMarginInterestRecord. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexMarginInterestRecord. + + Exchange # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexMarginInterestRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and exchange_type is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_type`, must not be `None`") # noqa: E501 + + self._exchange_type = exchange_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexMarginInterestRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexMarginInterestRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_margin_mode_request.py b/gate_api/models/crossex_margin_mode_request.py new file mode 100644 index 00000000..a9ab7356 --- /dev/null +++ b/gate_api/models/crossex_margin_mode_request.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexMarginModeRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'margin_mode': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'margin_mode': 'margin_mode' + } + + def __init__(self, symbol=None, margin_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexMarginModeRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._margin_mode = None + self.discriminator = None + + self.symbol = symbol + self.margin_mode = margin_mode + + @property + def symbol(self): + """Gets the symbol of this CrossexMarginModeRequest. # noqa: E501 + + Hyperliquid futures trading pair # noqa: E501 + + :return: The symbol of this CrossexMarginModeRequest. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexMarginModeRequest. + + Hyperliquid futures trading pair # noqa: E501 + + :param symbol: The symbol of this CrossexMarginModeRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def margin_mode(self): + """Gets the margin_mode of this CrossexMarginModeRequest. # noqa: E501 + + Margin mode (CROSS/ISOLATED) # noqa: E501 + + :return: The margin_mode of this CrossexMarginModeRequest. # noqa: E501 + :rtype: str + """ + return self._margin_mode + + @margin_mode.setter + def margin_mode(self, margin_mode): + """Sets the margin_mode of this CrossexMarginModeRequest. + + Margin mode (CROSS/ISOLATED) # noqa: E501 + + :param margin_mode: The margin_mode of this CrossexMarginModeRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and margin_mode is None: # noqa: E501 + raise ValueError("Invalid value for `margin_mode`, must not be `None`") # noqa: E501 + allowed_values = ["CROSS", "ISOLATED"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and margin_mode not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `margin_mode` ({0}), must be one of {1}" # noqa: E501 + .format(margin_mode, allowed_values) + ) + + self._margin_mode = margin_mode + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexMarginModeRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexMarginModeRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_margin_mode_response.py b/gate_api/models/crossex_margin_mode_response.py new file mode 100644 index 00000000..e9009a44 --- /dev/null +++ b/gate_api/models/crossex_margin_mode_response.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexMarginModeResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'margin_mode': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'margin_mode': 'margin_mode' + } + + def __init__(self, symbol=None, margin_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexMarginModeResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._margin_mode = None + self.discriminator = None + + self.symbol = symbol + self.margin_mode = margin_mode + + @property + def symbol(self): + """Gets the symbol of this CrossexMarginModeResponse. # noqa: E501 + + Futures trading pair # noqa: E501 + + :return: The symbol of this CrossexMarginModeResponse. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexMarginModeResponse. + + Futures trading pair # noqa: E501 + + :param symbol: The symbol of this CrossexMarginModeResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def margin_mode(self): + """Gets the margin_mode of this CrossexMarginModeResponse. # noqa: E501 + + Margin mode (CROSS/ISOLATED) # noqa: E501 + + :return: The margin_mode of this CrossexMarginModeResponse. # noqa: E501 + :rtype: str + """ + return self._margin_mode + + @margin_mode.setter + def margin_mode(self, margin_mode): + """Sets the margin_mode of this CrossexMarginModeResponse. + + Margin mode (CROSS/ISOLATED) # noqa: E501 + + :param margin_mode: The margin_mode of this CrossexMarginModeResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and margin_mode is None: # noqa: E501 + raise ValueError("Invalid value for `margin_mode`, must not be `None`") # noqa: E501 + + self._margin_mode = margin_mode + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexMarginModeResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexMarginModeResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_margin_position.py b/gate_api/models/crossex_margin_position.py new file mode 100644 index 00000000..7db9c75d --- /dev/null +++ b/gate_api/models/crossex_margin_position.py @@ -0,0 +1,704 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexMarginPosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_id': 'str', + 'position_id': 'str', + 'symbol': 'str', + 'position_side': 'str', + 'initial_margin': 'str', + 'maintenance_margin': 'str', + 'asset_qty': 'str', + 'asset_coin': 'str', + 'position_value': 'str', + 'liability': 'str', + 'liability_coin': 'str', + 'interest': 'str', + 'max_position_qty': 'str', + 'entry_price': 'str', + 'index_price': 'str', + 'upnl': 'str', + 'upnl_rate': 'str', + 'leverage': 'str', + 'max_leverage': 'str', + 'create_time': 'str', + 'update_time': 'str' + } + + attribute_map = { + 'user_id': 'user_id', + 'position_id': 'position_id', + 'symbol': 'symbol', + 'position_side': 'position_side', + 'initial_margin': 'initial_margin', + 'maintenance_margin': 'maintenance_margin', + 'asset_qty': 'asset_qty', + 'asset_coin': 'asset_coin', + 'position_value': 'position_value', + 'liability': 'liability', + 'liability_coin': 'liability_coin', + 'interest': 'interest', + 'max_position_qty': 'max_position_qty', + 'entry_price': 'entry_price', + 'index_price': 'index_price', + 'upnl': 'upnl', + 'upnl_rate': 'upnl_rate', + 'leverage': 'leverage', + 'max_leverage': 'max_leverage', + 'create_time': 'create_time', + 'update_time': 'update_time' + } + + def __init__(self, user_id=None, position_id=None, symbol=None, position_side=None, initial_margin=None, maintenance_margin=None, asset_qty=None, asset_coin=None, position_value=None, liability=None, liability_coin=None, interest=None, max_position_qty=None, entry_price=None, index_price=None, upnl=None, upnl_rate=None, leverage=None, max_leverage=None, create_time=None, update_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """CrossexMarginPosition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_id = None + self._position_id = None + self._symbol = None + self._position_side = None + self._initial_margin = None + self._maintenance_margin = None + self._asset_qty = None + self._asset_coin = None + self._position_value = None + self._liability = None + self._liability_coin = None + self._interest = None + self._max_position_qty = None + self._entry_price = None + self._index_price = None + self._upnl = None + self._upnl_rate = None + self._leverage = None + self._max_leverage = None + self._create_time = None + self._update_time = None + self.discriminator = None + + self.user_id = user_id + self.position_id = position_id + self.symbol = symbol + self.position_side = position_side + self.initial_margin = initial_margin + self.maintenance_margin = maintenance_margin + self.asset_qty = asset_qty + self.asset_coin = asset_coin + self.position_value = position_value + self.liability = liability + self.liability_coin = liability_coin + self.interest = interest + self.max_position_qty = max_position_qty + self.entry_price = entry_price + self.index_price = index_price + self.upnl = upnl + self.upnl_rate = upnl_rate + self.leverage = leverage + self.max_leverage = max_leverage + self.create_time = create_time + self.update_time = update_time + + @property + def user_id(self): + """Gets the user_id of this CrossexMarginPosition. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexMarginPosition. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def position_id(self): + """Gets the position_id of this CrossexMarginPosition. # noqa: E501 + + Leveraged Position ID # noqa: E501 + + :return: The position_id of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._position_id + + @position_id.setter + def position_id(self, position_id): + """Sets the position_id of this CrossexMarginPosition. + + Leveraged Position ID # noqa: E501 + + :param position_id: The position_id of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and position_id is None: # noqa: E501 + raise ValueError("Invalid value for `position_id`, must not be `None`") # noqa: E501 + + self._position_id = position_id + + @property + def symbol(self): + """Gets the symbol of this CrossexMarginPosition. # noqa: E501 + + Trading Pair # noqa: E501 + + :return: The symbol of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexMarginPosition. + + Trading Pair # noqa: E501 + + :param symbol: The symbol of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def position_side(self): + """Gets the position_side of this CrossexMarginPosition. # noqa: E501 + + Position Direction # noqa: E501 + + :return: The position_side of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._position_side + + @position_side.setter + def position_side(self, position_side): + """Sets the position_side of this CrossexMarginPosition. + + Position Direction # noqa: E501 + + :param position_side: The position_side of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and position_side is None: # noqa: E501 + raise ValueError("Invalid value for `position_side`, must not be `None`") # noqa: E501 + + self._position_side = position_side + + @property + def initial_margin(self): + """Gets the initial_margin of this CrossexMarginPosition. # noqa: E501 + + Initial position margin # noqa: E501 + + :return: The initial_margin of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._initial_margin + + @initial_margin.setter + def initial_margin(self, initial_margin): + """Sets the initial_margin of this CrossexMarginPosition. + + Initial position margin # noqa: E501 + + :param initial_margin: The initial_margin of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and initial_margin is None: # noqa: E501 + raise ValueError("Invalid value for `initial_margin`, must not be `None`") # noqa: E501 + + self._initial_margin = initial_margin + + @property + def maintenance_margin(self): + """Gets the maintenance_margin of this CrossexMarginPosition. # noqa: E501 + + Position maintenance margin # noqa: E501 + + :return: The maintenance_margin of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._maintenance_margin + + @maintenance_margin.setter + def maintenance_margin(self, maintenance_margin): + """Sets the maintenance_margin of this CrossexMarginPosition. + + Position maintenance margin # noqa: E501 + + :param maintenance_margin: The maintenance_margin of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and maintenance_margin is None: # noqa: E501 + raise ValueError("Invalid value for `maintenance_margin`, must not be `None`") # noqa: E501 + + self._maintenance_margin = maintenance_margin + + @property + def asset_qty(self): + """Gets the asset_qty of this CrossexMarginPosition. # noqa: E501 + + Position Asset Quantity # noqa: E501 + + :return: The asset_qty of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._asset_qty + + @asset_qty.setter + def asset_qty(self, asset_qty): + """Sets the asset_qty of this CrossexMarginPosition. + + Position Asset Quantity # noqa: E501 + + :param asset_qty: The asset_qty of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset_qty is None: # noqa: E501 + raise ValueError("Invalid value for `asset_qty`, must not be `None`") # noqa: E501 + + self._asset_qty = asset_qty + + @property + def asset_coin(self): + """Gets the asset_coin of this CrossexMarginPosition. # noqa: E501 + + Position Asset Currency # noqa: E501 + + :return: The asset_coin of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._asset_coin + + @asset_coin.setter + def asset_coin(self, asset_coin): + """Sets the asset_coin of this CrossexMarginPosition. + + Position Asset Currency # noqa: E501 + + :param asset_coin: The asset_coin of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset_coin is None: # noqa: E501 + raise ValueError("Invalid value for `asset_coin`, must not be `None`") # noqa: E501 + + self._asset_coin = asset_coin + + @property + def position_value(self): + """Gets the position_value of this CrossexMarginPosition. # noqa: E501 + + Position Value # noqa: E501 + + :return: The position_value of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._position_value + + @position_value.setter + def position_value(self, position_value): + """Sets the position_value of this CrossexMarginPosition. + + Position Value # noqa: E501 + + :param position_value: The position_value of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and position_value is None: # noqa: E501 + raise ValueError("Invalid value for `position_value`, must not be `None`") # noqa: E501 + + self._position_value = position_value + + @property + def liability(self): + """Gets the liability of this CrossexMarginPosition. # noqa: E501 + + Debt Quantity # noqa: E501 + + :return: The liability of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._liability + + @liability.setter + def liability(self, liability): + """Sets the liability of this CrossexMarginPosition. + + Debt Quantity # noqa: E501 + + :param liability: The liability of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and liability is None: # noqa: E501 + raise ValueError("Invalid value for `liability`, must not be `None`") # noqa: E501 + + self._liability = liability + + @property + def liability_coin(self): + """Gets the liability_coin of this CrossexMarginPosition. # noqa: E501 + + Debt Currency # noqa: E501 + + :return: The liability_coin of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._liability_coin + + @liability_coin.setter + def liability_coin(self, liability_coin): + """Sets the liability_coin of this CrossexMarginPosition. + + Debt Currency # noqa: E501 + + :param liability_coin: The liability_coin of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and liability_coin is None: # noqa: E501 + raise ValueError("Invalid value for `liability_coin`, must not be `None`") # noqa: E501 + + self._liability_coin = liability_coin + + @property + def interest(self): + """Gets the interest of this CrossexMarginPosition. # noqa: E501 + + Deducted Interest # noqa: E501 + + :return: The interest of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._interest + + @interest.setter + def interest(self, interest): + """Sets the interest of this CrossexMarginPosition. + + Deducted Interest # noqa: E501 + + :param interest: The interest of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and interest is None: # noqa: E501 + raise ValueError("Invalid value for `interest`, must not be `None`") # noqa: E501 + + self._interest = interest + + @property + def max_position_qty(self): + """Gets the max_position_qty of this CrossexMarginPosition. # noqa: E501 + + Max Trade Size # noqa: E501 + + :return: The max_position_qty of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._max_position_qty + + @max_position_qty.setter + def max_position_qty(self, max_position_qty): + """Sets the max_position_qty of this CrossexMarginPosition. + + Max Trade Size # noqa: E501 + + :param max_position_qty: The max_position_qty of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and max_position_qty is None: # noqa: E501 + raise ValueError("Invalid value for `max_position_qty`, must not be `None`") # noqa: E501 + + self._max_position_qty = max_position_qty + + @property + def entry_price(self): + """Gets the entry_price of this CrossexMarginPosition. # noqa: E501 + + Position Cost Price (Average Opening Price) # noqa: E501 + + :return: The entry_price of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._entry_price + + @entry_price.setter + def entry_price(self, entry_price): + """Sets the entry_price of this CrossexMarginPosition. + + Position Cost Price (Average Opening Price) # noqa: E501 + + :param entry_price: The entry_price of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and entry_price is None: # noqa: E501 + raise ValueError("Invalid value for `entry_price`, must not be `None`") # noqa: E501 + + self._entry_price = entry_price + + @property + def index_price(self): + """Gets the index_price of this CrossexMarginPosition. # noqa: E501 + + Index price # noqa: E501 + + :return: The index_price of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this CrossexMarginPosition. + + Index price # noqa: E501 + + :param index_price: The index_price of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and index_price is None: # noqa: E501 + raise ValueError("Invalid value for `index_price`, must not be `None`") # noqa: E501 + + self._index_price = index_price + + @property + def upnl(self): + """Gets the upnl of this CrossexMarginPosition. # noqa: E501 + + Unrealized P&L # noqa: E501 + + :return: The upnl of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._upnl + + @upnl.setter + def upnl(self, upnl): + """Sets the upnl of this CrossexMarginPosition. + + Unrealized P&L # noqa: E501 + + :param upnl: The upnl of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and upnl is None: # noqa: E501 + raise ValueError("Invalid value for `upnl`, must not be `None`") # noqa: E501 + + self._upnl = upnl + + @property + def upnl_rate(self): + """Gets the upnl_rate of this CrossexMarginPosition. # noqa: E501 + + Unrealized P&L Ratio # noqa: E501 + + :return: The upnl_rate of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._upnl_rate + + @upnl_rate.setter + def upnl_rate(self, upnl_rate): + """Sets the upnl_rate of this CrossexMarginPosition. + + Unrealized P&L Ratio # noqa: E501 + + :param upnl_rate: The upnl_rate of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and upnl_rate is None: # noqa: E501 + raise ValueError("Invalid value for `upnl_rate`, must not be `None`") # noqa: E501 + + self._upnl_rate = upnl_rate + + @property + def leverage(self): + """Gets the leverage of this CrossexMarginPosition. # noqa: E501 + + Opening Leverage # noqa: E501 + + :return: The leverage of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this CrossexMarginPosition. + + Opening Leverage # noqa: E501 + + :param leverage: The leverage of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and leverage is None: # noqa: E501 + raise ValueError("Invalid value for `leverage`, must not be `None`") # noqa: E501 + + self._leverage = leverage + + @property + def max_leverage(self): + """Gets the max_leverage of this CrossexMarginPosition. # noqa: E501 + + Maximum leverage # noqa: E501 + + :return: The max_leverage of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._max_leverage + + @max_leverage.setter + def max_leverage(self, max_leverage): + """Sets the max_leverage of this CrossexMarginPosition. + + Maximum leverage # noqa: E501 + + :param max_leverage: The max_leverage of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and max_leverage is None: # noqa: E501 + raise ValueError("Invalid value for `max_leverage`, must not be `None`") # noqa: E501 + + self._max_leverage = max_leverage + + @property + def create_time(self): + """Gets the create_time of this CrossexMarginPosition. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CrossexMarginPosition. + + Created time # noqa: E501 + + :param create_time: The create_time of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this CrossexMarginPosition. # noqa: E501 + + Update time # noqa: E501 + + :return: The update_time of this CrossexMarginPosition. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this CrossexMarginPosition. + + Update time # noqa: E501 + + :param update_time: The update_time of this CrossexMarginPosition. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and update_time is None: # noqa: E501 + raise ValueError("Invalid value for `update_time`, must not be `None`") # noqa: E501 + + self._update_time = update_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexMarginPosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexMarginPosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_order.py b/gate_api/models/crossex_order.py new file mode 100644 index 00000000..1014262a --- /dev/null +++ b/gate_api/models/crossex_order.py @@ -0,0 +1,907 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_id': 'str', + 'order_id': 'str', + 'text': 'str', + 'state': 'str', + 'symbol': 'str', + 'side': 'str', + 'type': 'str', + 'attribute': 'str', + 'exchange_type': 'str', + 'business_type': 'str', + 'qty': 'str', + 'quote_qty': 'str', + 'price': 'str', + 'time_in_force': 'str', + 'executed_qty': 'str', + 'executed_amount': 'str', + 'executed_avg_price': 'str', + 'fee_coin': 'str', + 'fee': 'str', + 'reduce_only': 'str', + 'leverage': 'str', + 'reason': 'str', + 'last_executed_qty': 'str', + 'last_executed_price': 'str', + 'last_executed_amount': 'str', + 'position_side': 'str', + 'create_time': 'str', + 'update_time': 'str' + } + + attribute_map = { + 'user_id': 'user_id', + 'order_id': 'order_id', + 'text': 'text', + 'state': 'state', + 'symbol': 'symbol', + 'side': 'side', + 'type': 'type', + 'attribute': 'attribute', + 'exchange_type': 'exchange_type', + 'business_type': 'business_type', + 'qty': 'qty', + 'quote_qty': 'quote_qty', + 'price': 'price', + 'time_in_force': 'time_in_force', + 'executed_qty': 'executed_qty', + 'executed_amount': 'executed_amount', + 'executed_avg_price': 'executed_avg_price', + 'fee_coin': 'fee_coin', + 'fee': 'fee', + 'reduce_only': 'reduce_only', + 'leverage': 'leverage', + 'reason': 'reason', + 'last_executed_qty': 'last_executed_qty', + 'last_executed_price': 'last_executed_price', + 'last_executed_amount': 'last_executed_amount', + 'position_side': 'position_side', + 'create_time': 'create_time', + 'update_time': 'update_time' + } + + def __init__(self, user_id=None, order_id=None, text=None, state=None, symbol=None, side=None, type=None, attribute=None, exchange_type=None, business_type=None, qty=None, quote_qty=None, price=None, time_in_force=None, executed_qty=None, executed_amount=None, executed_avg_price=None, fee_coin=None, fee=None, reduce_only=None, leverage=None, reason=None, last_executed_qty=None, last_executed_price=None, last_executed_amount=None, position_side=None, create_time=None, update_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """CrossexOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_id = None + self._order_id = None + self._text = None + self._state = None + self._symbol = None + self._side = None + self._type = None + self._attribute = None + self._exchange_type = None + self._business_type = None + self._qty = None + self._quote_qty = None + self._price = None + self._time_in_force = None + self._executed_qty = None + self._executed_amount = None + self._executed_avg_price = None + self._fee_coin = None + self._fee = None + self._reduce_only = None + self._leverage = None + self._reason = None + self._last_executed_qty = None + self._last_executed_price = None + self._last_executed_amount = None + self._position_side = None + self._create_time = None + self._update_time = None + self.discriminator = None + + self.user_id = user_id + self.order_id = order_id + self.text = text + self.state = state + self.symbol = symbol + self.side = side + self.type = type + self.attribute = attribute + self.exchange_type = exchange_type + self.business_type = business_type + self.qty = qty + self.quote_qty = quote_qty + self.price = price + self.time_in_force = time_in_force + self.executed_qty = executed_qty + self.executed_amount = executed_amount + self.executed_avg_price = executed_avg_price + self.fee_coin = fee_coin + self.fee = fee + self.reduce_only = reduce_only + self.leverage = leverage + self.reason = reason + self.last_executed_qty = last_executed_qty + self.last_executed_price = last_executed_price + self.last_executed_amount = last_executed_amount + self.position_side = position_side + self.create_time = create_time + self.update_time = update_time + + @property + def user_id(self): + """Gets the user_id of this CrossexOrder. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexOrder. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def order_id(self): + """Gets the order_id of this CrossexOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this CrossexOrder. + + Order ID # noqa: E501 + + :param order_id: The order_id of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 + raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 + + self._order_id = order_id + + @property + def text(self): + """Gets the text of this CrossexOrder. # noqa: E501 + + Client-defined order ID. # noqa: E501 + + :return: The text of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CrossexOrder. + + Client-defined order ID. # noqa: E501 + + :param text: The text of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and text is None: # noqa: E501 + raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501 + + self._text = text + + @property + def state(self): + """Gets the state of this CrossexOrder. # noqa: E501 + + Order status: NEW: Validated and queued to be sent to the exchange. OPEN: Resting on the exchange order book. PARTIALLY_FILLED: Partially filled. FILLED: Fully filled. FAIL: CrossEx internal validation failed; see the `reason` field for details. REJECT: Rejected by the exchange; see the `reason` field for details. # noqa: E501 + + :return: The state of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this CrossexOrder. + + Order status: NEW: Validated and queued to be sent to the exchange. OPEN: Resting on the exchange order book. PARTIALLY_FILLED: Partially filled. FILLED: Fully filled. FAIL: CrossEx internal validation failed; see the `reason` field for details. REJECT: Rejected by the exchange; see the `reason` field for details. # noqa: E501 + + :param state: The state of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and state is None: # noqa: E501 + raise ValueError("Invalid value for `state`, must not be `None`") # noqa: E501 + + self._state = state + + @property + def symbol(self): + """Gets the symbol of this CrossexOrder. # noqa: E501 + + Unique trading pair identifiers, e.g. `BINANCE_SPOT_BTC_USDT`, `BINANCE_FUTURE_BTC_USDT`. # noqa: E501 + + :return: The symbol of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexOrder. + + Unique trading pair identifiers, e.g. `BINANCE_SPOT_BTC_USDT`, `BINANCE_FUTURE_BTC_USDT`. # noqa: E501 + + :param symbol: The symbol of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def side(self): + """Gets the side of this CrossexOrder. # noqa: E501 + + Side (`BUY` buy / `SELL` sell). # noqa: E501 + + :return: The side of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this CrossexOrder. + + Side (`BUY` buy / `SELL` sell). # noqa: E501 + + :param side: The side of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def type(self): + """Gets the type of this CrossexOrder. # noqa: E501 + + Order type (`LIMIT` limit / `MARKET` market). # noqa: E501 + + :return: The type of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CrossexOrder. + + Order type (`LIMIT` limit / `MARKET` market). # noqa: E501 + + :param type: The type of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + @property + def attribute(self): + """Gets the attribute of this CrossexOrder. # noqa: E501 + + Order attributes (`COMMON` normal / `LIQ` liquidation takeover / `REDUCE` liquidation reduction / `ADL` auto-deleverage / `SETTLEMENT` delisting settlement). # noqa: E501 + + :return: The attribute of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._attribute + + @attribute.setter + def attribute(self, attribute): + """Sets the attribute of this CrossexOrder. + + Order attributes (`COMMON` normal / `LIQ` liquidation takeover / `REDUCE` liquidation reduction / `ADL` auto-deleverage / `SETTLEMENT` delisting settlement). # noqa: E501 + + :param attribute: The attribute of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and attribute is None: # noqa: E501 + raise ValueError("Invalid value for `attribute`, must not be `None`") # noqa: E501 + + self._attribute = attribute + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexOrder. # noqa: E501 + + Venue bucket (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT`). # noqa: E501 + + :return: The exchange_type of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexOrder. + + Venue bucket (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT`). # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and exchange_type is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_type`, must not be `None`") # noqa: E501 + + self._exchange_type = exchange_type + + @property + def business_type(self): + """Gets the business_type of this CrossexOrder. # noqa: E501 + + Business type (`SPOT` Spot / `FUTURE` Futures / `MARGIN` Margin). # noqa: E501 + + :return: The business_type of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._business_type + + @business_type.setter + def business_type(self, business_type): + """Sets the business_type of this CrossexOrder. + + Business type (`SPOT` Spot / `FUTURE` Futures / `MARGIN` Margin). # noqa: E501 + + :param business_type: The business_type of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and business_type is None: # noqa: E501 + raise ValueError("Invalid value for `business_type`, must not be `None`") # noqa: E501 + + self._business_type = business_type + + @property + def qty(self): + """Gets the qty of this CrossexOrder. # noqa: E501 + + Order quantity in the base currency. # noqa: E501 + + :return: The qty of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._qty + + @qty.setter + def qty(self, qty): + """Sets the qty of this CrossexOrder. + + Order quantity in the base currency. # noqa: E501 + + :param qty: The qty of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and qty is None: # noqa: E501 + raise ValueError("Invalid value for `qty`, must not be `None`") # noqa: E501 + + self._qty = qty + + @property + def quote_qty(self): + """Gets the quote_qty of this CrossexOrder. # noqa: E501 + + Order quantity in the quote currency. # noqa: E501 + + :return: The quote_qty of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._quote_qty + + @quote_qty.setter + def quote_qty(self, quote_qty): + """Sets the quote_qty of this CrossexOrder. + + Order quantity in the quote currency. # noqa: E501 + + :param quote_qty: The quote_qty of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and quote_qty is None: # noqa: E501 + raise ValueError("Invalid value for `quote_qty`, must not be `None`") # noqa: E501 + + self._quote_qty = quote_qty + + @property + def price(self): + """Gets the price of this CrossexOrder. # noqa: E501 + + Order price. # noqa: E501 + + :return: The price of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this CrossexOrder. + + Order price. # noqa: E501 + + :param price: The price of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price is None: # noqa: E501 + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + @property + def time_in_force(self): + """Gets the time_in_force of this CrossexOrder. # noqa: E501 + + Time-in-force policy (default: GTC; allowed values: GTC, IOC, FOK, POC, and RPI) # noqa: E501 + + :return: The time_in_force of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._time_in_force + + @time_in_force.setter + def time_in_force(self, time_in_force): + """Sets the time_in_force of this CrossexOrder. + + Time-in-force policy (default: GTC; allowed values: GTC, IOC, FOK, POC, and RPI) # noqa: E501 + + :param time_in_force: The time_in_force of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and time_in_force is None: # noqa: E501 + raise ValueError("Invalid value for `time_in_force`, must not be `None`") # noqa: E501 + + self._time_in_force = time_in_force + + @property + def executed_qty(self): + """Gets the executed_qty of this CrossexOrder. # noqa: E501 + + Filled base amount. # noqa: E501 + + :return: The executed_qty of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._executed_qty + + @executed_qty.setter + def executed_qty(self, executed_qty): + """Sets the executed_qty of this CrossexOrder. + + Filled base amount. # noqa: E501 + + :param executed_qty: The executed_qty of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and executed_qty is None: # noqa: E501 + raise ValueError("Invalid value for `executed_qty`, must not be `None`") # noqa: E501 + + self._executed_qty = executed_qty + + @property + def executed_amount(self): + """Gets the executed_amount of this CrossexOrder. # noqa: E501 + + Filled quote amount. # noqa: E501 + + :return: The executed_amount of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._executed_amount + + @executed_amount.setter + def executed_amount(self, executed_amount): + """Sets the executed_amount of this CrossexOrder. + + Filled quote amount. # noqa: E501 + + :param executed_amount: The executed_amount of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and executed_amount is None: # noqa: E501 + raise ValueError("Invalid value for `executed_amount`, must not be `None`") # noqa: E501 + + self._executed_amount = executed_amount + + @property + def executed_avg_price(self): + """Gets the executed_avg_price of this CrossexOrder. # noqa: E501 + + Average Filled Price # noqa: E501 + + :return: The executed_avg_price of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._executed_avg_price + + @executed_avg_price.setter + def executed_avg_price(self, executed_avg_price): + """Sets the executed_avg_price of this CrossexOrder. + + Average Filled Price # noqa: E501 + + :param executed_avg_price: The executed_avg_price of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and executed_avg_price is None: # noqa: E501 + raise ValueError("Invalid value for `executed_avg_price`, must not be `None`") # noqa: E501 + + self._executed_avg_price = executed_avg_price + + @property + def fee_coin(self): + """Gets the fee_coin of this CrossexOrder. # noqa: E501 + + Fee currency # noqa: E501 + + :return: The fee_coin of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._fee_coin + + @fee_coin.setter + def fee_coin(self, fee_coin): + """Sets the fee_coin of this CrossexOrder. + + Fee currency # noqa: E501 + + :param fee_coin: The fee_coin of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fee_coin is None: # noqa: E501 + raise ValueError("Invalid value for `fee_coin`, must not be `None`") # noqa: E501 + + self._fee_coin = fee_coin + + @property + def fee(self): + """Gets the fee of this CrossexOrder. # noqa: E501 + + Fee amount. # noqa: E501 + + :return: The fee of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this CrossexOrder. + + Fee amount. # noqa: E501 + + :param fee: The fee of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fee is None: # noqa: E501 + raise ValueError("Invalid value for `fee`, must not be `None`") # noqa: E501 + + self._fee = fee + + @property + def reduce_only(self): + """Gets the reduce_only of this CrossexOrder. # noqa: E501 + + Reduce-only order (`\"true\"` or `\"false\"`). # noqa: E501 + + :return: The reduce_only of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._reduce_only + + @reduce_only.setter + def reduce_only(self, reduce_only): + """Sets the reduce_only of this CrossexOrder. + + Reduce-only order (`\"true\"` or `\"false\"`). # noqa: E501 + + :param reduce_only: The reduce_only of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and reduce_only is None: # noqa: E501 + raise ValueError("Invalid value for `reduce_only`, must not be `None`") # noqa: E501 + + self._reduce_only = reduce_only + + @property + def leverage(self): + """Gets the leverage of this CrossexOrder. # noqa: E501 + + Order leverage multiplier. # noqa: E501 + + :return: The leverage of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this CrossexOrder. + + Order leverage multiplier. # noqa: E501 + + :param leverage: The leverage of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and leverage is None: # noqa: E501 + raise ValueError("Invalid value for `leverage`, must not be `None`") # noqa: E501 + + self._leverage = leverage + + @property + def reason(self): + """Gets the reason of this CrossexOrder. # noqa: E501 + + Failure reason description. # noqa: E501 + + :return: The reason of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this CrossexOrder. + + Failure reason description. # noqa: E501 + + :param reason: The reason of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and reason is None: # noqa: E501 + raise ValueError("Invalid value for `reason`, must not be `None`") # noqa: E501 + + self._reason = reason + + @property + def last_executed_qty(self): + """Gets the last_executed_qty of this CrossexOrder. # noqa: E501 + + Base quantity of the latest fill. # noqa: E501 + + :return: The last_executed_qty of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._last_executed_qty + + @last_executed_qty.setter + def last_executed_qty(self, last_executed_qty): + """Sets the last_executed_qty of this CrossexOrder. + + Base quantity of the latest fill. # noqa: E501 + + :param last_executed_qty: The last_executed_qty of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and last_executed_qty is None: # noqa: E501 + raise ValueError("Invalid value for `last_executed_qty`, must not be `None`") # noqa: E501 + + self._last_executed_qty = last_executed_qty + + @property + def last_executed_price(self): + """Gets the last_executed_price of this CrossexOrder. # noqa: E501 + + Price of the latest fill. # noqa: E501 + + :return: The last_executed_price of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._last_executed_price + + @last_executed_price.setter + def last_executed_price(self, last_executed_price): + """Sets the last_executed_price of this CrossexOrder. + + Price of the latest fill. # noqa: E501 + + :param last_executed_price: The last_executed_price of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and last_executed_price is None: # noqa: E501 + raise ValueError("Invalid value for `last_executed_price`, must not be `None`") # noqa: E501 + + self._last_executed_price = last_executed_price + + @property + def last_executed_amount(self): + """Gets the last_executed_amount of this CrossexOrder. # noqa: E501 + + Quote amount of the latest fill. # noqa: E501 + + :return: The last_executed_amount of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._last_executed_amount + + @last_executed_amount.setter + def last_executed_amount(self, last_executed_amount): + """Sets the last_executed_amount of this CrossexOrder. + + Quote amount of the latest fill. # noqa: E501 + + :param last_executed_amount: The last_executed_amount of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and last_executed_amount is None: # noqa: E501 + raise ValueError("Invalid value for `last_executed_amount`, must not be `None`") # noqa: E501 + + self._last_executed_amount = last_executed_amount + + @property + def position_side(self): + """Gets the position_side of this CrossexOrder. # noqa: E501 + + Position side (`NONE` flat / `LONG` long / `SHORT` short). # noqa: E501 + + :return: The position_side of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._position_side + + @position_side.setter + def position_side(self, position_side): + """Sets the position_side of this CrossexOrder. + + Position side (`NONE` flat / `LONG` long / `SHORT` short). # noqa: E501 + + :param position_side: The position_side of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and position_side is None: # noqa: E501 + raise ValueError("Invalid value for `position_side`, must not be `None`") # noqa: E501 + + self._position_side = position_side + + @property + def create_time(self): + """Gets the create_time of this CrossexOrder. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CrossexOrder. + + Created time # noqa: E501 + + :param create_time: The create_time of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this CrossexOrder. # noqa: E501 + + Update time # noqa: E501 + + :return: The update_time of this CrossexOrder. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this CrossexOrder. + + Update time # noqa: E501 + + :param update_time: The update_time of this CrossexOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and update_time is None: # noqa: E501 + raise ValueError("Invalid value for `update_time`, must not be `None`") # noqa: E501 + + self._update_time = update_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_order_action_response.py b/gate_api/models/crossex_order_action_response.py new file mode 100644 index 00000000..ca1051e5 --- /dev/null +++ b/gate_api/models/crossex_order_action_response.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexOrderActionResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'text': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'text': 'text' + } + + def __init__(self, order_id=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexOrderActionResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._text = None + self.discriminator = None + + self.order_id = order_id + self.text = text + + @property + def order_id(self): + """Gets the order_id of this CrossexOrderActionResponse. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this CrossexOrderActionResponse. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this CrossexOrderActionResponse. + + Order ID # noqa: E501 + + :param order_id: The order_id of this CrossexOrderActionResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 + raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 + + self._order_id = order_id + + @property + def text(self): + """Gets the text of this CrossexOrderActionResponse. # noqa: E501 + + User-defined Order ID # noqa: E501 + + :return: The text of this CrossexOrderActionResponse. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CrossexOrderActionResponse. + + User-defined Order ID # noqa: E501 + + :param text: The text of this CrossexOrderActionResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and text is None: # noqa: E501 + raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501 + + self._text = text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexOrderActionResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexOrderActionResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_order_request.py b/gate_api/models/crossex_order_request.py new file mode 100644 index 00000000..fd10b1ed --- /dev/null +++ b/gate_api/models/crossex_order_request.py @@ -0,0 +1,407 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'text': 'str', + 'symbol': 'str', + 'side': 'str', + 'type': 'str', + 'time_in_force': 'str', + 'qty': 'str', + 'price': 'str', + 'quote_qty': 'str', + 'reduce_only': 'str', + 'position_side': 'str' + } + + attribute_map = { + 'text': 'text', + 'symbol': 'symbol', + 'side': 'side', + 'type': 'type', + 'time_in_force': 'time_in_force', + 'qty': 'qty', + 'price': 'price', + 'quote_qty': 'quote_qty', + 'reduce_only': 'reduce_only', + 'position_side': 'position_side' + } + + def __init__(self, text=None, symbol=None, side=None, type='LIMIT', time_in_force='GTC', qty=None, price=None, quote_qty=None, reduce_only=None, position_side=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """CrossexOrderRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._text = None + self._symbol = None + self._side = None + self._type = None + self._time_in_force = None + self._qty = None + self._price = None + self._quote_qty = None + self._reduce_only = None + self._position_side = None + self.discriminator = None + + if text is not None: + self.text = text + self.symbol = symbol + self.side = side + if type is not None: + self.type = type + if time_in_force is not None: + self.time_in_force = time_in_force + if qty is not None: + self.qty = qty + if price is not None: + self.price = price + if quote_qty is not None: + self.quote_qty = quote_qty + if reduce_only is not None: + self.reduce_only = reduce_only + if position_side is not None: + self.position_side = position_side + + @property + def text(self): + """Gets the text of this CrossexOrderRequest. # noqa: E501 + + Client-defined Order ID, supports letters (a-z), numbers (0-9), symbols (-, _) only # noqa: E501 + + :return: The text of this CrossexOrderRequest. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CrossexOrderRequest. + + Client-defined Order ID, supports letters (a-z), numbers (0-9), symbols (-, _) only # noqa: E501 + + :param text: The text of this CrossexOrderRequest. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def symbol(self): + """Gets the symbol of this CrossexOrderRequest. # noqa: E501 + + Unique identifier `{Exchange}_{Business}_{Base}_{Counter}` Examples: To send a Binance spot order on `ADA/USDT`, use `BINANCE_SPOT_ADA_USDT`; For an ADA/USDT-margined USDT perpetual futures order on OKX, use `OKX_FUTURE_ADA_USDT`; For ADA/USDT margin trading on Gate, use `GATE_MARGIN_ADA_USDT`; For ADA/USDT spot trading on Bybit, use `BYBIT_SPOT_ADA_USDT`; For an ADA/USD futures order on Kraken, use `KRAKEN_FUTURE_ADA_USD`; For an ADA/USDC futures order on Hyperliquid, use `HYPERLIQUID_FUTURE_ADA_USDC`; For an ADA/USDC futures order on Deribit, use `DERIBIT_FUTURE_ADA_USDC`; Supports spot trades, USDT-margined perpetual futures, and spot margin templates. BYBIT and DERIBIT omit spot margin for now; Kraken and Hyperliquid omit dedicated spot/margin legs inside CrossEx. # noqa: E501 + + :return: The symbol of this CrossexOrderRequest. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexOrderRequest. + + Unique identifier `{Exchange}_{Business}_{Base}_{Counter}` Examples: To send a Binance spot order on `ADA/USDT`, use `BINANCE_SPOT_ADA_USDT`; For an ADA/USDT-margined USDT perpetual futures order on OKX, use `OKX_FUTURE_ADA_USDT`; For ADA/USDT margin trading on Gate, use `GATE_MARGIN_ADA_USDT`; For ADA/USDT spot trading on Bybit, use `BYBIT_SPOT_ADA_USDT`; For an ADA/USD futures order on Kraken, use `KRAKEN_FUTURE_ADA_USD`; For an ADA/USDC futures order on Hyperliquid, use `HYPERLIQUID_FUTURE_ADA_USDC`; For an ADA/USDC futures order on Deribit, use `DERIBIT_FUTURE_ADA_USDC`; Supports spot trades, USDT-margined perpetual futures, and spot margin templates. BYBIT and DERIBIT omit spot margin for now; Kraken and Hyperliquid omit dedicated spot/margin legs inside CrossEx. # noqa: E501 + + :param symbol: The symbol of this CrossexOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def side(self): + """Gets the side of this CrossexOrderRequest. # noqa: E501 + + BUY, SELL # noqa: E501 + + :return: The side of this CrossexOrderRequest. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this CrossexOrderRequest. + + BUY, SELL # noqa: E501 + + :param side: The side of this CrossexOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + allowed_values = ["BUY", "SELL"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) + ) + + self._side = side + + @property + def type(self): + """Gets the type of this CrossexOrderRequest. # noqa: E501 + + Order type (default: `LIMIT`; supported types: `LIMIT`, `MARKET`) # noqa: E501 + + :return: The type of this CrossexOrderRequest. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CrossexOrderRequest. + + Order type (default: `LIMIT`; supported types: `LIMIT`, `MARKET`) # noqa: E501 + + :param type: The type of this CrossexOrderRequest. # noqa: E501 + :type: str + """ + allowed_values = ["LIMIT", "MARKET"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def time_in_force(self): + """Gets the time_in_force of this CrossexOrderRequest. # noqa: E501 + + Defaults to GTC. Supported values: `GTC`, `IOC`, `FOK`, `POC`, and `RPI` `GTC`: GoodTillCancelled `IOC`: ImmediateOrCancelled `FOK`: FillOrKill `POC`: PendingOrCancelled or PostOnly `RPI`: Retail Price Improvement # noqa: E501 + + :return: The time_in_force of this CrossexOrderRequest. # noqa: E501 + :rtype: str + """ + return self._time_in_force + + @time_in_force.setter + def time_in_force(self, time_in_force): + """Sets the time_in_force of this CrossexOrderRequest. + + Defaults to GTC. Supported values: `GTC`, `IOC`, `FOK`, `POC`, and `RPI` `GTC`: GoodTillCancelled `IOC`: ImmediateOrCancelled `FOK`: FillOrKill `POC`: PendingOrCancelled or PostOnly `RPI`: Retail Price Improvement # noqa: E501 + + :param time_in_force: The time_in_force of this CrossexOrderRequest. # noqa: E501 + :type: str + """ + allowed_values = ["GTC", "IOC", "FOK", "POC", "RPI"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and time_in_force not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `time_in_force` ({0}), must be one of {1}" # noqa: E501 + .format(time_in_force, allowed_values) + ) + + self._time_in_force = time_in_force + + @property + def qty(self): + """Gets the qty of this CrossexOrderRequest. # noqa: E501 + + Order quantity (required unless spot market buy) # noqa: E501 + + :return: The qty of this CrossexOrderRequest. # noqa: E501 + :rtype: str + """ + return self._qty + + @qty.setter + def qty(self, qty): + """Sets the qty of this CrossexOrderRequest. + + Order quantity (required unless spot market buy) # noqa: E501 + + :param qty: The qty of this CrossexOrderRequest. # noqa: E501 + :type: str + """ + + self._qty = qty + + @property + def price(self): + """Gets the price of this CrossexOrderRequest. # noqa: E501 + + Limit Order Price (Required for Limit Orders) # noqa: E501 + + :return: The price of this CrossexOrderRequest. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this CrossexOrderRequest. + + Limit Order Price (Required for Limit Orders) # noqa: E501 + + :param price: The price of this CrossexOrderRequest. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def quote_qty(self): + """Gets the quote_qty of this CrossexOrderRequest. # noqa: E501 + + Order quote quantity; required for spot and margin market buy orders # noqa: E501 + + :return: The quote_qty of this CrossexOrderRequest. # noqa: E501 + :rtype: str + """ + return self._quote_qty + + @quote_qty.setter + def quote_qty(self, quote_qty): + """Sets the quote_qty of this CrossexOrderRequest. + + Order quote quantity; required for spot and margin market buy orders # noqa: E501 + + :param quote_qty: The quote_qty of this CrossexOrderRequest. # noqa: E501 + :type: str + """ + + self._quote_qty = quote_qty + + @property + def reduce_only(self): + """Gets the reduce_only of this CrossexOrderRequest. # noqa: E501 + + Reduce-only: `true` or `false` # noqa: E501 + + :return: The reduce_only of this CrossexOrderRequest. # noqa: E501 + :rtype: str + """ + return self._reduce_only + + @reduce_only.setter + def reduce_only(self, reduce_only): + """Sets the reduce_only of this CrossexOrderRequest. + + Reduce-only: `true` or `false` # noqa: E501 + + :param reduce_only: The reduce_only of this CrossexOrderRequest. # noqa: E501 + :type: str + """ + allowed_values = ["true", "false"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and reduce_only not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `reduce_only` ({0}), must be one of {1}" # noqa: E501 + .format(reduce_only, allowed_values) + ) + + self._reduce_only = reduce_only + + @property + def position_side(self): + """Gets the position_side of this CrossexOrderRequest. # noqa: E501 + + Position side: `NONE`, `LONG`, `SHORT` Defaults to `NONE` (single position mode) if not specified # noqa: E501 + + :return: The position_side of this CrossexOrderRequest. # noqa: E501 + :rtype: str + """ + return self._position_side + + @position_side.setter + def position_side(self, position_side): + """Sets the position_side of this CrossexOrderRequest. + + Position side: `NONE`, `LONG`, `SHORT` Defaults to `NONE` (single position mode) if not specified # noqa: E501 + + :param position_side: The position_side of this CrossexOrderRequest. # noqa: E501 + :type: str + """ + allowed_values = ["LONG", "SHORT", "NONE"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and position_side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `position_side` ({0}), must be one of {1}" # noqa: E501 + .format(position_side, allowed_values) + ) + + self._position_side = position_side + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_order_update_request.py b/gate_api/models/crossex_order_update_request.py new file mode 100644 index 00000000..7a26508d --- /dev/null +++ b/gate_api/models/crossex_order_update_request.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexOrderUpdateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'qty': 'str', + 'price': 'str' + } + + attribute_map = { + 'qty': 'qty', + 'price': 'price' + } + + def __init__(self, qty=None, price=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexOrderUpdateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._qty = None + self._price = None + self.discriminator = None + + if qty is not None: + self.qty = qty + if price is not None: + self.price = price + + @property + def qty(self): + """Gets the qty of this CrossexOrderUpdateRequest. # noqa: E501 + + modify amount # noqa: E501 + + :return: The qty of this CrossexOrderUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._qty + + @qty.setter + def qty(self, qty): + """Sets the qty of this CrossexOrderUpdateRequest. + + modify amount # noqa: E501 + + :param qty: The qty of this CrossexOrderUpdateRequest. # noqa: E501 + :type: str + """ + + self._qty = qty + + @property + def price(self): + """Gets the price of this CrossexOrderUpdateRequest. # noqa: E501 + + modify price # noqa: E501 + + :return: The price of this CrossexOrderUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this CrossexOrderUpdateRequest. + + modify price # noqa: E501 + + :param price: The price of this CrossexOrderUpdateRequest. # noqa: E501 + :type: str + """ + + self._price = price + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexOrderUpdateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexOrderUpdateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_position.py b/gate_api/models/crossex_position.py new file mode 100644 index 00000000..6d78ac50 --- /dev/null +++ b/gate_api/models/crossex_position.py @@ -0,0 +1,767 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexPosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_id': 'str', + 'position_id': 'str', + 'symbol': 'str', + 'position_side': 'str', + 'initial_margin': 'str', + 'isolated_margin': 'str', + 'margin_mode': 'str', + 'maintenance_margin': 'str', + 'position_qty': 'str', + 'position_value': 'str', + 'upnl': 'str', + 'upnl_rate': 'str', + 'entry_price': 'str', + 'liq_price': 'str', + 'mark_price': 'str', + 'leverage': 'str', + 'max_leverage': 'str', + 'risk_limit': 'str', + 'fee': 'str', + 'funding_fee': 'str', + 'funding_time': 'str', + 'create_time': 'str', + 'update_time': 'str', + 'closed_pnl': 'str' + } + + attribute_map = { + 'user_id': 'user_id', + 'position_id': 'position_id', + 'symbol': 'symbol', + 'position_side': 'position_side', + 'initial_margin': 'initial_margin', + 'isolated_margin': 'isolated_margin', + 'margin_mode': 'margin_mode', + 'maintenance_margin': 'maintenance_margin', + 'position_qty': 'position_qty', + 'position_value': 'position_value', + 'upnl': 'upnl', + 'upnl_rate': 'upnl_rate', + 'entry_price': 'entry_price', + 'liq_price': 'liq_price', + 'mark_price': 'mark_price', + 'leverage': 'leverage', + 'max_leverage': 'max_leverage', + 'risk_limit': 'risk_limit', + 'fee': 'fee', + 'funding_fee': 'funding_fee', + 'funding_time': 'funding_time', + 'create_time': 'create_time', + 'update_time': 'update_time', + 'closed_pnl': 'closed_pnl' + } + + def __init__(self, user_id=None, position_id=None, symbol=None, position_side=None, initial_margin=None, isolated_margin=None, margin_mode=None, maintenance_margin=None, position_qty=None, position_value=None, upnl=None, upnl_rate=None, entry_price=None, liq_price=None, mark_price=None, leverage=None, max_leverage=None, risk_limit=None, fee=None, funding_fee=None, funding_time=None, create_time=None, update_time=None, closed_pnl=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """CrossexPosition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_id = None + self._position_id = None + self._symbol = None + self._position_side = None + self._initial_margin = None + self._isolated_margin = None + self._margin_mode = None + self._maintenance_margin = None + self._position_qty = None + self._position_value = None + self._upnl = None + self._upnl_rate = None + self._entry_price = None + self._liq_price = None + self._mark_price = None + self._leverage = None + self._max_leverage = None + self._risk_limit = None + self._fee = None + self._funding_fee = None + self._funding_time = None + self._create_time = None + self._update_time = None + self._closed_pnl = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if position_id is not None: + self.position_id = position_id + if symbol is not None: + self.symbol = symbol + if position_side is not None: + self.position_side = position_side + if initial_margin is not None: + self.initial_margin = initial_margin + if isolated_margin is not None: + self.isolated_margin = isolated_margin + if margin_mode is not None: + self.margin_mode = margin_mode + if maintenance_margin is not None: + self.maintenance_margin = maintenance_margin + if position_qty is not None: + self.position_qty = position_qty + if position_value is not None: + self.position_value = position_value + if upnl is not None: + self.upnl = upnl + if upnl_rate is not None: + self.upnl_rate = upnl_rate + if entry_price is not None: + self.entry_price = entry_price + if liq_price is not None: + self.liq_price = liq_price + if mark_price is not None: + self.mark_price = mark_price + if leverage is not None: + self.leverage = leverage + if max_leverage is not None: + self.max_leverage = max_leverage + if risk_limit is not None: + self.risk_limit = risk_limit + if fee is not None: + self.fee = fee + if funding_fee is not None: + self.funding_fee = funding_fee + if funding_time is not None: + self.funding_time = funding_time + if create_time is not None: + self.create_time = create_time + if update_time is not None: + self.update_time = update_time + if closed_pnl is not None: + self.closed_pnl = closed_pnl + + @property + def user_id(self): + """Gets the user_id of this CrossexPosition. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexPosition. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._user_id = user_id + + @property + def position_id(self): + """Gets the position_id of this CrossexPosition. # noqa: E501 + + Position ID # noqa: E501 + + :return: The position_id of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._position_id + + @position_id.setter + def position_id(self, position_id): + """Sets the position_id of this CrossexPosition. + + Position ID # noqa: E501 + + :param position_id: The position_id of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._position_id = position_id + + @property + def symbol(self): + """Gets the symbol of this CrossexPosition. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexPosition. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def position_side(self): + """Gets the position_side of this CrossexPosition. # noqa: E501 + + Position Direction # noqa: E501 + + :return: The position_side of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._position_side + + @position_side.setter + def position_side(self, position_side): + """Sets the position_side of this CrossexPosition. + + Position Direction # noqa: E501 + + :param position_side: The position_side of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._position_side = position_side + + @property + def initial_margin(self): + """Gets the initial_margin of this CrossexPosition. # noqa: E501 + + Initial Margin # noqa: E501 + + :return: The initial_margin of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._initial_margin + + @initial_margin.setter + def initial_margin(self, initial_margin): + """Sets the initial_margin of this CrossexPosition. + + Initial Margin # noqa: E501 + + :param initial_margin: The initial_margin of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._initial_margin = initial_margin + + @property + def isolated_margin(self): + """Gets the isolated_margin of this CrossexPosition. # noqa: E501 + + Isolated margin. It is 0 in cross margin mode and applies only to isolated margin positions # noqa: E501 + + :return: The isolated_margin of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._isolated_margin + + @isolated_margin.setter + def isolated_margin(self, isolated_margin): + """Sets the isolated_margin of this CrossexPosition. + + Isolated margin. It is 0 in cross margin mode and applies only to isolated margin positions # noqa: E501 + + :param isolated_margin: The isolated_margin of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._isolated_margin = isolated_margin + + @property + def margin_mode(self): + """Gets the margin_mode of this CrossexPosition. # noqa: E501 + + Margin mode (CROSS/ISOLATED) # noqa: E501 + + :return: The margin_mode of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._margin_mode + + @margin_mode.setter + def margin_mode(self, margin_mode): + """Sets the margin_mode of this CrossexPosition. + + Margin mode (CROSS/ISOLATED) # noqa: E501 + + :param margin_mode: The margin_mode of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._margin_mode = margin_mode + + @property + def maintenance_margin(self): + """Gets the maintenance_margin of this CrossexPosition. # noqa: E501 + + Maintenance margin # noqa: E501 + + :return: The maintenance_margin of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._maintenance_margin + + @maintenance_margin.setter + def maintenance_margin(self, maintenance_margin): + """Sets the maintenance_margin of this CrossexPosition. + + Maintenance margin # noqa: E501 + + :param maintenance_margin: The maintenance_margin of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._maintenance_margin = maintenance_margin + + @property + def position_qty(self): + """Gets the position_qty of this CrossexPosition. # noqa: E501 + + Position Quantity # noqa: E501 + + :return: The position_qty of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._position_qty + + @position_qty.setter + def position_qty(self, position_qty): + """Sets the position_qty of this CrossexPosition. + + Position Quantity # noqa: E501 + + :param position_qty: The position_qty of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._position_qty = position_qty + + @property + def position_value(self): + """Gets the position_value of this CrossexPosition. # noqa: E501 + + Position Value # noqa: E501 + + :return: The position_value of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._position_value + + @position_value.setter + def position_value(self, position_value): + """Sets the position_value of this CrossexPosition. + + Position Value # noqa: E501 + + :param position_value: The position_value of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._position_value = position_value + + @property + def upnl(self): + """Gets the upnl of this CrossexPosition. # noqa: E501 + + Unrealized P&L # noqa: E501 + + :return: The upnl of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._upnl + + @upnl.setter + def upnl(self, upnl): + """Sets the upnl of this CrossexPosition. + + Unrealized P&L # noqa: E501 + + :param upnl: The upnl of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._upnl = upnl + + @property + def upnl_rate(self): + """Gets the upnl_rate of this CrossexPosition. # noqa: E501 + + Unrealized P&L Ratio # noqa: E501 + + :return: The upnl_rate of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._upnl_rate + + @upnl_rate.setter + def upnl_rate(self, upnl_rate): + """Sets the upnl_rate of this CrossexPosition. + + Unrealized P&L Ratio # noqa: E501 + + :param upnl_rate: The upnl_rate of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._upnl_rate = upnl_rate + + @property + def entry_price(self): + """Gets the entry_price of this CrossexPosition. # noqa: E501 + + Position Average Entry Price # noqa: E501 + + :return: The entry_price of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._entry_price + + @entry_price.setter + def entry_price(self, entry_price): + """Sets the entry_price of this CrossexPosition. + + Position Average Entry Price # noqa: E501 + + :param entry_price: The entry_price of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._entry_price = entry_price + + @property + def liq_price(self): + """Gets the liq_price of this CrossexPosition. # noqa: E501 + + Liquidation price. It is 0 in cross margin mode and applies only to isolated margin positions; 0 in isolated margin mode means the position will not be liquidated # noqa: E501 + + :return: The liq_price of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._liq_price + + @liq_price.setter + def liq_price(self, liq_price): + """Sets the liq_price of this CrossexPosition. + + Liquidation price. It is 0 in cross margin mode and applies only to isolated margin positions; 0 in isolated margin mode means the position will not be liquidated # noqa: E501 + + :param liq_price: The liq_price of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._liq_price = liq_price + + @property + def mark_price(self): + """Gets the mark_price of this CrossexPosition. # noqa: E501 + + Mark price # noqa: E501 + + :return: The mark_price of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._mark_price + + @mark_price.setter + def mark_price(self, mark_price): + """Sets the mark_price of this CrossexPosition. + + Mark price # noqa: E501 + + :param mark_price: The mark_price of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._mark_price = mark_price + + @property + def leverage(self): + """Gets the leverage of this CrossexPosition. # noqa: E501 + + Position Leverage # noqa: E501 + + :return: The leverage of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this CrossexPosition. + + Position Leverage # noqa: E501 + + :param leverage: The leverage of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + @property + def max_leverage(self): + """Gets the max_leverage of this CrossexPosition. # noqa: E501 + + Maximum leverage # noqa: E501 + + :return: The max_leverage of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._max_leverage + + @max_leverage.setter + def max_leverage(self, max_leverage): + """Sets the max_leverage of this CrossexPosition. + + Maximum leverage # noqa: E501 + + :param max_leverage: The max_leverage of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._max_leverage = max_leverage + + @property + def risk_limit(self): + """Gets the risk_limit of this CrossexPosition. # noqa: E501 + + Position risk limit # noqa: E501 + + :return: The risk_limit of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._risk_limit + + @risk_limit.setter + def risk_limit(self, risk_limit): + """Sets the risk_limit of this CrossexPosition. + + Position risk limit # noqa: E501 + + :param risk_limit: The risk_limit of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._risk_limit = risk_limit + + @property + def fee(self): + """Gets the fee of this CrossexPosition. # noqa: E501 + + Position Fee # noqa: E501 + + :return: The fee of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this CrossexPosition. + + Position Fee # noqa: E501 + + :param fee: The fee of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def funding_fee(self): + """Gets the funding_fee of this CrossexPosition. # noqa: E501 + + Accumulated position funding fee. A positive value indicates a gain, while a negative value indicates a loss. # noqa: E501 + + :return: The funding_fee of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._funding_fee + + @funding_fee.setter + def funding_fee(self, funding_fee): + """Sets the funding_fee of this CrossexPosition. + + Accumulated position funding fee. A positive value indicates a gain, while a negative value indicates a loss. # noqa: E501 + + :param funding_fee: The funding_fee of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._funding_fee = funding_fee + + @property + def funding_time(self): + """Gets the funding_time of this CrossexPosition. # noqa: E501 + + Position funding fee collection time (0 indicates it has not been collected yet) # noqa: E501 + + :return: The funding_time of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._funding_time + + @funding_time.setter + def funding_time(self, funding_time): + """Sets the funding_time of this CrossexPosition. + + Position funding fee collection time (0 indicates it has not been collected yet) # noqa: E501 + + :param funding_time: The funding_time of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._funding_time = funding_time + + @property + def create_time(self): + """Gets the create_time of this CrossexPosition. # noqa: E501 + + Position Creation Time # noqa: E501 + + :return: The create_time of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CrossexPosition. + + Position Creation Time # noqa: E501 + + :param create_time: The create_time of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this CrossexPosition. # noqa: E501 + + Position Update Time # noqa: E501 + + :return: The update_time of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this CrossexPosition. + + Position Update Time # noqa: E501 + + :param update_time: The update_time of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._update_time = update_time + + @property + def closed_pnl(self): + """Gets the closed_pnl of this CrossexPosition. # noqa: E501 + + Realized PnL # noqa: E501 + + :return: The closed_pnl of this CrossexPosition. # noqa: E501 + :rtype: str + """ + return self._closed_pnl + + @closed_pnl.setter + def closed_pnl(self, closed_pnl): + """Sets the closed_pnl of this CrossexPosition. + + Realized PnL # noqa: E501 + + :param closed_pnl: The closed_pnl of this CrossexPosition. # noqa: E501 + :type: str + """ + + self._closed_pnl = closed_pnl + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexPosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexPosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_risk_limit.py b/gate_api/models/crossex_risk_limit.py new file mode 100644 index 00000000..c3d05655 --- /dev/null +++ b/gate_api/models/crossex_risk_limit.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexRiskLimit(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'tiers': 'list[CrossexRiskLimitTier]' + } + + attribute_map = { + 'symbol': 'symbol', + 'tiers': 'tiers' + } + + def __init__(self, symbol=None, tiers=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[CrossexRiskLimitTier], Configuration) -> None + """CrossexRiskLimit - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._tiers = None + self.discriminator = None + + if symbol is not None: + self.symbol = symbol + if tiers is not None: + self.tiers = tiers + + @property + def symbol(self): + """Gets the symbol of this CrossexRiskLimit. # noqa: E501 + + + :return: The symbol of this CrossexRiskLimit. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexRiskLimit. + + + :param symbol: The symbol of this CrossexRiskLimit. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def tiers(self): + """Gets the tiers of this CrossexRiskLimit. # noqa: E501 + + + :return: The tiers of this CrossexRiskLimit. # noqa: E501 + :rtype: list[CrossexRiskLimitTier] + """ + return self._tiers + + @tiers.setter + def tiers(self, tiers): + """Sets the tiers of this CrossexRiskLimit. + + + :param tiers: The tiers of this CrossexRiskLimit. # noqa: E501 + :type: list[CrossexRiskLimitTier] + """ + + self._tiers = tiers + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexRiskLimit): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexRiskLimit): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_risk_limit_tier.py b/gate_api/models/crossex_risk_limit_tier.py new file mode 100644 index 00000000..1d7d3290 --- /dev/null +++ b/gate_api/models/crossex_risk_limit_tier.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexRiskLimitTier(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'min_risk_limit_value': 'str', + 'max_risk_limit_value': 'str', + 'quick_cal_amount': 'str', + 'leverage_max': 'str', + 'maintenance_rate': 'str', + 'tier': 'str' + } + + attribute_map = { + 'min_risk_limit_value': 'min_risk_limit_value', + 'max_risk_limit_value': 'max_risk_limit_value', + 'quick_cal_amount': 'quick_cal_amount', + 'leverage_max': 'leverage_max', + 'maintenance_rate': 'maintenance_rate', + 'tier': 'tier' + } + + def __init__(self, min_risk_limit_value=None, max_risk_limit_value=None, quick_cal_amount=None, leverage_max=None, maintenance_rate=None, tier=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """CrossexRiskLimitTier - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._min_risk_limit_value = None + self._max_risk_limit_value = None + self._quick_cal_amount = None + self._leverage_max = None + self._maintenance_rate = None + self._tier = None + self.discriminator = None + + self.min_risk_limit_value = min_risk_limit_value + self.max_risk_limit_value = max_risk_limit_value + self.quick_cal_amount = quick_cal_amount + self.leverage_max = leverage_max + self.maintenance_rate = maintenance_rate + self.tier = tier + + @property + def min_risk_limit_value(self): + """Gets the min_risk_limit_value of this CrossexRiskLimitTier. # noqa: E501 + + Minimum risk limit value # noqa: E501 + + :return: The min_risk_limit_value of this CrossexRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._min_risk_limit_value + + @min_risk_limit_value.setter + def min_risk_limit_value(self, min_risk_limit_value): + """Sets the min_risk_limit_value of this CrossexRiskLimitTier. + + Minimum risk limit value # noqa: E501 + + :param min_risk_limit_value: The min_risk_limit_value of this CrossexRiskLimitTier. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and min_risk_limit_value is None: # noqa: E501 + raise ValueError("Invalid value for `min_risk_limit_value`, must not be `None`") # noqa: E501 + + self._min_risk_limit_value = min_risk_limit_value + + @property + def max_risk_limit_value(self): + """Gets the max_risk_limit_value of this CrossexRiskLimitTier. # noqa: E501 + + Maximum risk limit value # noqa: E501 + + :return: The max_risk_limit_value of this CrossexRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._max_risk_limit_value + + @max_risk_limit_value.setter + def max_risk_limit_value(self, max_risk_limit_value): + """Sets the max_risk_limit_value of this CrossexRiskLimitTier. + + Maximum risk limit value # noqa: E501 + + :param max_risk_limit_value: The max_risk_limit_value of this CrossexRiskLimitTier. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and max_risk_limit_value is None: # noqa: E501 + raise ValueError("Invalid value for `max_risk_limit_value`, must not be `None`") # noqa: E501 + + self._max_risk_limit_value = max_risk_limit_value + + @property + def quick_cal_amount(self): + """Gets the quick_cal_amount of this CrossexRiskLimitTier. # noqa: E501 + + Quick-calculation amount # noqa: E501 + + :return: The quick_cal_amount of this CrossexRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._quick_cal_amount + + @quick_cal_amount.setter + def quick_cal_amount(self, quick_cal_amount): + """Sets the quick_cal_amount of this CrossexRiskLimitTier. + + Quick-calculation amount # noqa: E501 + + :param quick_cal_amount: The quick_cal_amount of this CrossexRiskLimitTier. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and quick_cal_amount is None: # noqa: E501 + raise ValueError("Invalid value for `quick_cal_amount`, must not be `None`") # noqa: E501 + + self._quick_cal_amount = quick_cal_amount + + @property + def leverage_max(self): + """Gets the leverage_max of this CrossexRiskLimitTier. # noqa: E501 + + Maximum leverage # noqa: E501 + + :return: The leverage_max of this CrossexRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._leverage_max + + @leverage_max.setter + def leverage_max(self, leverage_max): + """Sets the leverage_max of this CrossexRiskLimitTier. + + Maximum leverage # noqa: E501 + + :param leverage_max: The leverage_max of this CrossexRiskLimitTier. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and leverage_max is None: # noqa: E501 + raise ValueError("Invalid value for `leverage_max`, must not be `None`") # noqa: E501 + + self._leverage_max = leverage_max + + @property + def maintenance_rate(self): + """Gets the maintenance_rate of this CrossexRiskLimitTier. # noqa: E501 + + Maintenance margin rate # noqa: E501 + + :return: The maintenance_rate of this CrossexRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._maintenance_rate + + @maintenance_rate.setter + def maintenance_rate(self, maintenance_rate): + """Sets the maintenance_rate of this CrossexRiskLimitTier. + + Maintenance margin rate # noqa: E501 + + :param maintenance_rate: The maintenance_rate of this CrossexRiskLimitTier. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and maintenance_rate is None: # noqa: E501 + raise ValueError("Invalid value for `maintenance_rate`, must not be `None`") # noqa: E501 + + self._maintenance_rate = maintenance_rate + + @property + def tier(self): + """Gets the tier of this CrossexRiskLimitTier. # noqa: E501 + + Tier # noqa: E501 + + :return: The tier of this CrossexRiskLimitTier. # noqa: E501 + :rtype: str + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this CrossexRiskLimitTier. + + Tier # noqa: E501 + + :param tier: The tier of this CrossexRiskLimitTier. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and tier is None: # noqa: E501 + raise ValueError("Invalid value for `tier`, must not be `None`") # noqa: E501 + + self._tier = tier + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexRiskLimitTier): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexRiskLimitTier): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_special_fee.py b/gate_api/models/crossex_special_fee.py new file mode 100644 index 00000000..4db992da --- /dev/null +++ b/gate_api/models/crossex_special_fee.py @@ -0,0 +1,210 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexSpecialFee(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'taker_fee_rate': 'str', + 'maker_fee_rate': 'str', + 'rpi_fee_rate': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'taker_fee_rate': 'taker_fee_rate', + 'maker_fee_rate': 'maker_fee_rate', + 'rpi_fee_rate': 'rpi_fee_rate' + } + + def __init__(self, symbol=None, taker_fee_rate=None, maker_fee_rate=None, rpi_fee_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """CrossexSpecialFee - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._taker_fee_rate = None + self._maker_fee_rate = None + self._rpi_fee_rate = None + self.discriminator = None + + self.symbol = symbol + self.taker_fee_rate = taker_fee_rate + self.maker_fee_rate = maker_fee_rate + if rpi_fee_rate is not None: + self.rpi_fee_rate = rpi_fee_rate + + @property + def symbol(self): + """Gets the symbol of this CrossexSpecialFee. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this CrossexSpecialFee. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexSpecialFee. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this CrossexSpecialFee. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def taker_fee_rate(self): + """Gets the taker_fee_rate of this CrossexSpecialFee. # noqa: E501 + + Taker fee rate # noqa: E501 + + :return: The taker_fee_rate of this CrossexSpecialFee. # noqa: E501 + :rtype: str + """ + return self._taker_fee_rate + + @taker_fee_rate.setter + def taker_fee_rate(self, taker_fee_rate): + """Sets the taker_fee_rate of this CrossexSpecialFee. + + Taker fee rate # noqa: E501 + + :param taker_fee_rate: The taker_fee_rate of this CrossexSpecialFee. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and taker_fee_rate is None: # noqa: E501 + raise ValueError("Invalid value for `taker_fee_rate`, must not be `None`") # noqa: E501 + + self._taker_fee_rate = taker_fee_rate + + @property + def maker_fee_rate(self): + """Gets the maker_fee_rate of this CrossexSpecialFee. # noqa: E501 + + Maker fee rate # noqa: E501 + + :return: The maker_fee_rate of this CrossexSpecialFee. # noqa: E501 + :rtype: str + """ + return self._maker_fee_rate + + @maker_fee_rate.setter + def maker_fee_rate(self, maker_fee_rate): + """Sets the maker_fee_rate of this CrossexSpecialFee. + + Maker fee rate # noqa: E501 + + :param maker_fee_rate: The maker_fee_rate of this CrossexSpecialFee. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and maker_fee_rate is None: # noqa: E501 + raise ValueError("Invalid value for `maker_fee_rate`, must not be `None`") # noqa: E501 + + self._maker_fee_rate = maker_fee_rate + + @property + def rpi_fee_rate(self): + """Gets the rpi_fee_rate of this CrossexSpecialFee. # noqa: E501 + + RPI order maker fee rate # noqa: E501 + + :return: The rpi_fee_rate of this CrossexSpecialFee. # noqa: E501 + :rtype: str + """ + return self._rpi_fee_rate + + @rpi_fee_rate.setter + def rpi_fee_rate(self, rpi_fee_rate): + """Sets the rpi_fee_rate of this CrossexSpecialFee. + + RPI order maker fee rate # noqa: E501 + + :param rpi_fee_rate: The rpi_fee_rate of this CrossexSpecialFee. # noqa: E501 + :type: str + """ + + self._rpi_fee_rate = rpi_fee_rate + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexSpecialFee): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexSpecialFee): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_trade.py b/gate_api/models/crossex_trade.py new file mode 100644 index 00000000..a796f910 --- /dev/null +++ b/gate_api/models/crossex_trade.py @@ -0,0 +1,599 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexTrade(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_id': 'str', + 'transaction_id': 'str', + 'order_id': 'str', + 'text': 'str', + 'symbol': 'str', + 'exchange_type': 'str', + 'business_type': 'str', + 'side': 'str', + 'qty': 'str', + 'price': 'str', + 'fee': 'str', + 'fee_coin': 'str', + 'fee_rate': 'str', + 'match_role': 'str', + 'rpnl': 'str', + 'position_mode': 'str', + 'position_side': 'str', + 'create_time': 'str' + } + + attribute_map = { + 'user_id': 'user_id', + 'transaction_id': 'transaction_id', + 'order_id': 'order_id', + 'text': 'text', + 'symbol': 'symbol', + 'exchange_type': 'exchange_type', + 'business_type': 'business_type', + 'side': 'side', + 'qty': 'qty', + 'price': 'price', + 'fee': 'fee', + 'fee_coin': 'fee_coin', + 'fee_rate': 'fee_rate', + 'match_role': 'match_role', + 'rpnl': 'rpnl', + 'position_mode': 'position_mode', + 'position_side': 'position_side', + 'create_time': 'create_time' + } + + def __init__(self, user_id=None, transaction_id=None, order_id=None, text=None, symbol=None, exchange_type=None, business_type=None, side=None, qty=None, price=None, fee=None, fee_coin=None, fee_rate=None, match_role=None, rpnl=None, position_mode=None, position_side=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """CrossexTrade - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_id = None + self._transaction_id = None + self._order_id = None + self._text = None + self._symbol = None + self._exchange_type = None + self._business_type = None + self._side = None + self._qty = None + self._price = None + self._fee = None + self._fee_coin = None + self._fee_rate = None + self._match_role = None + self._rpnl = None + self._position_mode = None + self._position_side = None + self._create_time = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if transaction_id is not None: + self.transaction_id = transaction_id + if order_id is not None: + self.order_id = order_id + if text is not None: + self.text = text + if symbol is not None: + self.symbol = symbol + if exchange_type is not None: + self.exchange_type = exchange_type + if business_type is not None: + self.business_type = business_type + if side is not None: + self.side = side + if qty is not None: + self.qty = qty + if price is not None: + self.price = price + if fee is not None: + self.fee = fee + if fee_coin is not None: + self.fee_coin = fee_coin + if fee_rate is not None: + self.fee_rate = fee_rate + if match_role is not None: + self.match_role = match_role + if rpnl is not None: + self.rpnl = rpnl + if position_mode is not None: + self.position_mode = position_mode + if position_side is not None: + self.position_side = position_side + if create_time is not None: + self.create_time = create_time + + @property + def user_id(self): + """Gets the user_id of this CrossexTrade. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this CrossexTrade. + + User ID # noqa: E501 + + :param user_id: The user_id of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._user_id = user_id + + @property + def transaction_id(self): + """Gets the transaction_id of this CrossexTrade. # noqa: E501 + + filledrecordsID # noqa: E501 + + :return: The transaction_id of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._transaction_id + + @transaction_id.setter + def transaction_id(self, transaction_id): + """Sets the transaction_id of this CrossexTrade. + + filledrecordsID # noqa: E501 + + :param transaction_id: The transaction_id of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._transaction_id = transaction_id + + @property + def order_id(self): + """Gets the order_id of this CrossexTrade. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this CrossexTrade. + + Order ID # noqa: E501 + + :param order_id: The order_id of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def text(self): + """Gets the text of this CrossexTrade. # noqa: E501 + + User Order ID # noqa: E501 + + :return: The text of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CrossexTrade. + + User Order ID # noqa: E501 + + :param text: The text of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def symbol(self): + """Gets the symbol of this CrossexTrade. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this CrossexTrade. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def exchange_type(self): + """Gets the exchange_type of this CrossexTrade. # noqa: E501 + + Exchange # noqa: E501 + + :return: The exchange_type of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this CrossexTrade. + + Exchange # noqa: E501 + + :param exchange_type: The exchange_type of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._exchange_type = exchange_type + + @property + def business_type(self): + """Gets the business_type of this CrossexTrade. # noqa: E501 + + Business Type # noqa: E501 + + :return: The business_type of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._business_type + + @business_type.setter + def business_type(self, business_type): + """Sets the business_type of this CrossexTrade. + + Business Type # noqa: E501 + + :param business_type: The business_type of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._business_type = business_type + + @property + def side(self): + """Gets the side of this CrossexTrade. # noqa: E501 + + Buy/Sell Direction # noqa: E501 + + :return: The side of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this CrossexTrade. + + Buy/Sell Direction # noqa: E501 + + :param side: The side of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._side = side + + @property + def qty(self): + """Gets the qty of this CrossexTrade. # noqa: E501 + + Trading size # noqa: E501 + + :return: The qty of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._qty + + @qty.setter + def qty(self, qty): + """Sets the qty of this CrossexTrade. + + Trading size # noqa: E501 + + :param qty: The qty of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._qty = qty + + @property + def price(self): + """Gets the price of this CrossexTrade. # noqa: E501 + + Fill Price # noqa: E501 + + :return: The price of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this CrossexTrade. + + Fill Price # noqa: E501 + + :param price: The price of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def fee(self): + """Gets the fee of this CrossexTrade. # noqa: E501 + + fee # noqa: E501 + + :return: The fee of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this CrossexTrade. + + fee # noqa: E501 + + :param fee: The fee of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def fee_coin(self): + """Gets the fee_coin of this CrossexTrade. # noqa: E501 + + Fee currency # noqa: E501 + + :return: The fee_coin of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._fee_coin + + @fee_coin.setter + def fee_coin(self, fee_coin): + """Sets the fee_coin of this CrossexTrade. + + Fee currency # noqa: E501 + + :param fee_coin: The fee_coin of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._fee_coin = fee_coin + + @property + def fee_rate(self): + """Gets the fee_rate of this CrossexTrade. # noqa: E501 + + Fee Rate # noqa: E501 + + :return: The fee_rate of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._fee_rate + + @fee_rate.setter + def fee_rate(self, fee_rate): + """Sets the fee_rate of this CrossexTrade. + + Fee Rate # noqa: E501 + + :param fee_rate: The fee_rate of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._fee_rate = fee_rate + + @property + def match_role(self): + """Gets the match_role of this CrossexTrade. # noqa: E501 + + Filled Role # noqa: E501 + + :return: The match_role of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._match_role + + @match_role.setter + def match_role(self, match_role): + """Sets the match_role of this CrossexTrade. + + Filled Role # noqa: E501 + + :param match_role: The match_role of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._match_role = match_role + + @property + def rpnl(self): + """Gets the rpnl of this CrossexTrade. # noqa: E501 + + Realized P&L # noqa: E501 + + :return: The rpnl of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._rpnl + + @rpnl.setter + def rpnl(self, rpnl): + """Sets the rpnl of this CrossexTrade. + + Realized P&L # noqa: E501 + + :param rpnl: The rpnl of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._rpnl = rpnl + + @property + def position_mode(self): + """Gets the position_mode of this CrossexTrade. # noqa: E501 + + Position Mode # noqa: E501 + + :return: The position_mode of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._position_mode + + @position_mode.setter + def position_mode(self, position_mode): + """Sets the position_mode of this CrossexTrade. + + Position Mode # noqa: E501 + + :param position_mode: The position_mode of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._position_mode = position_mode + + @property + def position_side(self): + """Gets the position_side of this CrossexTrade. # noqa: E501 + + Position Direction # noqa: E501 + + :return: The position_side of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._position_side + + @position_side.setter + def position_side(self, position_side): + """Sets the position_side of this CrossexTrade. + + Position Direction # noqa: E501 + + :param position_side: The position_side of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._position_side = position_side + + @property + def create_time(self): + """Gets the create_time of this CrossexTrade. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this CrossexTrade. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CrossexTrade. + + Created time # noqa: E501 + + :param create_time: The create_time of this CrossexTrade. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexTrade): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexTrade): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_transfer_coin.py b/gate_api/models/crossex_transfer_coin.py new file mode 100644 index 00000000..86d99835 --- /dev/null +++ b/gate_api/models/crossex_transfer_coin.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexTransferCoin(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'coin': 'str', + 'min_trans_amount': 'float', + 'est_fee': 'float', + 'precision': 'int', + 'is_disabled': 'int' + } + + attribute_map = { + 'coin': 'coin', + 'min_trans_amount': 'min_trans_amount', + 'est_fee': 'est_fee', + 'precision': 'precision', + 'is_disabled': 'is_disabled' + } + + def __init__(self, coin=None, min_trans_amount=None, est_fee=None, precision=None, is_disabled=None, local_vars_configuration=None): # noqa: E501 + # type: (str, float, float, int, int, Configuration) -> None + """CrossexTransferCoin - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._coin = None + self._min_trans_amount = None + self._est_fee = None + self._precision = None + self._is_disabled = None + self.discriminator = None + + self.coin = coin + self.min_trans_amount = min_trans_amount + self.est_fee = est_fee + self.precision = precision + self.is_disabled = is_disabled + + @property + def coin(self): + """Gets the coin of this CrossexTransferCoin. # noqa: E501 + + Currency # noqa: E501 + + :return: The coin of this CrossexTransferCoin. # noqa: E501 + :rtype: str + """ + return self._coin + + @coin.setter + def coin(self, coin): + """Sets the coin of this CrossexTransferCoin. + + Currency # noqa: E501 + + :param coin: The coin of this CrossexTransferCoin. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and coin is None: # noqa: E501 + raise ValueError("Invalid value for `coin`, must not be `None`") # noqa: E501 + + self._coin = coin + + @property + def min_trans_amount(self): + """Gets the min_trans_amount of this CrossexTransferCoin. # noqa: E501 + + Minimum Transfer Quantity (including estimated fees) # noqa: E501 + + :return: The min_trans_amount of this CrossexTransferCoin. # noqa: E501 + :rtype: float + """ + return self._min_trans_amount + + @min_trans_amount.setter + def min_trans_amount(self, min_trans_amount): + """Sets the min_trans_amount of this CrossexTransferCoin. + + Minimum Transfer Quantity (including estimated fees) # noqa: E501 + + :param min_trans_amount: The min_trans_amount of this CrossexTransferCoin. # noqa: E501 + :type: float + """ + if self.local_vars_configuration.client_side_validation and min_trans_amount is None: # noqa: E501 + raise ValueError("Invalid value for `min_trans_amount`, must not be `None`") # noqa: E501 + + self._min_trans_amount = min_trans_amount + + @property + def est_fee(self): + """Gets the est_fee of this CrossexTransferCoin. # noqa: E501 + + Estimated Fee # noqa: E501 + + :return: The est_fee of this CrossexTransferCoin. # noqa: E501 + :rtype: float + """ + return self._est_fee + + @est_fee.setter + def est_fee(self, est_fee): + """Sets the est_fee of this CrossexTransferCoin. + + Estimated Fee # noqa: E501 + + :param est_fee: The est_fee of this CrossexTransferCoin. # noqa: E501 + :type: float + """ + if self.local_vars_configuration.client_side_validation and est_fee is None: # noqa: E501 + raise ValueError("Invalid value for `est_fee`, must not be `None`") # noqa: E501 + + self._est_fee = est_fee + + @property + def precision(self): + """Gets the precision of this CrossexTransferCoin. # noqa: E501 + + Precision # noqa: E501 + + :return: The precision of this CrossexTransferCoin. # noqa: E501 + :rtype: int + """ + return self._precision + + @precision.setter + def precision(self, precision): + """Sets the precision of this CrossexTransferCoin. + + Precision # noqa: E501 + + :param precision: The precision of this CrossexTransferCoin. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and precision is None: # noqa: E501 + raise ValueError("Invalid value for `precision`, must not be `None`") # noqa: E501 + + self._precision = precision + + @property + def is_disabled(self): + """Gets the is_disabled of this CrossexTransferCoin. # noqa: E501 + + If it is disabled. 0 means NOT being disabled # noqa: E501 + + :return: The is_disabled of this CrossexTransferCoin. # noqa: E501 + :rtype: int + """ + return self._is_disabled + + @is_disabled.setter + def is_disabled(self, is_disabled): + """Sets the is_disabled of this CrossexTransferCoin. + + If it is disabled. 0 means NOT being disabled # noqa: E501 + + :param is_disabled: The is_disabled of this CrossexTransferCoin. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and is_disabled is None: # noqa: E501 + raise ValueError("Invalid value for `is_disabled`, must not be `None`") # noqa: E501 + + self._is_disabled = is_disabled + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexTransferCoin): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexTransferCoin): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_transfer_record.py b/gate_api/models/crossex_transfer_record.py new file mode 100644 index 00000000..e3b154ab --- /dev/null +++ b/gate_api/models/crossex_transfer_record.py @@ -0,0 +1,412 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexTransferRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'text': 'str', + 'from_account_type': 'str', + 'to_account_type': 'str', + 'coin': 'str', + 'amount': 'str', + 'actual_receive': 'str', + 'status': 'str', + 'fail_reason': 'str', + 'create_time': 'int', + 'update_time': 'int' + } + + attribute_map = { + 'id': 'id', + 'text': 'text', + 'from_account_type': 'from_account_type', + 'to_account_type': 'to_account_type', + 'coin': 'coin', + 'amount': 'amount', + 'actual_receive': 'actual_receive', + 'status': 'status', + 'fail_reason': 'fail_reason', + 'create_time': 'create_time', + 'update_time': 'update_time' + } + + def __init__(self, id=None, text=None, from_account_type=None, to_account_type=None, coin=None, amount=None, actual_receive=None, status=None, fail_reason=None, create_time=None, update_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, int, int, Configuration) -> None + """CrossexTransferRecord - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._text = None + self._from_account_type = None + self._to_account_type = None + self._coin = None + self._amount = None + self._actual_receive = None + self._status = None + self._fail_reason = None + self._create_time = None + self._update_time = None + self.discriminator = None + + self.id = id + self.text = text + self.from_account_type = from_account_type + self.to_account_type = to_account_type + self.coin = coin + self.amount = amount + if actual_receive is not None: + self.actual_receive = actual_receive + self.status = status + if fail_reason is not None: + self.fail_reason = fail_reason + self.create_time = create_time + self.update_time = update_time + + @property + def id(self): + """Gets the id of this CrossexTransferRecord. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this CrossexTransferRecord. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CrossexTransferRecord. + + Order ID # noqa: E501 + + :param id: The id of this CrossexTransferRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def text(self): + """Gets the text of this CrossexTransferRecord. # noqa: E501 + + Client Custom ID # noqa: E501 + + :return: The text of this CrossexTransferRecord. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CrossexTransferRecord. + + Client Custom ID # noqa: E501 + + :param text: The text of this CrossexTransferRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and text is None: # noqa: E501 + raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501 + + self._text = text + + @property + def from_account_type(self): + """Gets the from_account_type of this CrossexTransferRecord. # noqa: E501 + + `from` credit account touched by this operation (`CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT`). # noqa: E501 + + :return: The from_account_type of this CrossexTransferRecord. # noqa: E501 + :rtype: str + """ + return self._from_account_type + + @from_account_type.setter + def from_account_type(self, from_account_type): + """Sets the from_account_type of this CrossexTransferRecord. + + `from` credit account touched by this operation (`CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT`). # noqa: E501 + + :param from_account_type: The from_account_type of this CrossexTransferRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and from_account_type is None: # noqa: E501 + raise ValueError("Invalid value for `from_account_type`, must not be `None`") # noqa: E501 + + self._from_account_type = from_account_type + + @property + def to_account_type(self): + """Gets the to_account_type of this CrossexTransferRecord. # noqa: E501 + + `to` debit account handled by this operation (`CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT`). # noqa: E501 + + :return: The to_account_type of this CrossexTransferRecord. # noqa: E501 + :rtype: str + """ + return self._to_account_type + + @to_account_type.setter + def to_account_type(self, to_account_type): + """Sets the to_account_type of this CrossexTransferRecord. + + `to` debit account handled by this operation (`CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT`). # noqa: E501 + + :param to_account_type: The to_account_type of this CrossexTransferRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and to_account_type is None: # noqa: E501 + raise ValueError("Invalid value for `to_account_type`, must not be `None`") # noqa: E501 + + self._to_account_type = to_account_type + + @property + def coin(self): + """Gets the coin of this CrossexTransferRecord. # noqa: E501 + + Currency # noqa: E501 + + :return: The coin of this CrossexTransferRecord. # noqa: E501 + :rtype: str + """ + return self._coin + + @coin.setter + def coin(self, coin): + """Sets the coin of this CrossexTransferRecord. + + Currency # noqa: E501 + + :param coin: The coin of this CrossexTransferRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and coin is None: # noqa: E501 + raise ValueError("Invalid value for `coin`, must not be `None`") # noqa: E501 + + self._coin = coin + + @property + def amount(self): + """Gets the amount of this CrossexTransferRecord. # noqa: E501 + + Transfer amount, the amount requested for the transfer # noqa: E501 + + :return: The amount of this CrossexTransferRecord. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this CrossexTransferRecord. + + Transfer amount, the amount requested for the transfer # noqa: E501 + + :param amount: The amount of this CrossexTransferRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def actual_receive(self): + """Gets the actual_receive of this CrossexTransferRecord. # noqa: E501 + + Actual credited amount (has a value when status = SUCCESS; empty for other statuses) # noqa: E501 + + :return: The actual_receive of this CrossexTransferRecord. # noqa: E501 + :rtype: str + """ + return self._actual_receive + + @actual_receive.setter + def actual_receive(self, actual_receive): + """Sets the actual_receive of this CrossexTransferRecord. + + Actual credited amount (has a value when status = SUCCESS; empty for other statuses) # noqa: E501 + + :param actual_receive: The actual_receive of this CrossexTransferRecord. # noqa: E501 + :type: str + """ + + self._actual_receive = actual_receive + + @property + def status(self): + """Gets the status of this CrossexTransferRecord. # noqa: E501 + + Transfer Status - `FAIL`: Failed - `SUCCESS`: Successful - `PENDING`: Transfer in Progress # noqa: E501 + + :return: The status of this CrossexTransferRecord. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this CrossexTransferRecord. + + Transfer Status - `FAIL`: Failed - `SUCCESS`: Successful - `PENDING`: Transfer in Progress # noqa: E501 + + :param status: The status of this CrossexTransferRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def fail_reason(self): + """Gets the fail_reason of this CrossexTransferRecord. # noqa: E501 + + Failure reason (has a value when status = FAIL; empty for other statuses) # noqa: E501 + + :return: The fail_reason of this CrossexTransferRecord. # noqa: E501 + :rtype: str + """ + return self._fail_reason + + @fail_reason.setter + def fail_reason(self, fail_reason): + """Sets the fail_reason of this CrossexTransferRecord. + + Failure reason (has a value when status = FAIL; empty for other statuses) # noqa: E501 + + :param fail_reason: The fail_reason of this CrossexTransferRecord. # noqa: E501 + :type: str + """ + + self._fail_reason = fail_reason + + @property + def create_time(self): + """Gets the create_time of this CrossexTransferRecord. # noqa: E501 + + Creation time of order # noqa: E501 + + :return: The create_time of this CrossexTransferRecord. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this CrossexTransferRecord. + + Creation time of order # noqa: E501 + + :param create_time: The create_time of this CrossexTransferRecord. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this CrossexTransferRecord. # noqa: E501 + + OrderUpdateTime # noqa: E501 + + :return: The update_time of this CrossexTransferRecord. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this CrossexTransferRecord. + + OrderUpdateTime # noqa: E501 + + :param update_time: The update_time of this CrossexTransferRecord. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and update_time is None: # noqa: E501 + raise ValueError("Invalid value for `update_time`, must not be `None`") # noqa: E501 + + self._update_time = update_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexTransferRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexTransferRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_transfer_request.py b/gate_api/models/crossex_transfer_request.py new file mode 100644 index 00000000..bc33815d --- /dev/null +++ b/gate_api/models/crossex_transfer_request.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexTransferRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'coin': 'str', + 'amount': 'str', + '_from': 'str', + 'to': 'str', + 'text': 'str' + } + + attribute_map = { + 'coin': 'coin', + 'amount': 'amount', + '_from': 'from', + 'to': 'to', + 'text': 'text' + } + + def __init__(self, coin=None, amount=None, _from=None, to=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """CrossexTransferRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._coin = None + self._amount = None + self.__from = None + self._to = None + self._text = None + self.discriminator = None + + self.coin = coin + self.amount = amount + self._from = _from + self.to = to + if text is not None: + self.text = text + + @property + def coin(self): + """Gets the coin of this CrossexTransferRequest. # noqa: E501 + + Currency # noqa: E501 + + :return: The coin of this CrossexTransferRequest. # noqa: E501 + :rtype: str + """ + return self._coin + + @coin.setter + def coin(self, coin): + """Sets the coin of this CrossexTransferRequest. + + Currency # noqa: E501 + + :param coin: The coin of this CrossexTransferRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and coin is None: # noqa: E501 + raise ValueError("Invalid value for `coin`, must not be `None`") # noqa: E501 + + self._coin = coin + + @property + def amount(self): + """Gets the amount of this CrossexTransferRequest. # noqa: E501 + + Transfer amount # noqa: E501 + + :return: The amount of this CrossexTransferRequest. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this CrossexTransferRequest. + + Transfer amount # noqa: E501 + + :param amount: The amount of this CrossexTransferRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def _from(self): + """Gets the _from of this CrossexTransferRequest. # noqa: E501 + + `from` receiving account (`CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT`). # noqa: E501 + + :return: The _from of this CrossexTransferRequest. # noqa: E501 + :rtype: str + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this CrossexTransferRequest. + + `from` receiving account (`CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT`). # noqa: E501 + + :param _from: The _from of this CrossexTransferRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and _from is None: # noqa: E501 + raise ValueError("Invalid value for `_from`, must not be `None`") # noqa: E501 + + self.__from = _from + + @property + def to(self): + """Gets the to of this CrossexTransferRequest. # noqa: E501 + + `to` debit account (funds withdrawn from): `CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT` # noqa: E501 + + :return: The to of this CrossexTransferRequest. # noqa: E501 + :rtype: str + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this CrossexTransferRequest. + + `to` debit account (funds withdrawn from): `CROSSEX_BINANCE`, `CROSSEX_OKX`, `CROSSEX_GATE`, `CROSSEX_BYBIT`, `CROSSEX_KRAKEN`, `CROSSEX_HYPERLIQUID`, `CROSSEX_DERIBIT`, `CROSSEX`, `SPOT` # noqa: E501 + + :param to: The to of this CrossexTransferRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and to is None: # noqa: E501 + raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501 + + self._to = to + + @property + def text(self): + """Gets the text of this CrossexTransferRequest. # noqa: E501 + + User-defined ID # noqa: E501 + + :return: The text of this CrossexTransferRequest. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CrossexTransferRequest. + + User-defined ID # noqa: E501 + + :param text: The text of this CrossexTransferRequest. # noqa: E501 + :type: str + """ + + self._text = text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexTransferRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexTransferRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/crossex_transfer_response.py b/gate_api/models/crossex_transfer_response.py new file mode 100644 index 00000000..dd84c6a1 --- /dev/null +++ b/gate_api/models/crossex_transfer_response.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class CrossexTransferResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'tx_id': 'str', + 'text': 'str' + } + + attribute_map = { + 'tx_id': 'tx_id', + 'text': 'text' + } + + def __init__(self, tx_id=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """CrossexTransferResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._tx_id = None + self._text = None + self.discriminator = None + + self.tx_id = tx_id + self.text = text + + @property + def tx_id(self): + """Gets the tx_id of this CrossexTransferResponse. # noqa: E501 + + Order ID # noqa: E501 + + :return: The tx_id of this CrossexTransferResponse. # noqa: E501 + :rtype: str + """ + return self._tx_id + + @tx_id.setter + def tx_id(self, tx_id): + """Sets the tx_id of this CrossexTransferResponse. + + Order ID # noqa: E501 + + :param tx_id: The tx_id of this CrossexTransferResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and tx_id is None: # noqa: E501 + raise ValueError("Invalid value for `tx_id`, must not be `None`") # noqa: E501 + + self._tx_id = tx_id + + @property + def text(self): + """Gets the text of this CrossexTransferResponse. # noqa: E501 + + User-defined Order ID # noqa: E501 + + :return: The text of this CrossexTransferResponse. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this CrossexTransferResponse. + + User-defined Order ID # noqa: E501 + + :param text: The text of this CrossexTransferResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and text is None: # noqa: E501 + raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501 + + self._text = text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CrossexTransferResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CrossexTransferResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/currency.py b/gate_api/models/currency.py index 14789cfe..0634b91c 100644 --- a/gate_api/models/currency.py +++ b/gate_api/models/currency.py @@ -42,7 +42,10 @@ class Currency(object): 'trade_disabled': 'bool', 'fixed_rate': 'str', 'chain': 'str', - 'chains': 'list[SpotCurrencyChain]' + 'chains': 'list[SpotCurrencyChain]', + 'total_supply': 'str', + 'market_cap': 'str', + 'category': 'list[str]' } attribute_map = { @@ -55,11 +58,14 @@ class Currency(object): 'trade_disabled': 'trade_disabled', 'fixed_rate': 'fixed_rate', 'chain': 'chain', - 'chains': 'chains' + 'chains': 'chains', + 'total_supply': 'total_supply', + 'market_cap': 'market_cap', + 'category': 'category' } - def __init__(self, currency=None, name=None, delisted=None, withdraw_disabled=None, withdraw_delayed=None, deposit_disabled=None, trade_disabled=None, fixed_rate=None, chain=None, chains=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, bool, bool, bool, bool, bool, str, str, list[SpotCurrencyChain], Configuration) -> None + def __init__(self, currency=None, name=None, delisted=None, withdraw_disabled=None, withdraw_delayed=None, deposit_disabled=None, trade_disabled=None, fixed_rate=None, chain=None, chains=None, total_supply=None, market_cap=None, category=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, bool, bool, bool, bool, bool, str, str, list[SpotCurrencyChain], str, str, list[str], Configuration) -> None """Currency - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -75,6 +81,9 @@ def __init__(self, currency=None, name=None, delisted=None, withdraw_disabled=No self._fixed_rate = None self._chain = None self._chains = None + self._total_supply = None + self._market_cap = None + self._category = None self.discriminator = None if currency is not None: @@ -97,6 +106,12 @@ def __init__(self, currency=None, name=None, delisted=None, withdraw_disabled=No self.chain = chain if chains is not None: self.chains = chains + if total_supply is not None: + self.total_supply = total_supply + if market_cap is not None: + self.market_cap = market_cap + if category is not None: + self.category = category @property def currency(self): @@ -328,6 +343,75 @@ def chains(self, chains): self._chains = chains + @property + def total_supply(self): + """Gets the total_supply of this Currency. # noqa: E501 + + Total supply # noqa: E501 + + :return: The total_supply of this Currency. # noqa: E501 + :rtype: str + """ + return self._total_supply + + @total_supply.setter + def total_supply(self, total_supply): + """Sets the total_supply of this Currency. + + Total supply # noqa: E501 + + :param total_supply: The total_supply of this Currency. # noqa: E501 + :type: str + """ + + self._total_supply = total_supply + + @property + def market_cap(self): + """Gets the market_cap of this Currency. # noqa: E501 + + Market cap # noqa: E501 + + :return: The market_cap of this Currency. # noqa: E501 + :rtype: str + """ + return self._market_cap + + @market_cap.setter + def market_cap(self, market_cap): + """Sets the market_cap of this Currency. + + Market cap # noqa: E501 + + :param market_cap: The market_cap of this Currency. # noqa: E501 + :type: str + """ + + self._market_cap = market_cap + + @property + def category(self): + """Gets the category of this Currency. # noqa: E501 + + Currency categories - stocks: Stocks - metals: Metals - indices: Indices - forex: Forex - commodities: Commodities # noqa: E501 + + :return: The category of this Currency. # noqa: E501 + :rtype: list[str] + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this Currency. + + Currency categories - stocks: Stocks - metals: Metals - indices: Indices - forex: Forex - commodities: Commodities # noqa: E501 + + :param category: The category of this Currency. # noqa: E501 + :type: list[str] + """ + + self._category = category + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/currency_pair.py b/gate_api/models/currency_pair.py index d129a196..4feb9266 100644 --- a/gate_api/models/currency_pair.py +++ b/gate_api/models/currency_pair.py @@ -402,7 +402,7 @@ def max_quote_amount(self, max_quote_amount): def amount_precision(self): """Gets the amount_precision of this CurrencyPair. # noqa: E501 - Amount scale # noqa: E501 + Quantity precision # noqa: E501 :return: The amount_precision of this CurrencyPair. # noqa: E501 :rtype: int @@ -413,7 +413,7 @@ def amount_precision(self): def amount_precision(self, amount_precision): """Sets the amount_precision of this CurrencyPair. - Amount scale # noqa: E501 + Quantity precision # noqa: E501 :param amount_precision: The amount_precision of this CurrencyPair. # noqa: E501 :type: int @@ -425,7 +425,7 @@ def amount_precision(self, amount_precision): def precision(self): """Gets the precision of this CurrencyPair. # noqa: E501 - Price scale # noqa: E501 + Price precision # noqa: E501 :return: The precision of this CurrencyPair. # noqa: E501 :rtype: int @@ -436,7 +436,7 @@ def precision(self): def precision(self, precision): """Sets the precision of this CurrencyPair. - Price scale # noqa: E501 + Price precision # noqa: E501 :param precision: The precision of this CurrencyPair. # noqa: E501 :type: int @@ -661,7 +661,7 @@ def down_rate(self, down_rate): def slippage(self): """Gets the slippage of this CurrencyPair. # noqa: E501 - Currency Slippage # noqa: E501 + Maximum supported slippage ratio for Spot Market Order Placement, calculated based on the latest market price at the time of order placement as the benchmark (Example: 0.03 means 3%) # noqa: E501 :return: The slippage of this CurrencyPair. # noqa: E501 :rtype: str @@ -672,7 +672,7 @@ def slippage(self): def slippage(self, slippage): """Sets the slippage of this CurrencyPair. - Currency Slippage # noqa: E501 + Maximum supported slippage ratio for Spot Market Order Placement, calculated based on the latest market price at the time of order placement as the benchmark (Example: 0.03 means 3%) # noqa: E501 :param slippage: The slippage of this CurrencyPair. # noqa: E501 :type: str @@ -684,7 +684,7 @@ def slippage(self, slippage): def market_order_max_stock(self): """Gets the market_order_max_stock of this CurrencyPair. # noqa: E501 - Maximum Market Order Quantity # noqa: E501 + Maximum market order quantity. `null` or `0` means no limit # noqa: E501 :return: The market_order_max_stock of this CurrencyPair. # noqa: E501 :rtype: str @@ -695,7 +695,7 @@ def market_order_max_stock(self): def market_order_max_stock(self, market_order_max_stock): """Sets the market_order_max_stock of this CurrencyPair. - Maximum Market Order Quantity # noqa: E501 + Maximum market order quantity. `null` or `0` means no limit # noqa: E501 :param market_order_max_stock: The market_order_max_stock of this CurrencyPair. # noqa: E501 :type: str @@ -707,7 +707,7 @@ def market_order_max_stock(self, market_order_max_stock): def market_order_max_money(self): """Gets the market_order_max_money of this CurrencyPair. # noqa: E501 - Maximum Market Order Amount # noqa: E501 + Maximum market order amount. `null` or `0` means no limit # noqa: E501 :return: The market_order_max_money of this CurrencyPair. # noqa: E501 :rtype: str @@ -718,7 +718,7 @@ def market_order_max_money(self): def market_order_max_money(self, market_order_max_money): """Sets the market_order_max_money of this CurrencyPair. - Maximum Market Order Amount # noqa: E501 + Maximum market order amount. `null` or `0` means no limit # noqa: E501 :param market_order_max_money: The market_order_max_money of this CurrencyPair. # noqa: E501 :type: str diff --git a/gate_api/models/currency_quota.py b/gate_api/models/currency_quota.py index 3ebee029..ba01a168 100644 --- a/gate_api/models/currency_quota.py +++ b/gate_api/models/currency_quota.py @@ -37,7 +37,9 @@ class CurrencyQuota(object): 'index_price': 'str', 'min_quota': 'str', 'left_quota': 'str', - 'left_quote_usdt': 'str' + 'left_quote_usdt': 'str', + 'left_quota_fixed': 'str', + 'left_quote_usdt_fixed': 'str' } attribute_map = { @@ -45,11 +47,13 @@ class CurrencyQuota(object): 'index_price': 'index_price', 'min_quota': 'min_quota', 'left_quota': 'left_quota', - 'left_quote_usdt': 'left_quote_usdt' + 'left_quote_usdt': 'left_quote_usdt', + 'left_quota_fixed': 'left_quota_fixed', + 'left_quote_usdt_fixed': 'left_quote_usdt_fixed' } - def __init__(self, currency=None, index_price=None, min_quota=None, left_quota=None, left_quote_usdt=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, Configuration) -> None + def __init__(self, currency=None, index_price=None, min_quota=None, left_quota=None, left_quote_usdt=None, left_quota_fixed=None, left_quote_usdt_fixed=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, Configuration) -> None """CurrencyQuota - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -60,6 +64,8 @@ def __init__(self, currency=None, index_price=None, min_quota=None, left_quota=N self._min_quota = None self._left_quota = None self._left_quote_usdt = None + self._left_quota_fixed = None + self._left_quote_usdt_fixed = None self.discriminator = None if currency is not None: @@ -72,6 +78,10 @@ def __init__(self, currency=None, index_price=None, min_quota=None, left_quota=N self.left_quota = left_quota if left_quote_usdt is not None: self.left_quote_usdt = left_quote_usdt + if left_quota_fixed is not None: + self.left_quota_fixed = left_quota_fixed + if left_quote_usdt_fixed is not None: + self.left_quote_usdt_fixed = left_quote_usdt_fixed @property def currency(self): @@ -146,7 +156,7 @@ def min_quota(self, min_quota): def left_quota(self): """Gets the left_quota of this CurrencyQuota. # noqa: E501 - Remaining borrowing/collateral quota for the currency # noqa: E501 + Remaining currency limit for `borrow/collateral` (when input parameter `type` is `borrow`, represents current currency) # noqa: E501 :return: The left_quota of this CurrencyQuota. # noqa: E501 :rtype: str @@ -157,7 +167,7 @@ def left_quota(self): def left_quota(self, left_quota): """Sets the left_quota of this CurrencyQuota. - Remaining borrowing/collateral quota for the currency # noqa: E501 + Remaining currency limit for `borrow/collateral` (when input parameter `type` is `borrow`, represents current currency) # noqa: E501 :param left_quota: The left_quota of this CurrencyQuota. # noqa: E501 :type: str @@ -169,7 +179,7 @@ def left_quota(self, left_quota): def left_quote_usdt(self): """Gets the left_quote_usdt of this CurrencyQuota. # noqa: E501 - Remaining currency limit converted to USDT # noqa: E501 + Remaining currency limit converted to USDT (when input parameter `type` is `borrow`, represents current currency) # noqa: E501 :return: The left_quote_usdt of this CurrencyQuota. # noqa: E501 :rtype: str @@ -180,7 +190,7 @@ def left_quote_usdt(self): def left_quote_usdt(self, left_quote_usdt): """Sets the left_quote_usdt of this CurrencyQuota. - Remaining currency limit converted to USDT # noqa: E501 + Remaining currency limit converted to USDT (when input parameter `type` is `borrow`, represents current currency) # noqa: E501 :param left_quote_usdt: The left_quote_usdt of this CurrencyQuota. # noqa: E501 :type: str @@ -188,6 +198,52 @@ def left_quote_usdt(self, left_quote_usdt): self._left_quote_usdt = left_quote_usdt + @property + def left_quota_fixed(self): + """Gets the left_quota_fixed of this CurrencyQuota. # noqa: E501 + + Remaining `borrow/collateral` limit for fixed-term currency # noqa: E501 + + :return: The left_quota_fixed of this CurrencyQuota. # noqa: E501 + :rtype: str + """ + return self._left_quota_fixed + + @left_quota_fixed.setter + def left_quota_fixed(self, left_quota_fixed): + """Sets the left_quota_fixed of this CurrencyQuota. + + Remaining `borrow/collateral` limit for fixed-term currency # noqa: E501 + + :param left_quota_fixed: The left_quota_fixed of this CurrencyQuota. # noqa: E501 + :type: str + """ + + self._left_quota_fixed = left_quota_fixed + + @property + def left_quote_usdt_fixed(self): + """Gets the left_quote_usdt_fixed of this CurrencyQuota. # noqa: E501 + + Remaining currency limit for fixed-term currency converted to USDT # noqa: E501 + + :return: The left_quote_usdt_fixed of this CurrencyQuota. # noqa: E501 + :rtype: str + """ + return self._left_quote_usdt_fixed + + @left_quote_usdt_fixed.setter + def left_quote_usdt_fixed(self, left_quote_usdt_fixed): + """Sets the left_quote_usdt_fixed of this CurrencyQuota. + + Remaining currency limit for fixed-term currency converted to USDT # noqa: E501 + + :param left_quote_usdt_fixed: The left_quote_usdt_fixed of this CurrencyQuota. # noqa: E501 + :type: str + """ + + self._left_quote_usdt_fixed = left_quote_usdt_fixed + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/delete_order.py b/gate_api/models/delete_order.py new file mode 100644 index 00000000..5783bfb1 --- /dev/null +++ b/gate_api/models/delete_order.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DeleteOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (object, int, Configuration) -> None + """DeleteOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this DeleteOrder. # noqa: E501 + + Returns empty object on success # noqa: E501 + + :return: The data of this DeleteOrder. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this DeleteOrder. + + Returns empty object on success # noqa: E501 + + :param data: The data of this DeleteOrder. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this DeleteOrder. # noqa: E501 + + + :return: The timestamp of this DeleteOrder. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this DeleteOrder. + + + :param timestamp: The timestamp of this DeleteOrder. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeleteOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeleteOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/delete_position.py b/gate_api/models/delete_position.py new file mode 100644 index 00000000..ccfcf301 --- /dev/null +++ b/gate_api/models/delete_position.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DeletePosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'object' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, object, Configuration) -> None + """DeletePosition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this DeletePosition. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this DeletePosition. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this DeletePosition. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this DeletePosition. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this DeletePosition. # noqa: E501 + + + :return: The data of this DeletePosition. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this DeletePosition. + + + :param data: The data of this DeletePosition. # noqa: E501 + :type: object + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeletePosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeletePosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/delivery_account.py b/gate_api/models/delivery_account.py index e98cab39..df63e7e1 100644 --- a/gate_api/models/delivery_account.py +++ b/gate_api/models/delivery_account.py @@ -58,7 +58,7 @@ class DeliveryAccount(object): 'enable_new_dual_mode': 'bool', 'margin_mode': 'int', 'enable_tiered_mm': 'bool', - 'history': 'FuturesAccountHistory' + 'history': 'DeliveryAccountHistory' } attribute_map = { @@ -91,7 +91,7 @@ class DeliveryAccount(object): } def __init__(self, total=None, unrealised_pnl=None, position_margin=None, order_margin=None, available=None, point=None, currency=None, in_dual_mode=None, enable_credit=None, position_initial_margin=None, maintenance_margin=None, bonus=None, enable_evolved_classic=None, cross_order_margin=None, cross_initial_margin=None, cross_maintenance_margin=None, cross_unrealised_pnl=None, cross_available=None, cross_margin_balance=None, cross_mmr=None, cross_imr=None, isolated_position_margin=None, enable_new_dual_mode=None, margin_mode=None, enable_tiered_mm=None, history=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, str, str, bool, bool, str, str, str, bool, str, str, str, str, str, str, str, str, str, bool, int, bool, FuturesAccountHistory, Configuration) -> None + # type: (str, str, str, str, str, str, str, bool, bool, str, str, str, bool, str, str, str, str, str, str, str, str, str, bool, int, bool, DeliveryAccountHistory, Configuration) -> None """DeliveryAccount - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -759,7 +759,7 @@ def history(self): :return: The history of this DeliveryAccount. # noqa: E501 - :rtype: FuturesAccountHistory + :rtype: DeliveryAccountHistory """ return self._history @@ -769,7 +769,7 @@ def history(self, history): :param history: The history of this DeliveryAccount. # noqa: E501 - :type: FuturesAccountHistory + :type: DeliveryAccountHistory """ self._history = history diff --git a/gate_api/models/delivery_account_history.py b/gate_api/models/delivery_account_history.py new file mode 100644 index 00000000..61064845 --- /dev/null +++ b/gate_api/models/delivery_account_history.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DeliveryAccountHistory(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'dnw': 'str', + 'pnl': 'str', + 'fee': 'str', + 'refr': 'str', + 'fund': 'str', + 'point_dnw': 'str', + 'point_fee': 'str', + 'point_refr': 'str', + 'bonus_dnw': 'str', + 'bonus_offset': 'str' + } + + attribute_map = { + 'dnw': 'dnw', + 'pnl': 'pnl', + 'fee': 'fee', + 'refr': 'refr', + 'fund': 'fund', + 'point_dnw': 'point_dnw', + 'point_fee': 'point_fee', + 'point_refr': 'point_refr', + 'bonus_dnw': 'bonus_dnw', + 'bonus_offset': 'bonus_offset' + } + + def __init__(self, dnw=None, pnl=None, fee=None, refr=None, fund=None, point_dnw=None, point_fee=None, point_refr=None, bonus_dnw=None, bonus_offset=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """DeliveryAccountHistory - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._dnw = None + self._pnl = None + self._fee = None + self._refr = None + self._fund = None + self._point_dnw = None + self._point_fee = None + self._point_refr = None + self._bonus_dnw = None + self._bonus_offset = None + self.discriminator = None + + if dnw is not None: + self.dnw = dnw + if pnl is not None: + self.pnl = pnl + if fee is not None: + self.fee = fee + if refr is not None: + self.refr = refr + if fund is not None: + self.fund = fund + if point_dnw is not None: + self.point_dnw = point_dnw + if point_fee is not None: + self.point_fee = point_fee + if point_refr is not None: + self.point_refr = point_refr + if bonus_dnw is not None: + self.bonus_dnw = bonus_dnw + if bonus_offset is not None: + self.bonus_offset = bonus_offset + + @property + def dnw(self): + """Gets the dnw of this DeliveryAccountHistory. # noqa: E501 + + total amount of deposit and withdraw # noqa: E501 + + :return: The dnw of this DeliveryAccountHistory. # noqa: E501 + :rtype: str + """ + return self._dnw + + @dnw.setter + def dnw(self, dnw): + """Sets the dnw of this DeliveryAccountHistory. + + total amount of deposit and withdraw # noqa: E501 + + :param dnw: The dnw of this DeliveryAccountHistory. # noqa: E501 + :type: str + """ + + self._dnw = dnw + + @property + def pnl(self): + """Gets the pnl of this DeliveryAccountHistory. # noqa: E501 + + total amount of trading profit and loss # noqa: E501 + + :return: The pnl of this DeliveryAccountHistory. # noqa: E501 + :rtype: str + """ + return self._pnl + + @pnl.setter + def pnl(self, pnl): + """Sets the pnl of this DeliveryAccountHistory. + + total amount of trading profit and loss # noqa: E501 + + :param pnl: The pnl of this DeliveryAccountHistory. # noqa: E501 + :type: str + """ + + self._pnl = pnl + + @property + def fee(self): + """Gets the fee of this DeliveryAccountHistory. # noqa: E501 + + total amount of fee # noqa: E501 + + :return: The fee of this DeliveryAccountHistory. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this DeliveryAccountHistory. + + total amount of fee # noqa: E501 + + :param fee: The fee of this DeliveryAccountHistory. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def refr(self): + """Gets the refr of this DeliveryAccountHistory. # noqa: E501 + + total amount of referrer rebates # noqa: E501 + + :return: The refr of this DeliveryAccountHistory. # noqa: E501 + :rtype: str + """ + return self._refr + + @refr.setter + def refr(self, refr): + """Sets the refr of this DeliveryAccountHistory. + + total amount of referrer rebates # noqa: E501 + + :param refr: The refr of this DeliveryAccountHistory. # noqa: E501 + :type: str + """ + + self._refr = refr + + @property + def fund(self): + """Gets the fund of this DeliveryAccountHistory. # noqa: E501 + + total amount of funding costs # noqa: E501 + + :return: The fund of this DeliveryAccountHistory. # noqa: E501 + :rtype: str + """ + return self._fund + + @fund.setter + def fund(self, fund): + """Sets the fund of this DeliveryAccountHistory. + + total amount of funding costs # noqa: E501 + + :param fund: The fund of this DeliveryAccountHistory. # noqa: E501 + :type: str + """ + + self._fund = fund + + @property + def point_dnw(self): + """Gets the point_dnw of this DeliveryAccountHistory. # noqa: E501 + + total amount of point deposit and withdraw # noqa: E501 + + :return: The point_dnw of this DeliveryAccountHistory. # noqa: E501 + :rtype: str + """ + return self._point_dnw + + @point_dnw.setter + def point_dnw(self, point_dnw): + """Sets the point_dnw of this DeliveryAccountHistory. + + total amount of point deposit and withdraw # noqa: E501 + + :param point_dnw: The point_dnw of this DeliveryAccountHistory. # noqa: E501 + :type: str + """ + + self._point_dnw = point_dnw + + @property + def point_fee(self): + """Gets the point_fee of this DeliveryAccountHistory. # noqa: E501 + + total amount of point fee # noqa: E501 + + :return: The point_fee of this DeliveryAccountHistory. # noqa: E501 + :rtype: str + """ + return self._point_fee + + @point_fee.setter + def point_fee(self, point_fee): + """Sets the point_fee of this DeliveryAccountHistory. + + total amount of point fee # noqa: E501 + + :param point_fee: The point_fee of this DeliveryAccountHistory. # noqa: E501 + :type: str + """ + + self._point_fee = point_fee + + @property + def point_refr(self): + """Gets the point_refr of this DeliveryAccountHistory. # noqa: E501 + + total amount of referrer rebates of point fee # noqa: E501 + + :return: The point_refr of this DeliveryAccountHistory. # noqa: E501 + :rtype: str + """ + return self._point_refr + + @point_refr.setter + def point_refr(self, point_refr): + """Sets the point_refr of this DeliveryAccountHistory. + + total amount of referrer rebates of point fee # noqa: E501 + + :param point_refr: The point_refr of this DeliveryAccountHistory. # noqa: E501 + :type: str + """ + + self._point_refr = point_refr + + @property + def bonus_dnw(self): + """Gets the bonus_dnw of this DeliveryAccountHistory. # noqa: E501 + + total amount of perpetual contract bonus transfer # noqa: E501 + + :return: The bonus_dnw of this DeliveryAccountHistory. # noqa: E501 + :rtype: str + """ + return self._bonus_dnw + + @bonus_dnw.setter + def bonus_dnw(self, bonus_dnw): + """Sets the bonus_dnw of this DeliveryAccountHistory. + + total amount of perpetual contract bonus transfer # noqa: E501 + + :param bonus_dnw: The bonus_dnw of this DeliveryAccountHistory. # noqa: E501 + :type: str + """ + + self._bonus_dnw = bonus_dnw + + @property + def bonus_offset(self): + """Gets the bonus_offset of this DeliveryAccountHistory. # noqa: E501 + + total amount of perpetual contract bonus deduction # noqa: E501 + + :return: The bonus_offset of this DeliveryAccountHistory. # noqa: E501 + :rtype: str + """ + return self._bonus_offset + + @bonus_offset.setter + def bonus_offset(self, bonus_offset): + """Sets the bonus_offset of this DeliveryAccountHistory. + + total amount of perpetual contract bonus deduction # noqa: E501 + + :param bonus_offset: The bonus_offset of this DeliveryAccountHistory. # noqa: E501 + :type: str + """ + + self._bonus_offset = bonus_offset + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeliveryAccountHistory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeliveryAccountHistory): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/delivery_contract.py b/gate_api/models/delivery_contract.py index aaf4e491..9212fda9 100644 --- a/gate_api/models/delivery_contract.py +++ b/gate_api/models/delivery_contract.py @@ -858,7 +858,7 @@ def risk_limit_max(self, risk_limit_max): def order_size_min(self): """Gets the order_size_min of this DeliveryContract. # noqa: E501 - Minimum order size allowed by the contract # noqa: E501 + Minimum order quantity # noqa: E501 :return: The order_size_min of this DeliveryContract. # noqa: E501 :rtype: int @@ -869,7 +869,7 @@ def order_size_min(self): def order_size_min(self, order_size_min): """Sets the order_size_min of this DeliveryContract. - Minimum order size allowed by the contract # noqa: E501 + Minimum order quantity # noqa: E501 :param order_size_min: The order_size_min of this DeliveryContract. # noqa: E501 :type: int @@ -881,7 +881,7 @@ def order_size_min(self, order_size_min): def order_size_max(self): """Gets the order_size_max of this DeliveryContract. # noqa: E501 - Maximum order size allowed by the contract # noqa: E501 + Maximum order quantity # noqa: E501 :return: The order_size_max of this DeliveryContract. # noqa: E501 :rtype: int @@ -892,7 +892,7 @@ def order_size_max(self): def order_size_max(self, order_size_max): """Sets the order_size_max of this DeliveryContract. - Maximum order size allowed by the contract # noqa: E501 + Maximum order quantity # noqa: E501 :param order_size_max: The order_size_max of this DeliveryContract. # noqa: E501 :type: int diff --git a/gate_api/models/delivery_order.py b/gate_api/models/delivery_order.py index 697070ec..ce912fc7 100644 --- a/gate_api/models/delivery_order.py +++ b/gate_api/models/delivery_order.py @@ -616,7 +616,7 @@ def fill_price(self, fill_price): def text(self): """Gets the text of this DeliveryOrder. # noqa: E501 - 订单自定义信息,用户可以用该字段设置自定义 ID,用户自定义字段必须满足以下条件: 1. 必须以 `t-` 开头 2. 不计算 `t-` ,长度不能超过 28 字节 3. 输入内容只能包含数字、字母、下划线(_)、中划线(-) 或者点(.) 除用户自定义信息以外,以下为内部保留字段,标识订单来源: - web: 网页 - api: API 调用 - app: 移动端 - auto_deleveraging: 自动减仓 - liquidation: ⽼经典模式仓位强制平仓 - liq-xxx: a. 新经典模式仓位强制平仓,包含逐仓、单向全仓、双向全仓⾮对冲仓位强平。 b. 统⼀账户单币种保证金模式逐仓强制平仓 - hedge-liq-xxx: 新经典模式双向全仓对冲部分强制平仓,即同时平多空仓位 - pm_liquidate: 统⼀账户跨币种保证金模式强制平仓 - comb_margin_liquidate: 统⼀账户组合保证金模式强制平仓 - scm_liquidate: 统⼀账户单币种保证金模式仓位强制平仓 - insurance: 保险 # noqa: E501 + Order Custom Information: Users can set custom IDs via this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Content can only contain numbers, letters, underscores (_), hyphens (-), or dots (.) In addition to user custom information, the following are internal reserved fields identifying order sources: - web: Web - api: API Call - app: Mobile App - auto_deleveraging: Auto-Deleveraging - liquidation: Forced Liquidation of Legacy Classic Mode Positions - liq-xxx: a. Forced liquidation of New Classic Mode positions, including isolated margin, single-direction cross margin, and non-hedged dual-direction cross margin positions. b. Forced liquidation of isolated margin positions in Unified Account Single-Currency Margin Mode - hedge-liq-xxx: Forced liquidation of hedged portions in New Classic Mode dual-direction cross margin (simultaneous closing of long and short positions) - pm_liquidate: Forced liquidation in Unified Account Cross-Currency Margin Mode - comb_margin_liquidate: Forced liquidation in Unified Account Portfolio Margin Mode - scm_liquidate: Forced liquidation of positions in Unified Account Single-Currency Margin Mode - insurance: Insurance # noqa: E501 :return: The text of this DeliveryOrder. # noqa: E501 :rtype: str @@ -627,7 +627,7 @@ def text(self): def text(self, text): """Sets the text of this DeliveryOrder. - 订单自定义信息,用户可以用该字段设置自定义 ID,用户自定义字段必须满足以下条件: 1. 必须以 `t-` 开头 2. 不计算 `t-` ,长度不能超过 28 字节 3. 输入内容只能包含数字、字母、下划线(_)、中划线(-) 或者点(.) 除用户自定义信息以外,以下为内部保留字段,标识订单来源: - web: 网页 - api: API 调用 - app: 移动端 - auto_deleveraging: 自动减仓 - liquidation: ⽼经典模式仓位强制平仓 - liq-xxx: a. 新经典模式仓位强制平仓,包含逐仓、单向全仓、双向全仓⾮对冲仓位强平。 b. 统⼀账户单币种保证金模式逐仓强制平仓 - hedge-liq-xxx: 新经典模式双向全仓对冲部分强制平仓,即同时平多空仓位 - pm_liquidate: 统⼀账户跨币种保证金模式强制平仓 - comb_margin_liquidate: 统⼀账户组合保证金模式强制平仓 - scm_liquidate: 统⼀账户单币种保证金模式仓位强制平仓 - insurance: 保险 # noqa: E501 + Order Custom Information: Users can set custom IDs via this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Content can only contain numbers, letters, underscores (_), hyphens (-), or dots (.) In addition to user custom information, the following are internal reserved fields identifying order sources: - web: Web - api: API Call - app: Mobile App - auto_deleveraging: Auto-Deleveraging - liquidation: Forced Liquidation of Legacy Classic Mode Positions - liq-xxx: a. Forced liquidation of New Classic Mode positions, including isolated margin, single-direction cross margin, and non-hedged dual-direction cross margin positions. b. Forced liquidation of isolated margin positions in Unified Account Single-Currency Margin Mode - hedge-liq-xxx: Forced liquidation of hedged portions in New Classic Mode dual-direction cross margin (simultaneous closing of long and short positions) - pm_liquidate: Forced liquidation in Unified Account Cross-Currency Margin Mode - comb_margin_liquidate: Forced liquidation in Unified Account Portfolio Margin Mode - scm_liquidate: Forced liquidation of positions in Unified Account Single-Currency Margin Mode - insurance: Insurance # noqa: E501 :param text: The text of this DeliveryOrder. # noqa: E501 :type: str diff --git a/gate_api/models/delivery_order_book.py b/gate_api/models/delivery_order_book.py index c0087208..d449821a 100644 --- a/gate_api/models/delivery_order_book.py +++ b/gate_api/models/delivery_order_book.py @@ -36,8 +36,8 @@ class DeliveryOrderBook(object): 'id': 'int', 'current': 'float', 'update': 'float', - 'asks': 'list[FuturesOrderBookItem1]', - 'bids': 'list[FuturesOrderBookItem1]' + 'asks': 'list[DeliveryOrderBookItem]', + 'bids': 'list[DeliveryOrderBookItem]' } attribute_map = { @@ -49,7 +49,7 @@ class DeliveryOrderBook(object): } def __init__(self, id=None, current=None, update=None, asks=None, bids=None, local_vars_configuration=None): # noqa: E501 - # type: (int, float, float, list[FuturesOrderBookItem1], list[FuturesOrderBookItem1], Configuration) -> None + # type: (int, float, float, list[DeliveryOrderBookItem], list[DeliveryOrderBookItem], Configuration) -> None """DeliveryOrderBook - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -147,7 +147,7 @@ def asks(self): Ask Depth # noqa: E501 :return: The asks of this DeliveryOrderBook. # noqa: E501 - :rtype: list[FuturesOrderBookItem1] + :rtype: list[DeliveryOrderBookItem] """ return self._asks @@ -158,7 +158,7 @@ def asks(self, asks): Ask Depth # noqa: E501 :param asks: The asks of this DeliveryOrderBook. # noqa: E501 - :type: list[FuturesOrderBookItem1] + :type: list[DeliveryOrderBookItem] """ if self.local_vars_configuration.client_side_validation and asks is None: # noqa: E501 raise ValueError("Invalid value for `asks`, must not be `None`") # noqa: E501 @@ -172,7 +172,7 @@ def bids(self): Bid Depth # noqa: E501 :return: The bids of this DeliveryOrderBook. # noqa: E501 - :rtype: list[FuturesOrderBookItem1] + :rtype: list[DeliveryOrderBookItem] """ return self._bids @@ -183,7 +183,7 @@ def bids(self, bids): Bid Depth # noqa: E501 :param bids: The bids of this DeliveryOrderBook. # noqa: E501 - :type: list[FuturesOrderBookItem1] + :type: list[DeliveryOrderBookItem] """ if self.local_vars_configuration.client_side_validation and bids is None: # noqa: E501 raise ValueError("Invalid value for `bids`, must not be `None`") # noqa: E501 diff --git a/gate_api/models/futures_order_book_item1.py b/gate_api/models/delivery_order_book_item.py similarity index 82% rename from gate_api/models/futures_order_book_item1.py rename to gate_api/models/delivery_order_book_item.py index c2aed685..c8ef36d4 100644 --- a/gate_api/models/futures_order_book_item1.py +++ b/gate_api/models/delivery_order_book_item.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class FuturesOrderBookItem1(object): +class DeliveryOrderBookItem(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -44,7 +44,7 @@ class FuturesOrderBookItem1(object): def __init__(self, p=None, s=None, local_vars_configuration=None): # noqa: E501 # type: (str, int, Configuration) -> None - """FuturesOrderBookItem1 - a model defined in OpenAPI""" # noqa: E501 + """DeliveryOrderBookItem - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration @@ -60,22 +60,22 @@ def __init__(self, p=None, s=None, local_vars_configuration=None): # noqa: E501 @property def p(self): - """Gets the p of this FuturesOrderBookItem1. # noqa: E501 + """Gets the p of this DeliveryOrderBookItem. # noqa: E501 Price (quote currency) # noqa: E501 - :return: The p of this FuturesOrderBookItem1. # noqa: E501 + :return: The p of this DeliveryOrderBookItem. # noqa: E501 :rtype: str """ return self._p @p.setter def p(self, p): - """Sets the p of this FuturesOrderBookItem1. + """Sets the p of this DeliveryOrderBookItem. Price (quote currency) # noqa: E501 - :param p: The p of this FuturesOrderBookItem1. # noqa: E501 + :param p: The p of this DeliveryOrderBookItem. # noqa: E501 :type: str """ @@ -83,22 +83,22 @@ def p(self, p): @property def s(self): - """Gets the s of this FuturesOrderBookItem1. # noqa: E501 + """Gets the s of this DeliveryOrderBookItem. # noqa: E501 Size # noqa: E501 - :return: The s of this FuturesOrderBookItem1. # noqa: E501 + :return: The s of this DeliveryOrderBookItem. # noqa: E501 :rtype: int """ return self._s @s.setter def s(self, s): - """Sets the s of this FuturesOrderBookItem1. + """Sets the s of this DeliveryOrderBookItem. Size # noqa: E501 - :param s: The s of this FuturesOrderBookItem1. # noqa: E501 + :param s: The s of this DeliveryOrderBookItem. # noqa: E501 :type: int """ @@ -138,14 +138,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, FuturesOrderBookItem1): + if not isinstance(other, DeliveryOrderBookItem): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, FuturesOrderBookItem1): + if not isinstance(other, DeliveryOrderBookItem): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/delivery_position.py b/gate_api/models/delivery_position.py index 6e00aa29..5bcab4d6 100644 --- a/gate_api/models/delivery_position.py +++ b/gate_api/models/delivery_position.py @@ -400,7 +400,7 @@ def value(self, value): def margin(self): """Gets the margin of this DeliveryPosition. # noqa: E501 - Position margin # noqa: E501 + Margin # noqa: E501 :return: The margin of this DeliveryPosition. # noqa: E501 :rtype: str @@ -411,7 +411,7 @@ def margin(self): def margin(self, margin): """Sets the margin of this DeliveryPosition. - Position margin # noqa: E501 + Margin # noqa: E501 :param margin: The margin of this DeliveryPosition. # noqa: E501 :type: str diff --git a/gate_api/models/delivery_settlement.py b/gate_api/models/delivery_settlement.py index 1985a9b2..b1dc8d98 100644 --- a/gate_api/models/delivery_settlement.py +++ b/gate_api/models/delivery_settlement.py @@ -143,7 +143,7 @@ def contract(self, contract): def leverage(self): """Gets the leverage of this DeliverySettlement. # noqa: E501 - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :return: The leverage of this DeliverySettlement. # noqa: E501 :rtype: str @@ -154,7 +154,7 @@ def leverage(self): def leverage(self, leverage): """Sets the leverage of this DeliverySettlement. - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :param leverage: The leverage of this DeliverySettlement. # noqa: E501 :type: str @@ -189,7 +189,7 @@ def size(self, size): def margin(self): """Gets the margin of this DeliverySettlement. # noqa: E501 - Position margin # noqa: E501 + Margin # noqa: E501 :return: The margin of this DeliverySettlement. # noqa: E501 :rtype: str @@ -200,7 +200,7 @@ def margin(self): def margin(self, margin): """Sets the margin of this DeliverySettlement. - Position margin # noqa: E501 + Margin # noqa: E501 :param margin: The margin of this DeliverySettlement. # noqa: E501 :type: str diff --git a/gate_api/models/delta_neutral_enabled.py b/gate_api/models/delta_neutral_enabled.py new file mode 100644 index 00000000..82eb2f56 --- /dev/null +++ b/gate_api/models/delta_neutral_enabled.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DeltaNeutralEnabled(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'enabled': 'bool' + } + + attribute_map = { + 'enabled': 'enabled' + } + + def __init__(self, enabled=None, local_vars_configuration=None): # noqa: E501 + # type: (bool, Configuration) -> None + """DeltaNeutralEnabled - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._enabled = None + self.discriminator = None + + self.enabled = enabled + + @property + def enabled(self): + """Gets the enabled of this DeltaNeutralEnabled. # noqa: E501 + + Whether to enable the account Delta-neutral strategy mode # noqa: E501 + + :return: The enabled of this DeltaNeutralEnabled. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this DeltaNeutralEnabled. + + Whether to enable the account Delta-neutral strategy mode # noqa: E501 + + :param enabled: The enabled of this DeltaNeutralEnabled. # noqa: E501 + :type: bool + """ + if self.local_vars_configuration.client_side_validation and enabled is None: # noqa: E501 + raise ValueError("Invalid value for `enabled`, must not be `None`") # noqa: E501 + + self._enabled = enabled + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeltaNeutralEnabled): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeltaNeutralEnabled): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/deposit_record.py b/gate_api/models/deposit_record.py index 274c9291..45893d04 100644 --- a/gate_api/models/deposit_record.py +++ b/gate_api/models/deposit_record.py @@ -41,6 +41,7 @@ class DepositRecord(object): 'address': 'str', 'memo': 'str', 'status': 'str', + 'refund_status': 'str', 'chain': 'str' } @@ -53,11 +54,12 @@ class DepositRecord(object): 'address': 'address', 'memo': 'memo', 'status': 'status', + 'refund_status': 'refund_status', 'chain': 'chain' } - def __init__(self, id=None, txid=None, timestamp=None, amount=None, currency=None, address=None, memo=None, status=None, chain=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, str, Configuration) -> None + def __init__(self, id=None, txid=None, timestamp=None, amount=None, currency=None, address=None, memo=None, status=None, refund_status=None, chain=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, Configuration) -> None """DepositRecord - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -71,6 +73,7 @@ def __init__(self, id=None, txid=None, timestamp=None, amount=None, currency=Non self._address = None self._memo = None self._status = None + self._refund_status = None self._chain = None self.discriminator = None @@ -88,6 +91,8 @@ def __init__(self, id=None, txid=None, timestamp=None, amount=None, currency=Non self.memo = memo if status is not None: self.status = status + if refund_status is not None: + self.refund_status = refund_status self.chain = chain @property @@ -278,6 +283,29 @@ def status(self, status): self._status = status + @property + def refund_status(self): + """Gets the refund_status of this DepositRecord. # noqa: E501 + + Blocked deposit refund status. This field is returned only when the deposit record has a blocked deposit refund record with a non-empty refund status. Not returned when there is no refund record or the refund status is empty - REFUNDING: Refund in progress - REFUNDED: Refund completed - REFUND_FAILED: Refund failed - REJECTED: Refund rejected # noqa: E501 + + :return: The refund_status of this DepositRecord. # noqa: E501 + :rtype: str + """ + return self._refund_status + + @refund_status.setter + def refund_status(self, refund_status): + """Sets the refund_status of this DepositRecord. + + Blocked deposit refund status. This field is returned only when the deposit record has a blocked deposit refund record with a non-empty refund status. Not returned when there is no refund record or the refund status is empty - REFUNDING: Refund in progress - REFUNDED: Refund completed - REFUND_FAILED: Refund failed - REJECTED: Refund rejected # noqa: E501 + + :param refund_status: The refund_status of this DepositRecord. # noqa: E501 + :type: str + """ + + self._refund_status = refund_status + @property def chain(self): """Gets the chain of this DepositRecord. # noqa: E501 diff --git a/gate_api/models/discover_scene.py b/gate_api/models/discover_scene.py new file mode 100644 index 00000000..e8c2afe5 --- /dev/null +++ b/gate_api/models/discover_scene.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DiscoverScene(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + TOP1 = "top1" + BUNDLE = "bundle" + FILTER = "filter" + REFRESH = "refresh" + + allowable_values = [TOP1, BUNDLE, FILTER, REFRESH] # noqa: E501 + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self, local_vars_configuration=None): # noqa: E501 + # type: (Configuration) -> None + """DiscoverScene - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DiscoverScene): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DiscoverScene): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/dual_get_balance.py b/gate_api/models/dual_get_balance.py new file mode 100644 index 00000000..ce231239 --- /dev/null +++ b/gate_api/models/dual_get_balance.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DualGetBalance(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_asset_usdt': 'str', + 'user_asset_btc': 'str', + 'user_total_interest_usdt': 'str', + 'user_total_interest_btc': 'str' + } + + attribute_map = { + 'user_asset_usdt': 'user_asset_usdt', + 'user_asset_btc': 'user_asset_btc', + 'user_total_interest_usdt': 'user_total_interest_usdt', + 'user_total_interest_btc': 'user_total_interest_btc' + } + + def __init__(self, user_asset_usdt=None, user_asset_btc=None, user_total_interest_usdt=None, user_total_interest_btc=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """DualGetBalance - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_asset_usdt = None + self._user_asset_btc = None + self._user_total_interest_usdt = None + self._user_total_interest_btc = None + self.discriminator = None + + if user_asset_usdt is not None: + self.user_asset_usdt = user_asset_usdt + if user_asset_btc is not None: + self.user_asset_btc = user_asset_btc + if user_total_interest_usdt is not None: + self.user_total_interest_usdt = user_total_interest_usdt + if user_total_interest_btc is not None: + self.user_total_interest_btc = user_total_interest_btc + + @property + def user_asset_usdt(self): + """Gets the user_asset_usdt of this DualGetBalance. # noqa: E501 + + User Assets in USDT Equivalent # noqa: E501 + + :return: The user_asset_usdt of this DualGetBalance. # noqa: E501 + :rtype: str + """ + return self._user_asset_usdt + + @user_asset_usdt.setter + def user_asset_usdt(self, user_asset_usdt): + """Sets the user_asset_usdt of this DualGetBalance. + + User Assets in USDT Equivalent # noqa: E501 + + :param user_asset_usdt: The user_asset_usdt of this DualGetBalance. # noqa: E501 + :type: str + """ + + self._user_asset_usdt = user_asset_usdt + + @property + def user_asset_btc(self): + """Gets the user_asset_btc of this DualGetBalance. # noqa: E501 + + User Assets in BTC Equivalent # noqa: E501 + + :return: The user_asset_btc of this DualGetBalance. # noqa: E501 + :rtype: str + """ + return self._user_asset_btc + + @user_asset_btc.setter + def user_asset_btc(self, user_asset_btc): + """Sets the user_asset_btc of this DualGetBalance. + + User Assets in BTC Equivalent # noqa: E501 + + :param user_asset_btc: The user_asset_btc of this DualGetBalance. # noqa: E501 + :type: str + """ + + self._user_asset_btc = user_asset_btc + + @property + def user_total_interest_usdt(self): + """Gets the user_total_interest_usdt of this DualGetBalance. # noqa: E501 + + Total User Interest in USDT Equivalent # noqa: E501 + + :return: The user_total_interest_usdt of this DualGetBalance. # noqa: E501 + :rtype: str + """ + return self._user_total_interest_usdt + + @user_total_interest_usdt.setter + def user_total_interest_usdt(self, user_total_interest_usdt): + """Sets the user_total_interest_usdt of this DualGetBalance. + + Total User Interest in USDT Equivalent # noqa: E501 + + :param user_total_interest_usdt: The user_total_interest_usdt of this DualGetBalance. # noqa: E501 + :type: str + """ + + self._user_total_interest_usdt = user_total_interest_usdt + + @property + def user_total_interest_btc(self): + """Gets the user_total_interest_btc of this DualGetBalance. # noqa: E501 + + Total User Interest in BTC Equivalent # noqa: E501 + + :return: The user_total_interest_btc of this DualGetBalance. # noqa: E501 + :rtype: str + """ + return self._user_total_interest_btc + + @user_total_interest_btc.setter + def user_total_interest_btc(self, user_total_interest_btc): + """Sets the user_total_interest_btc of this DualGetBalance. + + Total User Interest in BTC Equivalent # noqa: E501 + + :param user_total_interest_btc: The user_total_interest_btc of this DualGetBalance. # noqa: E501 + :type: str + """ + + self._user_total_interest_btc = user_total_interest_btc + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DualGetBalance): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DualGetBalance): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/dual_get_orders.py b/gate_api/models/dual_get_orders.py index 37343530..222b00e2 100644 --- a/gate_api/models/dual_get_orders.py +++ b/gate_api/models/dual_get_orders.py @@ -35,7 +35,6 @@ class DualGetOrders(object): openapi_types = { 'id': 'int', 'plan_id': 'int', - 'copies': 'str', 'invest_amount': 'str', 'settlement_amount': 'str', 'create_time': 'int', @@ -55,7 +54,6 @@ class DualGetOrders(object): attribute_map = { 'id': 'id', 'plan_id': 'plan_id', - 'copies': 'copies', 'invest_amount': 'invest_amount', 'settlement_amount': 'settlement_amount', 'create_time': 'create_time', @@ -72,8 +70,8 @@ class DualGetOrders(object): 'text': 'text' } - def __init__(self, id=None, plan_id=None, copies=None, invest_amount=None, settlement_amount=None, create_time=None, complete_time=None, status=None, invest_currency=None, exercise_currency=None, exercise_price=None, settlement_price=None, settlement_currency=None, apy_display=None, apy_settlement=None, delivery_time=None, text=None, local_vars_configuration=None): # noqa: E501 - # type: (int, int, str, str, str, int, int, str, str, str, str, str, str, str, str, int, str, Configuration) -> None + def __init__(self, id=None, plan_id=None, invest_amount=None, settlement_amount=None, create_time=None, complete_time=None, status=None, invest_currency=None, exercise_currency=None, exercise_price=None, settlement_price=None, settlement_currency=None, apy_display=None, apy_settlement=None, delivery_time=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, int, int, str, str, str, str, str, str, str, str, int, str, Configuration) -> None """DualGetOrders - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -81,7 +79,6 @@ def __init__(self, id=None, plan_id=None, copies=None, invest_amount=None, settl self._id = None self._plan_id = None - self._copies = None self._invest_amount = None self._settlement_amount = None self._create_time = None @@ -102,8 +99,6 @@ def __init__(self, id=None, plan_id=None, copies=None, invest_amount=None, settl self.id = id if plan_id is not None: self.plan_id = plan_id - if copies is not None: - self.copies = copies if invest_amount is not None: self.invest_amount = invest_amount if settlement_amount is not None: @@ -179,29 +174,6 @@ def plan_id(self, plan_id): self._plan_id = plan_id - @property - def copies(self): - """Gets the copies of this DualGetOrders. # noqa: E501 - - Units # noqa: E501 - - :return: The copies of this DualGetOrders. # noqa: E501 - :rtype: str - """ - return self._copies - - @copies.setter - def copies(self, copies): - """Sets the copies of this DualGetOrders. - - Units # noqa: E501 - - :param copies: The copies of this DualGetOrders. # noqa: E501 - :type: str - """ - - self._copies = copies - @property def invest_amount(self): """Gets the invest_amount of this DualGetOrders. # noqa: E501 diff --git a/gate_api/models/dual_get_plans.py b/gate_api/models/dual_get_plans.py index 90808a3e..1801929e 100644 --- a/gate_api/models/dual_get_plans.py +++ b/gate_api/models/dual_get_plans.py @@ -39,10 +39,8 @@ class DualGetPlans(object): 'exercise_currency': 'str', 'exercise_price': 'float', 'delivery_time': 'int', - 'min_copies': 'int', - 'max_copies': 'int', - 'per_value': 'str', 'apy_display': 'str', + 'min_amount': 'str', 'start_time': 'int', 'end_time': 'int', 'status': 'str' @@ -55,17 +53,15 @@ class DualGetPlans(object): 'exercise_currency': 'exercise_currency', 'exercise_price': 'exercise_price', 'delivery_time': 'delivery_time', - 'min_copies': 'min_copies', - 'max_copies': 'max_copies', - 'per_value': 'per_value', 'apy_display': 'apy_display', + 'min_amount': 'min_amount', 'start_time': 'start_time', 'end_time': 'end_time', 'status': 'status' } - def __init__(self, id=None, instrument_name=None, invest_currency=None, exercise_currency=None, exercise_price=None, delivery_time=None, min_copies=None, max_copies=None, per_value=None, apy_display=None, start_time=None, end_time=None, status=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, str, str, float, int, int, int, str, str, int, int, str, Configuration) -> None + def __init__(self, id=None, instrument_name=None, invest_currency=None, exercise_currency=None, exercise_price=None, delivery_time=None, apy_display=None, min_amount=None, start_time=None, end_time=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, float, int, str, str, int, int, str, Configuration) -> None """DualGetPlans - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -77,10 +73,8 @@ def __init__(self, id=None, instrument_name=None, invest_currency=None, exercise self._exercise_currency = None self._exercise_price = None self._delivery_time = None - self._min_copies = None - self._max_copies = None - self._per_value = None self._apy_display = None + self._min_amount = None self._start_time = None self._end_time = None self._status = None @@ -98,14 +92,10 @@ def __init__(self, id=None, instrument_name=None, invest_currency=None, exercise self.exercise_price = exercise_price if delivery_time is not None: self.delivery_time = delivery_time - if min_copies is not None: - self.min_copies = min_copies - if max_copies is not None: - self.max_copies = max_copies - if per_value is not None: - self.per_value = per_value if apy_display is not None: self.apy_display = apy_display + if min_amount is not None: + self.min_amount = min_amount if start_time is not None: self.start_time = start_time if end_time is not None: @@ -252,96 +242,50 @@ def delivery_time(self, delivery_time): self._delivery_time = delivery_time @property - def min_copies(self): - """Gets the min_copies of this DualGetPlans. # noqa: E501 - - Minimum Units # noqa: E501 - - :return: The min_copies of this DualGetPlans. # noqa: E501 - :rtype: int - """ - return self._min_copies - - @min_copies.setter - def min_copies(self, min_copies): - """Sets the min_copies of this DualGetPlans. - - Minimum Units # noqa: E501 - - :param min_copies: The min_copies of this DualGetPlans. # noqa: E501 - :type: int - """ - - self._min_copies = min_copies - - @property - def max_copies(self): - """Gets the max_copies of this DualGetPlans. # noqa: E501 - - Maximum Units # noqa: E501 - - :return: The max_copies of this DualGetPlans. # noqa: E501 - :rtype: int - """ - return self._max_copies - - @max_copies.setter - def max_copies(self, max_copies): - """Sets the max_copies of this DualGetPlans. - - Maximum Units # noqa: E501 - - :param max_copies: The max_copies of this DualGetPlans. # noqa: E501 - :type: int - """ - - self._max_copies = max_copies - - @property - def per_value(self): - """Gets the per_value of this DualGetPlans. # noqa: E501 + def apy_display(self): + """Gets the apy_display of this DualGetPlans. # noqa: E501 - Value Per Unit # noqa: E501 + Annual Yield # noqa: E501 - :return: The per_value of this DualGetPlans. # noqa: E501 + :return: The apy_display of this DualGetPlans. # noqa: E501 :rtype: str """ - return self._per_value + return self._apy_display - @per_value.setter - def per_value(self, per_value): - """Sets the per_value of this DualGetPlans. + @apy_display.setter + def apy_display(self, apy_display): + """Sets the apy_display of this DualGetPlans. - Value Per Unit # noqa: E501 + Annual Yield # noqa: E501 - :param per_value: The per_value of this DualGetPlans. # noqa: E501 + :param apy_display: The apy_display of this DualGetPlans. # noqa: E501 :type: str """ - self._per_value = per_value + self._apy_display = apy_display @property - def apy_display(self): - """Gets the apy_display of this DualGetPlans. # noqa: E501 + def min_amount(self): + """Gets the min_amount of this DualGetPlans. # noqa: E501 - Annual Yield # noqa: E501 + Minimum investment amount # noqa: E501 - :return: The apy_display of this DualGetPlans. # noqa: E501 + :return: The min_amount of this DualGetPlans. # noqa: E501 :rtype: str """ - return self._apy_display + return self._min_amount - @apy_display.setter - def apy_display(self, apy_display): - """Sets the apy_display of this DualGetPlans. + @min_amount.setter + def min_amount(self, min_amount): + """Sets the min_amount of this DualGetPlans. - Annual Yield # noqa: E501 + Minimum investment amount # noqa: E501 - :param apy_display: The apy_display of this DualGetPlans. # noqa: E501 + :param min_amount: The min_amount of this DualGetPlans. # noqa: E501 :type: str """ - self._apy_display = apy_display + self._min_amount = min_amount @property def start_time(self): @@ -393,7 +337,7 @@ def end_time(self, end_time): def status(self): """Gets the status of this DualGetPlans. # noqa: E501 - Status: `NOTSTARTED`-Not Started `ONGOING`-In Progress `ENDED`-Ended # noqa: E501 + Status: `NOTSTARTED` - Not started `ONGOING` - In progress `ENDED` - Ended # noqa: E501 :return: The status of this DualGetPlans. # noqa: E501 :rtype: str @@ -404,7 +348,7 @@ def status(self): def status(self, status): """Sets the status of this DualGetPlans. - Status: `NOTSTARTED`-Not Started `ONGOING`-In Progress `ENDED`-Ended # noqa: E501 + Status: `NOTSTARTED` - Not started `ONGOING` - In progress `ENDED` - Ended # noqa: E501 :param status: The status of this DualGetPlans. # noqa: E501 :type: str diff --git a/gate_api/models/dual_modify_order_reinvest_params.py b/gate_api/models/dual_modify_order_reinvest_params.py new file mode 100644 index 00000000..794a5844 --- /dev/null +++ b/gate_api/models/dual_modify_order_reinvest_params.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DualModifyOrderReinvestParams(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'int', + 'status': 'int', + 'effective_time_duration': 'int' + } + + attribute_map = { + 'order_id': 'order_id', + 'status': 'status', + 'effective_time_duration': 'effective_time_duration' + } + + def __init__(self, order_id=None, status=None, effective_time_duration=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, Configuration) -> None + """DualModifyOrderReinvestParams - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._status = None + self._effective_time_duration = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if status is not None: + self.status = status + if effective_time_duration is not None: + self.effective_time_duration = effective_time_duration + + @property + def order_id(self): + """Gets the order_id of this DualModifyOrderReinvestParams. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this DualModifyOrderReinvestParams. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this DualModifyOrderReinvestParams. + + Order ID # noqa: E501 + + :param order_id: The order_id of this DualModifyOrderReinvestParams. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def status(self): + """Gets the status of this DualModifyOrderReinvestParams. # noqa: E501 + + `0` — off; `1` — on # noqa: E501 + + :return: The status of this DualModifyOrderReinvestParams. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this DualModifyOrderReinvestParams. + + `0` — off; `1` — on # noqa: E501 + + :param status: The status of this DualModifyOrderReinvestParams. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def effective_time_duration(self): + """Gets the effective_time_duration of this DualModifyOrderReinvestParams. # noqa: E501 + + Effective duration in seconds; default 1 day (86400) # noqa: E501 + + :return: The effective_time_duration of this DualModifyOrderReinvestParams. # noqa: E501 + :rtype: int + """ + return self._effective_time_duration + + @effective_time_duration.setter + def effective_time_duration(self, effective_time_duration): + """Sets the effective_time_duration of this DualModifyOrderReinvestParams. + + Effective duration in seconds; default 1 day (86400) # noqa: E501 + + :param effective_time_duration: The effective_time_duration of this DualModifyOrderReinvestParams. # noqa: E501 + :type: int + """ + + self._effective_time_duration = effective_time_duration + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DualModifyOrderReinvestParams): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DualModifyOrderReinvestParams): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/dual_order_refund_params.py b/gate_api/models/dual_order_refund_params.py new file mode 100644 index 00000000..1177ce1c --- /dev/null +++ b/gate_api/models/dual_order_refund_params.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DualOrderRefundParams(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'req_id': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'req_id': 'req_id' + } + + def __init__(self, order_id=None, req_id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """DualOrderRefundParams - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._req_id = None + self.discriminator = None + + self.order_id = order_id + self.req_id = req_id + + @property + def order_id(self): + """Gets the order_id of this DualOrderRefundParams. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this DualOrderRefundParams. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this DualOrderRefundParams. + + Order ID # noqa: E501 + + :param order_id: The order_id of this DualOrderRefundParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 + raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 + + self._order_id = order_id + + @property + def req_id(self): + """Gets the req_id of this DualOrderRefundParams. # noqa: E501 + + Request ID returned by order-refund-preview # noqa: E501 + + :return: The req_id of this DualOrderRefundParams. # noqa: E501 + :rtype: str + """ + return self._req_id + + @req_id.setter + def req_id(self, req_id): + """Sets the req_id of this DualOrderRefundParams. + + Request ID returned by order-refund-preview # noqa: E501 + + :param req_id: The req_id of this DualOrderRefundParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and req_id is None: # noqa: E501 + raise ValueError("Invalid value for `req_id`, must not be `None`") # noqa: E501 + + self._req_id = req_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DualOrderRefundParams): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DualOrderRefundParams): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/dual_order_refund_preview.py b/gate_api/models/dual_order_refund_preview.py new file mode 100644 index 00000000..2a7f4ca8 --- /dev/null +++ b/gate_api/models/dual_order_refund_preview.py @@ -0,0 +1,543 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DualOrderRefundPreview(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'create_timest': 'int', + 'delivery_timest': 'int', + 'exercise_price': 'str', + 'invest_amount': 'str', + 'invest_currency': 'str', + 'name': 'str', + 'order_id': 'int', + 'req_id': 'str', + 'refund_service_charge': 'int', + 'settle_price': 'str', + 'settlement_amount': 'str', + 'settlement_currency': 'str', + 'settlement_interest': 'str', + 'settlement_principle': 'str', + 'type': 'str', + 'money_back_timest': 'int' + } + + attribute_map = { + 'create_timest': 'create_timest', + 'delivery_timest': 'delivery_timest', + 'exercise_price': 'exercise_price', + 'invest_amount': 'invest_amount', + 'invest_currency': 'invest_currency', + 'name': 'name', + 'order_id': 'order_id', + 'req_id': 'req_id', + 'refund_service_charge': 'refund_service_charge', + 'settle_price': 'settle_price', + 'settlement_amount': 'settlement_amount', + 'settlement_currency': 'settlement_currency', + 'settlement_interest': 'settlement_interest', + 'settlement_principle': 'settlement_principle', + 'type': 'type', + 'money_back_timest': 'money_back_timest' + } + + def __init__(self, create_timest=None, delivery_timest=None, exercise_price=None, invest_amount=None, invest_currency=None, name=None, order_id=None, req_id=None, refund_service_charge=None, settle_price=None, settlement_amount=None, settlement_currency=None, settlement_interest=None, settlement_principle=None, type=None, money_back_timest=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, str, int, str, int, str, str, str, str, str, str, int, Configuration) -> None + """DualOrderRefundPreview - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._create_timest = None + self._delivery_timest = None + self._exercise_price = None + self._invest_amount = None + self._invest_currency = None + self._name = None + self._order_id = None + self._req_id = None + self._refund_service_charge = None + self._settle_price = None + self._settlement_amount = None + self._settlement_currency = None + self._settlement_interest = None + self._settlement_principle = None + self._type = None + self._money_back_timest = None + self.discriminator = None + + if create_timest is not None: + self.create_timest = create_timest + if delivery_timest is not None: + self.delivery_timest = delivery_timest + if exercise_price is not None: + self.exercise_price = exercise_price + if invest_amount is not None: + self.invest_amount = invest_amount + if invest_currency is not None: + self.invest_currency = invest_currency + if name is not None: + self.name = name + if order_id is not None: + self.order_id = order_id + if req_id is not None: + self.req_id = req_id + if refund_service_charge is not None: + self.refund_service_charge = refund_service_charge + if settle_price is not None: + self.settle_price = settle_price + if settlement_amount is not None: + self.settlement_amount = settlement_amount + if settlement_currency is not None: + self.settlement_currency = settlement_currency + if settlement_interest is not None: + self.settlement_interest = settlement_interest + if settlement_principle is not None: + self.settlement_principle = settlement_principle + if type is not None: + self.type = type + if money_back_timest is not None: + self.money_back_timest = money_back_timest + + @property + def create_timest(self): + """Gets the create_timest of this DualOrderRefundPreview. # noqa: E501 + + Order creation timestamp # noqa: E501 + + :return: The create_timest of this DualOrderRefundPreview. # noqa: E501 + :rtype: int + """ + return self._create_timest + + @create_timest.setter + def create_timest(self, create_timest): + """Sets the create_timest of this DualOrderRefundPreview. + + Order creation timestamp # noqa: E501 + + :param create_timest: The create_timest of this DualOrderRefundPreview. # noqa: E501 + :type: int + """ + + self._create_timest = create_timest + + @property + def delivery_timest(self): + """Gets the delivery_timest of this DualOrderRefundPreview. # noqa: E501 + + Order delivery timestamp # noqa: E501 + + :return: The delivery_timest of this DualOrderRefundPreview. # noqa: E501 + :rtype: int + """ + return self._delivery_timest + + @delivery_timest.setter + def delivery_timest(self, delivery_timest): + """Sets the delivery_timest of this DualOrderRefundPreview. + + Order delivery timestamp # noqa: E501 + + :param delivery_timest: The delivery_timest of this DualOrderRefundPreview. # noqa: E501 + :type: int + """ + + self._delivery_timest = delivery_timest + + @property + def exercise_price(self): + """Gets the exercise_price of this DualOrderRefundPreview. # noqa: E501 + + Strike price # noqa: E501 + + :return: The exercise_price of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._exercise_price + + @exercise_price.setter + def exercise_price(self, exercise_price): + """Sets the exercise_price of this DualOrderRefundPreview. + + Strike price # noqa: E501 + + :param exercise_price: The exercise_price of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._exercise_price = exercise_price + + @property + def invest_amount(self): + """Gets the invest_amount of this DualOrderRefundPreview. # noqa: E501 + + Investment amount # noqa: E501 + + :return: The invest_amount of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._invest_amount + + @invest_amount.setter + def invest_amount(self, invest_amount): + """Sets the invest_amount of this DualOrderRefundPreview. + + Investment amount # noqa: E501 + + :param invest_amount: The invest_amount of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._invest_amount = invest_amount + + @property + def invest_currency(self): + """Gets the invest_currency of this DualOrderRefundPreview. # noqa: E501 + + Investment Token # noqa: E501 + + :return: The invest_currency of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._invest_currency + + @invest_currency.setter + def invest_currency(self, invest_currency): + """Sets the invest_currency of this DualOrderRefundPreview. + + Investment Token # noqa: E501 + + :param invest_currency: The invest_currency of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._invest_currency = invest_currency + + @property + def name(self): + """Gets the name of this DualOrderRefundPreview. # noqa: E501 + + Order name identifier # noqa: E501 + + :return: The name of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DualOrderRefundPreview. + + Order name identifier # noqa: E501 + + :param name: The name of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def order_id(self): + """Gets the order_id of this DualOrderRefundPreview. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this DualOrderRefundPreview. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this DualOrderRefundPreview. + + Order ID # noqa: E501 + + :param order_id: The order_id of this DualOrderRefundPreview. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def req_id(self): + """Gets the req_id of this DualOrderRefundPreview. # noqa: E501 + + Request ID used for actual redemption # noqa: E501 + + :return: The req_id of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._req_id + + @req_id.setter + def req_id(self, req_id): + """Sets the req_id of this DualOrderRefundPreview. + + Request ID used for actual redemption # noqa: E501 + + :param req_id: The req_id of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._req_id = req_id + + @property + def refund_service_charge(self): + """Gets the refund_service_charge of this DualOrderRefundPreview. # noqa: E501 + + Refund fee # noqa: E501 + + :return: The refund_service_charge of this DualOrderRefundPreview. # noqa: E501 + :rtype: int + """ + return self._refund_service_charge + + @refund_service_charge.setter + def refund_service_charge(self, refund_service_charge): + """Sets the refund_service_charge of this DualOrderRefundPreview. + + Refund fee # noqa: E501 + + :param refund_service_charge: The refund_service_charge of this DualOrderRefundPreview. # noqa: E501 + :type: int + """ + + self._refund_service_charge = refund_service_charge + + @property + def settle_price(self): + """Gets the settle_price of this DualOrderRefundPreview. # noqa: E501 + + Settlement price # noqa: E501 + + :return: The settle_price of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._settle_price + + @settle_price.setter + def settle_price(self, settle_price): + """Sets the settle_price of this DualOrderRefundPreview. + + Settlement price # noqa: E501 + + :param settle_price: The settle_price of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._settle_price = settle_price + + @property + def settlement_amount(self): + """Gets the settlement_amount of this DualOrderRefundPreview. # noqa: E501 + + Settlement amount # noqa: E501 + + :return: The settlement_amount of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._settlement_amount + + @settlement_amount.setter + def settlement_amount(self, settlement_amount): + """Sets the settlement_amount of this DualOrderRefundPreview. + + Settlement amount # noqa: E501 + + :param settlement_amount: The settlement_amount of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._settlement_amount = settlement_amount + + @property + def settlement_currency(self): + """Gets the settlement_currency of this DualOrderRefundPreview. # noqa: E501 + + Settlement currency # noqa: E501 + + :return: The settlement_currency of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._settlement_currency + + @settlement_currency.setter + def settlement_currency(self, settlement_currency): + """Sets the settlement_currency of this DualOrderRefundPreview. + + Settlement currency # noqa: E501 + + :param settlement_currency: The settlement_currency of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._settlement_currency = settlement_currency + + @property + def settlement_interest(self): + """Gets the settlement_interest of this DualOrderRefundPreview. # noqa: E501 + + Settlement interest # noqa: E501 + + :return: The settlement_interest of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._settlement_interest + + @settlement_interest.setter + def settlement_interest(self, settlement_interest): + """Sets the settlement_interest of this DualOrderRefundPreview. + + Settlement interest # noqa: E501 + + :param settlement_interest: The settlement_interest of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._settlement_interest = settlement_interest + + @property + def settlement_principle(self): + """Gets the settlement_principle of this DualOrderRefundPreview. # noqa: E501 + + Settlement principal # noqa: E501 + + :return: The settlement_principle of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._settlement_principle + + @settlement_principle.setter + def settlement_principle(self, settlement_principle): + """Sets the settlement_principle of this DualOrderRefundPreview. + + Settlement principal # noqa: E501 + + :param settlement_principle: The settlement_principle of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._settlement_principle = settlement_principle + + @property + def type(self): + """Gets the type of this DualOrderRefundPreview. # noqa: E501 + + `call`: sell high; `put`: buy low # noqa: E501 + + :return: The type of this DualOrderRefundPreview. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DualOrderRefundPreview. + + `call`: sell high; `put`: buy low # noqa: E501 + + :param type: The type of this DualOrderRefundPreview. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def money_back_timest(self): + """Gets the money_back_timest of this DualOrderRefundPreview. # noqa: E501 + + Redemption time # noqa: E501 + + :return: The money_back_timest of this DualOrderRefundPreview. # noqa: E501 + :rtype: int + """ + return self._money_back_timest + + @money_back_timest.setter + def money_back_timest(self, money_back_timest): + """Sets the money_back_timest of this DualOrderRefundPreview. + + Redemption time # noqa: E501 + + :param money_back_timest: The money_back_timest of this DualOrderRefundPreview. # noqa: E501 + :type: int + """ + + self._money_back_timest = money_back_timest + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DualOrderRefundPreview): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DualOrderRefundPreview): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/dual_project_recommend.py b/gate_api/models/dual_project_recommend.py new file mode 100644 index 00000000..cd4b1a33 --- /dev/null +++ b/gate_api/models/dual_project_recommend.py @@ -0,0 +1,487 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DualProjectRecommend(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'category': 'int', + 'type': 'str', + 'invest_currency': 'str', + 'exercise_currency': 'str', + 'apy_display': 'str', + 'exercise_price': 'str', + 'delivery_timest': 'int', + 'min_amount': 'str', + 'max_amount': 'str', + 'min_copies': 'int', + 'max_copies': 'int', + 'invest_days': 'int', + 'invest_hours': 'str' + } + + attribute_map = { + 'id': 'id', + 'category': 'category', + 'type': 'type', + 'invest_currency': 'invest_currency', + 'exercise_currency': 'exercise_currency', + 'apy_display': 'apy_display', + 'exercise_price': 'exercise_price', + 'delivery_timest': 'delivery_timest', + 'min_amount': 'min_amount', + 'max_amount': 'max_amount', + 'min_copies': 'min_copies', + 'max_copies': 'max_copies', + 'invest_days': 'invest_days', + 'invest_hours': 'invest_hours' + } + + def __init__(self, id=None, category=None, type=None, invest_currency=None, exercise_currency=None, apy_display=None, exercise_price=None, delivery_timest=None, min_amount=None, max_amount=None, min_copies=None, max_copies=None, invest_days=None, invest_hours=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, str, str, int, str, str, int, int, int, str, Configuration) -> None + """DualProjectRecommend - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._category = None + self._type = None + self._invest_currency = None + self._exercise_currency = None + self._apy_display = None + self._exercise_price = None + self._delivery_timest = None + self._min_amount = None + self._max_amount = None + self._min_copies = None + self._max_copies = None + self._invest_days = None + self._invest_hours = None + self.discriminator = None + + if id is not None: + self.id = id + if category is not None: + self.category = category + if type is not None: + self.type = type + if invest_currency is not None: + self.invest_currency = invest_currency + if exercise_currency is not None: + self.exercise_currency = exercise_currency + if apy_display is not None: + self.apy_display = apy_display + if exercise_price is not None: + self.exercise_price = exercise_price + if delivery_timest is not None: + self.delivery_timest = delivery_timest + if min_amount is not None: + self.min_amount = min_amount + if max_amount is not None: + self.max_amount = max_amount + if min_copies is not None: + self.min_copies = min_copies + if max_copies is not None: + self.max_copies = max_copies + if invest_days is not None: + self.invest_days = invest_days + if invest_hours is not None: + self.invest_hours = invest_hours + + @property + def id(self): + """Gets the id of this DualProjectRecommend. # noqa: E501 + + Product ID # noqa: E501 + + :return: The id of this DualProjectRecommend. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DualProjectRecommend. + + Product ID # noqa: E501 + + :param id: The id of this DualProjectRecommend. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def category(self): + """Gets the category of this DualProjectRecommend. # noqa: E501 + + Strategy category # noqa: E501 + + :return: The category of this DualProjectRecommend. # noqa: E501 + :rtype: int + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this DualProjectRecommend. + + Strategy category # noqa: E501 + + :param category: The category of this DualProjectRecommend. # noqa: E501 + :type: int + """ + + self._category = category + + @property + def type(self): + """Gets the type of this DualProjectRecommend. # noqa: E501 + + `call`: sell high; `put`: buy low # noqa: E501 + + :return: The type of this DualProjectRecommend. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DualProjectRecommend. + + `call`: sell high; `put`: buy low # noqa: E501 + + :param type: The type of this DualProjectRecommend. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def invest_currency(self): + """Gets the invest_currency of this DualProjectRecommend. # noqa: E501 + + Investment Token # noqa: E501 + + :return: The invest_currency of this DualProjectRecommend. # noqa: E501 + :rtype: str + """ + return self._invest_currency + + @invest_currency.setter + def invest_currency(self, invest_currency): + """Sets the invest_currency of this DualProjectRecommend. + + Investment Token # noqa: E501 + + :param invest_currency: The invest_currency of this DualProjectRecommend. # noqa: E501 + :type: str + """ + + self._invest_currency = invest_currency + + @property + def exercise_currency(self): + """Gets the exercise_currency of this DualProjectRecommend. # noqa: E501 + + Strike Token # noqa: E501 + + :return: The exercise_currency of this DualProjectRecommend. # noqa: E501 + :rtype: str + """ + return self._exercise_currency + + @exercise_currency.setter + def exercise_currency(self, exercise_currency): + """Sets the exercise_currency of this DualProjectRecommend. + + Strike Token # noqa: E501 + + :param exercise_currency: The exercise_currency of this DualProjectRecommend. # noqa: E501 + :type: str + """ + + self._exercise_currency = exercise_currency + + @property + def apy_display(self): + """Gets the apy_display of this DualProjectRecommend. # noqa: E501 + + Annual Yield # noqa: E501 + + :return: The apy_display of this DualProjectRecommend. # noqa: E501 + :rtype: str + """ + return self._apy_display + + @apy_display.setter + def apy_display(self, apy_display): + """Sets the apy_display of this DualProjectRecommend. + + Annual Yield # noqa: E501 + + :param apy_display: The apy_display of this DualProjectRecommend. # noqa: E501 + :type: str + """ + + self._apy_display = apy_display + + @property + def exercise_price(self): + """Gets the exercise_price of this DualProjectRecommend. # noqa: E501 + + Strike price # noqa: E501 + + :return: The exercise_price of this DualProjectRecommend. # noqa: E501 + :rtype: str + """ + return self._exercise_price + + @exercise_price.setter + def exercise_price(self, exercise_price): + """Sets the exercise_price of this DualProjectRecommend. + + Strike price # noqa: E501 + + :param exercise_price: The exercise_price of this DualProjectRecommend. # noqa: E501 + :type: str + """ + + self._exercise_price = exercise_price + + @property + def delivery_timest(self): + """Gets the delivery_timest of this DualProjectRecommend. # noqa: E501 + + Settlement time # noqa: E501 + + :return: The delivery_timest of this DualProjectRecommend. # noqa: E501 + :rtype: int + """ + return self._delivery_timest + + @delivery_timest.setter + def delivery_timest(self, delivery_timest): + """Sets the delivery_timest of this DualProjectRecommend. + + Settlement time # noqa: E501 + + :param delivery_timest: The delivery_timest of this DualProjectRecommend. # noqa: E501 + :type: int + """ + + self._delivery_timest = delivery_timest + + @property + def min_amount(self): + """Gets the min_amount of this DualProjectRecommend. # noqa: E501 + + Minimum investment amount # noqa: E501 + + :return: The min_amount of this DualProjectRecommend. # noqa: E501 + :rtype: str + """ + return self._min_amount + + @min_amount.setter + def min_amount(self, min_amount): + """Sets the min_amount of this DualProjectRecommend. + + Minimum investment amount # noqa: E501 + + :param min_amount: The min_amount of this DualProjectRecommend. # noqa: E501 + :type: str + """ + + self._min_amount = min_amount + + @property + def max_amount(self): + """Gets the max_amount of this DualProjectRecommend. # noqa: E501 + + Maximum investment amount # noqa: E501 + + :return: The max_amount of this DualProjectRecommend. # noqa: E501 + :rtype: str + """ + return self._max_amount + + @max_amount.setter + def max_amount(self, max_amount): + """Sets the max_amount of this DualProjectRecommend. + + Maximum investment amount # noqa: E501 + + :param max_amount: The max_amount of this DualProjectRecommend. # noqa: E501 + :type: str + """ + + self._max_amount = max_amount + + @property + def min_copies(self): + """Gets the min_copies of this DualProjectRecommend. # noqa: E501 + + Minimum Units # noqa: E501 + + :return: The min_copies of this DualProjectRecommend. # noqa: E501 + :rtype: int + """ + return self._min_copies + + @min_copies.setter + def min_copies(self, min_copies): + """Sets the min_copies of this DualProjectRecommend. + + Minimum Units # noqa: E501 + + :param min_copies: The min_copies of this DualProjectRecommend. # noqa: E501 + :type: int + """ + + self._min_copies = min_copies + + @property + def max_copies(self): + """Gets the max_copies of this DualProjectRecommend. # noqa: E501 + + Maximum Units # noqa: E501 + + :return: The max_copies of this DualProjectRecommend. # noqa: E501 + :rtype: int + """ + return self._max_copies + + @max_copies.setter + def max_copies(self, max_copies): + """Sets the max_copies of this DualProjectRecommend. + + Maximum Units # noqa: E501 + + :param max_copies: The max_copies of this DualProjectRecommend. # noqa: E501 + :type: int + """ + + self._max_copies = max_copies + + @property + def invest_days(self): + """Gets the invest_days of this DualProjectRecommend. # noqa: E501 + + Lock-up days # noqa: E501 + + :return: The invest_days of this DualProjectRecommend. # noqa: E501 + :rtype: int + """ + return self._invest_days + + @invest_days.setter + def invest_days(self, invest_days): + """Sets the invest_days of this DualProjectRecommend. + + Lock-up days # noqa: E501 + + :param invest_days: The invest_days of this DualProjectRecommend. # noqa: E501 + :type: int + """ + + self._invest_days = invest_days + + @property + def invest_hours(self): + """Gets the invest_hours of this DualProjectRecommend. # noqa: E501 + + Lock-up hours # noqa: E501 + + :return: The invest_hours of this DualProjectRecommend. # noqa: E501 + :rtype: str + """ + return self._invest_hours + + @invest_hours.setter + def invest_hours(self, invest_hours): + """Sets the invest_hours of this DualProjectRecommend. + + Lock-up hours # noqa: E501 + + :param invest_hours: The invest_hours of this DualProjectRecommend. # noqa: E501 + :type: str + """ + + self._invest_hours = invest_hours + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DualProjectRecommend): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DualProjectRecommend): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/earn_fixed_term_pre_redeem_request.py b/gate_api/models/earn_fixed_term_pre_redeem_request.py new file mode 100644 index 00000000..f11d96bb --- /dev/null +++ b/gate_api/models/earn_fixed_term_pre_redeem_request.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class EarnFixedTermPreRedeemRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str' + } + + attribute_map = { + 'order_id': 'order_id' + } + + def __init__(self, order_id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """EarnFixedTermPreRedeemRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self.discriminator = None + + self.order_id = order_id + + @property + def order_id(self): + """Gets the order_id of this EarnFixedTermPreRedeemRequest. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this EarnFixedTermPreRedeemRequest. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this EarnFixedTermPreRedeemRequest. + + Order ID # noqa: E501 + + :param order_id: The order_id of this EarnFixedTermPreRedeemRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 + raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 + + self._order_id = order_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EarnFixedTermPreRedeemRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, EarnFixedTermPreRedeemRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/eligibility.py b/gate_api/models/eligibility.py new file mode 100644 index 00000000..5428d653 --- /dev/null +++ b/gate_api/models/eligibility.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Eligibility(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'eligible': 'bool', + 'block_reasons': 'list[str]', + 'block_reason_codes': 'list[str]' + } + + attribute_map = { + 'eligible': 'eligible', + 'block_reasons': 'block_reasons', + 'block_reason_codes': 'block_reason_codes' + } + + def __init__(self, eligible=None, block_reasons=None, block_reason_codes=None, local_vars_configuration=None): # noqa: E501 + # type: (bool, list[str], list[str], Configuration) -> None + """Eligibility - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._eligible = None + self._block_reasons = None + self._block_reason_codes = None + self.discriminator = None + + self.eligible = eligible + self.block_reasons = block_reasons + self.block_reason_codes = block_reason_codes + + @property + def eligible(self): + """Gets the eligible of this Eligibility. # noqa: E501 + + Whether eligible for application # noqa: E501 + + :return: The eligible of this Eligibility. # noqa: E501 + :rtype: bool + """ + return self._eligible + + @eligible.setter + def eligible(self, eligible): + """Sets the eligible of this Eligibility. + + Whether eligible for application # noqa: E501 + + :param eligible: The eligible of this Eligibility. # noqa: E501 + :type: bool + """ + if self.local_vars_configuration.client_side_validation and eligible is None: # noqa: E501 + raise ValueError("Invalid value for `eligible`, must not be `None`") # noqa: E501 + + self._eligible = eligible + + @property + def block_reasons(self): + """Gets the block_reasons of this Eligibility. # noqa: E501 + + List of ineligibility reason descriptions # noqa: E501 + + :return: The block_reasons of this Eligibility. # noqa: E501 + :rtype: list[str] + """ + return self._block_reasons + + @block_reasons.setter + def block_reasons(self, block_reasons): + """Sets the block_reasons of this Eligibility. + + List of ineligibility reason descriptions # noqa: E501 + + :param block_reasons: The block_reasons of this Eligibility. # noqa: E501 + :type: list[str] + """ + if self.local_vars_configuration.client_side_validation and block_reasons is None: # noqa: E501 + raise ValueError("Invalid value for `block_reasons`, must not be `None`") # noqa: E501 + + self._block_reasons = block_reasons + + @property + def block_reason_codes(self): + """Gets the block_reason_codes of this Eligibility. # noqa: E501 + + List of ineligibility reason codes # noqa: E501 + + :return: The block_reason_codes of this Eligibility. # noqa: E501 + :rtype: list[str] + """ + return self._block_reason_codes + + @block_reason_codes.setter + def block_reason_codes(self, block_reason_codes): + """Sets the block_reason_codes of this Eligibility. + + List of ineligibility reason codes # noqa: E501 + + :param block_reason_codes: The block_reason_codes of this Eligibility. # noqa: E501 + :type: list[str] + """ + if self.local_vars_configuration.client_side_validation and block_reason_codes is None: # noqa: E501 + raise ValueError("Invalid value for `block_reason_codes`, must not be `None`") # noqa: E501 + allowed_values = ["user_not_exist", "user_blacked", "sub_account", "already_agent", "kyc_incomplete", "in_agent_tree", "ch_code_conflict"] # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + not set(block_reason_codes).issubset(set(allowed_values))): # noqa: E501 + raise ValueError( + "Invalid values for `block_reason_codes` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(block_reason_codes) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._block_reason_codes = block_reason_codes + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Eligibility): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Eligibility): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/eligibility_response.py b/gate_api/models/eligibility_response.py new file mode 100644 index 00000000..b35c18b5 --- /dev/null +++ b/gate_api/models/eligibility_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class EligibilityResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'Eligibility', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Eligibility, int, Configuration) -> None + """EligibilityResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this EligibilityResponse. # noqa: E501 + + Error Code, 0 Indicates Success # noqa: E501 + + :return: The code of this EligibilityResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this EligibilityResponse. + + Error Code, 0 Indicates Success # noqa: E501 + + :param code: The code of this EligibilityResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this EligibilityResponse. # noqa: E501 + + Error message description # noqa: E501 + + :return: The message of this EligibilityResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this EligibilityResponse. + + Error message description # noqa: E501 + + :param message: The message of this EligibilityResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this EligibilityResponse. # noqa: E501 + + + :return: The data of this EligibilityResponse. # noqa: E501 + :rtype: Eligibility + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this EligibilityResponse. + + + :param data: The data of this EligibilityResponse. # noqa: E501 + :type: Eligibility + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this EligibilityResponse. # noqa: E501 + + Unix timestamp # noqa: E501 + + :return: The timestamp of this EligibilityResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this EligibilityResponse. + + Unix timestamp # noqa: E501 + + :param timestamp: The timestamp of this EligibilityResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EligibilityResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, EligibilityResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/eligibility_response_all_of.py b/gate_api/models/eligibility_response_all_of.py new file mode 100644 index 00000000..ab936f85 --- /dev/null +++ b/gate_api/models/eligibility_response_all_of.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class EligibilityResponseAllOf(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'Eligibility' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 + # type: (Eligibility, Configuration) -> None + """EligibilityResponseAllOf - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self.discriminator = None + + if data is not None: + self.data = data + + @property + def data(self): + """Gets the data of this EligibilityResponseAllOf. # noqa: E501 + + + :return: The data of this EligibilityResponseAllOf. # noqa: E501 + :rtype: Eligibility + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this EligibilityResponseAllOf. + + + :param data: The data of this EligibilityResponseAllOf. # noqa: E501 + :type: Eligibility + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EligibilityResponseAllOf): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, EligibilityResponseAllOf): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/err_code_msg.py b/gate_api/models/err_code_msg.py new file mode 100644 index 00000000..87a8e3b7 --- /dev/null +++ b/gate_api/models/err_code_msg.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ErrCodeMsg(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'extra': 'object' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'extra': 'extra' + } + + def __init__(self, code=None, message=None, extra=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, object, Configuration) -> None + """ErrCodeMsg - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._extra = None + self.discriminator = None + + self.code = code + self.message = message + self.extra = extra + + @property + def code(self): + """Gets the code of this ErrCodeMsg. # noqa: E501 + + Error code # noqa: E501 + + :return: The code of this ErrCodeMsg. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ErrCodeMsg. + + Error code # noqa: E501 + + :param code: The code of this ErrCodeMsg. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this ErrCodeMsg. # noqa: E501 + + Error message # noqa: E501 + + :return: The message of this ErrCodeMsg. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ErrCodeMsg. + + Error message # noqa: E501 + + :param message: The message of this ErrCodeMsg. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def extra(self): + """Gets the extra of this ErrCodeMsg. # noqa: E501 + + Additional information # noqa: E501 + + :return: The extra of this ErrCodeMsg. # noqa: E501 + :rtype: object + """ + return self._extra + + @extra.setter + def extra(self, extra): + """Sets the extra of this ErrCodeMsg. + + Additional information # noqa: E501 + + :param extra: The extra of this ErrCodeMsg. # noqa: E501 + :type: object + """ + if self.local_vars_configuration.client_side_validation and extra is None: # noqa: E501 + raise ValueError("Invalid value for `extra`, must not be `None`") # noqa: E501 + + self._extra = extra + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrCodeMsg): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrCodeMsg): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/error_response.py b/gate_api/models/error_response.py new file mode 100644 index 00000000..c925fa6a --- /dev/null +++ b/gate_api/models/error_response.py @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ErrorResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, object, int, Configuration) -> None + """ErrorResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ErrorResponse. # noqa: E501 + + Error code # noqa: E501 + + :return: The code of this ErrorResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ErrorResponse. + + Error code # noqa: E501 + + :param code: The code of this ErrorResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this ErrorResponse. # noqa: E501 + + Error message # noqa: E501 + + :return: The message of this ErrorResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ErrorResponse. + + Error message # noqa: E501 + + :param message: The message of this ErrorResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ErrorResponse. # noqa: E501 + + Empty object # noqa: E501 + + :return: The data of this ErrorResponse. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ErrorResponse. + + Empty object # noqa: E501 + + :param data: The data of this ErrorResponse. # noqa: E501 + :type: object + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ErrorResponse. # noqa: E501 + + Unix timestamp # noqa: E501 + + :return: The timestamp of this ErrorResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ErrorResponse. + + Unix timestamp # noqa: E501 + + :param timestamp: The timestamp of this ErrorResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ErrorResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/evaluate_item.py b/gate_api/models/evaluate_item.py new file mode 100644 index 00000000..cd25b1d7 --- /dev/null +++ b/gate_api/models/evaluate_item.py @@ -0,0 +1,284 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class EvaluateItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'asset_full_name': 'str', + 'asset_icon_url': 'str', + 'available': 'str', + 'available_show': 'str', + 'evaluate_usdt': 'str', + 'evaluate_usdt_show': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'asset_full_name': 'asset_full_name', + 'asset_icon_url': 'asset_icon_url', + 'available': 'available', + 'available_show': 'available_show', + 'evaluate_usdt': 'evaluate_usdt', + 'evaluate_usdt_show': 'evaluate_usdt_show' + } + + def __init__(self, asset=None, asset_full_name=None, asset_icon_url=None, available=None, available_show=None, evaluate_usdt=None, evaluate_usdt_show=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, Configuration) -> None + """EvaluateItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._asset_full_name = None + self._asset_icon_url = None + self._available = None + self._available_show = None + self._evaluate_usdt = None + self._evaluate_usdt_show = None + self.discriminator = None + + self.asset = asset + self.asset_full_name = asset_full_name + self.asset_icon_url = asset_icon_url + self.available = available + self.available_show = available_show + self.evaluate_usdt = evaluate_usdt + self.evaluate_usdt_show = evaluate_usdt_show + + @property + def asset(self): + """Gets the asset of this EvaluateItem. # noqa: E501 + + + :return: The asset of this EvaluateItem. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this EvaluateItem. + + + :param asset: The asset of this EvaluateItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def asset_full_name(self): + """Gets the asset_full_name of this EvaluateItem. # noqa: E501 + + + :return: The asset_full_name of this EvaluateItem. # noqa: E501 + :rtype: str + """ + return self._asset_full_name + + @asset_full_name.setter + def asset_full_name(self, asset_full_name): + """Sets the asset_full_name of this EvaluateItem. + + + :param asset_full_name: The asset_full_name of this EvaluateItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset_full_name is None: # noqa: E501 + raise ValueError("Invalid value for `asset_full_name`, must not be `None`") # noqa: E501 + + self._asset_full_name = asset_full_name + + @property + def asset_icon_url(self): + """Gets the asset_icon_url of this EvaluateItem. # noqa: E501 + + + :return: The asset_icon_url of this EvaluateItem. # noqa: E501 + :rtype: str + """ + return self._asset_icon_url + + @asset_icon_url.setter + def asset_icon_url(self, asset_icon_url): + """Sets the asset_icon_url of this EvaluateItem. + + + :param asset_icon_url: The asset_icon_url of this EvaluateItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset_icon_url is None: # noqa: E501 + raise ValueError("Invalid value for `asset_icon_url`, must not be `None`") # noqa: E501 + + self._asset_icon_url = asset_icon_url + + @property + def available(self): + """Gets the available of this EvaluateItem. # noqa: E501 + + + :return: The available of this EvaluateItem. # noqa: E501 + :rtype: str + """ + return self._available + + @available.setter + def available(self, available): + """Sets the available of this EvaluateItem. + + + :param available: The available of this EvaluateItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and available is None: # noqa: E501 + raise ValueError("Invalid value for `available`, must not be `None`") # noqa: E501 + + self._available = available + + @property + def available_show(self): + """Gets the available_show of this EvaluateItem. # noqa: E501 + + + :return: The available_show of this EvaluateItem. # noqa: E501 + :rtype: str + """ + return self._available_show + + @available_show.setter + def available_show(self, available_show): + """Sets the available_show of this EvaluateItem. + + + :param available_show: The available_show of this EvaluateItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and available_show is None: # noqa: E501 + raise ValueError("Invalid value for `available_show`, must not be `None`") # noqa: E501 + + self._available_show = available_show + + @property + def evaluate_usdt(self): + """Gets the evaluate_usdt of this EvaluateItem. # noqa: E501 + + + :return: The evaluate_usdt of this EvaluateItem. # noqa: E501 + :rtype: str + """ + return self._evaluate_usdt + + @evaluate_usdt.setter + def evaluate_usdt(self, evaluate_usdt): + """Sets the evaluate_usdt of this EvaluateItem. + + + :param evaluate_usdt: The evaluate_usdt of this EvaluateItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and evaluate_usdt is None: # noqa: E501 + raise ValueError("Invalid value for `evaluate_usdt`, must not be `None`") # noqa: E501 + + self._evaluate_usdt = evaluate_usdt + + @property + def evaluate_usdt_show(self): + """Gets the evaluate_usdt_show of this EvaluateItem. # noqa: E501 + + + :return: The evaluate_usdt_show of this EvaluateItem. # noqa: E501 + :rtype: str + """ + return self._evaluate_usdt_show + + @evaluate_usdt_show.setter + def evaluate_usdt_show(self, evaluate_usdt_show): + """Sets the evaluate_usdt_show of this EvaluateItem. + + + :param evaluate_usdt_show: The evaluate_usdt_show of this EvaluateItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and evaluate_usdt_show is None: # noqa: E501 + raise ValueError("Invalid value for `evaluate_usdt_show`, must not be `None`") # noqa: E501 + + self._evaluate_usdt_show = evaluate_usdt_show + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EvaluateItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, EvaluateItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/evaluate_resp.py b/gate_api/models/evaluate_resp.py new file mode 100644 index 00000000..206e0bcc --- /dev/null +++ b/gate_api/models/evaluate_resp.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class EvaluateResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[EvaluateItem]', + 'total': 'int', + 'cursor': 'str', + 'total_available': 'str', + 'total_available_show': 'str' + } + + attribute_map = { + 'list': 'list', + 'total': 'total', + 'cursor': 'cursor', + 'total_available': 'total_available', + 'total_available_show': 'total_available_show' + } + + def __init__(self, list=None, total=None, cursor=None, total_available=None, total_available_show=None, local_vars_configuration=None): # noqa: E501 + # type: (list[EvaluateItem], int, str, str, str, Configuration) -> None + """EvaluateResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self._total = None + self._cursor = None + self._total_available = None + self._total_available_show = None + self.discriminator = None + + self.list = list + self.total = total + self.cursor = cursor + self.total_available = total_available + self.total_available_show = total_available_show + + @property + def list(self): + """Gets the list of this EvaluateResp. # noqa: E501 + + + :return: The list of this EvaluateResp. # noqa: E501 + :rtype: list[EvaluateItem] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this EvaluateResp. + + + :param list: The list of this EvaluateResp. # noqa: E501 + :type: list[EvaluateItem] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + @property + def total(self): + """Gets the total of this EvaluateResp. # noqa: E501 + + + :return: The total of this EvaluateResp. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this EvaluateResp. + + + :param total: The total of this EvaluateResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + @property + def cursor(self): + """Gets the cursor of this EvaluateResp. # noqa: E501 + + + :return: The cursor of this EvaluateResp. # noqa: E501 + :rtype: str + """ + return self._cursor + + @cursor.setter + def cursor(self, cursor): + """Sets the cursor of this EvaluateResp. + + + :param cursor: The cursor of this EvaluateResp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and cursor is None: # noqa: E501 + raise ValueError("Invalid value for `cursor`, must not be `None`") # noqa: E501 + + self._cursor = cursor + + @property + def total_available(self): + """Gets the total_available of this EvaluateResp. # noqa: E501 + + + :return: The total_available of this EvaluateResp. # noqa: E501 + :rtype: str + """ + return self._total_available + + @total_available.setter + def total_available(self, total_available): + """Sets the total_available of this EvaluateResp. + + + :param total_available: The total_available of this EvaluateResp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total_available is None: # noqa: E501 + raise ValueError("Invalid value for `total_available`, must not be `None`") # noqa: E501 + + self._total_available = total_available + + @property + def total_available_show(self): + """Gets the total_available_show of this EvaluateResp. # noqa: E501 + + + :return: The total_available_show of this EvaluateResp. # noqa: E501 + :rtype: str + """ + return self._total_available_show + + @total_available_show.setter + def total_available_show(self, total_available_show): + """Sets the total_available_show of this EvaluateResp. + + + :param total_available_show: The total_available_show of this EvaluateResp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total_available_show is None: # noqa: E501 + raise ValueError("Invalid value for `total_available_show`, must not be `None`") # noqa: E501 + + self._total_available_show = total_available_show + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EvaluateResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, EvaluateResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ex_skill_claim_reward_req.py b/gate_api/models/ex_skill_claim_reward_req.py new file mode 100644 index 00000000..f81d8568 --- /dev/null +++ b/gate_api/models/ex_skill_claim_reward_req.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ExSkillClaimRewardReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'welfare_task_id': 'int' + } + + attribute_map = { + 'welfare_task_id': 'welfare_task_id' + } + + def __init__(self, welfare_task_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """ExSkillClaimRewardReq - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._welfare_task_id = None + self.discriminator = None + + self.welfare_task_id = welfare_task_id + + @property + def welfare_task_id(self): + """Gets the welfare_task_id of this ExSkillClaimRewardReq. # noqa: E501 + + Rewards Center task ID # noqa: E501 + + :return: The welfare_task_id of this ExSkillClaimRewardReq. # noqa: E501 + :rtype: int + """ + return self._welfare_task_id + + @welfare_task_id.setter + def welfare_task_id(self, welfare_task_id): + """Sets the welfare_task_id of this ExSkillClaimRewardReq. + + Rewards Center task ID # noqa: E501 + + :param welfare_task_id: The welfare_task_id of this ExSkillClaimRewardReq. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and welfare_task_id is None: # noqa: E501 + raise ValueError("Invalid value for `welfare_task_id`, must not be `None`") # noqa: E501 + + self._welfare_task_id = welfare_task_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExSkillClaimRewardReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ExSkillClaimRewardReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ex_skill_claim_task_req.py b/gate_api/models/ex_skill_claim_task_req.py new file mode 100644 index 00000000..0d9b8617 --- /dev/null +++ b/gate_api/models/ex_skill_claim_task_req.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ExSkillClaimTaskReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'welfare_task_id': 'int' + } + + attribute_map = { + 'welfare_task_id': 'welfare_task_id' + } + + def __init__(self, welfare_task_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """ExSkillClaimTaskReq - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._welfare_task_id = None + self.discriminator = None + + self.welfare_task_id = welfare_task_id + + @property + def welfare_task_id(self): + """Gets the welfare_task_id of this ExSkillClaimTaskReq. # noqa: E501 + + Rewards Center task ID # noqa: E501 + + :return: The welfare_task_id of this ExSkillClaimTaskReq. # noqa: E501 + :rtype: int + """ + return self._welfare_task_id + + @welfare_task_id.setter + def welfare_task_id(self, welfare_task_id): + """Sets the welfare_task_id of this ExSkillClaimTaskReq. + + Rewards Center task ID # noqa: E501 + + :param welfare_task_id: The welfare_task_id of this ExSkillClaimTaskReq. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and welfare_task_id is None: # noqa: E501 + raise ValueError("Invalid value for `welfare_task_id`, must not be `None`") # noqa: E501 + + self._welfare_task_id = welfare_task_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExSkillClaimTaskReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ExSkillClaimTaskReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/exchanges.py b/gate_api/models/exchanges.py new file mode 100644 index 00000000..ba0d1618 --- /dev/null +++ b/gate_api/models/exchanges.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Exchanges(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'ExchangesData', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (ExchangesData, int, Configuration) -> None + """Exchanges - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this Exchanges. # noqa: E501 + + + :return: The data of this Exchanges. # noqa: E501 + :rtype: ExchangesData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this Exchanges. + + + :param data: The data of this Exchanges. # noqa: E501 + :type: ExchangesData + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this Exchanges. # noqa: E501 + + + :return: The timestamp of this Exchanges. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this Exchanges. + + + :param timestamp: The timestamp of this Exchanges. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Exchanges): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Exchanges): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/exchanges_data.py b/gate_api/models/exchanges_data.py new file mode 100644 index 00000000..83a0d206 --- /dev/null +++ b/gate_api/models/exchanges_data.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ExchangesData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[ExchangesDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[ExchangesDataList], Configuration) -> None + """ExchangesData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this ExchangesData. # noqa: E501 + + + :return: The list of this ExchangesData. # noqa: E501 + :rtype: list[ExchangesDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this ExchangesData. + + + :param list: The list of this ExchangesData. # noqa: E501 + :type: list[ExchangesDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExchangesData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ExchangesData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/exchanges_data_list.py b/gate_api/models/exchanges_data_list.py new file mode 100644 index 00000000..13946f99 --- /dev/null +++ b/gate_api/models/exchanges_data_list.py @@ -0,0 +1,213 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ExchangesDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'exchange': 'str', + 'exchange_desc': 'str', + 'icon_link': 'str', + 'support_transfer': 'bool' + } + + attribute_map = { + 'exchange': 'exchange', + 'exchange_desc': 'exchange_desc', + 'icon_link': 'icon_link', + 'support_transfer': 'support_transfer' + } + + def __init__(self, exchange=None, exchange_desc=None, icon_link=None, support_transfer=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, bool, Configuration) -> None + """ExchangesDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._exchange = None + self._exchange_desc = None + self._icon_link = None + self._support_transfer = None + self.discriminator = None + + if exchange is not None: + self.exchange = exchange + if exchange_desc is not None: + self.exchange_desc = exchange_desc + if icon_link is not None: + self.icon_link = icon_link + if support_transfer is not None: + self.support_transfer = support_transfer + + @property + def exchange(self): + """Gets the exchange of this ExchangesDataList. # noqa: E501 + + Trading market, supports us, hk, and kr # noqa: E501 + + :return: The exchange of this ExchangesDataList. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this ExchangesDataList. + + Trading market, supports us, hk, and kr # noqa: E501 + + :param exchange: The exchange of this ExchangesDataList. # noqa: E501 + :type: str + """ + allowed_values = ["us", "hk", "kr"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and exchange not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `exchange` ({0}), must be one of {1}" # noqa: E501 + .format(exchange, allowed_values) + ) + + self._exchange = exchange + + @property + def exchange_desc(self): + """Gets the exchange_desc of this ExchangesDataList. # noqa: E501 + + Market display name # noqa: E501 + + :return: The exchange_desc of this ExchangesDataList. # noqa: E501 + :rtype: str + """ + return self._exchange_desc + + @exchange_desc.setter + def exchange_desc(self, exchange_desc): + """Sets the exchange_desc of this ExchangesDataList. + + Market display name # noqa: E501 + + :param exchange_desc: The exchange_desc of this ExchangesDataList. # noqa: E501 + :type: str + """ + + self._exchange_desc = exchange_desc + + @property + def icon_link(self): + """Gets the icon_link of this ExchangesDataList. # noqa: E501 + + Market icon # noqa: E501 + + :return: The icon_link of this ExchangesDataList. # noqa: E501 + :rtype: str + """ + return self._icon_link + + @icon_link.setter + def icon_link(self, icon_link): + """Sets the icon_link of this ExchangesDataList. + + Market icon # noqa: E501 + + :param icon_link: The icon_link of this ExchangesDataList. # noqa: E501 + :type: str + """ + + self._icon_link = icon_link + + @property + def support_transfer(self): + """Gets the support_transfer of this ExchangesDataList. # noqa: E501 + + Whether stock transfer is supported # noqa: E501 + + :return: The support_transfer of this ExchangesDataList. # noqa: E501 + :rtype: bool + """ + return self._support_transfer + + @support_transfer.setter + def support_transfer(self, support_transfer): + """Sets the support_transfer of this ExchangesDataList. + + Whether stock transfer is supported # noqa: E501 + + :param support_transfer: The support_transfer of this ExchangesDataList. # noqa: E501 + :type: bool + """ + + self._support_transfer = support_transfer + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExchangesDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ExchangesDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fee_rate.py b/gate_api/models/fee_rate.py new file mode 100644 index 00000000..faaae98c --- /dev/null +++ b/gate_api/models/fee_rate.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FeeRate(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'FeeRateData', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (FeeRateData, int, Configuration) -> None + """FeeRate - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this FeeRate. # noqa: E501 + + + :return: The data of this FeeRate. # noqa: E501 + :rtype: FeeRateData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this FeeRate. + + + :param data: The data of this FeeRate. # noqa: E501 + :type: FeeRateData + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this FeeRate. # noqa: E501 + + + :return: The timestamp of this FeeRate. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this FeeRate. + + + :param timestamp: The timestamp of this FeeRate. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FeeRate): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FeeRate): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fee_rate_data.py b/gate_api/models/fee_rate_data.py new file mode 100644 index 00000000..e5534b56 --- /dev/null +++ b/gate_api/models/fee_rate_data.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FeeRateData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[FeeRateDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FeeRateDataList], Configuration) -> None + """FeeRateData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this FeeRateData. # noqa: E501 + + + :return: The list of this FeeRateData. # noqa: E501 + :rtype: list[FeeRateDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this FeeRateData. + + + :param list: The list of this FeeRateData. # noqa: E501 + :type: list[FeeRateDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FeeRateData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FeeRateData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fee_rate_data_list.py b/gate_api/models/fee_rate_data_list.py new file mode 100644 index 00000000..73bf6b9b --- /dev/null +++ b/gate_api/models/fee_rate_data_list.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FeeRateDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'vip_level': 'int', + 'maker_fee': 'str', + 'taker_fee': 'str' + } + + attribute_map = { + 'vip_level': 'vip_level', + 'maker_fee': 'maker_fee', + 'taker_fee': 'taker_fee' + } + + def __init__(self, vip_level=None, maker_fee=None, taker_fee=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, Configuration) -> None + """FeeRateDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._vip_level = None + self._maker_fee = None + self._taker_fee = None + self.discriminator = None + + if vip_level is not None: + self.vip_level = vip_level + if maker_fee is not None: + self.maker_fee = maker_fee + if taker_fee is not None: + self.taker_fee = taker_fee + + @property + def vip_level(self): + """Gets the vip_level of this FeeRateDataList. # noqa: E501 + + VIP level # noqa: E501 + + :return: The vip_level of this FeeRateDataList. # noqa: E501 + :rtype: int + """ + return self._vip_level + + @vip_level.setter + def vip_level(self, vip_level): + """Sets the vip_level of this FeeRateDataList. + + VIP level # noqa: E501 + + :param vip_level: The vip_level of this FeeRateDataList. # noqa: E501 + :type: int + """ + + self._vip_level = vip_level + + @property + def maker_fee(self): + """Gets the maker_fee of this FeeRateDataList. # noqa: E501 + + Maker fee rate for Japanese and Korean stocks # noqa: E501 + + :return: The maker_fee of this FeeRateDataList. # noqa: E501 + :rtype: str + """ + return self._maker_fee + + @maker_fee.setter + def maker_fee(self, maker_fee): + """Sets the maker_fee of this FeeRateDataList. + + Maker fee rate for Japanese and Korean stocks # noqa: E501 + + :param maker_fee: The maker_fee of this FeeRateDataList. # noqa: E501 + :type: str + """ + + self._maker_fee = maker_fee + + @property + def taker_fee(self): + """Gets the taker_fee of this FeeRateDataList. # noqa: E501 + + Taker fee rate for Japanese and Korean stocks # noqa: E501 + + :return: The taker_fee of this FeeRateDataList. # noqa: E501 + :rtype: str + """ + return self._taker_fee + + @taker_fee.setter + def taker_fee(self, taker_fee): + """Sets the taker_fee of this FeeRateDataList. + + Taker fee rate for Japanese and Korean stocks # noqa: E501 + + :param taker_fee: The taker_fee of this FeeRateDataList. # noqa: E501 + :type: str + """ + + self._taker_fee = taker_fee + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FeeRateDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FeeRateDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fixed_term_bonus_info.py b/gate_api/models/fixed_term_bonus_info.py new file mode 100644 index 00000000..61d4729c --- /dev/null +++ b/gate_api/models/fixed_term_bonus_info.py @@ -0,0 +1,627 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FixedTermBonusInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'product_id': 'int', + 'asset': 'str', + 'bonus_asset': 'str', + 'kyc_limit': 'str', + 'ladder_apr': 'list[LadderApr]', + 'total_bonus_amount': 'str', + 'user_total_bonus_amount': 'str', + 'status': 'int', + 'start_time': 'str', + 'end_time': 'str', + 'create_time': 'str', + 'start_at': 'int', + 'end_at': 'int', + 'total_issued_amount': 'str', + 'user_total_issued_amount': 'str', + 'bonus_asset_price': 'str', + 'product_asset_price': 'str', + 'product_year_rate': 'str' + } + + attribute_map = { + 'id': 'id', + 'product_id': 'product_id', + 'asset': 'asset', + 'bonus_asset': 'bonus_asset', + 'kyc_limit': 'kyc_limit', + 'ladder_apr': 'ladder_apr', + 'total_bonus_amount': 'total_bonus_amount', + 'user_total_bonus_amount': 'user_total_bonus_amount', + 'status': 'status', + 'start_time': 'start_time', + 'end_time': 'end_time', + 'create_time': 'create_time', + 'start_at': 'start_at', + 'end_at': 'end_at', + 'total_issued_amount': 'total_issued_amount', + 'user_total_issued_amount': 'user_total_issued_amount', + 'bonus_asset_price': 'bonus_asset_price', + 'product_asset_price': 'product_asset_price', + 'product_year_rate': 'product_year_rate' + } + + def __init__(self, id=None, product_id=None, asset=None, bonus_asset=None, kyc_limit=None, ladder_apr=None, total_bonus_amount=None, user_total_bonus_amount=None, status=None, start_time=None, end_time=None, create_time=None, start_at=None, end_at=None, total_issued_amount=None, user_total_issued_amount=None, bonus_asset_price=None, product_asset_price=None, product_year_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, list[LadderApr], str, str, int, str, str, str, int, int, str, str, str, str, str, Configuration) -> None + """FixedTermBonusInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._product_id = None + self._asset = None + self._bonus_asset = None + self._kyc_limit = None + self._ladder_apr = None + self._total_bonus_amount = None + self._user_total_bonus_amount = None + self._status = None + self._start_time = None + self._end_time = None + self._create_time = None + self._start_at = None + self._end_at = None + self._total_issued_amount = None + self._user_total_issued_amount = None + self._bonus_asset_price = None + self._product_asset_price = None + self._product_year_rate = None + self.discriminator = None + + if id is not None: + self.id = id + if product_id is not None: + self.product_id = product_id + if asset is not None: + self.asset = asset + if bonus_asset is not None: + self.bonus_asset = bonus_asset + if kyc_limit is not None: + self.kyc_limit = kyc_limit + if ladder_apr is not None: + self.ladder_apr = ladder_apr + if total_bonus_amount is not None: + self.total_bonus_amount = total_bonus_amount + if user_total_bonus_amount is not None: + self.user_total_bonus_amount = user_total_bonus_amount + if status is not None: + self.status = status + if start_time is not None: + self.start_time = start_time + if end_time is not None: + self.end_time = end_time + if create_time is not None: + self.create_time = create_time + if start_at is not None: + self.start_at = start_at + if end_at is not None: + self.end_at = end_at + if total_issued_amount is not None: + self.total_issued_amount = total_issued_amount + if user_total_issued_amount is not None: + self.user_total_issued_amount = user_total_issued_amount + if bonus_asset_price is not None: + self.bonus_asset_price = bonus_asset_price + if product_asset_price is not None: + self.product_asset_price = product_asset_price + if product_year_rate is not None: + self.product_year_rate = product_year_rate + + @property + def id(self): + """Gets the id of this FixedTermBonusInfo. # noqa: E501 + + Activity ID # noqa: E501 + + :return: The id of this FixedTermBonusInfo. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FixedTermBonusInfo. + + Activity ID # noqa: E501 + + :param id: The id of this FixedTermBonusInfo. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def product_id(self): + """Gets the product_id of this FixedTermBonusInfo. # noqa: E501 + + Associated product ID # noqa: E501 + + :return: The product_id of this FixedTermBonusInfo. # noqa: E501 + :rtype: int + """ + return self._product_id + + @product_id.setter + def product_id(self, product_id): + """Sets the product_id of this FixedTermBonusInfo. + + Associated product ID # noqa: E501 + + :param product_id: The product_id of this FixedTermBonusInfo. # noqa: E501 + :type: int + """ + + self._product_id = product_id + + @property + def asset(self): + """Gets the asset of this FixedTermBonusInfo. # noqa: E501 + + Product currency # noqa: E501 + + :return: The asset of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this FixedTermBonusInfo. + + Product currency # noqa: E501 + + :param asset: The asset of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._asset = asset + + @property + def bonus_asset(self): + """Gets the bonus_asset of this FixedTermBonusInfo. # noqa: E501 + + Reward currency # noqa: E501 + + :return: The bonus_asset of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._bonus_asset + + @bonus_asset.setter + def bonus_asset(self, bonus_asset): + """Sets the bonus_asset of this FixedTermBonusInfo. + + Reward currency # noqa: E501 + + :param bonus_asset: The bonus_asset of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._bonus_asset = bonus_asset + + @property + def kyc_limit(self): + """Gets the kyc_limit of this FixedTermBonusInfo. # noqa: E501 + + KYC level restrictions, comma-separated # noqa: E501 + + :return: The kyc_limit of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._kyc_limit + + @kyc_limit.setter + def kyc_limit(self, kyc_limit): + """Sets the kyc_limit of this FixedTermBonusInfo. + + KYC level restrictions, comma-separated # noqa: E501 + + :param kyc_limit: The kyc_limit of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._kyc_limit = kyc_limit + + @property + def ladder_apr(self): + """Gets the ladder_apr of this FixedTermBonusInfo. # noqa: E501 + + Tiered annual interest rate # noqa: E501 + + :return: The ladder_apr of this FixedTermBonusInfo. # noqa: E501 + :rtype: list[LadderApr] + """ + return self._ladder_apr + + @ladder_apr.setter + def ladder_apr(self, ladder_apr): + """Sets the ladder_apr of this FixedTermBonusInfo. + + Tiered annual interest rate # noqa: E501 + + :param ladder_apr: The ladder_apr of this FixedTermBonusInfo. # noqa: E501 + :type: list[LadderApr] + """ + + self._ladder_apr = ladder_apr + + @property + def total_bonus_amount(self): + """Gets the total_bonus_amount of this FixedTermBonusInfo. # noqa: E501 + + Total reward amount # noqa: E501 + + :return: The total_bonus_amount of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._total_bonus_amount + + @total_bonus_amount.setter + def total_bonus_amount(self, total_bonus_amount): + """Sets the total_bonus_amount of this FixedTermBonusInfo. + + Total reward amount # noqa: E501 + + :param total_bonus_amount: The total_bonus_amount of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._total_bonus_amount = total_bonus_amount + + @property + def user_total_bonus_amount(self): + """Gets the user_total_bonus_amount of this FixedTermBonusInfo. # noqa: E501 + + Maximum reward per user # noqa: E501 + + :return: The user_total_bonus_amount of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._user_total_bonus_amount + + @user_total_bonus_amount.setter + def user_total_bonus_amount(self, user_total_bonus_amount): + """Sets the user_total_bonus_amount of this FixedTermBonusInfo. + + Maximum reward per user # noqa: E501 + + :param user_total_bonus_amount: The user_total_bonus_amount of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._user_total_bonus_amount = user_total_bonus_amount + + @property + def status(self): + """Gets the status of this FixedTermBonusInfo. # noqa: E501 + + Activity status: 1 for unlisted, 2 for listed, 3 for delisted # noqa: E501 + + :return: The status of this FixedTermBonusInfo. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this FixedTermBonusInfo. + + Activity status: 1 for unlisted, 2 for listed, 3 for delisted # noqa: E501 + + :param status: The status of this FixedTermBonusInfo. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def start_time(self): + """Gets the start_time of this FixedTermBonusInfo. # noqa: E501 + + Activity start time # noqa: E501 + + :return: The start_time of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this FixedTermBonusInfo. + + Activity start time # noqa: E501 + + :param start_time: The start_time of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._start_time = start_time + + @property + def end_time(self): + """Gets the end_time of this FixedTermBonusInfo. # noqa: E501 + + Activity end time # noqa: E501 + + :return: The end_time of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this FixedTermBonusInfo. + + Activity end time # noqa: E501 + + :param end_time: The end_time of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._end_time = end_time + + @property + def create_time(self): + """Gets the create_time of this FixedTermBonusInfo. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this FixedTermBonusInfo. + + Created time # noqa: E501 + + :param create_time: The create_time of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + @property + def start_at(self): + """Gets the start_at of this FixedTermBonusInfo. # noqa: E501 + + Activity start timestamp (in seconds) # noqa: E501 + + :return: The start_at of this FixedTermBonusInfo. # noqa: E501 + :rtype: int + """ + return self._start_at + + @start_at.setter + def start_at(self, start_at): + """Sets the start_at of this FixedTermBonusInfo. + + Activity start timestamp (in seconds) # noqa: E501 + + :param start_at: The start_at of this FixedTermBonusInfo. # noqa: E501 + :type: int + """ + + self._start_at = start_at + + @property + def end_at(self): + """Gets the end_at of this FixedTermBonusInfo. # noqa: E501 + + Activity end timestamp (in seconds) # noqa: E501 + + :return: The end_at of this FixedTermBonusInfo. # noqa: E501 + :rtype: int + """ + return self._end_at + + @end_at.setter + def end_at(self, end_at): + """Sets the end_at of this FixedTermBonusInfo. + + Activity end timestamp (in seconds) # noqa: E501 + + :param end_at: The end_at of this FixedTermBonusInfo. # noqa: E501 + :type: int + """ + + self._end_at = end_at + + @property + def total_issued_amount(self): + """Gets the total_issued_amount of this FixedTermBonusInfo. # noqa: E501 + + Total rewards distributed # noqa: E501 + + :return: The total_issued_amount of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._total_issued_amount + + @total_issued_amount.setter + def total_issued_amount(self, total_issued_amount): + """Sets the total_issued_amount of this FixedTermBonusInfo. + + Total rewards distributed # noqa: E501 + + :param total_issued_amount: The total_issued_amount of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._total_issued_amount = total_issued_amount + + @property + def user_total_issued_amount(self): + """Gets the user_total_issued_amount of this FixedTermBonusInfo. # noqa: E501 + + Total rewards distributed to the user # noqa: E501 + + :return: The user_total_issued_amount of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._user_total_issued_amount + + @user_total_issued_amount.setter + def user_total_issued_amount(self, user_total_issued_amount): + """Sets the user_total_issued_amount of this FixedTermBonusInfo. + + Total rewards distributed to the user # noqa: E501 + + :param user_total_issued_amount: The user_total_issued_amount of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._user_total_issued_amount = user_total_issued_amount + + @property + def bonus_asset_price(self): + """Gets the bonus_asset_price of this FixedTermBonusInfo. # noqa: E501 + + Reward currency price (denominated in USDT) # noqa: E501 + + :return: The bonus_asset_price of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._bonus_asset_price + + @bonus_asset_price.setter + def bonus_asset_price(self, bonus_asset_price): + """Sets the bonus_asset_price of this FixedTermBonusInfo. + + Reward currency price (denominated in USDT) # noqa: E501 + + :param bonus_asset_price: The bonus_asset_price of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._bonus_asset_price = bonus_asset_price + + @property + def product_asset_price(self): + """Gets the product_asset_price of this FixedTermBonusInfo. # noqa: E501 + + Product currency price (denominated in USDT) # noqa: E501 + + :return: The product_asset_price of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._product_asset_price + + @product_asset_price.setter + def product_asset_price(self, product_asset_price): + """Sets the product_asset_price of this FixedTermBonusInfo. + + Product currency price (denominated in USDT) # noqa: E501 + + :param product_asset_price: The product_asset_price of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._product_asset_price = product_asset_price + + @property + def product_year_rate(self): + """Gets the product_year_rate of this FixedTermBonusInfo. # noqa: E501 + + Product base annual interest rate # noqa: E501 + + :return: The product_year_rate of this FixedTermBonusInfo. # noqa: E501 + :rtype: str + """ + return self._product_year_rate + + @product_year_rate.setter + def product_year_rate(self, product_year_rate): + """Sets the product_year_rate of this FixedTermBonusInfo. + + Product base annual interest rate # noqa: E501 + + :param product_year_rate: The product_year_rate of this FixedTermBonusInfo. # noqa: E501 + :type: str + """ + + self._product_year_rate = product_year_rate + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FixedTermBonusInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FixedTermBonusInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fixed_term_coupon_info.py b/gate_api/models/fixed_term_coupon_info.py new file mode 100644 index 00000000..2e493f48 --- /dev/null +++ b/gate_api/models/fixed_term_coupon_info.py @@ -0,0 +1,588 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FixedTermCouponInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'business': 'int', + 'user_id': 'int', + 'asset': 'str', + 'order_id': 'int', + 'financial_rate_id': 'int', + 'buy_limit_low': 'str', + 'buy_limit_high': 'str', + 'rate_day': 'int', + 'rate_ratio': 'str', + 'coupon_days': 'int', + 'coupon_principal': 'str', + 'coupon_year_rate': 'str', + 'coupon_interest': 'str', + 'status': 'int', + 'finish_time': 'str', + 'create_time': 'str' + } + + attribute_map = { + 'id': 'id', + 'business': 'business', + 'user_id': 'user_id', + 'asset': 'asset', + 'order_id': 'order_id', + 'financial_rate_id': 'financial_rate_id', + 'buy_limit_low': 'buy_limit_low', + 'buy_limit_high': 'buy_limit_high', + 'rate_day': 'rate_day', + 'rate_ratio': 'rate_ratio', + 'coupon_days': 'coupon_days', + 'coupon_principal': 'coupon_principal', + 'coupon_year_rate': 'coupon_year_rate', + 'coupon_interest': 'coupon_interest', + 'status': 'status', + 'finish_time': 'finish_time', + 'create_time': 'create_time' + } + + def __init__(self, id=None, business=None, user_id=None, asset=None, order_id=None, financial_rate_id=None, buy_limit_low=None, buy_limit_high=None, rate_day=None, rate_ratio=None, coupon_days=None, coupon_principal=None, coupon_year_rate=None, coupon_interest=None, status=None, finish_time=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, str, int, int, str, str, int, str, int, str, str, str, int, str, str, Configuration) -> None + """FixedTermCouponInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._business = None + self._user_id = None + self._asset = None + self._order_id = None + self._financial_rate_id = None + self._buy_limit_low = None + self._buy_limit_high = None + self._rate_day = None + self._rate_ratio = None + self._coupon_days = None + self._coupon_principal = None + self._coupon_year_rate = None + self._coupon_interest = None + self._status = None + self._finish_time = None + self._create_time = None + self.discriminator = None + + self.id = id + self.business = business + self.user_id = user_id + self.asset = asset + self.order_id = order_id + self.financial_rate_id = financial_rate_id + self.buy_limit_low = buy_limit_low + self.buy_limit_high = buy_limit_high + self.rate_day = rate_day + self.rate_ratio = rate_ratio + self.coupon_days = coupon_days + self.coupon_principal = coupon_principal + self.coupon_year_rate = coupon_year_rate + self.coupon_interest = coupon_interest + self.status = status + self.finish_time = finish_time + self.create_time = create_time + + @property + def id(self): + """Gets the id of this FixedTermCouponInfo. # noqa: E501 + + Interest rate boost coupon record ID # noqa: E501 + + :return: The id of this FixedTermCouponInfo. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FixedTermCouponInfo. + + Interest rate boost coupon record ID # noqa: E501 + + :param id: The id of this FixedTermCouponInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def business(self): + """Gets the business of this FixedTermCouponInfo. # noqa: E501 + + Business Type # noqa: E501 + + :return: The business of this FixedTermCouponInfo. # noqa: E501 + :rtype: int + """ + return self._business + + @business.setter + def business(self, business): + """Sets the business of this FixedTermCouponInfo. + + Business Type # noqa: E501 + + :param business: The business of this FixedTermCouponInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and business is None: # noqa: E501 + raise ValueError("Invalid value for `business`, must not be `None`") # noqa: E501 + + self._business = business + + @property + def user_id(self): + """Gets the user_id of this FixedTermCouponInfo. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this FixedTermCouponInfo. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this FixedTermCouponInfo. + + User ID # noqa: E501 + + :param user_id: The user_id of this FixedTermCouponInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def asset(self): + """Gets the asset of this FixedTermCouponInfo. # noqa: E501 + + Currency # noqa: E501 + + :return: The asset of this FixedTermCouponInfo. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this FixedTermCouponInfo. + + Currency # noqa: E501 + + :param asset: The asset of this FixedTermCouponInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def order_id(self): + """Gets the order_id of this FixedTermCouponInfo. # noqa: E501 + + Associated order ID # noqa: E501 + + :return: The order_id of this FixedTermCouponInfo. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this FixedTermCouponInfo. + + Associated order ID # noqa: E501 + + :param order_id: The order_id of this FixedTermCouponInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 + raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 + + self._order_id = order_id + + @property + def financial_rate_id(self): + """Gets the financial_rate_id of this FixedTermCouponInfo. # noqa: E501 + + Interest rate boost coupon ID # noqa: E501 + + :return: The financial_rate_id of this FixedTermCouponInfo. # noqa: E501 + :rtype: int + """ + return self._financial_rate_id + + @financial_rate_id.setter + def financial_rate_id(self, financial_rate_id): + """Sets the financial_rate_id of this FixedTermCouponInfo. + + Interest rate boost coupon ID # noqa: E501 + + :param financial_rate_id: The financial_rate_id of this FixedTermCouponInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and financial_rate_id is None: # noqa: E501 + raise ValueError("Invalid value for `financial_rate_id`, must not be `None`") # noqa: E501 + + self._financial_rate_id = financial_rate_id + + @property + def buy_limit_low(self): + """Gets the buy_limit_low of this FixedTermCouponInfo. # noqa: E501 + + Minimum subscription amount for interest rate boost coupon # noqa: E501 + + :return: The buy_limit_low of this FixedTermCouponInfo. # noqa: E501 + :rtype: str + """ + return self._buy_limit_low + + @buy_limit_low.setter + def buy_limit_low(self, buy_limit_low): + """Sets the buy_limit_low of this FixedTermCouponInfo. + + Minimum subscription amount for interest rate boost coupon # noqa: E501 + + :param buy_limit_low: The buy_limit_low of this FixedTermCouponInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and buy_limit_low is None: # noqa: E501 + raise ValueError("Invalid value for `buy_limit_low`, must not be `None`") # noqa: E501 + + self._buy_limit_low = buy_limit_low + + @property + def buy_limit_high(self): + """Gets the buy_limit_high of this FixedTermCouponInfo. # noqa: E501 + + Maximum subscription amount for interest rate boost coupon # noqa: E501 + + :return: The buy_limit_high of this FixedTermCouponInfo. # noqa: E501 + :rtype: str + """ + return self._buy_limit_high + + @buy_limit_high.setter + def buy_limit_high(self, buy_limit_high): + """Sets the buy_limit_high of this FixedTermCouponInfo. + + Maximum subscription amount for interest rate boost coupon # noqa: E501 + + :param buy_limit_high: The buy_limit_high of this FixedTermCouponInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and buy_limit_high is None: # noqa: E501 + raise ValueError("Invalid value for `buy_limit_high`, must not be `None`") # noqa: E501 + + self._buy_limit_high = buy_limit_high + + @property + def rate_day(self): + """Gets the rate_day of this FixedTermCouponInfo. # noqa: E501 + + Interest rate boost days # noqa: E501 + + :return: The rate_day of this FixedTermCouponInfo. # noqa: E501 + :rtype: int + """ + return self._rate_day + + @rate_day.setter + def rate_day(self, rate_day): + """Sets the rate_day of this FixedTermCouponInfo. + + Interest rate boost days # noqa: E501 + + :param rate_day: The rate_day of this FixedTermCouponInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and rate_day is None: # noqa: E501 + raise ValueError("Invalid value for `rate_day`, must not be `None`") # noqa: E501 + + self._rate_day = rate_day + + @property + def rate_ratio(self): + """Gets the rate_ratio of this FixedTermCouponInfo. # noqa: E501 + + Interest rate boost percentage # noqa: E501 + + :return: The rate_ratio of this FixedTermCouponInfo. # noqa: E501 + :rtype: str + """ + return self._rate_ratio + + @rate_ratio.setter + def rate_ratio(self, rate_ratio): + """Sets the rate_ratio of this FixedTermCouponInfo. + + Interest rate boost percentage # noqa: E501 + + :param rate_ratio: The rate_ratio of this FixedTermCouponInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and rate_ratio is None: # noqa: E501 + raise ValueError("Invalid value for `rate_ratio`, must not be `None`") # noqa: E501 + + self._rate_ratio = rate_ratio + + @property + def coupon_days(self): + """Gets the coupon_days of this FixedTermCouponInfo. # noqa: E501 + + Actual interest rate boost days # noqa: E501 + + :return: The coupon_days of this FixedTermCouponInfo. # noqa: E501 + :rtype: int + """ + return self._coupon_days + + @coupon_days.setter + def coupon_days(self, coupon_days): + """Sets the coupon_days of this FixedTermCouponInfo. + + Actual interest rate boost days # noqa: E501 + + :param coupon_days: The coupon_days of this FixedTermCouponInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and coupon_days is None: # noqa: E501 + raise ValueError("Invalid value for `coupon_days`, must not be `None`") # noqa: E501 + + self._coupon_days = coupon_days + + @property + def coupon_principal(self): + """Gets the coupon_principal of this FixedTermCouponInfo. # noqa: E501 + + Principal for interest rate boost calculation # noqa: E501 + + :return: The coupon_principal of this FixedTermCouponInfo. # noqa: E501 + :rtype: str + """ + return self._coupon_principal + + @coupon_principal.setter + def coupon_principal(self, coupon_principal): + """Sets the coupon_principal of this FixedTermCouponInfo. + + Principal for interest rate boost calculation # noqa: E501 + + :param coupon_principal: The coupon_principal of this FixedTermCouponInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and coupon_principal is None: # noqa: E501 + raise ValueError("Invalid value for `coupon_principal`, must not be `None`") # noqa: E501 + + self._coupon_principal = coupon_principal + + @property + def coupon_year_rate(self): + """Gets the coupon_year_rate of this FixedTermCouponInfo. # noqa: E501 + + Interest rate boost APR # noqa: E501 + + :return: The coupon_year_rate of this FixedTermCouponInfo. # noqa: E501 + :rtype: str + """ + return self._coupon_year_rate + + @coupon_year_rate.setter + def coupon_year_rate(self, coupon_year_rate): + """Sets the coupon_year_rate of this FixedTermCouponInfo. + + Interest rate boost APR # noqa: E501 + + :param coupon_year_rate: The coupon_year_rate of this FixedTermCouponInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and coupon_year_rate is None: # noqa: E501 + raise ValueError("Invalid value for `coupon_year_rate`, must not be `None`") # noqa: E501 + + self._coupon_year_rate = coupon_year_rate + + @property + def coupon_interest(self): + """Gets the coupon_interest of this FixedTermCouponInfo. # noqa: E501 + + Interest generated from rate boost # noqa: E501 + + :return: The coupon_interest of this FixedTermCouponInfo. # noqa: E501 + :rtype: str + """ + return self._coupon_interest + + @coupon_interest.setter + def coupon_interest(self, coupon_interest): + """Sets the coupon_interest of this FixedTermCouponInfo. + + Interest generated from rate boost # noqa: E501 + + :param coupon_interest: The coupon_interest of this FixedTermCouponInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and coupon_interest is None: # noqa: E501 + raise ValueError("Invalid value for `coupon_interest`, must not be `None`") # noqa: E501 + + self._coupon_interest = coupon_interest + + @property + def status(self): + """Gets the status of this FixedTermCouponInfo. # noqa: E501 + + Status: 1 for active, 2 for settled # noqa: E501 + + :return: The status of this FixedTermCouponInfo. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this FixedTermCouponInfo. + + Status: 1 for active, 2 for settled # noqa: E501 + + :param status: The status of this FixedTermCouponInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def finish_time(self): + """Gets the finish_time of this FixedTermCouponInfo. # noqa: E501 + + Settlement time # noqa: E501 + + :return: The finish_time of this FixedTermCouponInfo. # noqa: E501 + :rtype: str + """ + return self._finish_time + + @finish_time.setter + def finish_time(self, finish_time): + """Sets the finish_time of this FixedTermCouponInfo. + + Settlement time # noqa: E501 + + :param finish_time: The finish_time of this FixedTermCouponInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and finish_time is None: # noqa: E501 + raise ValueError("Invalid value for `finish_time`, must not be `None`") # noqa: E501 + + self._finish_time = finish_time + + @property + def create_time(self): + """Gets the create_time of this FixedTermCouponInfo. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this FixedTermCouponInfo. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this FixedTermCouponInfo. + + Created time # noqa: E501 + + :param create_time: The create_time of this FixedTermCouponInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FixedTermCouponInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FixedTermCouponInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fixed_term_history_record.py b/gate_api/models/fixed_term_history_record.py new file mode 100644 index 00000000..f6dbfd74 --- /dev/null +++ b/gate_api/models/fixed_term_history_record.py @@ -0,0 +1,550 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FixedTermHistoryRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'order_id': 'int', + 'user_id': 'int', + 'asset': 'str', + 'uniq_time': 'str', + 'bonus_id': 'int', + 'product_id': 'int', + 'bonus_asset': 'str', + 'total_principal': 'str', + 'amount': 'str', + 'asset_price': 'str', + 'status': 'int', + 'detail': 'str', + 'create_time': 'str', + 'create_at': 'int', + 'lock_up_period': 'int' + } + + attribute_map = { + 'id': 'id', + 'order_id': 'order_id', + 'user_id': 'user_id', + 'asset': 'asset', + 'uniq_time': 'uniq_time', + 'bonus_id': 'bonus_id', + 'product_id': 'product_id', + 'bonus_asset': 'bonus_asset', + 'total_principal': 'total_principal', + 'amount': 'amount', + 'asset_price': 'asset_price', + 'status': 'status', + 'detail': 'detail', + 'create_time': 'create_time', + 'create_at': 'create_at', + 'lock_up_period': 'lock_up_period' + } + + def __init__(self, id=None, order_id=None, user_id=None, asset=None, uniq_time=None, bonus_id=None, product_id=None, bonus_asset=None, total_principal=None, amount=None, asset_price=None, status=None, detail=None, create_time=None, create_at=None, lock_up_period=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, str, str, int, int, str, str, str, str, int, str, str, int, int, Configuration) -> None + """FixedTermHistoryRecord - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._order_id = None + self._user_id = None + self._asset = None + self._uniq_time = None + self._bonus_id = None + self._product_id = None + self._bonus_asset = None + self._total_principal = None + self._amount = None + self._asset_price = None + self._status = None + self._detail = None + self._create_time = None + self._create_at = None + self._lock_up_period = None + self.discriminator = None + + self.id = id + if order_id is not None: + self.order_id = order_id + self.user_id = user_id + self.asset = asset + if uniq_time is not None: + self.uniq_time = uniq_time + if bonus_id is not None: + self.bonus_id = bonus_id + self.product_id = product_id + if bonus_asset is not None: + self.bonus_asset = bonus_asset + if total_principal is not None: + self.total_principal = total_principal + if amount is not None: + self.amount = amount + if asset_price is not None: + self.asset_price = asset_price + self.status = status + if detail is not None: + self.detail = detail + self.create_time = create_time + self.create_at = create_at + if lock_up_period is not None: + self.lock_up_period = lock_up_period + + @property + def id(self): + """Gets the id of this FixedTermHistoryRecord. # noqa: E501 + + Record ID # noqa: E501 + + :return: The id of this FixedTermHistoryRecord. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FixedTermHistoryRecord. + + Record ID # noqa: E501 + + :param id: The id of this FixedTermHistoryRecord. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def order_id(self): + """Gets the order_id of this FixedTermHistoryRecord. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this FixedTermHistoryRecord. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this FixedTermHistoryRecord. + + Order ID # noqa: E501 + + :param order_id: The order_id of this FixedTermHistoryRecord. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def user_id(self): + """Gets the user_id of this FixedTermHistoryRecord. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this FixedTermHistoryRecord. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this FixedTermHistoryRecord. + + User ID # noqa: E501 + + :param user_id: The user_id of this FixedTermHistoryRecord. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and user_id is None: # noqa: E501 + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def asset(self): + """Gets the asset of this FixedTermHistoryRecord. # noqa: E501 + + Currency # noqa: E501 + + :return: The asset of this FixedTermHistoryRecord. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this FixedTermHistoryRecord. + + Currency # noqa: E501 + + :param asset: The asset of this FixedTermHistoryRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def uniq_time(self): + """Gets the uniq_time of this FixedTermHistoryRecord. # noqa: E501 + + Unique time identifier (date) # noqa: E501 + + :return: The uniq_time of this FixedTermHistoryRecord. # noqa: E501 + :rtype: str + """ + return self._uniq_time + + @uniq_time.setter + def uniq_time(self, uniq_time): + """Sets the uniq_time of this FixedTermHistoryRecord. + + Unique time identifier (date) # noqa: E501 + + :param uniq_time: The uniq_time of this FixedTermHistoryRecord. # noqa: E501 + :type: str + """ + + self._uniq_time = uniq_time + + @property + def bonus_id(self): + """Gets the bonus_id of this FixedTermHistoryRecord. # noqa: E501 + + Reward campaign ID # noqa: E501 + + :return: The bonus_id of this FixedTermHistoryRecord. # noqa: E501 + :rtype: int + """ + return self._bonus_id + + @bonus_id.setter + def bonus_id(self, bonus_id): + """Sets the bonus_id of this FixedTermHistoryRecord. + + Reward campaign ID # noqa: E501 + + :param bonus_id: The bonus_id of this FixedTermHistoryRecord. # noqa: E501 + :type: int + """ + + self._bonus_id = bonus_id + + @property + def product_id(self): + """Gets the product_id of this FixedTermHistoryRecord. # noqa: E501 + + Product ID # noqa: E501 + + :return: The product_id of this FixedTermHistoryRecord. # noqa: E501 + :rtype: int + """ + return self._product_id + + @product_id.setter + def product_id(self, product_id): + """Sets the product_id of this FixedTermHistoryRecord. + + Product ID # noqa: E501 + + :param product_id: The product_id of this FixedTermHistoryRecord. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and product_id is None: # noqa: E501 + raise ValueError("Invalid value for `product_id`, must not be `None`") # noqa: E501 + + self._product_id = product_id + + @property + def bonus_asset(self): + """Gets the bonus_asset of this FixedTermHistoryRecord. # noqa: E501 + + Reward currency # noqa: E501 + + :return: The bonus_asset of this FixedTermHistoryRecord. # noqa: E501 + :rtype: str + """ + return self._bonus_asset + + @bonus_asset.setter + def bonus_asset(self, bonus_asset): + """Sets the bonus_asset of this FixedTermHistoryRecord. + + Reward currency # noqa: E501 + + :param bonus_asset: The bonus_asset of this FixedTermHistoryRecord. # noqa: E501 + :type: str + """ + + self._bonus_asset = bonus_asset + + @property + def total_principal(self): + """Gets the total_principal of this FixedTermHistoryRecord. # noqa: E501 + + Total principal # noqa: E501 + + :return: The total_principal of this FixedTermHistoryRecord. # noqa: E501 + :rtype: str + """ + return self._total_principal + + @total_principal.setter + def total_principal(self, total_principal): + """Sets the total_principal of this FixedTermHistoryRecord. + + Total principal # noqa: E501 + + :param total_principal: The total_principal of this FixedTermHistoryRecord. # noqa: E501 + :type: str + """ + + self._total_principal = total_principal + + @property + def amount(self): + """Gets the amount of this FixedTermHistoryRecord. # noqa: E501 + + Amount # noqa: E501 + + :return: The amount of this FixedTermHistoryRecord. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this FixedTermHistoryRecord. + + Amount # noqa: E501 + + :param amount: The amount of this FixedTermHistoryRecord. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def asset_price(self): + """Gets the asset_price of this FixedTermHistoryRecord. # noqa: E501 + + Currency price # noqa: E501 + + :return: The asset_price of this FixedTermHistoryRecord. # noqa: E501 + :rtype: str + """ + return self._asset_price + + @asset_price.setter + def asset_price(self, asset_price): + """Sets the asset_price of this FixedTermHistoryRecord. + + Currency price # noqa: E501 + + :param asset_price: The asset_price of this FixedTermHistoryRecord. # noqa: E501 + :type: str + """ + + self._asset_price = asset_price + + @property + def status(self): + """Gets the status of this FixedTermHistoryRecord. # noqa: E501 + + Status # noqa: E501 + + :return: The status of this FixedTermHistoryRecord. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this FixedTermHistoryRecord. + + Status # noqa: E501 + + :param status: The status of this FixedTermHistoryRecord. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def detail(self): + """Gets the detail of this FixedTermHistoryRecord. # noqa: E501 + + Detail description # noqa: E501 + + :return: The detail of this FixedTermHistoryRecord. # noqa: E501 + :rtype: str + """ + return self._detail + + @detail.setter + def detail(self, detail): + """Sets the detail of this FixedTermHistoryRecord. + + Detail description # noqa: E501 + + :param detail: The detail of this FixedTermHistoryRecord. # noqa: E501 + :type: str + """ + + self._detail = detail + + @property + def create_time(self): + """Gets the create_time of this FixedTermHistoryRecord. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this FixedTermHistoryRecord. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this FixedTermHistoryRecord. + + Created time # noqa: E501 + + :param create_time: The create_time of this FixedTermHistoryRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + @property + def create_at(self): + """Gets the create_at of this FixedTermHistoryRecord. # noqa: E501 + + Creation timestamp (in seconds) # noqa: E501 + + :return: The create_at of this FixedTermHistoryRecord. # noqa: E501 + :rtype: int + """ + return self._create_at + + @create_at.setter + def create_at(self, create_at): + """Sets the create_at of this FixedTermHistoryRecord. + + Creation timestamp (in seconds) # noqa: E501 + + :param create_at: The create_at of this FixedTermHistoryRecord. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and create_at is None: # noqa: E501 + raise ValueError("Invalid value for `create_at`, must not be `None`") # noqa: E501 + + self._create_at = create_at + + @property + def lock_up_period(self): + """Gets the lock_up_period of this FixedTermHistoryRecord. # noqa: E501 + + Term # noqa: E501 + + :return: The lock_up_period of this FixedTermHistoryRecord. # noqa: E501 + :rtype: int + """ + return self._lock_up_period + + @lock_up_period.setter + def lock_up_period(self, lock_up_period): + """Sets the lock_up_period of this FixedTermHistoryRecord. + + Term # noqa: E501 + + :param lock_up_period: The lock_up_period of this FixedTermHistoryRecord. # noqa: E501 + :type: int + """ + + self._lock_up_period = lock_up_period + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FixedTermHistoryRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FixedTermHistoryRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fixed_term_lend_order.py b/gate_api/models/fixed_term_lend_order.py new file mode 100644 index 00000000..8ed9c0d4 --- /dev/null +++ b/gate_api/models/fixed_term_lend_order.py @@ -0,0 +1,901 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FixedTermLendOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'business': 'int', + 'order_id': 'int', + 'user_id': 'int', + 'asset': 'str', + 'product_id': 'int', + 'lock_up_period': 'int', + 'principal': 'str', + 'year_rate': 'str', + 'product_type': 'int', + 'interest': 'str', + 'status': 'int', + 'reinvest_status': 'int', + 'redeem_account_type': 'int', + 'origin_order': 'str', + 'redeem_type': 'int', + 'redeem_time': 'str', + 'finish_time': 'str', + 'create_time': 'str', + 'year_rate_perent': 'str', + 'total_year_rate_percent': 'str', + 'total_interest': 'str', + 'product_info': 'FixedTermProductInfo', + 'bonus_info': 'FixedTermBonusInfo', + 'coupon_info': 'FixedTermCouponInfo', + 'redeem_at': 'int', + 'finish_at': 'int', + 'create_at': 'int', + 'icon': 'str' + } + + attribute_map = { + 'id': 'id', + 'business': 'business', + 'order_id': 'order_id', + 'user_id': 'user_id', + 'asset': 'asset', + 'product_id': 'product_id', + 'lock_up_period': 'lock_up_period', + 'principal': 'principal', + 'year_rate': 'year_rate', + 'product_type': 'product_type', + 'interest': 'interest', + 'status': 'status', + 'reinvest_status': 'reinvest_status', + 'redeem_account_type': 'redeem_account_type', + 'origin_order': 'origin_order', + 'redeem_type': 'redeem_type', + 'redeem_time': 'redeem_time', + 'finish_time': 'finish_time', + 'create_time': 'create_time', + 'year_rate_perent': 'year_rate_perent', + 'total_year_rate_percent': 'total_year_rate_percent', + 'total_interest': 'total_interest', + 'product_info': 'product_info', + 'bonus_info': 'bonus_info', + 'coupon_info': 'coupon_info', + 'redeem_at': 'redeem_at', + 'finish_at': 'finish_at', + 'create_at': 'create_at', + 'icon': 'icon' + } + + def __init__(self, id=None, business=None, order_id=None, user_id=None, asset=None, product_id=None, lock_up_period=None, principal=None, year_rate=None, product_type=None, interest=None, status=None, reinvest_status=None, redeem_account_type=None, origin_order=None, redeem_type=None, redeem_time=None, finish_time=None, create_time=None, year_rate_perent=None, total_year_rate_percent=None, total_interest=None, product_info=None, bonus_info=None, coupon_info=None, redeem_at=None, finish_at=None, create_at=None, icon=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, int, str, int, int, str, str, int, str, int, int, int, str, int, str, str, str, str, str, str, FixedTermProductInfo, FixedTermBonusInfo, FixedTermCouponInfo, int, int, int, str, Configuration) -> None + """FixedTermLendOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._business = None + self._order_id = None + self._user_id = None + self._asset = None + self._product_id = None + self._lock_up_period = None + self._principal = None + self._year_rate = None + self._product_type = None + self._interest = None + self._status = None + self._reinvest_status = None + self._redeem_account_type = None + self._origin_order = None + self._redeem_type = None + self._redeem_time = None + self._finish_time = None + self._create_time = None + self._year_rate_perent = None + self._total_year_rate_percent = None + self._total_interest = None + self._product_info = None + self._bonus_info = None + self._coupon_info = None + self._redeem_at = None + self._finish_at = None + self._create_at = None + self._icon = None + self.discriminator = None + + if id is not None: + self.id = id + if business is not None: + self.business = business + if order_id is not None: + self.order_id = order_id + if user_id is not None: + self.user_id = user_id + if asset is not None: + self.asset = asset + if product_id is not None: + self.product_id = product_id + if lock_up_period is not None: + self.lock_up_period = lock_up_period + if principal is not None: + self.principal = principal + if year_rate is not None: + self.year_rate = year_rate + if product_type is not None: + self.product_type = product_type + if interest is not None: + self.interest = interest + if status is not None: + self.status = status + if reinvest_status is not None: + self.reinvest_status = reinvest_status + if redeem_account_type is not None: + self.redeem_account_type = redeem_account_type + if origin_order is not None: + self.origin_order = origin_order + if redeem_type is not None: + self.redeem_type = redeem_type + if redeem_time is not None: + self.redeem_time = redeem_time + if finish_time is not None: + self.finish_time = finish_time + if create_time is not None: + self.create_time = create_time + if year_rate_perent is not None: + self.year_rate_perent = year_rate_perent + if total_year_rate_percent is not None: + self.total_year_rate_percent = total_year_rate_percent + if total_interest is not None: + self.total_interest = total_interest + if product_info is not None: + self.product_info = product_info + if bonus_info is not None: + self.bonus_info = bonus_info + if coupon_info is not None: + self.coupon_info = coupon_info + if redeem_at is not None: + self.redeem_at = redeem_at + if finish_at is not None: + self.finish_at = finish_at + if create_at is not None: + self.create_at = create_at + if icon is not None: + self.icon = icon + + @property + def id(self): + """Gets the id of this FixedTermLendOrder. # noqa: E501 + + Subscription record ID # noqa: E501 + + :return: The id of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FixedTermLendOrder. + + Subscription record ID # noqa: E501 + + :param id: The id of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def business(self): + """Gets the business of this FixedTermLendOrder. # noqa: E501 + + Business type: 1 for regular, 2 for VIP # noqa: E501 + + :return: The business of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._business + + @business.setter + def business(self, business): + """Sets the business of this FixedTermLendOrder. + + Business type: 1 for regular, 2 for VIP # noqa: E501 + + :param business: The business of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._business = business + + @property + def order_id(self): + """Gets the order_id of this FixedTermLendOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this FixedTermLendOrder. + + Order ID # noqa: E501 + + :param order_id: The order_id of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def user_id(self): + """Gets the user_id of this FixedTermLendOrder. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this FixedTermLendOrder. + + User ID # noqa: E501 + + :param user_id: The user_id of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def asset(self): + """Gets the asset of this FixedTermLendOrder. # noqa: E501 + + Currency # noqa: E501 + + :return: The asset of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this FixedTermLendOrder. + + Currency # noqa: E501 + + :param asset: The asset of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._asset = asset + + @property + def product_id(self): + """Gets the product_id of this FixedTermLendOrder. # noqa: E501 + + Product ID # noqa: E501 + + :return: The product_id of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._product_id + + @product_id.setter + def product_id(self, product_id): + """Sets the product_id of this FixedTermLendOrder. + + Product ID # noqa: E501 + + :param product_id: The product_id of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._product_id = product_id + + @property + def lock_up_period(self): + """Gets the lock_up_period of this FixedTermLendOrder. # noqa: E501 + + Lock-up period (in days) # noqa: E501 + + :return: The lock_up_period of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._lock_up_period + + @lock_up_period.setter + def lock_up_period(self, lock_up_period): + """Sets the lock_up_period of this FixedTermLendOrder. + + Lock-up period (in days) # noqa: E501 + + :param lock_up_period: The lock_up_period of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._lock_up_period = lock_up_period + + @property + def principal(self): + """Gets the principal of this FixedTermLendOrder. # noqa: E501 + + Subscription principal # noqa: E501 + + :return: The principal of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._principal + + @principal.setter + def principal(self, principal): + """Sets the principal of this FixedTermLendOrder. + + Subscription principal # noqa: E501 + + :param principal: The principal of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._principal = principal + + @property + def year_rate(self): + """Gets the year_rate of this FixedTermLendOrder. # noqa: E501 + + Annual interest rate # noqa: E501 + + :return: The year_rate of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._year_rate + + @year_rate.setter + def year_rate(self, year_rate): + """Sets the year_rate of this FixedTermLendOrder. + + Annual interest rate # noqa: E501 + + :param year_rate: The year_rate of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._year_rate = year_rate + + @property + def product_type(self): + """Gets the product_type of this FixedTermLendOrder. # noqa: E501 + + Product type: 1 for regular, 2 for VIP # noqa: E501 + + :return: The product_type of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._product_type + + @product_type.setter + def product_type(self, product_type): + """Sets the product_type of this FixedTermLendOrder. + + Product type: 1 for regular, 2 for VIP # noqa: E501 + + :param product_type: The product_type of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._product_type = product_type + + @property + def interest(self): + """Gets the interest of this FixedTermLendOrder. # noqa: E501 + + Accrued interest # noqa: E501 + + :return: The interest of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._interest + + @interest.setter + def interest(self, interest): + """Sets the interest of this FixedTermLendOrder. + + Accrued interest # noqa: E501 + + :param interest: The interest of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._interest = interest + + @property + def status(self): + """Gets the status of this FixedTermLendOrder. # noqa: E501 + + Order status: 1 for holding, 2 for redeemed, 3 for matured, 4 for settled # noqa: E501 + + :return: The status of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this FixedTermLendOrder. + + Order status: 1 for holding, 2 for redeemed, 3 for matured, 4 for settled # noqa: E501 + + :param status: The status of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def reinvest_status(self): + """Gets the reinvest_status of this FixedTermLendOrder. # noqa: E501 + + Auto-renewal status: 0 for disabled, 1 for enabled # noqa: E501 + + :return: The reinvest_status of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._reinvest_status + + @reinvest_status.setter + def reinvest_status(self, reinvest_status): + """Sets the reinvest_status of this FixedTermLendOrder. + + Auto-renewal status: 0 for disabled, 1 for enabled # noqa: E501 + + :param reinvest_status: The reinvest_status of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._reinvest_status = reinvest_status + + @property + def redeem_account_type(self): + """Gets the redeem_account_type of this FixedTermLendOrder. # noqa: E501 + + Redemption payout account type: 1 for spot account # noqa: E501 + + :return: The redeem_account_type of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._redeem_account_type + + @redeem_account_type.setter + def redeem_account_type(self, redeem_account_type): + """Sets the redeem_account_type of this FixedTermLendOrder. + + Redemption payout account type: 1 for spot account # noqa: E501 + + :param redeem_account_type: The redeem_account_type of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._redeem_account_type = redeem_account_type + + @property + def origin_order(self): + """Gets the origin_order of this FixedTermLendOrder. # noqa: E501 + + Original order ID, linked to previous order IDs in auto-renewal scenarios # noqa: E501 + + :return: The origin_order of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._origin_order + + @origin_order.setter + def origin_order(self, origin_order): + """Sets the origin_order of this FixedTermLendOrder. + + Original order ID, linked to previous order IDs in auto-renewal scenarios # noqa: E501 + + :param origin_order: The origin_order of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._origin_order = origin_order + + @property + def redeem_type(self): + """Gets the redeem_type of this FixedTermLendOrder. # noqa: E501 + + Redemption type: 1 for early redemption, 2 for maturity redemption # noqa: E501 + + :return: The redeem_type of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._redeem_type + + @redeem_type.setter + def redeem_type(self, redeem_type): + """Sets the redeem_type of this FixedTermLendOrder. + + Redemption type: 1 for early redemption, 2 for maturity redemption # noqa: E501 + + :param redeem_type: The redeem_type of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._redeem_type = redeem_type + + @property + def redeem_time(self): + """Gets the redeem_time of this FixedTermLendOrder. # noqa: E501 + + Redemption time # noqa: E501 + + :return: The redeem_time of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._redeem_time + + @redeem_time.setter + def redeem_time(self, redeem_time): + """Sets the redeem_time of this FixedTermLendOrder. + + Redemption time # noqa: E501 + + :param redeem_time: The redeem_time of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._redeem_time = redeem_time + + @property + def finish_time(self): + """Gets the finish_time of this FixedTermLendOrder. # noqa: E501 + + Expiration time # noqa: E501 + + :return: The finish_time of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._finish_time + + @finish_time.setter + def finish_time(self, finish_time): + """Sets the finish_time of this FixedTermLendOrder. + + Expiration time # noqa: E501 + + :param finish_time: The finish_time of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._finish_time = finish_time + + @property + def create_time(self): + """Gets the create_time of this FixedTermLendOrder. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this FixedTermLendOrder. + + Created time # noqa: E501 + + :param create_time: The create_time of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + @property + def year_rate_perent(self): + """Gets the year_rate_perent of this FixedTermLendOrder. # noqa: E501 + + Annual interest rate percentage display value # noqa: E501 + + :return: The year_rate_perent of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._year_rate_perent + + @year_rate_perent.setter + def year_rate_perent(self, year_rate_perent): + """Sets the year_rate_perent of this FixedTermLendOrder. + + Annual interest rate percentage display value # noqa: E501 + + :param year_rate_perent: The year_rate_perent of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._year_rate_perent = year_rate_perent + + @property + def total_year_rate_percent(self): + """Gets the total_year_rate_percent of this FixedTermLendOrder. # noqa: E501 + + Comprehensive annualized yield percentage (including interest rate boost, rewards, etc.) # noqa: E501 + + :return: The total_year_rate_percent of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._total_year_rate_percent + + @total_year_rate_percent.setter + def total_year_rate_percent(self, total_year_rate_percent): + """Sets the total_year_rate_percent of this FixedTermLendOrder. + + Comprehensive annualized yield percentage (including interest rate boost, rewards, etc.) # noqa: E501 + + :param total_year_rate_percent: The total_year_rate_percent of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._total_year_rate_percent = total_year_rate_percent + + @property + def total_interest(self): + """Gets the total_interest of this FixedTermLendOrder. # noqa: E501 + + Total earnings (including interest and bonus rewards) # noqa: E501 + + :return: The total_interest of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._total_interest + + @total_interest.setter + def total_interest(self, total_interest): + """Sets the total_interest of this FixedTermLendOrder. + + Total earnings (including interest and bonus rewards) # noqa: E501 + + :param total_interest: The total_interest of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._total_interest = total_interest + + @property + def product_info(self): + """Gets the product_info of this FixedTermLendOrder. # noqa: E501 + + + :return: The product_info of this FixedTermLendOrder. # noqa: E501 + :rtype: FixedTermProductInfo + """ + return self._product_info + + @product_info.setter + def product_info(self, product_info): + """Sets the product_info of this FixedTermLendOrder. + + + :param product_info: The product_info of this FixedTermLendOrder. # noqa: E501 + :type: FixedTermProductInfo + """ + + self._product_info = product_info + + @property + def bonus_info(self): + """Gets the bonus_info of this FixedTermLendOrder. # noqa: E501 + + + :return: The bonus_info of this FixedTermLendOrder. # noqa: E501 + :rtype: FixedTermBonusInfo + """ + return self._bonus_info + + @bonus_info.setter + def bonus_info(self, bonus_info): + """Sets the bonus_info of this FixedTermLendOrder. + + + :param bonus_info: The bonus_info of this FixedTermLendOrder. # noqa: E501 + :type: FixedTermBonusInfo + """ + + self._bonus_info = bonus_info + + @property + def coupon_info(self): + """Gets the coupon_info of this FixedTermLendOrder. # noqa: E501 + + + :return: The coupon_info of this FixedTermLendOrder. # noqa: E501 + :rtype: FixedTermCouponInfo + """ + return self._coupon_info + + @coupon_info.setter + def coupon_info(self, coupon_info): + """Sets the coupon_info of this FixedTermLendOrder. + + + :param coupon_info: The coupon_info of this FixedTermLendOrder. # noqa: E501 + :type: FixedTermCouponInfo + """ + + self._coupon_info = coupon_info + + @property + def redeem_at(self): + """Gets the redeem_at of this FixedTermLendOrder. # noqa: E501 + + Redemption timestamp (in seconds) # noqa: E501 + + :return: The redeem_at of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._redeem_at + + @redeem_at.setter + def redeem_at(self, redeem_at): + """Sets the redeem_at of this FixedTermLendOrder. + + Redemption timestamp (in seconds) # noqa: E501 + + :param redeem_at: The redeem_at of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._redeem_at = redeem_at + + @property + def finish_at(self): + """Gets the finish_at of this FixedTermLendOrder. # noqa: E501 + + Expiration timestamp (in seconds) # noqa: E501 + + :return: The finish_at of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._finish_at + + @finish_at.setter + def finish_at(self, finish_at): + """Sets the finish_at of this FixedTermLendOrder. + + Expiration timestamp (in seconds) # noqa: E501 + + :param finish_at: The finish_at of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._finish_at = finish_at + + @property + def create_at(self): + """Gets the create_at of this FixedTermLendOrder. # noqa: E501 + + Creation timestamp (in seconds) # noqa: E501 + + :return: The create_at of this FixedTermLendOrder. # noqa: E501 + :rtype: int + """ + return self._create_at + + @create_at.setter + def create_at(self, create_at): + """Sets the create_at of this FixedTermLendOrder. + + Creation timestamp (in seconds) # noqa: E501 + + :param create_at: The create_at of this FixedTermLendOrder. # noqa: E501 + :type: int + """ + + self._create_at = create_at + + @property + def icon(self): + """Gets the icon of this FixedTermLendOrder. # noqa: E501 + + Currency icon URL # noqa: E501 + + :return: The icon of this FixedTermLendOrder. # noqa: E501 + :rtype: str + """ + return self._icon + + @icon.setter + def icon(self, icon): + """Sets the icon of this FixedTermLendOrder. + + Currency icon URL # noqa: E501 + + :param icon: The icon of this FixedTermLendOrder. # noqa: E501 + :type: str + """ + + self._icon = icon + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FixedTermLendOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FixedTermLendOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fixed_term_lend_request.py b/gate_api/models/fixed_term_lend_request.py new file mode 100644 index 00000000..bbee8c44 --- /dev/null +++ b/gate_api/models/fixed_term_lend_request.py @@ -0,0 +1,293 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FixedTermLendRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'product_id': 'int', + 'amount': 'str', + 'year_rate': 'str', + 'reinvest_status': 'int', + 'redeem_account_type': 'int', + 'financial_rate_id': 'int', + 'sub_business': 'int' + } + + attribute_map = { + 'product_id': 'product_id', + 'amount': 'amount', + 'year_rate': 'year_rate', + 'reinvest_status': 'reinvest_status', + 'redeem_account_type': 'redeem_account_type', + 'financial_rate_id': 'financial_rate_id', + 'sub_business': 'sub_business' + } + + def __init__(self, product_id=None, amount=None, year_rate=None, reinvest_status=None, redeem_account_type=None, financial_rate_id=None, sub_business=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, int, int, int, int, Configuration) -> None + """FixedTermLendRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._product_id = None + self._amount = None + self._year_rate = None + self._reinvest_status = None + self._redeem_account_type = None + self._financial_rate_id = None + self._sub_business = None + self.discriminator = None + + self.product_id = product_id + self.amount = amount + if year_rate is not None: + self.year_rate = year_rate + if reinvest_status is not None: + self.reinvest_status = reinvest_status + if redeem_account_type is not None: + self.redeem_account_type = redeem_account_type + if financial_rate_id is not None: + self.financial_rate_id = financial_rate_id + if sub_business is not None: + self.sub_business = sub_business + + @property + def product_id(self): + """Gets the product_id of this FixedTermLendRequest. # noqa: E501 + + Product ID # noqa: E501 + + :return: The product_id of this FixedTermLendRequest. # noqa: E501 + :rtype: int + """ + return self._product_id + + @product_id.setter + def product_id(self, product_id): + """Sets the product_id of this FixedTermLendRequest. + + Product ID # noqa: E501 + + :param product_id: The product_id of this FixedTermLendRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and product_id is None: # noqa: E501 + raise ValueError("Invalid value for `product_id`, must not be `None`") # noqa: E501 + + self._product_id = product_id + + @property + def amount(self): + """Gets the amount of this FixedTermLendRequest. # noqa: E501 + + Subscription amount # noqa: E501 + + :return: The amount of this FixedTermLendRequest. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this FixedTermLendRequest. + + Subscription amount # noqa: E501 + + :param amount: The amount of this FixedTermLendRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def year_rate(self): + """Gets the year_rate of this FixedTermLendRequest. # noqa: E501 + + Annual interest rate # noqa: E501 + + :return: The year_rate of this FixedTermLendRequest. # noqa: E501 + :rtype: str + """ + return self._year_rate + + @year_rate.setter + def year_rate(self, year_rate): + """Sets the year_rate of this FixedTermLendRequest. + + Annual interest rate # noqa: E501 + + :param year_rate: The year_rate of this FixedTermLendRequest. # noqa: E501 + :type: str + """ + + self._year_rate = year_rate + + @property + def reinvest_status(self): + """Gets the reinvest_status of this FixedTermLendRequest. # noqa: E501 + + Auto-renewal status: 0 for disabled, 1 for enabled # noqa: E501 + + :return: The reinvest_status of this FixedTermLendRequest. # noqa: E501 + :rtype: int + """ + return self._reinvest_status + + @reinvest_status.setter + def reinvest_status(self, reinvest_status): + """Sets the reinvest_status of this FixedTermLendRequest. + + Auto-renewal status: 0 for disabled, 1 for enabled # noqa: E501 + + :param reinvest_status: The reinvest_status of this FixedTermLendRequest. # noqa: E501 + :type: int + """ + + self._reinvest_status = reinvest_status + + @property + def redeem_account_type(self): + """Gets the redeem_account_type of this FixedTermLendRequest. # noqa: E501 + + Redemption payout account type: 1 for spot account # noqa: E501 + + :return: The redeem_account_type of this FixedTermLendRequest. # noqa: E501 + :rtype: int + """ + return self._redeem_account_type + + @redeem_account_type.setter + def redeem_account_type(self, redeem_account_type): + """Sets the redeem_account_type of this FixedTermLendRequest. + + Redemption payout account type: 1 for spot account # noqa: E501 + + :param redeem_account_type: The redeem_account_type of this FixedTermLendRequest. # noqa: E501 + :type: int + """ + + self._redeem_account_type = redeem_account_type + + @property + def financial_rate_id(self): + """Gets the financial_rate_id of this FixedTermLendRequest. # noqa: E501 + + Interest rate boost coupon ID, 0 means not used # noqa: E501 + + :return: The financial_rate_id of this FixedTermLendRequest. # noqa: E501 + :rtype: int + """ + return self._financial_rate_id + + @financial_rate_id.setter + def financial_rate_id(self, financial_rate_id): + """Sets the financial_rate_id of this FixedTermLendRequest. + + Interest rate boost coupon ID, 0 means not used # noqa: E501 + + :param financial_rate_id: The financial_rate_id of this FixedTermLendRequest. # noqa: E501 + :type: int + """ + + self._financial_rate_id = financial_rate_id + + @property + def sub_business(self): + """Gets the sub_business of this FixedTermLendRequest. # noqa: E501 + + Sub-business type # noqa: E501 + + :return: The sub_business of this FixedTermLendRequest. # noqa: E501 + :rtype: int + """ + return self._sub_business + + @sub_business.setter + def sub_business(self, sub_business): + """Sets the sub_business of this FixedTermLendRequest. + + Sub-business type # noqa: E501 + + :param sub_business: The sub_business of this FixedTermLendRequest. # noqa: E501 + :type: int + """ + + self._sub_business = sub_business + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FixedTermLendRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FixedTermLendRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fixed_term_product.py b/gate_api/models/fixed_term_product.py new file mode 100644 index 00000000..5de6e1aa --- /dev/null +++ b/gate_api/models/fixed_term_product.py @@ -0,0 +1,627 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FixedTermProduct(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'name': 'str', + 'asset': 'str', + 'lock_up_period': 'int', + 'min_lend_amount': 'str', + 'user_max_lend_amount': 'str', + 'total_lend_amount': 'str', + 'year_rate': 'str', + 'type': 'int', + 'pre_redeem': 'int', + 'reinvest': 'int', + 'redeem_account': 'int', + 'min_vip': 'int', + 'max_vip': 'int', + 'status': 'int', + 'create_time': 'str', + 'user_max_lend_volume': 'str', + 'user_total_amount': 'str', + 'sale_status': 'int' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'asset': 'asset', + 'lock_up_period': 'lock_up_period', + 'min_lend_amount': 'min_lend_amount', + 'user_max_lend_amount': 'user_max_lend_amount', + 'total_lend_amount': 'total_lend_amount', + 'year_rate': 'year_rate', + 'type': 'type', + 'pre_redeem': 'pre_redeem', + 'reinvest': 'reinvest', + 'redeem_account': 'redeem_account', + 'min_vip': 'min_vip', + 'max_vip': 'max_vip', + 'status': 'status', + 'create_time': 'create_time', + 'user_max_lend_volume': 'user_max_lend_volume', + 'user_total_amount': 'user_total_amount', + 'sale_status': 'sale_status' + } + + def __init__(self, id=None, name=None, asset=None, lock_up_period=None, min_lend_amount=None, user_max_lend_amount=None, total_lend_amount=None, year_rate=None, type=None, pre_redeem=None, reinvest=None, redeem_account=None, min_vip=None, max_vip=None, status=None, create_time=None, user_max_lend_volume=None, user_total_amount=None, sale_status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, int, str, str, str, str, int, int, int, int, int, int, int, str, str, str, int, Configuration) -> None + """FixedTermProduct - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._name = None + self._asset = None + self._lock_up_period = None + self._min_lend_amount = None + self._user_max_lend_amount = None + self._total_lend_amount = None + self._year_rate = None + self._type = None + self._pre_redeem = None + self._reinvest = None + self._redeem_account = None + self._min_vip = None + self._max_vip = None + self._status = None + self._create_time = None + self._user_max_lend_volume = None + self._user_total_amount = None + self._sale_status = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + if asset is not None: + self.asset = asset + if lock_up_period is not None: + self.lock_up_period = lock_up_period + if min_lend_amount is not None: + self.min_lend_amount = min_lend_amount + if user_max_lend_amount is not None: + self.user_max_lend_amount = user_max_lend_amount + if total_lend_amount is not None: + self.total_lend_amount = total_lend_amount + if year_rate is not None: + self.year_rate = year_rate + if type is not None: + self.type = type + if pre_redeem is not None: + self.pre_redeem = pre_redeem + if reinvest is not None: + self.reinvest = reinvest + if redeem_account is not None: + self.redeem_account = redeem_account + if min_vip is not None: + self.min_vip = min_vip + if max_vip is not None: + self.max_vip = max_vip + if status is not None: + self.status = status + if create_time is not None: + self.create_time = create_time + if user_max_lend_volume is not None: + self.user_max_lend_volume = user_max_lend_volume + if user_total_amount is not None: + self.user_total_amount = user_total_amount + if sale_status is not None: + self.sale_status = sale_status + + @property + def id(self): + """Gets the id of this FixedTermProduct. # noqa: E501 + + Product ID # noqa: E501 + + :return: The id of this FixedTermProduct. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FixedTermProduct. + + Product ID # noqa: E501 + + :param id: The id of this FixedTermProduct. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this FixedTermProduct. # noqa: E501 + + Product name # noqa: E501 + + :return: The name of this FixedTermProduct. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this FixedTermProduct. + + Product name # noqa: E501 + + :param name: The name of this FixedTermProduct. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def asset(self): + """Gets the asset of this FixedTermProduct. # noqa: E501 + + Currency # noqa: E501 + + :return: The asset of this FixedTermProduct. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this FixedTermProduct. + + Currency # noqa: E501 + + :param asset: The asset of this FixedTermProduct. # noqa: E501 + :type: str + """ + + self._asset = asset + + @property + def lock_up_period(self): + """Gets the lock_up_period of this FixedTermProduct. # noqa: E501 + + Lock-up period (in days) # noqa: E501 + + :return: The lock_up_period of this FixedTermProduct. # noqa: E501 + :rtype: int + """ + return self._lock_up_period + + @lock_up_period.setter + def lock_up_period(self, lock_up_period): + """Sets the lock_up_period of this FixedTermProduct. + + Lock-up period (in days) # noqa: E501 + + :param lock_up_period: The lock_up_period of this FixedTermProduct. # noqa: E501 + :type: int + """ + + self._lock_up_period = lock_up_period + + @property + def min_lend_amount(self): + """Gets the min_lend_amount of this FixedTermProduct. # noqa: E501 + + Minimum earn amount # noqa: E501 + + :return: The min_lend_amount of this FixedTermProduct. # noqa: E501 + :rtype: str + """ + return self._min_lend_amount + + @min_lend_amount.setter + def min_lend_amount(self, min_lend_amount): + """Sets the min_lend_amount of this FixedTermProduct. + + Minimum earn amount # noqa: E501 + + :param min_lend_amount: The min_lend_amount of this FixedTermProduct. # noqa: E501 + :type: str + """ + + self._min_lend_amount = min_lend_amount + + @property + def user_max_lend_amount(self): + """Gets the user_max_lend_amount of this FixedTermProduct. # noqa: E501 + + User maximum earn limit # noqa: E501 + + :return: The user_max_lend_amount of this FixedTermProduct. # noqa: E501 + :rtype: str + """ + return self._user_max_lend_amount + + @user_max_lend_amount.setter + def user_max_lend_amount(self, user_max_lend_amount): + """Sets the user_max_lend_amount of this FixedTermProduct. + + User maximum earn limit # noqa: E501 + + :param user_max_lend_amount: The user_max_lend_amount of this FixedTermProduct. # noqa: E501 + :type: str + """ + + self._user_max_lend_amount = user_max_lend_amount + + @property + def total_lend_amount(self): + """Gets the total_lend_amount of this FixedTermProduct. # noqa: E501 + + Platform earn limit # noqa: E501 + + :return: The total_lend_amount of this FixedTermProduct. # noqa: E501 + :rtype: str + """ + return self._total_lend_amount + + @total_lend_amount.setter + def total_lend_amount(self, total_lend_amount): + """Sets the total_lend_amount of this FixedTermProduct. + + Platform earn limit # noqa: E501 + + :param total_lend_amount: The total_lend_amount of this FixedTermProduct. # noqa: E501 + :type: str + """ + + self._total_lend_amount = total_lend_amount + + @property + def year_rate(self): + """Gets the year_rate of this FixedTermProduct. # noqa: E501 + + Annual interest rate # noqa: E501 + + :return: The year_rate of this FixedTermProduct. # noqa: E501 + :rtype: str + """ + return self._year_rate + + @year_rate.setter + def year_rate(self, year_rate): + """Sets the year_rate of this FixedTermProduct. + + Annual interest rate # noqa: E501 + + :param year_rate: The year_rate of this FixedTermProduct. # noqa: E501 + :type: str + """ + + self._year_rate = year_rate + + @property + def type(self): + """Gets the type of this FixedTermProduct. # noqa: E501 + + Product type: 1 for regular, 2 for VIP # noqa: E501 + + :return: The type of this FixedTermProduct. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this FixedTermProduct. + + Product type: 1 for regular, 2 for VIP # noqa: E501 + + :param type: The type of this FixedTermProduct. # noqa: E501 + :type: int + """ + + self._type = type + + @property + def pre_redeem(self): + """Gets the pre_redeem of this FixedTermProduct. # noqa: E501 + + Whether early redemption is supported: 0 for not supported, 1 for supported # noqa: E501 + + :return: The pre_redeem of this FixedTermProduct. # noqa: E501 + :rtype: int + """ + return self._pre_redeem + + @pre_redeem.setter + def pre_redeem(self, pre_redeem): + """Sets the pre_redeem of this FixedTermProduct. + + Whether early redemption is supported: 0 for not supported, 1 for supported # noqa: E501 + + :param pre_redeem: The pre_redeem of this FixedTermProduct. # noqa: E501 + :type: int + """ + + self._pre_redeem = pre_redeem + + @property + def reinvest(self): + """Gets the reinvest of this FixedTermProduct. # noqa: E501 + + Whether auto-renewal is supported: 0 for not supported, 1 for supported # noqa: E501 + + :return: The reinvest of this FixedTermProduct. # noqa: E501 + :rtype: int + """ + return self._reinvest + + @reinvest.setter + def reinvest(self, reinvest): + """Sets the reinvest of this FixedTermProduct. + + Whether auto-renewal is supported: 0 for not supported, 1 for supported # noqa: E501 + + :param reinvest: The reinvest of this FixedTermProduct. # noqa: E501 + :type: int + """ + + self._reinvest = reinvest + + @property + def redeem_account(self): + """Gets the redeem_account of this FixedTermProduct. # noqa: E501 + + Whether fixed-to-flexible conversion is supported: 0 for not supported, 1 for supported # noqa: E501 + + :return: The redeem_account of this FixedTermProduct. # noqa: E501 + :rtype: int + """ + return self._redeem_account + + @redeem_account.setter + def redeem_account(self, redeem_account): + """Sets the redeem_account of this FixedTermProduct. + + Whether fixed-to-flexible conversion is supported: 0 for not supported, 1 for supported # noqa: E501 + + :param redeem_account: The redeem_account of this FixedTermProduct. # noqa: E501 + :type: int + """ + + self._redeem_account = redeem_account + + @property + def min_vip(self): + """Gets the min_vip of this FixedTermProduct. # noqa: E501 + + Minimum VIP level requirement, 0-16, 0 means no restriction # noqa: E501 + + :return: The min_vip of this FixedTermProduct. # noqa: E501 + :rtype: int + """ + return self._min_vip + + @min_vip.setter + def min_vip(self, min_vip): + """Sets the min_vip of this FixedTermProduct. + + Minimum VIP level requirement, 0-16, 0 means no restriction # noqa: E501 + + :param min_vip: The min_vip of this FixedTermProduct. # noqa: E501 + :type: int + """ + + self._min_vip = min_vip + + @property + def max_vip(self): + """Gets the max_vip of this FixedTermProduct. # noqa: E501 + + Maximum VIP level requirement (0-16), 0 means no restriction # noqa: E501 + + :return: The max_vip of this FixedTermProduct. # noqa: E501 + :rtype: int + """ + return self._max_vip + + @max_vip.setter + def max_vip(self, max_vip): + """Sets the max_vip of this FixedTermProduct. + + Maximum VIP level requirement (0-16), 0 means no restriction # noqa: E501 + + :param max_vip: The max_vip of this FixedTermProduct. # noqa: E501 + :type: int + """ + + self._max_vip = max_vip + + @property + def status(self): + """Gets the status of this FixedTermProduct. # noqa: E501 + + Product status: 1 for unlisted, 2 for listed, 3 for delisted # noqa: E501 + + :return: The status of this FixedTermProduct. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this FixedTermProduct. + + Product status: 1 for unlisted, 2 for listed, 3 for delisted # noqa: E501 + + :param status: The status of this FixedTermProduct. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def create_time(self): + """Gets the create_time of this FixedTermProduct. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this FixedTermProduct. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this FixedTermProduct. + + Created time # noqa: E501 + + :param create_time: The create_time of this FixedTermProduct. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + @property + def user_max_lend_volume(self): + """Gets the user_max_lend_volume of this FixedTermProduct. # noqa: E501 + + User maximum earn amount # noqa: E501 + + :return: The user_max_lend_volume of this FixedTermProduct. # noqa: E501 + :rtype: str + """ + return self._user_max_lend_volume + + @user_max_lend_volume.setter + def user_max_lend_volume(self, user_max_lend_volume): + """Sets the user_max_lend_volume of this FixedTermProduct. + + User maximum earn amount # noqa: E501 + + :param user_max_lend_volume: The user_max_lend_volume of this FixedTermProduct. # noqa: E501 + :type: str + """ + + self._user_max_lend_volume = user_max_lend_volume + + @property + def user_total_amount(self): + """Gets the user_total_amount of this FixedTermProduct. # noqa: E501 + + Total amount the user has invested in earn products # noqa: E501 + + :return: The user_total_amount of this FixedTermProduct. # noqa: E501 + :rtype: str + """ + return self._user_total_amount + + @user_total_amount.setter + def user_total_amount(self, user_total_amount): + """Sets the user_total_amount of this FixedTermProduct. + + Total amount the user has invested in earn products # noqa: E501 + + :param user_total_amount: The user_total_amount of this FixedTermProduct. # noqa: E501 + :type: str + """ + + self._user_total_amount = user_total_amount + + @property + def sale_status(self): + """Gets the sale_status of this FixedTermProduct. # noqa: E501 + + Sale status: 1 for on sale, 2 for sold out # noqa: E501 + + :return: The sale_status of this FixedTermProduct. # noqa: E501 + :rtype: int + """ + return self._sale_status + + @sale_status.setter + def sale_status(self, sale_status): + """Sets the sale_status of this FixedTermProduct. + + Sale status: 1 for on sale, 2 for sold out # noqa: E501 + + :param sale_status: The sale_status of this FixedTermProduct. # noqa: E501 + :type: int + """ + + self._sale_status = sale_status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FixedTermProduct): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FixedTermProduct): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fixed_term_product_info.py b/gate_api/models/fixed_term_product_info.py new file mode 100644 index 00000000..6204ae81 --- /dev/null +++ b/gate_api/models/fixed_term_product_info.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FixedTermProductInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'pre_redeem': 'int', + 'reinvest': 'int', + 'redeem_account': 'int', + 'min_vip': 'int', + 'max_vip': 'int' + } + + attribute_map = { + 'pre_redeem': 'pre_redeem', + 'reinvest': 'reinvest', + 'redeem_account': 'redeem_account', + 'min_vip': 'min_vip', + 'max_vip': 'max_vip' + } + + def __init__(self, pre_redeem=None, reinvest=None, redeem_account=None, min_vip=None, max_vip=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, int, int, Configuration) -> None + """FixedTermProductInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._pre_redeem = None + self._reinvest = None + self._redeem_account = None + self._min_vip = None + self._max_vip = None + self.discriminator = None + + self.pre_redeem = pre_redeem + self.reinvest = reinvest + self.redeem_account = redeem_account + self.min_vip = min_vip + self.max_vip = max_vip + + @property + def pre_redeem(self): + """Gets the pre_redeem of this FixedTermProductInfo. # noqa: E501 + + Whether early redemption is supported: 0 for not supported, 1 for supported # noqa: E501 + + :return: The pre_redeem of this FixedTermProductInfo. # noqa: E501 + :rtype: int + """ + return self._pre_redeem + + @pre_redeem.setter + def pre_redeem(self, pre_redeem): + """Sets the pre_redeem of this FixedTermProductInfo. + + Whether early redemption is supported: 0 for not supported, 1 for supported # noqa: E501 + + :param pre_redeem: The pre_redeem of this FixedTermProductInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and pre_redeem is None: # noqa: E501 + raise ValueError("Invalid value for `pre_redeem`, must not be `None`") # noqa: E501 + + self._pre_redeem = pre_redeem + + @property + def reinvest(self): + """Gets the reinvest of this FixedTermProductInfo. # noqa: E501 + + Whether auto-renewal is supported: 0 for not supported, 1 for supported # noqa: E501 + + :return: The reinvest of this FixedTermProductInfo. # noqa: E501 + :rtype: int + """ + return self._reinvest + + @reinvest.setter + def reinvest(self, reinvest): + """Sets the reinvest of this FixedTermProductInfo. + + Whether auto-renewal is supported: 0 for not supported, 1 for supported # noqa: E501 + + :param reinvest: The reinvest of this FixedTermProductInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and reinvest is None: # noqa: E501 + raise ValueError("Invalid value for `reinvest`, must not be `None`") # noqa: E501 + + self._reinvest = reinvest + + @property + def redeem_account(self): + """Gets the redeem_account of this FixedTermProductInfo. # noqa: E501 + + Redemption payout account type # noqa: E501 + + :return: The redeem_account of this FixedTermProductInfo. # noqa: E501 + :rtype: int + """ + return self._redeem_account + + @redeem_account.setter + def redeem_account(self, redeem_account): + """Sets the redeem_account of this FixedTermProductInfo. + + Redemption payout account type # noqa: E501 + + :param redeem_account: The redeem_account of this FixedTermProductInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and redeem_account is None: # noqa: E501 + raise ValueError("Invalid value for `redeem_account`, must not be `None`") # noqa: E501 + + self._redeem_account = redeem_account + + @property + def min_vip(self): + """Gets the min_vip of this FixedTermProductInfo. # noqa: E501 + + Minimum VIP level requirement, 0 means no restriction # noqa: E501 + + :return: The min_vip of this FixedTermProductInfo. # noqa: E501 + :rtype: int + """ + return self._min_vip + + @min_vip.setter + def min_vip(self, min_vip): + """Sets the min_vip of this FixedTermProductInfo. + + Minimum VIP level requirement, 0 means no restriction # noqa: E501 + + :param min_vip: The min_vip of this FixedTermProductInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and min_vip is None: # noqa: E501 + raise ValueError("Invalid value for `min_vip`, must not be `None`") # noqa: E501 + + self._min_vip = min_vip + + @property + def max_vip(self): + """Gets the max_vip of this FixedTermProductInfo. # noqa: E501 + + Maximum VIP level requirement, 0 means no restriction # noqa: E501 + + :return: The max_vip of this FixedTermProductInfo. # noqa: E501 + :rtype: int + """ + return self._max_vip + + @max_vip.setter + def max_vip(self, max_vip): + """Sets the max_vip of this FixedTermProductInfo. + + Maximum VIP level requirement, 0 means no restriction # noqa: E501 + + :param max_vip: The max_vip of this FixedTermProductInfo. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and max_vip is None: # noqa: E501 + raise ValueError("Invalid value for `max_vip`, must not be `None`") # noqa: E501 + + self._max_vip = max_vip + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FixedTermProductInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FixedTermProductInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/fixed_term_product_simple.py b/gate_api/models/fixed_term_product_simple.py new file mode 100644 index 00000000..a34dda56 --- /dev/null +++ b/gate_api/models/fixed_term_product_simple.py @@ -0,0 +1,403 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FixedTermProductSimple(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'asset': 'str', + 'lock_up_period': 'int', + 'year_rate': 'str', + 'type': 'int', + 'pre_redeem': 'int', + 'reinvest': 'int', + 'simple_earn': 'int', + 'min_vip': 'int', + 'max_vip': 'int', + 'sale_status': 'int' + } + + attribute_map = { + 'id': 'id', + 'asset': 'asset', + 'lock_up_period': 'lock_up_period', + 'year_rate': 'year_rate', + 'type': 'type', + 'pre_redeem': 'pre_redeem', + 'reinvest': 'reinvest', + 'simple_earn': 'simple_earn', + 'min_vip': 'min_vip', + 'max_vip': 'max_vip', + 'sale_status': 'sale_status' + } + + def __init__(self, id=None, asset=None, lock_up_period=None, year_rate=None, type=None, pre_redeem=None, reinvest=None, simple_earn=None, min_vip=None, max_vip=None, sale_status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, int, str, int, int, int, int, int, int, int, Configuration) -> None + """FixedTermProductSimple - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._asset = None + self._lock_up_period = None + self._year_rate = None + self._type = None + self._pre_redeem = None + self._reinvest = None + self._simple_earn = None + self._min_vip = None + self._max_vip = None + self._sale_status = None + self.discriminator = None + + if id is not None: + self.id = id + if asset is not None: + self.asset = asset + if lock_up_period is not None: + self.lock_up_period = lock_up_period + if year_rate is not None: + self.year_rate = year_rate + if type is not None: + self.type = type + if pre_redeem is not None: + self.pre_redeem = pre_redeem + if reinvest is not None: + self.reinvest = reinvest + if simple_earn is not None: + self.simple_earn = simple_earn + if min_vip is not None: + self.min_vip = min_vip + if max_vip is not None: + self.max_vip = max_vip + if sale_status is not None: + self.sale_status = sale_status + + @property + def id(self): + """Gets the id of this FixedTermProductSimple. # noqa: E501 + + Product ID # noqa: E501 + + :return: The id of this FixedTermProductSimple. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FixedTermProductSimple. + + Product ID # noqa: E501 + + :param id: The id of this FixedTermProductSimple. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def asset(self): + """Gets the asset of this FixedTermProductSimple. # noqa: E501 + + Currency # noqa: E501 + + :return: The asset of this FixedTermProductSimple. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this FixedTermProductSimple. + + Currency # noqa: E501 + + :param asset: The asset of this FixedTermProductSimple. # noqa: E501 + :type: str + """ + + self._asset = asset + + @property + def lock_up_period(self): + """Gets the lock_up_period of this FixedTermProductSimple. # noqa: E501 + + Lock-up period (in days) # noqa: E501 + + :return: The lock_up_period of this FixedTermProductSimple. # noqa: E501 + :rtype: int + """ + return self._lock_up_period + + @lock_up_period.setter + def lock_up_period(self, lock_up_period): + """Sets the lock_up_period of this FixedTermProductSimple. + + Lock-up period (in days) # noqa: E501 + + :param lock_up_period: The lock_up_period of this FixedTermProductSimple. # noqa: E501 + :type: int + """ + + self._lock_up_period = lock_up_period + + @property + def year_rate(self): + """Gets the year_rate of this FixedTermProductSimple. # noqa: E501 + + Annual interest rate # noqa: E501 + + :return: The year_rate of this FixedTermProductSimple. # noqa: E501 + :rtype: str + """ + return self._year_rate + + @year_rate.setter + def year_rate(self, year_rate): + """Sets the year_rate of this FixedTermProductSimple. + + Annual interest rate # noqa: E501 + + :param year_rate: The year_rate of this FixedTermProductSimple. # noqa: E501 + :type: str + """ + + self._year_rate = year_rate + + @property + def type(self): + """Gets the type of this FixedTermProductSimple. # noqa: E501 + + Product type: 1 for regular, 2 for VIP # noqa: E501 + + :return: The type of this FixedTermProductSimple. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this FixedTermProductSimple. + + Product type: 1 for regular, 2 for VIP # noqa: E501 + + :param type: The type of this FixedTermProductSimple. # noqa: E501 + :type: int + """ + + self._type = type + + @property + def pre_redeem(self): + """Gets the pre_redeem of this FixedTermProductSimple. # noqa: E501 + + Whether early redemption is supported: 0 for not supported, 1 for supported # noqa: E501 + + :return: The pre_redeem of this FixedTermProductSimple. # noqa: E501 + :rtype: int + """ + return self._pre_redeem + + @pre_redeem.setter + def pre_redeem(self, pre_redeem): + """Sets the pre_redeem of this FixedTermProductSimple. + + Whether early redemption is supported: 0 for not supported, 1 for supported # noqa: E501 + + :param pre_redeem: The pre_redeem of this FixedTermProductSimple. # noqa: E501 + :type: int + """ + + self._pre_redeem = pre_redeem + + @property + def reinvest(self): + """Gets the reinvest of this FixedTermProductSimple. # noqa: E501 + + Whether auto-renewal is supported: 0 for not supported, 1 for supported # noqa: E501 + + :return: The reinvest of this FixedTermProductSimple. # noqa: E501 + :rtype: int + """ + return self._reinvest + + @reinvest.setter + def reinvest(self, reinvest): + """Sets the reinvest of this FixedTermProductSimple. + + Whether auto-renewal is supported: 0 for not supported, 1 for supported # noqa: E501 + + :param reinvest: The reinvest of this FixedTermProductSimple. # noqa: E501 + :type: int + """ + + self._reinvest = reinvest + + @property + def simple_earn(self): + """Gets the simple_earn of this FixedTermProductSimple. # noqa: E501 + + Whether fixed-to-flexible conversion is supported: 0 for not supported, 1 for supported # noqa: E501 + + :return: The simple_earn of this FixedTermProductSimple. # noqa: E501 + :rtype: int + """ + return self._simple_earn + + @simple_earn.setter + def simple_earn(self, simple_earn): + """Sets the simple_earn of this FixedTermProductSimple. + + Whether fixed-to-flexible conversion is supported: 0 for not supported, 1 for supported # noqa: E501 + + :param simple_earn: The simple_earn of this FixedTermProductSimple. # noqa: E501 + :type: int + """ + + self._simple_earn = simple_earn + + @property + def min_vip(self): + """Gets the min_vip of this FixedTermProductSimple. # noqa: E501 + + Minimum VIP level requirement, 0 means no restriction # noqa: E501 + + :return: The min_vip of this FixedTermProductSimple. # noqa: E501 + :rtype: int + """ + return self._min_vip + + @min_vip.setter + def min_vip(self, min_vip): + """Sets the min_vip of this FixedTermProductSimple. + + Minimum VIP level requirement, 0 means no restriction # noqa: E501 + + :param min_vip: The min_vip of this FixedTermProductSimple. # noqa: E501 + :type: int + """ + + self._min_vip = min_vip + + @property + def max_vip(self): + """Gets the max_vip of this FixedTermProductSimple. # noqa: E501 + + Maximum VIP level requirement, 0 means no restriction # noqa: E501 + + :return: The max_vip of this FixedTermProductSimple. # noqa: E501 + :rtype: int + """ + return self._max_vip + + @max_vip.setter + def max_vip(self, max_vip): + """Sets the max_vip of this FixedTermProductSimple. + + Maximum VIP level requirement, 0 means no restriction # noqa: E501 + + :param max_vip: The max_vip of this FixedTermProductSimple. # noqa: E501 + :type: int + """ + + self._max_vip = max_vip + + @property + def sale_status(self): + """Gets the sale_status of this FixedTermProductSimple. # noqa: E501 + + Sale status: 1 for on sale, 2 for sold out # noqa: E501 + + :return: The sale_status of this FixedTermProductSimple. # noqa: E501 + :rtype: int + """ + return self._sale_status + + @sale_status.setter + def sale_status(self, sale_status): + """Sets the sale_status of this FixedTermProductSimple. + + Sale status: 1 for on sale, 2 for sold out # noqa: E501 + + :param sale_status: The sale_status of this FixedTermProductSimple. # noqa: E501 + :type: int + """ + + self._sale_status = sale_status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FixedTermProductSimple): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FixedTermProductSimple): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_error_response.py b/gate_api/models/flash_swap_error_response.py new file mode 100644 index 00000000..f7a8b2a9 --- /dev/null +++ b/gate_api/models/flash_swap_error_response.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapErrorResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message' + } + + def __init__(self, code=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """FlashSwapErrorResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self.discriminator = None + + self.code = code + self.message = message + + @property + def code(self): + """Gets the code of this FlashSwapErrorResponse. # noqa: E501 + + Error code # noqa: E501 + + :return: The code of this FlashSwapErrorResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this FlashSwapErrorResponse. + + Error code # noqa: E501 + + :param code: The code of this FlashSwapErrorResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this FlashSwapErrorResponse. # noqa: E501 + + Error message # noqa: E501 + + :return: The message of this FlashSwapErrorResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this FlashSwapErrorResponse. + + Error message # noqa: E501 + + :param message: The message of this FlashSwapErrorResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapErrorResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapErrorResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_create_param.py b/gate_api/models/flash_swap_multi_currency_create_param.py new file mode 100644 index 00000000..6815042d --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_create_param.py @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyCreateParam(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'sell_asset': 'str', + 'sell_amount': 'str', + 'buy_asset': 'str', + 'buy_amount': 'str' + } + + attribute_map = { + 'sell_asset': 'sell_asset', + 'sell_amount': 'sell_amount', + 'buy_asset': 'buy_asset', + 'buy_amount': 'buy_amount' + } + + def __init__(self, sell_asset=None, sell_amount=None, buy_asset=None, buy_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """FlashSwapMultiCurrencyCreateParam - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._sell_asset = None + self._sell_amount = None + self._buy_asset = None + self._buy_amount = None + self.discriminator = None + + self.sell_asset = sell_asset + self.sell_amount = sell_amount + self.buy_asset = buy_asset + self.buy_amount = buy_amount + + @property + def sell_asset(self): + """Gets the sell_asset of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + + Currency to sell # noqa: E501 + + :return: The sell_asset of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + :rtype: str + """ + return self._sell_asset + + @sell_asset.setter + def sell_asset(self, sell_asset): + """Sets the sell_asset of this FlashSwapMultiCurrencyCreateParam. + + Currency to sell # noqa: E501 + + :param sell_asset: The sell_asset of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sell_asset is None: # noqa: E501 + raise ValueError("Invalid value for `sell_asset`, must not be `None`") # noqa: E501 + + self._sell_asset = sell_asset + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + + Sell amount # noqa: E501 + + :return: The sell_amount of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapMultiCurrencyCreateParam. + + Sell amount # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sell_amount is None: # noqa: E501 + raise ValueError("Invalid value for `sell_amount`, must not be `None`") # noqa: E501 + + self._sell_amount = sell_amount + + @property + def buy_asset(self): + """Gets the buy_asset of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + + Currency to buy # noqa: E501 + + :return: The buy_asset of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + :rtype: str + """ + return self._buy_asset + + @buy_asset.setter + def buy_asset(self, buy_asset): + """Sets the buy_asset of this FlashSwapMultiCurrencyCreateParam. + + Currency to buy # noqa: E501 + + :param buy_asset: The buy_asset of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and buy_asset is None: # noqa: E501 + raise ValueError("Invalid value for `buy_asset`, must not be `None`") # noqa: E501 + + self._buy_asset = buy_asset + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + + Buy amount # noqa: E501 + + :return: The buy_amount of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapMultiCurrencyCreateParam. + + Buy amount # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapMultiCurrencyCreateParam. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and buy_amount is None: # noqa: E501 + raise ValueError("Invalid value for `buy_amount`, must not be `None`") # noqa: E501 + + self._buy_amount = buy_amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyCreateParam): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyCreateParam): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_many_to_one_order_create_req.py b/gate_api/models/flash_swap_multi_currency_many_to_one_order_create_req.py new file mode 100644 index 00000000..fb432492 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_many_to_one_order_create_req.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyManyToOneOrderCreateReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'params': 'list[FlashSwapMultiCurrencyCreateParam]' + } + + attribute_map = { + 'params': 'params' + } + + def __init__(self, params=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FlashSwapMultiCurrencyCreateParam], Configuration) -> None + """FlashSwapMultiCurrencyManyToOneOrderCreateReq - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._params = None + self.discriminator = None + + self.params = params + + @property + def params(self): + """Gets the params of this FlashSwapMultiCurrencyManyToOneOrderCreateReq. # noqa: E501 + + Multi-currency exchange parameter list # noqa: E501 + + :return: The params of this FlashSwapMultiCurrencyManyToOneOrderCreateReq. # noqa: E501 + :rtype: list[FlashSwapMultiCurrencyCreateParam] + """ + return self._params + + @params.setter + def params(self, params): + """Sets the params of this FlashSwapMultiCurrencyManyToOneOrderCreateReq. + + Multi-currency exchange parameter list # noqa: E501 + + :param params: The params of this FlashSwapMultiCurrencyManyToOneOrderCreateReq. # noqa: E501 + :type: list[FlashSwapMultiCurrencyCreateParam] + """ + if self.local_vars_configuration.client_side_validation and params is None: # noqa: E501 + raise ValueError("Invalid value for `params`, must not be `None`") # noqa: E501 + + self._params = params + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderCreateReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderCreateReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_many_to_one_order_create_resp.py b/gate_api/models/flash_swap_multi_currency_many_to_one_order_create_resp.py new file mode 100644 index 00000000..0c675911 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_many_to_one_order_create_resp.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyManyToOneOrderCreateResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'FlashSwapMultiCurrencyManyToOneOrderCreateRespData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, FlashSwapMultiCurrencyManyToOneOrderCreateRespData, int, Configuration) -> None + """FlashSwapMultiCurrencyManyToOneOrderCreateResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + + Response code, 0 means success # noqa: E501 + + :return: The code of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. + + Response code, 0 means success # noqa: E501 + + :param code: The code of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. + + Response message # noqa: E501 + + :param message: The message of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + + + :return: The data of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + :rtype: FlashSwapMultiCurrencyManyToOneOrderCreateRespData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. + + + :param data: The data of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + :type: FlashSwapMultiCurrencyManyToOneOrderCreateRespData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + + Response timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. + + Response timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this FlashSwapMultiCurrencyManyToOneOrderCreateResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderCreateResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderCreateResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_many_to_one_order_create_resp_data.py b/gate_api/models/flash_swap_multi_currency_many_to_one_order_create_resp_data.py new file mode 100644 index 00000000..9c0cc892 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_many_to_one_order_create_resp_data.py @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyManyToOneOrderCreateRespData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'orders': 'list[FlashSwapMultiCurrencyOrder]', + 'account_mode': 'int', + 'exchange_time_ms': 'int', + 'total_acquire_amount': 'str' + } + + attribute_map = { + 'orders': 'orders', + 'account_mode': 'account_mode', + 'exchange_time_ms': 'exchange_time_ms', + 'total_acquire_amount': 'total_acquire_amount' + } + + def __init__(self, orders=None, account_mode=None, exchange_time_ms=None, total_acquire_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FlashSwapMultiCurrencyOrder], int, int, str, Configuration) -> None + """FlashSwapMultiCurrencyManyToOneOrderCreateRespData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._orders = None + self._account_mode = None + self._exchange_time_ms = None + self._total_acquire_amount = None + self.discriminator = None + + self.orders = orders + self.account_mode = account_mode + self.exchange_time_ms = exchange_time_ms + self.total_acquire_amount = total_acquire_amount + + @property + def orders(self): + """Gets the orders of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + + Order list # noqa: E501 + + :return: The orders of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + :rtype: list[FlashSwapMultiCurrencyOrder] + """ + return self._orders + + @orders.setter + def orders(self, orders): + """Sets the orders of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. + + Order list # noqa: E501 + + :param orders: The orders of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + :type: list[FlashSwapMultiCurrencyOrder] + """ + if self.local_vars_configuration.client_side_validation and orders is None: # noqa: E501 + raise ValueError("Invalid value for `orders`, must not be `None`") # noqa: E501 + + self._orders = orders + + @property + def account_mode(self): + """Gets the account_mode of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + + Account Mode # noqa: E501 + + :return: The account_mode of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + :rtype: int + """ + return self._account_mode + + @account_mode.setter + def account_mode(self, account_mode): + """Sets the account_mode of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. + + Account Mode # noqa: E501 + + :param account_mode: The account_mode of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and account_mode is None: # noqa: E501 + raise ValueError("Invalid value for `account_mode`, must not be `None`") # noqa: E501 + + self._account_mode = account_mode + + @property + def exchange_time_ms(self): + """Gets the exchange_time_ms of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + + Exchange timestamp (in milliseconds) # noqa: E501 + + :return: The exchange_time_ms of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + :rtype: int + """ + return self._exchange_time_ms + + @exchange_time_ms.setter + def exchange_time_ms(self, exchange_time_ms): + """Sets the exchange_time_ms of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. + + Exchange timestamp (in milliseconds) # noqa: E501 + + :param exchange_time_ms: The exchange_time_ms of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and exchange_time_ms is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_time_ms`, must not be `None`") # noqa: E501 + + self._exchange_time_ms = exchange_time_ms + + @property + def total_acquire_amount(self): + """Gets the total_acquire_amount of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + + Total amount received # noqa: E501 + + :return: The total_acquire_amount of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._total_acquire_amount + + @total_acquire_amount.setter + def total_acquire_amount(self, total_acquire_amount): + """Sets the total_acquire_amount of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. + + Total amount received # noqa: E501 + + :param total_acquire_amount: The total_acquire_amount of this FlashSwapMultiCurrencyManyToOneOrderCreateRespData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total_acquire_amount is None: # noqa: E501 + raise ValueError("Invalid value for `total_acquire_amount`, must not be `None`") # noqa: E501 + + self._total_acquire_amount = total_acquire_amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderCreateRespData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderCreateRespData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_many_to_one_order_preview_req.py b/gate_api/models/flash_swap_multi_currency_many_to_one_order_preview_req.py new file mode 100644 index 00000000..6513f9a2 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_many_to_one_order_preview_req.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyManyToOneOrderPreviewReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'params': 'list[FlashSwapMultiCurrencyPreviewParam]' + } + + attribute_map = { + 'params': 'params' + } + + def __init__(self, params=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FlashSwapMultiCurrencyPreviewParam], Configuration) -> None + """FlashSwapMultiCurrencyManyToOneOrderPreviewReq - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._params = None + self.discriminator = None + + self.params = params + + @property + def params(self): + """Gets the params of this FlashSwapMultiCurrencyManyToOneOrderPreviewReq. # noqa: E501 + + Multi-currency exchange preview parameter list # noqa: E501 + + :return: The params of this FlashSwapMultiCurrencyManyToOneOrderPreviewReq. # noqa: E501 + :rtype: list[FlashSwapMultiCurrencyPreviewParam] + """ + return self._params + + @params.setter + def params(self, params): + """Sets the params of this FlashSwapMultiCurrencyManyToOneOrderPreviewReq. + + Multi-currency exchange preview parameter list # noqa: E501 + + :param params: The params of this FlashSwapMultiCurrencyManyToOneOrderPreviewReq. # noqa: E501 + :type: list[FlashSwapMultiCurrencyPreviewParam] + """ + if self.local_vars_configuration.client_side_validation and params is None: # noqa: E501 + raise ValueError("Invalid value for `params`, must not be `None`") # noqa: E501 + + self._params = params + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderPreviewReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderPreviewReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_many_to_one_order_preview_resp.py b/gate_api/models/flash_swap_multi_currency_many_to_one_order_preview_resp.py new file mode 100644 index 00000000..782a6bba --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_many_to_one_order_preview_resp.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyManyToOneOrderPreviewResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'FlashSwapMultiCurrencyManyToOneOrderPreviewRespData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, FlashSwapMultiCurrencyManyToOneOrderPreviewRespData, int, Configuration) -> None + """FlashSwapMultiCurrencyManyToOneOrderPreviewResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + + Response code, 0 means success # noqa: E501 + + :return: The code of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. + + Response code, 0 means success # noqa: E501 + + :param code: The code of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. + + Response message # noqa: E501 + + :param message: The message of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + + + :return: The data of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + :rtype: FlashSwapMultiCurrencyManyToOneOrderPreviewRespData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. + + + :param data: The data of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + :type: FlashSwapMultiCurrencyManyToOneOrderPreviewRespData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + + Response timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. + + Response timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this FlashSwapMultiCurrencyManyToOneOrderPreviewResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderPreviewResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderPreviewResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_many_to_one_order_preview_resp_data.py b/gate_api/models/flash_swap_multi_currency_many_to_one_order_preview_resp_data.py new file mode 100644 index 00000000..4a906df5 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_many_to_one_order_preview_resp_data.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyManyToOneOrderPreviewRespData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'orders': 'list[FlashSwapMultiCurrencyPreviewOrder]', + 'total_acquire_amount': 'str' + } + + attribute_map = { + 'orders': 'orders', + 'total_acquire_amount': 'total_acquire_amount' + } + + def __init__(self, orders=None, total_acquire_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FlashSwapMultiCurrencyPreviewOrder], str, Configuration) -> None + """FlashSwapMultiCurrencyManyToOneOrderPreviewRespData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._orders = None + self._total_acquire_amount = None + self.discriminator = None + + self.orders = orders + self.total_acquire_amount = total_acquire_amount + + @property + def orders(self): + """Gets the orders of this FlashSwapMultiCurrencyManyToOneOrderPreviewRespData. # noqa: E501 + + Preview order list # noqa: E501 + + :return: The orders of this FlashSwapMultiCurrencyManyToOneOrderPreviewRespData. # noqa: E501 + :rtype: list[FlashSwapMultiCurrencyPreviewOrder] + """ + return self._orders + + @orders.setter + def orders(self, orders): + """Sets the orders of this FlashSwapMultiCurrencyManyToOneOrderPreviewRespData. + + Preview order list # noqa: E501 + + :param orders: The orders of this FlashSwapMultiCurrencyManyToOneOrderPreviewRespData. # noqa: E501 + :type: list[FlashSwapMultiCurrencyPreviewOrder] + """ + if self.local_vars_configuration.client_side_validation and orders is None: # noqa: E501 + raise ValueError("Invalid value for `orders`, must not be `None`") # noqa: E501 + + self._orders = orders + + @property + def total_acquire_amount(self): + """Gets the total_acquire_amount of this FlashSwapMultiCurrencyManyToOneOrderPreviewRespData. # noqa: E501 + + Total amount received # noqa: E501 + + :return: The total_acquire_amount of this FlashSwapMultiCurrencyManyToOneOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._total_acquire_amount + + @total_acquire_amount.setter + def total_acquire_amount(self, total_acquire_amount): + """Sets the total_acquire_amount of this FlashSwapMultiCurrencyManyToOneOrderPreviewRespData. + + Total amount received # noqa: E501 + + :param total_acquire_amount: The total_acquire_amount of this FlashSwapMultiCurrencyManyToOneOrderPreviewRespData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total_acquire_amount is None: # noqa: E501 + raise ValueError("Invalid value for `total_acquire_amount`, must not be `None`") # noqa: E501 + + self._total_acquire_amount = total_acquire_amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderPreviewRespData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyManyToOneOrderPreviewRespData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_one_to_many_order_create_req.py b/gate_api/models/flash_swap_multi_currency_one_to_many_order_create_req.py new file mode 100644 index 00000000..0cca585a --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_one_to_many_order_create_req.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyOneToManyOrderCreateReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'params': 'list[FlashSwapMultiCurrencyCreateParam]' + } + + attribute_map = { + 'params': 'params' + } + + def __init__(self, params=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FlashSwapMultiCurrencyCreateParam], Configuration) -> None + """FlashSwapMultiCurrencyOneToManyOrderCreateReq - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._params = None + self.discriminator = None + + self.params = params + + @property + def params(self): + """Gets the params of this FlashSwapMultiCurrencyOneToManyOrderCreateReq. # noqa: E501 + + Multi-currency exchange parameter list # noqa: E501 + + :return: The params of this FlashSwapMultiCurrencyOneToManyOrderCreateReq. # noqa: E501 + :rtype: list[FlashSwapMultiCurrencyCreateParam] + """ + return self._params + + @params.setter + def params(self, params): + """Sets the params of this FlashSwapMultiCurrencyOneToManyOrderCreateReq. + + Multi-currency exchange parameter list # noqa: E501 + + :param params: The params of this FlashSwapMultiCurrencyOneToManyOrderCreateReq. # noqa: E501 + :type: list[FlashSwapMultiCurrencyCreateParam] + """ + if self.local_vars_configuration.client_side_validation and params is None: # noqa: E501 + raise ValueError("Invalid value for `params`, must not be `None`") # noqa: E501 + + self._params = params + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderCreateReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderCreateReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_one_to_many_order_create_resp.py b/gate_api/models/flash_swap_multi_currency_one_to_many_order_create_resp.py new file mode 100644 index 00000000..e15fab26 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_one_to_many_order_create_resp.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyOneToManyOrderCreateResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'FlashSwapMultiCurrencyOneToManyOrderCreateRespData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, FlashSwapMultiCurrencyOneToManyOrderCreateRespData, int, Configuration) -> None + """FlashSwapMultiCurrencyOneToManyOrderCreateResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + + Response code, 0 means success # noqa: E501 + + :return: The code of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. + + Response code, 0 means success # noqa: E501 + + :param code: The code of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. + + Response message # noqa: E501 + + :param message: The message of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + + + :return: The data of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + :rtype: FlashSwapMultiCurrencyOneToManyOrderCreateRespData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. + + + :param data: The data of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + :type: FlashSwapMultiCurrencyOneToManyOrderCreateRespData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + + Response timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. + + Response timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this FlashSwapMultiCurrencyOneToManyOrderCreateResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderCreateResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderCreateResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_one_to_many_order_create_resp_data.py b/gate_api/models/flash_swap_multi_currency_one_to_many_order_create_resp_data.py new file mode 100644 index 00000000..624b9fd7 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_one_to_many_order_create_resp_data.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyOneToManyOrderCreateRespData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'orders': 'list[FlashSwapMultiCurrencyOrder]', + 'account_mode': 'int', + 'exchange_time_ms': 'int', + 'total_consume_amount': 'str', + 'total_acquire_amount': 'str' + } + + attribute_map = { + 'orders': 'orders', + 'account_mode': 'account_mode', + 'exchange_time_ms': 'exchange_time_ms', + 'total_consume_amount': 'total_consume_amount', + 'total_acquire_amount': 'total_acquire_amount' + } + + def __init__(self, orders=None, account_mode=None, exchange_time_ms=None, total_consume_amount=None, total_acquire_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FlashSwapMultiCurrencyOrder], int, int, str, str, Configuration) -> None + """FlashSwapMultiCurrencyOneToManyOrderCreateRespData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._orders = None + self._account_mode = None + self._exchange_time_ms = None + self._total_consume_amount = None + self._total_acquire_amount = None + self.discriminator = None + + self.orders = orders + self.account_mode = account_mode + self.exchange_time_ms = exchange_time_ms + self.total_consume_amount = total_consume_amount + self.total_acquire_amount = total_acquire_amount + + @property + def orders(self): + """Gets the orders of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + + Order list # noqa: E501 + + :return: The orders of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + :rtype: list[FlashSwapMultiCurrencyOrder] + """ + return self._orders + + @orders.setter + def orders(self, orders): + """Sets the orders of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. + + Order list # noqa: E501 + + :param orders: The orders of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + :type: list[FlashSwapMultiCurrencyOrder] + """ + if self.local_vars_configuration.client_side_validation and orders is None: # noqa: E501 + raise ValueError("Invalid value for `orders`, must not be `None`") # noqa: E501 + + self._orders = orders + + @property + def account_mode(self): + """Gets the account_mode of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + + Account Mode # noqa: E501 + + :return: The account_mode of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + :rtype: int + """ + return self._account_mode + + @account_mode.setter + def account_mode(self, account_mode): + """Sets the account_mode of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. + + Account Mode # noqa: E501 + + :param account_mode: The account_mode of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and account_mode is None: # noqa: E501 + raise ValueError("Invalid value for `account_mode`, must not be `None`") # noqa: E501 + + self._account_mode = account_mode + + @property + def exchange_time_ms(self): + """Gets the exchange_time_ms of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + + Exchange timestamp (in milliseconds) # noqa: E501 + + :return: The exchange_time_ms of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + :rtype: int + """ + return self._exchange_time_ms + + @exchange_time_ms.setter + def exchange_time_ms(self, exchange_time_ms): + """Sets the exchange_time_ms of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. + + Exchange timestamp (in milliseconds) # noqa: E501 + + :param exchange_time_ms: The exchange_time_ms of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and exchange_time_ms is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_time_ms`, must not be `None`") # noqa: E501 + + self._exchange_time_ms = exchange_time_ms + + @property + def total_consume_amount(self): + """Gets the total_consume_amount of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + + Total consumed amount # noqa: E501 + + :return: The total_consume_amount of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._total_consume_amount + + @total_consume_amount.setter + def total_consume_amount(self, total_consume_amount): + """Sets the total_consume_amount of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. + + Total consumed amount # noqa: E501 + + :param total_consume_amount: The total_consume_amount of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total_consume_amount is None: # noqa: E501 + raise ValueError("Invalid value for `total_consume_amount`, must not be `None`") # noqa: E501 + + self._total_consume_amount = total_consume_amount + + @property + def total_acquire_amount(self): + """Gets the total_acquire_amount of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + + Total amount received # noqa: E501 + + :return: The total_acquire_amount of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._total_acquire_amount + + @total_acquire_amount.setter + def total_acquire_amount(self, total_acquire_amount): + """Sets the total_acquire_amount of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. + + Total amount received # noqa: E501 + + :param total_acquire_amount: The total_acquire_amount of this FlashSwapMultiCurrencyOneToManyOrderCreateRespData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total_acquire_amount is None: # noqa: E501 + raise ValueError("Invalid value for `total_acquire_amount`, must not be `None`") # noqa: E501 + + self._total_acquire_amount = total_acquire_amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderCreateRespData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderCreateRespData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_one_to_many_order_preview_req.py b/gate_api/models/flash_swap_multi_currency_one_to_many_order_preview_req.py new file mode 100644 index 00000000..88283124 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_one_to_many_order_preview_req.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyOneToManyOrderPreviewReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'params': 'list[FlashSwapMultiCurrencyPreviewParam]' + } + + attribute_map = { + 'params': 'params' + } + + def __init__(self, params=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FlashSwapMultiCurrencyPreviewParam], Configuration) -> None + """FlashSwapMultiCurrencyOneToManyOrderPreviewReq - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._params = None + self.discriminator = None + + self.params = params + + @property + def params(self): + """Gets the params of this FlashSwapMultiCurrencyOneToManyOrderPreviewReq. # noqa: E501 + + Multi-currency exchange preview parameter list # noqa: E501 + + :return: The params of this FlashSwapMultiCurrencyOneToManyOrderPreviewReq. # noqa: E501 + :rtype: list[FlashSwapMultiCurrencyPreviewParam] + """ + return self._params + + @params.setter + def params(self, params): + """Sets the params of this FlashSwapMultiCurrencyOneToManyOrderPreviewReq. + + Multi-currency exchange preview parameter list # noqa: E501 + + :param params: The params of this FlashSwapMultiCurrencyOneToManyOrderPreviewReq. # noqa: E501 + :type: list[FlashSwapMultiCurrencyPreviewParam] + """ + if self.local_vars_configuration.client_side_validation and params is None: # noqa: E501 + raise ValueError("Invalid value for `params`, must not be `None`") # noqa: E501 + + self._params = params + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderPreviewReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderPreviewReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_one_to_many_order_preview_resp.py b/gate_api/models/flash_swap_multi_currency_one_to_many_order_preview_resp.py new file mode 100644 index 00000000..ae9cb00d --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_one_to_many_order_preview_resp.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyOneToManyOrderPreviewResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'FlashSwapMultiCurrencyOneToManyOrderPreviewRespData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, FlashSwapMultiCurrencyOneToManyOrderPreviewRespData, int, Configuration) -> None + """FlashSwapMultiCurrencyOneToManyOrderPreviewResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + + Response code, 0 means success # noqa: E501 + + :return: The code of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. + + Response code, 0 means success # noqa: E501 + + :param code: The code of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. + + Response message # noqa: E501 + + :param message: The message of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + + + :return: The data of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + :rtype: FlashSwapMultiCurrencyOneToManyOrderPreviewRespData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. + + + :param data: The data of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + :type: FlashSwapMultiCurrencyOneToManyOrderPreviewRespData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + + Response timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. + + Response timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this FlashSwapMultiCurrencyOneToManyOrderPreviewResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderPreviewResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderPreviewResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_one_to_many_order_preview_resp_data.py b/gate_api/models/flash_swap_multi_currency_one_to_many_order_preview_resp_data.py new file mode 100644 index 00000000..66c34532 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_one_to_many_order_preview_resp_data.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyOneToManyOrderPreviewRespData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'orders': 'list[FlashSwapMultiCurrencyPreviewOrder]', + 'total_consume_amount': 'str', + 'total_acquire_amount': 'str' + } + + attribute_map = { + 'orders': 'orders', + 'total_consume_amount': 'total_consume_amount', + 'total_acquire_amount': 'total_acquire_amount' + } + + def __init__(self, orders=None, total_consume_amount=None, total_acquire_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FlashSwapMultiCurrencyPreviewOrder], str, str, Configuration) -> None + """FlashSwapMultiCurrencyOneToManyOrderPreviewRespData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._orders = None + self._total_consume_amount = None + self._total_acquire_amount = None + self.discriminator = None + + self.orders = orders + self.total_consume_amount = total_consume_amount + self.total_acquire_amount = total_acquire_amount + + @property + def orders(self): + """Gets the orders of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. # noqa: E501 + + Preview order list # noqa: E501 + + :return: The orders of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. # noqa: E501 + :rtype: list[FlashSwapMultiCurrencyPreviewOrder] + """ + return self._orders + + @orders.setter + def orders(self, orders): + """Sets the orders of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. + + Preview order list # noqa: E501 + + :param orders: The orders of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. # noqa: E501 + :type: list[FlashSwapMultiCurrencyPreviewOrder] + """ + if self.local_vars_configuration.client_side_validation and orders is None: # noqa: E501 + raise ValueError("Invalid value for `orders`, must not be `None`") # noqa: E501 + + self._orders = orders + + @property + def total_consume_amount(self): + """Gets the total_consume_amount of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. # noqa: E501 + + Total consumed amount # noqa: E501 + + :return: The total_consume_amount of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._total_consume_amount + + @total_consume_amount.setter + def total_consume_amount(self, total_consume_amount): + """Sets the total_consume_amount of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. + + Total consumed amount # noqa: E501 + + :param total_consume_amount: The total_consume_amount of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total_consume_amount is None: # noqa: E501 + raise ValueError("Invalid value for `total_consume_amount`, must not be `None`") # noqa: E501 + + self._total_consume_amount = total_consume_amount + + @property + def total_acquire_amount(self): + """Gets the total_acquire_amount of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. # noqa: E501 + + Total amount received # noqa: E501 + + :return: The total_acquire_amount of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._total_acquire_amount + + @total_acquire_amount.setter + def total_acquire_amount(self, total_acquire_amount): + """Sets the total_acquire_amount of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. + + Total amount received # noqa: E501 + + :param total_acquire_amount: The total_acquire_amount of this FlashSwapMultiCurrencyOneToManyOrderPreviewRespData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and total_acquire_amount is None: # noqa: E501 + raise ValueError("Invalid value for `total_acquire_amount`, must not be `None`") # noqa: E501 + + self._total_acquire_amount = total_acquire_amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderPreviewRespData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyOneToManyOrderPreviewRespData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_order.py b/gate_api/models/flash_swap_multi_currency_order.py new file mode 100644 index 00000000..f3a6ab5a --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_order.py @@ -0,0 +1,626 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'user_id': 'int', + 'source': 'str', + 'app_id': 'str', + 'client_req_id': 'str', + 'sell_asset': 'str', + 'sell_amount': 'str', + 'sell_amount_show': 'str', + 'buy_asset': 'str', + 'buy_amount': 'str', + 'buy_amount_show': 'str', + 'price': 'str', + 'status': 'int', + 'quote_id': 'str', + 'failed_code': 'int', + 'failed_reason': 'str', + 'create_time': 'str', + 'create_time_ms': 'int', + 'error': 'ErrCodeMsg' + } + + attribute_map = { + 'id': 'id', + 'user_id': 'user_id', + 'source': 'source', + 'app_id': 'app_id', + 'client_req_id': 'client_req_id', + 'sell_asset': 'sell_asset', + 'sell_amount': 'sell_amount', + 'sell_amount_show': 'sell_amount_show', + 'buy_asset': 'buy_asset', + 'buy_amount': 'buy_amount', + 'buy_amount_show': 'buy_amount_show', + 'price': 'price', + 'status': 'status', + 'quote_id': 'quote_id', + 'failed_code': 'failed_code', + 'failed_reason': 'failed_reason', + 'create_time': 'create_time', + 'create_time_ms': 'create_time_ms', + 'error': 'error' + } + + def __init__(self, id=None, user_id=None, source=None, app_id=None, client_req_id=None, sell_asset=None, sell_amount=None, sell_amount_show=None, buy_asset=None, buy_amount=None, buy_amount_show=None, price=None, status=None, quote_id=None, failed_code=None, failed_reason=None, create_time=None, create_time_ms=None, error=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, str, str, str, str, str, str, str, int, str, int, str, str, int, ErrCodeMsg, Configuration) -> None + """FlashSwapMultiCurrencyOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._user_id = None + self._source = None + self._app_id = None + self._client_req_id = None + self._sell_asset = None + self._sell_amount = None + self._sell_amount_show = None + self._buy_asset = None + self._buy_amount = None + self._buy_amount_show = None + self._price = None + self._status = None + self._quote_id = None + self._failed_code = None + self._failed_reason = None + self._create_time = None + self._create_time_ms = None + self._error = None + self.discriminator = None + + if id is not None: + self.id = id + if user_id is not None: + self.user_id = user_id + if source is not None: + self.source = source + if app_id is not None: + self.app_id = app_id + if client_req_id is not None: + self.client_req_id = client_req_id + if sell_asset is not None: + self.sell_asset = sell_asset + if sell_amount is not None: + self.sell_amount = sell_amount + if sell_amount_show is not None: + self.sell_amount_show = sell_amount_show + if buy_asset is not None: + self.buy_asset = buy_asset + if buy_amount is not None: + self.buy_amount = buy_amount + if buy_amount_show is not None: + self.buy_amount_show = buy_amount_show + if price is not None: + self.price = price + if status is not None: + self.status = status + if quote_id is not None: + self.quote_id = quote_id + if failed_code is not None: + self.failed_code = failed_code + if failed_reason is not None: + self.failed_reason = failed_reason + if create_time is not None: + self.create_time = create_time + if create_time_ms is not None: + self.create_time_ms = create_time_ms + self.error = error + + @property + def id(self): + """Gets the id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FlashSwapMultiCurrencyOrder. + + Order ID # noqa: E501 + + :param id: The id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def user_id(self): + """Gets the user_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this FlashSwapMultiCurrencyOrder. + + User ID # noqa: E501 + + :param user_id: The user_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def source(self): + """Gets the source of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Request source # noqa: E501 + + :return: The source of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this FlashSwapMultiCurrencyOrder. + + Request source # noqa: E501 + + :param source: The source of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._source = source + + @property + def app_id(self): + """Gets the app_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Application ID # noqa: E501 + + :return: The app_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._app_id + + @app_id.setter + def app_id(self, app_id): + """Sets the app_id of this FlashSwapMultiCurrencyOrder. + + Application ID # noqa: E501 + + :param app_id: The app_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._app_id = app_id + + @property + def client_req_id(self): + """Gets the client_req_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Client request ID # noqa: E501 + + :return: The client_req_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._client_req_id + + @client_req_id.setter + def client_req_id(self, client_req_id): + """Sets the client_req_id of this FlashSwapMultiCurrencyOrder. + + Client request ID # noqa: E501 + + :param client_req_id: The client_req_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._client_req_id = client_req_id + + @property + def sell_asset(self): + """Gets the sell_asset of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Currency to sell # noqa: E501 + + :return: The sell_asset of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._sell_asset + + @sell_asset.setter + def sell_asset(self, sell_asset): + """Sets the sell_asset of this FlashSwapMultiCurrencyOrder. + + Currency to sell # noqa: E501 + + :param sell_asset: The sell_asset of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._sell_asset = sell_asset + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Sell amount # noqa: E501 + + :return: The sell_amount of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapMultiCurrencyOrder. + + Sell amount # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._sell_amount = sell_amount + + @property + def sell_amount_show(self): + """Gets the sell_amount_show of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Sell amount display value # noqa: E501 + + :return: The sell_amount_show of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._sell_amount_show + + @sell_amount_show.setter + def sell_amount_show(self, sell_amount_show): + """Sets the sell_amount_show of this FlashSwapMultiCurrencyOrder. + + Sell amount display value # noqa: E501 + + :param sell_amount_show: The sell_amount_show of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._sell_amount_show = sell_amount_show + + @property + def buy_asset(self): + """Gets the buy_asset of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Currency to buy # noqa: E501 + + :return: The buy_asset of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._buy_asset + + @buy_asset.setter + def buy_asset(self, buy_asset): + """Sets the buy_asset of this FlashSwapMultiCurrencyOrder. + + Currency to buy # noqa: E501 + + :param buy_asset: The buy_asset of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._buy_asset = buy_asset + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Buy amount # noqa: E501 + + :return: The buy_amount of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapMultiCurrencyOrder. + + Buy amount # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._buy_amount = buy_amount + + @property + def buy_amount_show(self): + """Gets the buy_amount_show of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Buy amount display value # noqa: E501 + + :return: The buy_amount_show of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._buy_amount_show + + @buy_amount_show.setter + def buy_amount_show(self, buy_amount_show): + """Sets the buy_amount_show of this FlashSwapMultiCurrencyOrder. + + Buy amount display value # noqa: E501 + + :param buy_amount_show: The buy_amount_show of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._buy_amount_show = buy_amount_show + + @property + def price(self): + """Gets the price of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Exchange price # noqa: E501 + + :return: The price of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this FlashSwapMultiCurrencyOrder. + + Exchange price # noqa: E501 + + :param price: The price of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def status(self): + """Gets the status of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Order status # noqa: E501 + + :return: The status of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this FlashSwapMultiCurrencyOrder. + + Order status # noqa: E501 + + :param status: The status of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def quote_id(self): + """Gets the quote_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Quote ID # noqa: E501 + + :return: The quote_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._quote_id + + @quote_id.setter + def quote_id(self, quote_id): + """Sets the quote_id of this FlashSwapMultiCurrencyOrder. + + Quote ID # noqa: E501 + + :param quote_id: The quote_id of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._quote_id = quote_id + + @property + def failed_code(self): + """Gets the failed_code of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Failure error code, 0 means success # noqa: E501 + + :return: The failed_code of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: int + """ + return self._failed_code + + @failed_code.setter + def failed_code(self, failed_code): + """Sets the failed_code of this FlashSwapMultiCurrencyOrder. + + Failure error code, 0 means success # noqa: E501 + + :param failed_code: The failed_code of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: int + """ + + self._failed_code = failed_code + + @property + def failed_reason(self): + """Gets the failed_reason of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Failure Reason # noqa: E501 + + :return: The failed_reason of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._failed_reason + + @failed_reason.setter + def failed_reason(self, failed_reason): + """Sets the failed_reason of this FlashSwapMultiCurrencyOrder. + + Failure Reason # noqa: E501 + + :param failed_reason: The failed_reason of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._failed_reason = failed_reason + + @property + def create_time(self): + """Gets the create_time of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this FlashSwapMultiCurrencyOrder. + + Created time # noqa: E501 + + :param create_time: The create_time of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + @property + def create_time_ms(self): + """Gets the create_time_ms of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + Creation timestamp (in milliseconds) # noqa: E501 + + :return: The create_time_ms of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: int + """ + return self._create_time_ms + + @create_time_ms.setter + def create_time_ms(self, create_time_ms): + """Sets the create_time_ms of this FlashSwapMultiCurrencyOrder. + + Creation timestamp (in milliseconds) # noqa: E501 + + :param create_time_ms: The create_time_ms of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: int + """ + + self._create_time_ms = create_time_ms + + @property + def error(self): + """Gets the error of this FlashSwapMultiCurrencyOrder. # noqa: E501 + + + :return: The error of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :rtype: ErrCodeMsg + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this FlashSwapMultiCurrencyOrder. + + + :param error: The error of this FlashSwapMultiCurrencyOrder. # noqa: E501 + :type: ErrCodeMsg + """ + if self.local_vars_configuration.client_side_validation and error is None: # noqa: E501 + raise ValueError("Invalid value for `error`, must not be `None`") # noqa: E501 + + self._error = error + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_preview_order.py b/gate_api/models/flash_swap_multi_currency_preview_order.py new file mode 100644 index 00000000..54463cf6 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_preview_order.py @@ -0,0 +1,458 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyPreviewOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'quote_id': 'str', + 'hedge_type': 'int', + 'sell_asset': 'str', + 'sell_amount': 'str', + 'sell_amount_show': 'str', + 'buy_asset': 'str', + 'buy_amount': 'str', + 'buy_amount_show': 'str', + 'price': 'str', + 'price_diff': 'str', + 'reverse_price': 'str', + 'valid_timestamp': 'int', + 'error': 'ErrCodeMsg' + } + + attribute_map = { + 'quote_id': 'quote_id', + 'hedge_type': 'hedge_type', + 'sell_asset': 'sell_asset', + 'sell_amount': 'sell_amount', + 'sell_amount_show': 'sell_amount_show', + 'buy_asset': 'buy_asset', + 'buy_amount': 'buy_amount', + 'buy_amount_show': 'buy_amount_show', + 'price': 'price', + 'price_diff': 'price_diff', + 'reverse_price': 'reverse_price', + 'valid_timestamp': 'valid_timestamp', + 'error': 'error' + } + + def __init__(self, quote_id=None, hedge_type=None, sell_asset=None, sell_amount=None, sell_amount_show=None, buy_asset=None, buy_amount=None, buy_amount_show=None, price=None, price_diff=None, reverse_price=None, valid_timestamp=None, error=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, str, str, str, str, str, str, str, str, str, int, ErrCodeMsg, Configuration) -> None + """FlashSwapMultiCurrencyPreviewOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._quote_id = None + self._hedge_type = None + self._sell_asset = None + self._sell_amount = None + self._sell_amount_show = None + self._buy_asset = None + self._buy_amount = None + self._buy_amount_show = None + self._price = None + self._price_diff = None + self._reverse_price = None + self._valid_timestamp = None + self._error = None + self.discriminator = None + + if quote_id is not None: + self.quote_id = quote_id + if hedge_type is not None: + self.hedge_type = hedge_type + if sell_asset is not None: + self.sell_asset = sell_asset + if sell_amount is not None: + self.sell_amount = sell_amount + if sell_amount_show is not None: + self.sell_amount_show = sell_amount_show + if buy_asset is not None: + self.buy_asset = buy_asset + if buy_amount is not None: + self.buy_amount = buy_amount + if buy_amount_show is not None: + self.buy_amount_show = buy_amount_show + if price is not None: + self.price = price + if price_diff is not None: + self.price_diff = price_diff + if reverse_price is not None: + self.reverse_price = reverse_price + if valid_timestamp is not None: + self.valid_timestamp = valid_timestamp + self.error = error + + @property + def quote_id(self): + """Gets the quote_id of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Quote ID # noqa: E501 + + :return: The quote_id of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: str + """ + return self._quote_id + + @quote_id.setter + def quote_id(self, quote_id): + """Sets the quote_id of this FlashSwapMultiCurrencyPreviewOrder. + + Quote ID # noqa: E501 + + :param quote_id: The quote_id of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: str + """ + + self._quote_id = quote_id + + @property + def hedge_type(self): + """Gets the hedge_type of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Hedge type # noqa: E501 + + :return: The hedge_type of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: int + """ + return self._hedge_type + + @hedge_type.setter + def hedge_type(self, hedge_type): + """Sets the hedge_type of this FlashSwapMultiCurrencyPreviewOrder. + + Hedge type # noqa: E501 + + :param hedge_type: The hedge_type of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: int + """ + + self._hedge_type = hedge_type + + @property + def sell_asset(self): + """Gets the sell_asset of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Currency to sell # noqa: E501 + + :return: The sell_asset of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: str + """ + return self._sell_asset + + @sell_asset.setter + def sell_asset(self, sell_asset): + """Sets the sell_asset of this FlashSwapMultiCurrencyPreviewOrder. + + Currency to sell # noqa: E501 + + :param sell_asset: The sell_asset of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: str + """ + + self._sell_asset = sell_asset + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Sell amount # noqa: E501 + + :return: The sell_amount of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapMultiCurrencyPreviewOrder. + + Sell amount # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: str + """ + + self._sell_amount = sell_amount + + @property + def sell_amount_show(self): + """Gets the sell_amount_show of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Sell amount display value # noqa: E501 + + :return: The sell_amount_show of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: str + """ + return self._sell_amount_show + + @sell_amount_show.setter + def sell_amount_show(self, sell_amount_show): + """Sets the sell_amount_show of this FlashSwapMultiCurrencyPreviewOrder. + + Sell amount display value # noqa: E501 + + :param sell_amount_show: The sell_amount_show of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: str + """ + + self._sell_amount_show = sell_amount_show + + @property + def buy_asset(self): + """Gets the buy_asset of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Currency to buy # noqa: E501 + + :return: The buy_asset of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: str + """ + return self._buy_asset + + @buy_asset.setter + def buy_asset(self, buy_asset): + """Sets the buy_asset of this FlashSwapMultiCurrencyPreviewOrder. + + Currency to buy # noqa: E501 + + :param buy_asset: The buy_asset of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: str + """ + + self._buy_asset = buy_asset + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Buy amount # noqa: E501 + + :return: The buy_amount of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapMultiCurrencyPreviewOrder. + + Buy amount # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: str + """ + + self._buy_amount = buy_amount + + @property + def buy_amount_show(self): + """Gets the buy_amount_show of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Buy amount display value # noqa: E501 + + :return: The buy_amount_show of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: str + """ + return self._buy_amount_show + + @buy_amount_show.setter + def buy_amount_show(self, buy_amount_show): + """Sets the buy_amount_show of this FlashSwapMultiCurrencyPreviewOrder. + + Buy amount display value # noqa: E501 + + :param buy_amount_show: The buy_amount_show of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: str + """ + + self._buy_amount_show = buy_amount_show + + @property + def price(self): + """Gets the price of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Exchange price # noqa: E501 + + :return: The price of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this FlashSwapMultiCurrencyPreviewOrder. + + Exchange price # noqa: E501 + + :param price: The price of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def price_diff(self): + """Gets the price_diff of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Spread percentage # noqa: E501 + + :return: The price_diff of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: str + """ + return self._price_diff + + @price_diff.setter + def price_diff(self, price_diff): + """Sets the price_diff of this FlashSwapMultiCurrencyPreviewOrder. + + Spread percentage # noqa: E501 + + :param price_diff: The price_diff of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: str + """ + + self._price_diff = price_diff + + @property + def reverse_price(self): + """Gets the reverse_price of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Reverse price # noqa: E501 + + :return: The reverse_price of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: str + """ + return self._reverse_price + + @reverse_price.setter + def reverse_price(self, reverse_price): + """Sets the reverse_price of this FlashSwapMultiCurrencyPreviewOrder. + + Reverse price # noqa: E501 + + :param reverse_price: The reverse_price of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: str + """ + + self._reverse_price = reverse_price + + @property + def valid_timestamp(self): + """Gets the valid_timestamp of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + Quote expiration timestamp (in seconds) # noqa: E501 + + :return: The valid_timestamp of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: int + """ + return self._valid_timestamp + + @valid_timestamp.setter + def valid_timestamp(self, valid_timestamp): + """Sets the valid_timestamp of this FlashSwapMultiCurrencyPreviewOrder. + + Quote expiration timestamp (in seconds) # noqa: E501 + + :param valid_timestamp: The valid_timestamp of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: int + """ + + self._valid_timestamp = valid_timestamp + + @property + def error(self): + """Gets the error of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + + + :return: The error of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :rtype: ErrCodeMsg + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this FlashSwapMultiCurrencyPreviewOrder. + + + :param error: The error of this FlashSwapMultiCurrencyPreviewOrder. # noqa: E501 + :type: ErrCodeMsg + """ + if self.local_vars_configuration.client_side_validation and error is None: # noqa: E501 + raise ValueError("Invalid value for `error`, must not be `None`") # noqa: E501 + + self._error = error + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyPreviewOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyPreviewOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_multi_currency_preview_param.py b/gate_api/models/flash_swap_multi_currency_preview_param.py new file mode 100644 index 00000000..b297eca8 --- /dev/null +++ b/gate_api/models/flash_swap_multi_currency_preview_param.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapMultiCurrencyPreviewParam(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'sell_asset': 'str', + 'sell_amount': 'str', + 'buy_asset': 'str', + 'buy_amount': 'str' + } + + attribute_map = { + 'sell_asset': 'sell_asset', + 'sell_amount': 'sell_amount', + 'buy_asset': 'buy_asset', + 'buy_amount': 'buy_amount' + } + + def __init__(self, sell_asset=None, sell_amount=None, buy_asset=None, buy_amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """FlashSwapMultiCurrencyPreviewParam - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._sell_asset = None + self._sell_amount = None + self._buy_asset = None + self._buy_amount = None + self.discriminator = None + + self.sell_asset = sell_asset + if sell_amount is not None: + self.sell_amount = sell_amount + self.buy_asset = buy_asset + if buy_amount is not None: + self.buy_amount = buy_amount + + @property + def sell_asset(self): + """Gets the sell_asset of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + + Currency to sell # noqa: E501 + + :return: The sell_asset of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + :rtype: str + """ + return self._sell_asset + + @sell_asset.setter + def sell_asset(self, sell_asset): + """Sets the sell_asset of this FlashSwapMultiCurrencyPreviewParam. + + Currency to sell # noqa: E501 + + :param sell_asset: The sell_asset of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sell_asset is None: # noqa: E501 + raise ValueError("Invalid value for `sell_asset`, must not be `None`") # noqa: E501 + + self._sell_asset = sell_asset + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + + Sell amount # noqa: E501 + + :return: The sell_amount of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapMultiCurrencyPreviewParam. + + Sell amount # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + :type: str + """ + + self._sell_amount = sell_amount + + @property + def buy_asset(self): + """Gets the buy_asset of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + + Currency to buy # noqa: E501 + + :return: The buy_asset of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + :rtype: str + """ + return self._buy_asset + + @buy_asset.setter + def buy_asset(self, buy_asset): + """Sets the buy_asset of this FlashSwapMultiCurrencyPreviewParam. + + Currency to buy # noqa: E501 + + :param buy_asset: The buy_asset of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and buy_asset is None: # noqa: E501 + raise ValueError("Invalid value for `buy_asset`, must not be `None`") # noqa: E501 + + self._buy_asset = buy_asset + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + + Buy amount # noqa: E501 + + :return: The buy_amount of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapMultiCurrencyPreviewParam. + + Buy amount # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapMultiCurrencyPreviewParam. # noqa: E501 + :type: str + """ + + self._buy_amount = buy_amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapMultiCurrencyPreviewParam): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapMultiCurrencyPreviewParam): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_order_create_req.py b/gate_api/models/flash_swap_order_create_req.py new file mode 100644 index 00000000..a93603bb --- /dev/null +++ b/gate_api/models/flash_swap_order_create_req.py @@ -0,0 +1,323 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapOrderCreateReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'quote_id': 'str', + 'hedge_type': 'int', + 'sell_asset': 'str', + 'sell_amount': 'str', + 'buy_asset': 'str', + 'buy_amount': 'str', + 'client_req_id': 'str', + 'request_time_ms': 'int' + } + + attribute_map = { + 'quote_id': 'quote_id', + 'hedge_type': 'hedge_type', + 'sell_asset': 'sell_asset', + 'sell_amount': 'sell_amount', + 'buy_asset': 'buy_asset', + 'buy_amount': 'buy_amount', + 'client_req_id': 'client_req_id', + 'request_time_ms': 'request_time_ms' + } + + def __init__(self, quote_id=None, hedge_type=None, sell_asset=None, sell_amount=None, buy_asset=None, buy_amount=None, client_req_id=None, request_time_ms=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, str, str, str, str, str, int, Configuration) -> None + """FlashSwapOrderCreateReq - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._quote_id = None + self._hedge_type = None + self._sell_asset = None + self._sell_amount = None + self._buy_asset = None + self._buy_amount = None + self._client_req_id = None + self._request_time_ms = None + self.discriminator = None + + if quote_id is not None: + self.quote_id = quote_id + if hedge_type is not None: + self.hedge_type = hedge_type + self.sell_asset = sell_asset + self.sell_amount = sell_amount + self.buy_asset = buy_asset + self.buy_amount = buy_amount + if client_req_id is not None: + self.client_req_id = client_req_id + if request_time_ms is not None: + self.request_time_ms = request_time_ms + + @property + def quote_id(self): + """Gets the quote_id of this FlashSwapOrderCreateReq. # noqa: E501 + + Quote ID returned by the preview endpoint # noqa: E501 + + :return: The quote_id of this FlashSwapOrderCreateReq. # noqa: E501 + :rtype: str + """ + return self._quote_id + + @quote_id.setter + def quote_id(self, quote_id): + """Sets the quote_id of this FlashSwapOrderCreateReq. + + Quote ID returned by the preview endpoint # noqa: E501 + + :param quote_id: The quote_id of this FlashSwapOrderCreateReq. # noqa: E501 + :type: str + """ + + self._quote_id = quote_id + + @property + def hedge_type(self): + """Gets the hedge_type of this FlashSwapOrderCreateReq. # noqa: E501 + + Hedge type # noqa: E501 + + :return: The hedge_type of this FlashSwapOrderCreateReq. # noqa: E501 + :rtype: int + """ + return self._hedge_type + + @hedge_type.setter + def hedge_type(self, hedge_type): + """Sets the hedge_type of this FlashSwapOrderCreateReq. + + Hedge type # noqa: E501 + + :param hedge_type: The hedge_type of this FlashSwapOrderCreateReq. # noqa: E501 + :type: int + """ + + self._hedge_type = hedge_type + + @property + def sell_asset(self): + """Gets the sell_asset of this FlashSwapOrderCreateReq. # noqa: E501 + + Currency to sell # noqa: E501 + + :return: The sell_asset of this FlashSwapOrderCreateReq. # noqa: E501 + :rtype: str + """ + return self._sell_asset + + @sell_asset.setter + def sell_asset(self, sell_asset): + """Sets the sell_asset of this FlashSwapOrderCreateReq. + + Currency to sell # noqa: E501 + + :param sell_asset: The sell_asset of this FlashSwapOrderCreateReq. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sell_asset is None: # noqa: E501 + raise ValueError("Invalid value for `sell_asset`, must not be `None`") # noqa: E501 + + self._sell_asset = sell_asset + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapOrderCreateReq. # noqa: E501 + + Sell amount # noqa: E501 + + :return: The sell_amount of this FlashSwapOrderCreateReq. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapOrderCreateReq. + + Sell amount # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapOrderCreateReq. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and sell_amount is None: # noqa: E501 + raise ValueError("Invalid value for `sell_amount`, must not be `None`") # noqa: E501 + + self._sell_amount = sell_amount + + @property + def buy_asset(self): + """Gets the buy_asset of this FlashSwapOrderCreateReq. # noqa: E501 + + Currency to buy # noqa: E501 + + :return: The buy_asset of this FlashSwapOrderCreateReq. # noqa: E501 + :rtype: str + """ + return self._buy_asset + + @buy_asset.setter + def buy_asset(self, buy_asset): + """Sets the buy_asset of this FlashSwapOrderCreateReq. + + Currency to buy # noqa: E501 + + :param buy_asset: The buy_asset of this FlashSwapOrderCreateReq. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and buy_asset is None: # noqa: E501 + raise ValueError("Invalid value for `buy_asset`, must not be `None`") # noqa: E501 + + self._buy_asset = buy_asset + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapOrderCreateReq. # noqa: E501 + + Buy amount # noqa: E501 + + :return: The buy_amount of this FlashSwapOrderCreateReq. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapOrderCreateReq. + + Buy amount # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapOrderCreateReq. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and buy_amount is None: # noqa: E501 + raise ValueError("Invalid value for `buy_amount`, must not be `None`") # noqa: E501 + + self._buy_amount = buy_amount + + @property + def client_req_id(self): + """Gets the client_req_id of this FlashSwapOrderCreateReq. # noqa: E501 + + Client request ID for idempotency check # noqa: E501 + + :return: The client_req_id of this FlashSwapOrderCreateReq. # noqa: E501 + :rtype: str + """ + return self._client_req_id + + @client_req_id.setter + def client_req_id(self, client_req_id): + """Sets the client_req_id of this FlashSwapOrderCreateReq. + + Client request ID for idempotency check # noqa: E501 + + :param client_req_id: The client_req_id of this FlashSwapOrderCreateReq. # noqa: E501 + :type: str + """ + + self._client_req_id = client_req_id + + @property + def request_time_ms(self): + """Gets the request_time_ms of this FlashSwapOrderCreateReq. # noqa: E501 + + Request timestamp (in milliseconds) # noqa: E501 + + :return: The request_time_ms of this FlashSwapOrderCreateReq. # noqa: E501 + :rtype: int + """ + return self._request_time_ms + + @request_time_ms.setter + def request_time_ms(self, request_time_ms): + """Sets the request_time_ms of this FlashSwapOrderCreateReq. + + Request timestamp (in milliseconds) # noqa: E501 + + :param request_time_ms: The request_time_ms of this FlashSwapOrderCreateReq. # noqa: E501 + :type: int + """ + + self._request_time_ms = request_time_ms + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapOrderCreateReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapOrderCreateReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_order_create_resp.py b/gate_api/models/flash_swap_order_create_resp.py new file mode 100644 index 00000000..b2122c1f --- /dev/null +++ b/gate_api/models/flash_swap_order_create_resp.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapOrderCreateResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'FlashSwapOrderCreateRespData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, FlashSwapOrderCreateRespData, int, Configuration) -> None + """FlashSwapOrderCreateResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this FlashSwapOrderCreateResp. # noqa: E501 + + Response code, 0 means success # noqa: E501 + + :return: The code of this FlashSwapOrderCreateResp. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this FlashSwapOrderCreateResp. + + Response code, 0 means success # noqa: E501 + + :param code: The code of this FlashSwapOrderCreateResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this FlashSwapOrderCreateResp. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this FlashSwapOrderCreateResp. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this FlashSwapOrderCreateResp. + + Response message # noqa: E501 + + :param message: The message of this FlashSwapOrderCreateResp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this FlashSwapOrderCreateResp. # noqa: E501 + + + :return: The data of this FlashSwapOrderCreateResp. # noqa: E501 + :rtype: FlashSwapOrderCreateRespData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this FlashSwapOrderCreateResp. + + + :param data: The data of this FlashSwapOrderCreateResp. # noqa: E501 + :type: FlashSwapOrderCreateRespData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this FlashSwapOrderCreateResp. # noqa: E501 + + Response timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this FlashSwapOrderCreateResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this FlashSwapOrderCreateResp. + + Response timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this FlashSwapOrderCreateResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapOrderCreateResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapOrderCreateResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_order_create_resp_data.py b/gate_api/models/flash_swap_order_create_resp_data.py new file mode 100644 index 00000000..a2189de6 --- /dev/null +++ b/gate_api/models/flash_swap_order_create_resp_data.py @@ -0,0 +1,628 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapOrderCreateRespData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'user_id': 'int', + 'source': 'str', + 'app_id': 'str', + 'client_req_id': 'str', + 'sell_asset': 'str', + 'sell_amount': 'str', + 'sell_amount_show': 'str', + 'buy_asset': 'str', + 'buy_amount': 'str', + 'buy_amount_show': 'str', + 'price': 'str', + 'status': 'int', + 'quote_id': 'str', + 'failed_code': 'int', + 'failed_reason': 'str', + 'create_time': 'str', + 'create_time_ms': 'int', + 'account_mode': 'int' + } + + attribute_map = { + 'id': 'id', + 'user_id': 'user_id', + 'source': 'source', + 'app_id': 'app_id', + 'client_req_id': 'client_req_id', + 'sell_asset': 'sell_asset', + 'sell_amount': 'sell_amount', + 'sell_amount_show': 'sell_amount_show', + 'buy_asset': 'buy_asset', + 'buy_amount': 'buy_amount', + 'buy_amount_show': 'buy_amount_show', + 'price': 'price', + 'status': 'status', + 'quote_id': 'quote_id', + 'failed_code': 'failed_code', + 'failed_reason': 'failed_reason', + 'create_time': 'create_time', + 'create_time_ms': 'create_time_ms', + 'account_mode': 'account_mode' + } + + def __init__(self, id=None, user_id=None, source=None, app_id=None, client_req_id=None, sell_asset=None, sell_amount=None, sell_amount_show=None, buy_asset=None, buy_amount=None, buy_amount_show=None, price=None, status=None, quote_id=None, failed_code=None, failed_reason=None, create_time=None, create_time_ms=None, account_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, str, str, str, str, str, str, str, int, str, int, str, str, int, int, Configuration) -> None + """FlashSwapOrderCreateRespData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._user_id = None + self._source = None + self._app_id = None + self._client_req_id = None + self._sell_asset = None + self._sell_amount = None + self._sell_amount_show = None + self._buy_asset = None + self._buy_amount = None + self._buy_amount_show = None + self._price = None + self._status = None + self._quote_id = None + self._failed_code = None + self._failed_reason = None + self._create_time = None + self._create_time_ms = None + self._account_mode = None + self.discriminator = None + + if id is not None: + self.id = id + if user_id is not None: + self.user_id = user_id + if source is not None: + self.source = source + if app_id is not None: + self.app_id = app_id + if client_req_id is not None: + self.client_req_id = client_req_id + if sell_asset is not None: + self.sell_asset = sell_asset + if sell_amount is not None: + self.sell_amount = sell_amount + if sell_amount_show is not None: + self.sell_amount_show = sell_amount_show + if buy_asset is not None: + self.buy_asset = buy_asset + if buy_amount is not None: + self.buy_amount = buy_amount + if buy_amount_show is not None: + self.buy_amount_show = buy_amount_show + if price is not None: + self.price = price + if status is not None: + self.status = status + if quote_id is not None: + self.quote_id = quote_id + if failed_code is not None: + self.failed_code = failed_code + if failed_reason is not None: + self.failed_reason = failed_reason + if create_time is not None: + self.create_time = create_time + if create_time_ms is not None: + self.create_time_ms = create_time_ms + self.account_mode = account_mode + + @property + def id(self): + """Gets the id of this FlashSwapOrderCreateRespData. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FlashSwapOrderCreateRespData. + + Order ID # noqa: E501 + + :param id: The id of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def user_id(self): + """Gets the user_id of this FlashSwapOrderCreateRespData. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this FlashSwapOrderCreateRespData. + + User ID # noqa: E501 + + :param user_id: The user_id of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def source(self): + """Gets the source of this FlashSwapOrderCreateRespData. # noqa: E501 + + Request source # noqa: E501 + + :return: The source of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this FlashSwapOrderCreateRespData. + + Request source # noqa: E501 + + :param source: The source of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._source = source + + @property + def app_id(self): + """Gets the app_id of this FlashSwapOrderCreateRespData. # noqa: E501 + + Application ID # noqa: E501 + + :return: The app_id of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._app_id + + @app_id.setter + def app_id(self, app_id): + """Sets the app_id of this FlashSwapOrderCreateRespData. + + Application ID # noqa: E501 + + :param app_id: The app_id of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._app_id = app_id + + @property + def client_req_id(self): + """Gets the client_req_id of this FlashSwapOrderCreateRespData. # noqa: E501 + + Client request ID # noqa: E501 + + :return: The client_req_id of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._client_req_id + + @client_req_id.setter + def client_req_id(self, client_req_id): + """Sets the client_req_id of this FlashSwapOrderCreateRespData. + + Client request ID # noqa: E501 + + :param client_req_id: The client_req_id of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._client_req_id = client_req_id + + @property + def sell_asset(self): + """Gets the sell_asset of this FlashSwapOrderCreateRespData. # noqa: E501 + + Currency to sell # noqa: E501 + + :return: The sell_asset of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._sell_asset + + @sell_asset.setter + def sell_asset(self, sell_asset): + """Sets the sell_asset of this FlashSwapOrderCreateRespData. + + Currency to sell # noqa: E501 + + :param sell_asset: The sell_asset of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._sell_asset = sell_asset + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapOrderCreateRespData. # noqa: E501 + + Sell amount # noqa: E501 + + :return: The sell_amount of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapOrderCreateRespData. + + Sell amount # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._sell_amount = sell_amount + + @property + def sell_amount_show(self): + """Gets the sell_amount_show of this FlashSwapOrderCreateRespData. # noqa: E501 + + Sell amount display value # noqa: E501 + + :return: The sell_amount_show of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._sell_amount_show + + @sell_amount_show.setter + def sell_amount_show(self, sell_amount_show): + """Sets the sell_amount_show of this FlashSwapOrderCreateRespData. + + Sell amount display value # noqa: E501 + + :param sell_amount_show: The sell_amount_show of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._sell_amount_show = sell_amount_show + + @property + def buy_asset(self): + """Gets the buy_asset of this FlashSwapOrderCreateRespData. # noqa: E501 + + Currency to buy # noqa: E501 + + :return: The buy_asset of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._buy_asset + + @buy_asset.setter + def buy_asset(self, buy_asset): + """Sets the buy_asset of this FlashSwapOrderCreateRespData. + + Currency to buy # noqa: E501 + + :param buy_asset: The buy_asset of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._buy_asset = buy_asset + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapOrderCreateRespData. # noqa: E501 + + Buy amount # noqa: E501 + + :return: The buy_amount of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapOrderCreateRespData. + + Buy amount # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._buy_amount = buy_amount + + @property + def buy_amount_show(self): + """Gets the buy_amount_show of this FlashSwapOrderCreateRespData. # noqa: E501 + + Buy amount display value # noqa: E501 + + :return: The buy_amount_show of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._buy_amount_show + + @buy_amount_show.setter + def buy_amount_show(self, buy_amount_show): + """Sets the buy_amount_show of this FlashSwapOrderCreateRespData. + + Buy amount display value # noqa: E501 + + :param buy_amount_show: The buy_amount_show of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._buy_amount_show = buy_amount_show + + @property + def price(self): + """Gets the price of this FlashSwapOrderCreateRespData. # noqa: E501 + + Exchange price # noqa: E501 + + :return: The price of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this FlashSwapOrderCreateRespData. + + Exchange price # noqa: E501 + + :param price: The price of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def status(self): + """Gets the status of this FlashSwapOrderCreateRespData. # noqa: E501 + + Order status # noqa: E501 + + :return: The status of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this FlashSwapOrderCreateRespData. + + Order status # noqa: E501 + + :param status: The status of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def quote_id(self): + """Gets the quote_id of this FlashSwapOrderCreateRespData. # noqa: E501 + + Quote ID # noqa: E501 + + :return: The quote_id of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._quote_id + + @quote_id.setter + def quote_id(self, quote_id): + """Sets the quote_id of this FlashSwapOrderCreateRespData. + + Quote ID # noqa: E501 + + :param quote_id: The quote_id of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._quote_id = quote_id + + @property + def failed_code(self): + """Gets the failed_code of this FlashSwapOrderCreateRespData. # noqa: E501 + + Failure error code, 0 means success # noqa: E501 + + :return: The failed_code of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: int + """ + return self._failed_code + + @failed_code.setter + def failed_code(self, failed_code): + """Sets the failed_code of this FlashSwapOrderCreateRespData. + + Failure error code, 0 means success # noqa: E501 + + :param failed_code: The failed_code of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: int + """ + + self._failed_code = failed_code + + @property + def failed_reason(self): + """Gets the failed_reason of this FlashSwapOrderCreateRespData. # noqa: E501 + + Failure Reason # noqa: E501 + + :return: The failed_reason of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._failed_reason + + @failed_reason.setter + def failed_reason(self, failed_reason): + """Sets the failed_reason of this FlashSwapOrderCreateRespData. + + Failure Reason # noqa: E501 + + :param failed_reason: The failed_reason of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._failed_reason = failed_reason + + @property + def create_time(self): + """Gets the create_time of this FlashSwapOrderCreateRespData. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this FlashSwapOrderCreateRespData. + + Created time # noqa: E501 + + :param create_time: The create_time of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + @property + def create_time_ms(self): + """Gets the create_time_ms of this FlashSwapOrderCreateRespData. # noqa: E501 + + Creation timestamp (in milliseconds) # noqa: E501 + + :return: The create_time_ms of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: int + """ + return self._create_time_ms + + @create_time_ms.setter + def create_time_ms(self, create_time_ms): + """Sets the create_time_ms of this FlashSwapOrderCreateRespData. + + Creation timestamp (in milliseconds) # noqa: E501 + + :param create_time_ms: The create_time_ms of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: int + """ + + self._create_time_ms = create_time_ms + + @property + def account_mode(self): + """Gets the account_mode of this FlashSwapOrderCreateRespData. # noqa: E501 + + Account Mode # noqa: E501 + + :return: The account_mode of this FlashSwapOrderCreateRespData. # noqa: E501 + :rtype: int + """ + return self._account_mode + + @account_mode.setter + def account_mode(self, account_mode): + """Sets the account_mode of this FlashSwapOrderCreateRespData. + + Account Mode # noqa: E501 + + :param account_mode: The account_mode of this FlashSwapOrderCreateRespData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and account_mode is None: # noqa: E501 + raise ValueError("Invalid value for `account_mode`, must not be `None`") # noqa: E501 + + self._account_mode = account_mode + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapOrderCreateRespData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapOrderCreateRespData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_order_preview_resp.py b/gate_api/models/flash_swap_order_preview_resp.py new file mode 100644 index 00000000..c0548249 --- /dev/null +++ b/gate_api/models/flash_swap_order_preview_resp.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapOrderPreviewResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'FlashSwapOrderPreviewRespData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, FlashSwapOrderPreviewRespData, int, Configuration) -> None + """FlashSwapOrderPreviewResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this FlashSwapOrderPreviewResp. # noqa: E501 + + Response code, 0 means success # noqa: E501 + + :return: The code of this FlashSwapOrderPreviewResp. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this FlashSwapOrderPreviewResp. + + Response code, 0 means success # noqa: E501 + + :param code: The code of this FlashSwapOrderPreviewResp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this FlashSwapOrderPreviewResp. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this FlashSwapOrderPreviewResp. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this FlashSwapOrderPreviewResp. + + Response message # noqa: E501 + + :param message: The message of this FlashSwapOrderPreviewResp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this FlashSwapOrderPreviewResp. # noqa: E501 + + + :return: The data of this FlashSwapOrderPreviewResp. # noqa: E501 + :rtype: FlashSwapOrderPreviewRespData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this FlashSwapOrderPreviewResp. + + + :param data: The data of this FlashSwapOrderPreviewResp. # noqa: E501 + :type: FlashSwapOrderPreviewRespData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this FlashSwapOrderPreviewResp. # noqa: E501 + + Response timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this FlashSwapOrderPreviewResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this FlashSwapOrderPreviewResp. + + Response timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this FlashSwapOrderPreviewResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapOrderPreviewResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapOrderPreviewResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/flash_swap_order_preview_resp_data.py b/gate_api/models/flash_swap_order_preview_resp_data.py new file mode 100644 index 00000000..ce3b52e7 --- /dev/null +++ b/gate_api/models/flash_swap_order_preview_resp_data.py @@ -0,0 +1,431 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FlashSwapOrderPreviewRespData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'quote_id': 'str', + 'hedge_type': 'int', + 'sell_asset': 'str', + 'sell_amount': 'str', + 'sell_amount_show': 'str', + 'buy_asset': 'str', + 'buy_amount': 'str', + 'buy_amount_show': 'str', + 'price': 'str', + 'price_diff': 'str', + 'reverse_price': 'str', + 'valid_timestamp': 'int' + } + + attribute_map = { + 'quote_id': 'quote_id', + 'hedge_type': 'hedge_type', + 'sell_asset': 'sell_asset', + 'sell_amount': 'sell_amount', + 'sell_amount_show': 'sell_amount_show', + 'buy_asset': 'buy_asset', + 'buy_amount': 'buy_amount', + 'buy_amount_show': 'buy_amount_show', + 'price': 'price', + 'price_diff': 'price_diff', + 'reverse_price': 'reverse_price', + 'valid_timestamp': 'valid_timestamp' + } + + def __init__(self, quote_id=None, hedge_type=None, sell_asset=None, sell_amount=None, sell_amount_show=None, buy_asset=None, buy_amount=None, buy_amount_show=None, price=None, price_diff=None, reverse_price=None, valid_timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, str, str, str, str, str, str, str, str, str, int, Configuration) -> None + """FlashSwapOrderPreviewRespData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._quote_id = None + self._hedge_type = None + self._sell_asset = None + self._sell_amount = None + self._sell_amount_show = None + self._buy_asset = None + self._buy_amount = None + self._buy_amount_show = None + self._price = None + self._price_diff = None + self._reverse_price = None + self._valid_timestamp = None + self.discriminator = None + + if quote_id is not None: + self.quote_id = quote_id + if hedge_type is not None: + self.hedge_type = hedge_type + if sell_asset is not None: + self.sell_asset = sell_asset + if sell_amount is not None: + self.sell_amount = sell_amount + if sell_amount_show is not None: + self.sell_amount_show = sell_amount_show + if buy_asset is not None: + self.buy_asset = buy_asset + if buy_amount is not None: + self.buy_amount = buy_amount + if buy_amount_show is not None: + self.buy_amount_show = buy_amount_show + if price is not None: + self.price = price + if price_diff is not None: + self.price_diff = price_diff + if reverse_price is not None: + self.reverse_price = reverse_price + if valid_timestamp is not None: + self.valid_timestamp = valid_timestamp + + @property + def quote_id(self): + """Gets the quote_id of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Quote ID, valid for one minute # noqa: E501 + + :return: The quote_id of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._quote_id + + @quote_id.setter + def quote_id(self, quote_id): + """Sets the quote_id of this FlashSwapOrderPreviewRespData. + + Quote ID, valid for one minute # noqa: E501 + + :param quote_id: The quote_id of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: str + """ + + self._quote_id = quote_id + + @property + def hedge_type(self): + """Gets the hedge_type of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Hedge type # noqa: E501 + + :return: The hedge_type of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: int + """ + return self._hedge_type + + @hedge_type.setter + def hedge_type(self, hedge_type): + """Sets the hedge_type of this FlashSwapOrderPreviewRespData. + + Hedge type # noqa: E501 + + :param hedge_type: The hedge_type of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: int + """ + + self._hedge_type = hedge_type + + @property + def sell_asset(self): + """Gets the sell_asset of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Currency to sell # noqa: E501 + + :return: The sell_asset of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._sell_asset + + @sell_asset.setter + def sell_asset(self, sell_asset): + """Sets the sell_asset of this FlashSwapOrderPreviewRespData. + + Currency to sell # noqa: E501 + + :param sell_asset: The sell_asset of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: str + """ + + self._sell_asset = sell_asset + + @property + def sell_amount(self): + """Gets the sell_amount of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Sell amount # noqa: E501 + + :return: The sell_amount of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._sell_amount + + @sell_amount.setter + def sell_amount(self, sell_amount): + """Sets the sell_amount of this FlashSwapOrderPreviewRespData. + + Sell amount # noqa: E501 + + :param sell_amount: The sell_amount of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: str + """ + + self._sell_amount = sell_amount + + @property + def sell_amount_show(self): + """Gets the sell_amount_show of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Sell amount display value # noqa: E501 + + :return: The sell_amount_show of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._sell_amount_show + + @sell_amount_show.setter + def sell_amount_show(self, sell_amount_show): + """Sets the sell_amount_show of this FlashSwapOrderPreviewRespData. + + Sell amount display value # noqa: E501 + + :param sell_amount_show: The sell_amount_show of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: str + """ + + self._sell_amount_show = sell_amount_show + + @property + def buy_asset(self): + """Gets the buy_asset of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Currency to buy # noqa: E501 + + :return: The buy_asset of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._buy_asset + + @buy_asset.setter + def buy_asset(self, buy_asset): + """Sets the buy_asset of this FlashSwapOrderPreviewRespData. + + Currency to buy # noqa: E501 + + :param buy_asset: The buy_asset of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: str + """ + + self._buy_asset = buy_asset + + @property + def buy_amount(self): + """Gets the buy_amount of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Buy amount # noqa: E501 + + :return: The buy_amount of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._buy_amount + + @buy_amount.setter + def buy_amount(self, buy_amount): + """Sets the buy_amount of this FlashSwapOrderPreviewRespData. + + Buy amount # noqa: E501 + + :param buy_amount: The buy_amount of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: str + """ + + self._buy_amount = buy_amount + + @property + def buy_amount_show(self): + """Gets the buy_amount_show of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Buy amount display value # noqa: E501 + + :return: The buy_amount_show of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._buy_amount_show + + @buy_amount_show.setter + def buy_amount_show(self, buy_amount_show): + """Sets the buy_amount_show of this FlashSwapOrderPreviewRespData. + + Buy amount display value # noqa: E501 + + :param buy_amount_show: The buy_amount_show of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: str + """ + + self._buy_amount_show = buy_amount_show + + @property + def price(self): + """Gets the price of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Exchange price # noqa: E501 + + :return: The price of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this FlashSwapOrderPreviewRespData. + + Exchange price # noqa: E501 + + :param price: The price of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def price_diff(self): + """Gets the price_diff of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Spread percentage # noqa: E501 + + :return: The price_diff of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._price_diff + + @price_diff.setter + def price_diff(self, price_diff): + """Sets the price_diff of this FlashSwapOrderPreviewRespData. + + Spread percentage # noqa: E501 + + :param price_diff: The price_diff of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: str + """ + + self._price_diff = price_diff + + @property + def reverse_price(self): + """Gets the reverse_price of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Reverse price # noqa: E501 + + :return: The reverse_price of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: str + """ + return self._reverse_price + + @reverse_price.setter + def reverse_price(self, reverse_price): + """Sets the reverse_price of this FlashSwapOrderPreviewRespData. + + Reverse price # noqa: E501 + + :param reverse_price: The reverse_price of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: str + """ + + self._reverse_price = reverse_price + + @property + def valid_timestamp(self): + """Gets the valid_timestamp of this FlashSwapOrderPreviewRespData. # noqa: E501 + + Quote expiration timestamp (in seconds) # noqa: E501 + + :return: The valid_timestamp of this FlashSwapOrderPreviewRespData. # noqa: E501 + :rtype: int + """ + return self._valid_timestamp + + @valid_timestamp.setter + def valid_timestamp(self, valid_timestamp): + """Sets the valid_timestamp of this FlashSwapOrderPreviewRespData. + + Quote expiration timestamp (in seconds) # noqa: E501 + + :param valid_timestamp: The valid_timestamp of this FlashSwapOrderPreviewRespData. # noqa: E501 + :type: int + """ + + self._valid_timestamp = valid_timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlashSwapOrderPreviewRespData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlashSwapOrderPreviewRespData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_account.py b/gate_api/models/futures_account.py index 8703391f..8b221e52 100644 --- a/gate_api/models/futures_account.py +++ b/gate_api/models/futures_account.py @@ -41,7 +41,6 @@ class FuturesAccount(object): 'point': 'str', 'currency': 'str', 'in_dual_mode': 'bool', - 'position_mode': 'str', 'enable_credit': 'bool', 'position_initial_margin': 'str', 'maintenance_margin': 'str', @@ -59,6 +58,8 @@ class FuturesAccount(object): 'enable_new_dual_mode': 'bool', 'margin_mode': 'int', 'enable_tiered_mm': 'bool', + 'enable_dual_plus': 'bool', + 'position_mode': 'str', 'history': 'FuturesAccountHistory' } @@ -71,7 +72,6 @@ class FuturesAccount(object): 'point': 'point', 'currency': 'currency', 'in_dual_mode': 'in_dual_mode', - 'position_mode': 'position_mode', 'enable_credit': 'enable_credit', 'position_initial_margin': 'position_initial_margin', 'maintenance_margin': 'maintenance_margin', @@ -89,11 +89,13 @@ class FuturesAccount(object): 'enable_new_dual_mode': 'enable_new_dual_mode', 'margin_mode': 'margin_mode', 'enable_tiered_mm': 'enable_tiered_mm', + 'enable_dual_plus': 'enable_dual_plus', + 'position_mode': 'position_mode', 'history': 'history' } - def __init__(self, total=None, unrealised_pnl=None, position_margin=None, order_margin=None, available=None, point=None, currency=None, in_dual_mode=None, position_mode=None, enable_credit=None, position_initial_margin=None, maintenance_margin=None, bonus=None, enable_evolved_classic=None, cross_order_margin=None, cross_initial_margin=None, cross_maintenance_margin=None, cross_unrealised_pnl=None, cross_available=None, cross_margin_balance=None, cross_mmr=None, cross_imr=None, isolated_position_margin=None, enable_new_dual_mode=None, margin_mode=None, enable_tiered_mm=None, history=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, str, str, bool, str, bool, str, str, str, bool, str, str, str, str, str, str, str, str, str, bool, int, bool, FuturesAccountHistory, Configuration) -> None + def __init__(self, total=None, unrealised_pnl=None, position_margin=None, order_margin=None, available=None, point=None, currency=None, in_dual_mode=None, enable_credit=None, position_initial_margin=None, maintenance_margin=None, bonus=None, enable_evolved_classic=None, cross_order_margin=None, cross_initial_margin=None, cross_maintenance_margin=None, cross_unrealised_pnl=None, cross_available=None, cross_margin_balance=None, cross_mmr=None, cross_imr=None, isolated_position_margin=None, enable_new_dual_mode=None, margin_mode=None, enable_tiered_mm=None, enable_dual_plus=None, position_mode=None, history=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, bool, bool, str, str, str, bool, str, str, str, str, str, str, str, str, str, bool, int, bool, bool, str, FuturesAccountHistory, Configuration) -> None """FuturesAccount - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -107,7 +109,6 @@ def __init__(self, total=None, unrealised_pnl=None, position_margin=None, order_ self._point = None self._currency = None self._in_dual_mode = None - self._position_mode = None self._enable_credit = None self._position_initial_margin = None self._maintenance_margin = None @@ -125,6 +126,8 @@ def __init__(self, total=None, unrealised_pnl=None, position_margin=None, order_ self._enable_new_dual_mode = None self._margin_mode = None self._enable_tiered_mm = None + self._enable_dual_plus = None + self._position_mode = None self._history = None self.discriminator = None @@ -144,8 +147,6 @@ def __init__(self, total=None, unrealised_pnl=None, position_margin=None, order_ self.currency = currency if in_dual_mode is not None: self.in_dual_mode = in_dual_mode - if position_mode is not None: - self.position_mode = position_mode if enable_credit is not None: self.enable_credit = enable_credit if position_initial_margin is not None: @@ -180,6 +181,10 @@ def __init__(self, total=None, unrealised_pnl=None, position_margin=None, order_ self.margin_mode = margin_mode if enable_tiered_mm is not None: self.enable_tiered_mm = enable_tiered_mm + if enable_dual_plus is not None: + self.enable_dual_plus = enable_dual_plus + if position_mode is not None: + self.position_mode = position_mode if history is not None: self.history = history @@ -367,29 +372,6 @@ def in_dual_mode(self, in_dual_mode): self._in_dual_mode = in_dual_mode - @property - def position_mode(self): - """Gets the position_mode of this FuturesAccount. # noqa: E501 - - Position mode: single - one-way, dual - dual-side, split - sub-positions (in_dual_mode is deprecated) # noqa: E501 - - :return: The position_mode of this FuturesAccount. # noqa: E501 - :rtype: str - """ - return self._position_mode - - @position_mode.setter - def position_mode(self, position_mode): - """Sets the position_mode of this FuturesAccount. - - Position mode: single - one-way, dual - dual-side, split - sub-positions (in_dual_mode is deprecated) # noqa: E501 - - :param position_mode: The position_mode of this FuturesAccount. # noqa: E501 - :type: str - """ - - self._position_mode = position_mode - @property def enable_credit(self): """Gets the enable_credit of this FuturesAccount. # noqa: E501 @@ -781,6 +763,52 @@ def enable_tiered_mm(self, enable_tiered_mm): self._enable_tiered_mm = enable_tiered_mm + @property + def enable_dual_plus(self): + """Gets the enable_dual_plus of this FuturesAccount. # noqa: E501 + + Whether to Support Split Position Mode # noqa: E501 + + :return: The enable_dual_plus of this FuturesAccount. # noqa: E501 + :rtype: bool + """ + return self._enable_dual_plus + + @enable_dual_plus.setter + def enable_dual_plus(self, enable_dual_plus): + """Sets the enable_dual_plus of this FuturesAccount. + + Whether to Support Split Position Mode # noqa: E501 + + :param enable_dual_plus: The enable_dual_plus of this FuturesAccount. # noqa: E501 + :type: bool + """ + + self._enable_dual_plus = enable_dual_plus + + @property + def position_mode(self): + """Gets the position_mode of this FuturesAccount. # noqa: E501 + + Position Holding Mode single - Single Direction Position, dual - Dual Direction Position, dual_plus - Split Position # noqa: E501 + + :return: The position_mode of this FuturesAccount. # noqa: E501 + :rtype: str + """ + return self._position_mode + + @position_mode.setter + def position_mode(self, position_mode): + """Sets the position_mode of this FuturesAccount. + + Position Holding Mode single - Single Direction Position, dual - Dual Direction Position, dual_plus - Split Position # noqa: E501 + + :param position_mode: The position_mode of this FuturesAccount. # noqa: E501 + :type: str + """ + + self._position_mode = position_mode + @property def history(self): """Gets the history of this FuturesAccount. # noqa: E501 diff --git a/gate_api/models/futures_account_history.py b/gate_api/models/futures_account_history.py index 69607440..c556670e 100644 --- a/gate_api/models/futures_account_history.py +++ b/gate_api/models/futures_account_history.py @@ -42,7 +42,8 @@ class FuturesAccountHistory(object): 'point_fee': 'str', 'point_refr': 'str', 'bonus_dnw': 'str', - 'bonus_offset': 'str' + 'bonus_offset': 'str', + 'cross_settle': 'str' } attribute_map = { @@ -55,11 +56,12 @@ class FuturesAccountHistory(object): 'point_fee': 'point_fee', 'point_refr': 'point_refr', 'bonus_dnw': 'bonus_dnw', - 'bonus_offset': 'bonus_offset' + 'bonus_offset': 'bonus_offset', + 'cross_settle': 'cross_settle' } - def __init__(self, dnw=None, pnl=None, fee=None, refr=None, fund=None, point_dnw=None, point_fee=None, point_refr=None, bonus_dnw=None, bonus_offset=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, str, str, Configuration) -> None + def __init__(self, dnw=None, pnl=None, fee=None, refr=None, fund=None, point_dnw=None, point_fee=None, point_refr=None, bonus_dnw=None, bonus_offset=None, cross_settle=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None """FuturesAccountHistory - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -75,6 +77,7 @@ def __init__(self, dnw=None, pnl=None, fee=None, refr=None, fund=None, point_dnw self._point_refr = None self._bonus_dnw = None self._bonus_offset = None + self._cross_settle = None self.discriminator = None if dnw is not None: @@ -97,6 +100,8 @@ def __init__(self, dnw=None, pnl=None, fee=None, refr=None, fund=None, point_dnw self.bonus_dnw = bonus_dnw if bonus_offset is not None: self.bonus_offset = bonus_offset + if cross_settle is not None: + self.cross_settle = cross_settle @property def dnw(self): @@ -328,6 +333,29 @@ def bonus_offset(self, bonus_offset): self._bonus_offset = bonus_offset + @property + def cross_settle(self): + """Gets the cross_settle of this FuturesAccountHistory. # noqa: E501 + + Represents the value of profit settlement from the futures account to the spot account under Unified Account Mode. Negative values indicate settlement from futures to spot, while positive values indicate settlement from spot to futures. This value is cumulative. # noqa: E501 + + :return: The cross_settle of this FuturesAccountHistory. # noqa: E501 + :rtype: str + """ + return self._cross_settle + + @cross_settle.setter + def cross_settle(self, cross_settle): + """Sets the cross_settle of this FuturesAccountHistory. + + Represents the value of profit settlement from the futures account to the spot account under Unified Account Mode. Negative values indicate settlement from futures to spot, while positive values indicate settlement from spot to futures. This value is cumulative. # noqa: E501 + + :param cross_settle: The cross_settle of this FuturesAccountHistory. # noqa: E501 + :type: str + """ + + self._cross_settle = cross_settle + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/futures_batch_amend_order_request.py b/gate_api/models/futures_batch_amend_order_request.py index cffe827b..1d88bae1 100644 --- a/gate_api/models/futures_batch_amend_order_request.py +++ b/gate_api/models/futures_batch_amend_order_request.py @@ -37,7 +37,8 @@ class FuturesBatchAmendOrderRequest(object): 'text': 'str', 'size': 'str', 'price': 'str', - 'amend_text': 'str' + 'amend_text': 'str', + 'action_mode': 'str' } attribute_map = { @@ -45,11 +46,12 @@ class FuturesBatchAmendOrderRequest(object): 'text': 'text', 'size': 'size', 'price': 'price', - 'amend_text': 'amend_text' + 'amend_text': 'amend_text', + 'action_mode': 'action_mode' } - def __init__(self, order_id=None, text=None, size=None, price=None, amend_text=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, str, str, str, Configuration) -> None + def __init__(self, order_id=None, text=None, size=None, price=None, amend_text=None, action_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, Configuration) -> None """FuturesBatchAmendOrderRequest - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -60,6 +62,7 @@ def __init__(self, order_id=None, text=None, size=None, price=None, amend_text=N self._size = None self._price = None self._amend_text = None + self._action_mode = None self.discriminator = None if order_id is not None: @@ -72,6 +75,8 @@ def __init__(self, order_id=None, text=None, size=None, price=None, amend_text=N self.price = price if amend_text is not None: self.amend_text = amend_text + if action_mode is not None: + self.action_mode = action_mode @property def order_id(self): @@ -188,6 +193,29 @@ def amend_text(self, amend_text): self._amend_text = amend_text + @property + def action_mode(self): + """Gets the action_mode of this FuturesBatchAmendOrderRequest. # noqa: E501 + + Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) # noqa: E501 + + :return: The action_mode of this FuturesBatchAmendOrderRequest. # noqa: E501 + :rtype: str + """ + return self._action_mode + + @action_mode.setter + def action_mode(self, action_mode): + """Sets the action_mode of this FuturesBatchAmendOrderRequest. + + Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) # noqa: E501 + + :param action_mode: The action_mode of this FuturesBatchAmendOrderRequest. # noqa: E501 + :type: str + """ + + self._action_mode = action_mode + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/futures_bbo_order.py b/gate_api/models/futures_bbo_order.py index e5981791..65816fda 100644 --- a/gate_api/models/futures_bbo_order.py +++ b/gate_api/models/futures_bbo_order.py @@ -54,7 +54,6 @@ class FuturesBBOOrder(object): 'stp_id': 'int', 'stp_act': 'str', 'amend_text': 'str', - 'limit_vip': 'int', 'pid': 'int' } @@ -80,12 +79,11 @@ class FuturesBBOOrder(object): 'stp_id': 'stp_id', 'stp_act': 'stp_act', 'amend_text': 'amend_text', - 'limit_vip': 'limit_vip', 'pid': 'pid' } - def __init__(self, contract=None, size=None, direction=None, iceberg=None, level=None, close=False, is_close=None, reduce_only=False, is_reduce_only=None, is_liq=None, tif='gtc', left=None, fill_price=None, text=None, tkfr=None, mkfr=None, refu=None, auto_size=None, stp_id=None, stp_act=None, amend_text=None, limit_vip=None, pid=None, local_vars_configuration=None): # noqa: E501 - # type: (str, int, str, int, int, bool, bool, bool, bool, bool, str, int, str, str, str, str, int, str, int, str, str, int, int, Configuration) -> None + def __init__(self, contract=None, size=None, direction=None, iceberg=None, level=None, close=False, is_close=None, reduce_only=False, is_reduce_only=None, is_liq=None, tif='gtc', left=None, fill_price=None, text=None, tkfr=None, mkfr=None, refu=None, auto_size=None, stp_id=None, stp_act=None, amend_text=None, pid=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, str, int, int, bool, bool, bool, bool, bool, str, int, str, str, str, str, int, str, int, str, str, int, Configuration) -> None """FuturesBBOOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -112,7 +110,6 @@ def __init__(self, contract=None, size=None, direction=None, iceberg=None, level self._stp_id = None self._stp_act = None self._amend_text = None - self._limit_vip = None self._pid = None self.discriminator = None @@ -154,8 +151,6 @@ def __init__(self, contract=None, size=None, direction=None, iceberg=None, level self.stp_act = stp_act if amend_text is not None: self.amend_text = amend_text - if limit_vip is not None: - self.limit_vip = limit_vip if pid is not None: self.pid = pid @@ -476,7 +471,7 @@ def fill_price(self, fill_price): def text(self): """Gets the text of this FuturesBBOOrder. # noqa: E501 - 订单自定义信息,用户可以用该字段设置自定义 ID,用户自定义字段必须满足以下条件: 1. 必须以 `t-` 开头 2. 不计算 `t-` ,长度不能超过 28 字节 3. 输入内容只能包含数字、字母、下划线(_)、中划线(-) 或者点(.) 除用户自定义信息以外,以下为内部保留字段,标识订单来源: - web: 网页 - api: API 调用 - app: 移动端 - auto_deleveraging: 自动减仓 - liquidation: ⽼经典模式仓位强制平仓 - liq-xxx: a. 新经典模式仓位强制平仓,包含逐仓、单向全仓、双向全仓⾮对冲仓位强平。 b. 统⼀账户单币种保证金模式逐仓强制平仓 - hedge-liq-xxx: 新经典模式双向全仓对冲部分强制平仓,即同时平多空仓位 - pm_liquidate: 统⼀账户跨币种保证金模式强制平仓 - comb_margin_liquidate: 统⼀账户组合保证金模式强制平仓 - scm_liquidate: 统⼀账户单币种保证金模式仓位强制平仓 - insurance: 保险 # noqa: E501 + Order Custom Information: Users can set custom IDs via this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Content can only contain numbers, letters, underscores (_), hyphens (-), or dots (.) In addition to user custom information, the following are internal reserved fields identifying order sources: - web: Web - api: API Call - app: Mobile App - auto_deleveraging: Auto-Deleveraging - liquidation: Forced Liquidation of Legacy Classic Mode Positions - liq-xxx: a. Forced liquidation of New Classic Mode positions, including isolated margin, single-direction cross margin, and non-hedged dual-direction cross margin positions. b. Forced liquidation of isolated margin positions in Unified Account Single-Currency Margin Mode - hedge-liq-xxx: Forced liquidation of hedged portions in New Classic Mode dual-direction cross margin (simultaneous closing of long and short positions) - pm_liquidate: Forced liquidation in Unified Account Cross-Currency Margin Mode - comb_margin_liquidate: Forced liquidation in Unified Account Portfolio Margin Mode - scm_liquidate: Forced liquidation of positions in Unified Account Single-Currency Margin Mode - insurance: Insurance # noqa: E501 :return: The text of this FuturesBBOOrder. # noqa: E501 :rtype: str @@ -487,7 +482,7 @@ def text(self): def text(self, text): """Sets the text of this FuturesBBOOrder. - 订单自定义信息,用户可以用该字段设置自定义 ID,用户自定义字段必须满足以下条件: 1. 必须以 `t-` 开头 2. 不计算 `t-` ,长度不能超过 28 字节 3. 输入内容只能包含数字、字母、下划线(_)、中划线(-) 或者点(.) 除用户自定义信息以外,以下为内部保留字段,标识订单来源: - web: 网页 - api: API 调用 - app: 移动端 - auto_deleveraging: 自动减仓 - liquidation: ⽼经典模式仓位强制平仓 - liq-xxx: a. 新经典模式仓位强制平仓,包含逐仓、单向全仓、双向全仓⾮对冲仓位强平。 b. 统⼀账户单币种保证金模式逐仓强制平仓 - hedge-liq-xxx: 新经典模式双向全仓对冲部分强制平仓,即同时平多空仓位 - pm_liquidate: 统⼀账户跨币种保证金模式强制平仓 - comb_margin_liquidate: 统⼀账户组合保证金模式强制平仓 - scm_liquidate: 统⼀账户单币种保证金模式仓位强制平仓 - insurance: 保险 # noqa: E501 + Order Custom Information: Users can set custom IDs via this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Content can only contain numbers, letters, underscores (_), hyphens (-), or dots (.) In addition to user custom information, the following are internal reserved fields identifying order sources: - web: Web - api: API Call - app: Mobile App - auto_deleveraging: Auto-Deleveraging - liquidation: Forced Liquidation of Legacy Classic Mode Positions - liq-xxx: a. Forced liquidation of New Classic Mode positions, including isolated margin, single-direction cross margin, and non-hedged dual-direction cross margin positions. b. Forced liquidation of isolated margin positions in Unified Account Single-Currency Margin Mode - hedge-liq-xxx: Forced liquidation of hedged portions in New Classic Mode dual-direction cross margin (simultaneous closing of long and short positions) - pm_liquidate: Forced liquidation in Unified Account Cross-Currency Margin Mode - comb_margin_liquidate: Forced liquidation in Unified Account Portfolio Margin Mode - scm_liquidate: Forced liquidation of positions in Unified Account Single-Currency Margin Mode - insurance: Insurance # noqa: E501 :param text: The text of this FuturesBBOOrder. # noqa: E501 :type: str @@ -668,29 +663,6 @@ def amend_text(self, amend_text): self._amend_text = amend_text - @property - def limit_vip(self): - """Gets the limit_vip of this FuturesBBOOrder. # noqa: E501 - - Counterparty user's VIP level for limit order fills. Current order will only match with orders whose VIP level is less than or equal to the specified level. Only 11~16 are supported; default is 0 # noqa: E501 - - :return: The limit_vip of this FuturesBBOOrder. # noqa: E501 - :rtype: int - """ - return self._limit_vip - - @limit_vip.setter - def limit_vip(self, limit_vip): - """Sets the limit_vip of this FuturesBBOOrder. - - Counterparty user's VIP level for limit order fills. Current order will only match with orders whose VIP level is less than or equal to the specified level. Only 11~16 are supported; default is 0 # noqa: E501 - - :param limit_vip: The limit_vip of this FuturesBBOOrder. # noqa: E501 - :type: int - """ - - self._limit_vip = limit_vip - @property def pid(self): """Gets the pid of this FuturesBBOOrder. # noqa: E501 diff --git a/gate_api/models/futures_direction.py b/gate_api/models/futures_direction.py new file mode 100644 index 00000000..20c07672 --- /dev/null +++ b/gate_api/models/futures_direction.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FuturesDirection(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + LONG = "long" + SHORT = "short" + NEUTRAL = "neutral" + + allowable_values = [LONG, SHORT, NEUTRAL] # noqa: E501 + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self, local_vars_configuration=None): # noqa: E501 + # type: (Configuration) -> None + """FuturesDirection - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FuturesDirection): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesDirection): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_grid_create_params.py b/gate_api/models/futures_grid_create_params.py new file mode 100644 index 00000000..93291375 --- /dev/null +++ b/gate_api/models/futures_grid_create_params.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FuturesGridCreateParams(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'money': 'str', + 'low_price': 'str', + 'high_price': 'str', + 'grid_num': 'int', + 'price_type': 'int', + 'leverage': 'str', + 'direction': 'FuturesDirection', + 'trigger_price': 'str', + 'stop_profit': 'str', + 'stop_loss': 'str', + 'profit_sharing_ratio': 'str', + 'is_use_base': 'bool' + } + + attribute_map = { + 'money': 'money', + 'low_price': 'low_price', + 'high_price': 'high_price', + 'grid_num': 'grid_num', + 'price_type': 'price_type', + 'leverage': 'leverage', + 'direction': 'direction', + 'trigger_price': 'trigger_price', + 'stop_profit': 'stop_profit', + 'stop_loss': 'stop_loss', + 'profit_sharing_ratio': 'profit_sharing_ratio', + 'is_use_base': 'is_use_base' + } + + def __init__(self, money=None, low_price=None, high_price=None, grid_num=None, price_type=None, leverage=None, direction=None, trigger_price=None, stop_profit=None, stop_loss=None, profit_sharing_ratio=None, is_use_base=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, int, str, FuturesDirection, str, str, str, str, bool, Configuration) -> None + """FuturesGridCreateParams - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._money = None + self._low_price = None + self._high_price = None + self._grid_num = None + self._price_type = None + self._leverage = None + self._direction = None + self._trigger_price = None + self._stop_profit = None + self._stop_loss = None + self._profit_sharing_ratio = None + self._is_use_base = None + self.discriminator = None + + self.money = money + self.low_price = low_price + self.high_price = high_price + self.grid_num = grid_num + self.price_type = price_type + self.leverage = leverage + if direction is not None: + self.direction = direction + if trigger_price is not None: + self.trigger_price = trigger_price + if stop_profit is not None: + self.stop_profit = stop_profit + if stop_loss is not None: + self.stop_loss = stop_loss + if profit_sharing_ratio is not None: + self.profit_sharing_ratio = profit_sharing_ratio + if is_use_base is not None: + self.is_use_base = is_use_base + + @property + def money(self): + """Gets the money of this FuturesGridCreateParams. # noqa: E501 + + + :return: The money of this FuturesGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this FuturesGridCreateParams. + + + :param money: The money of this FuturesGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and money is None: # noqa: E501 + raise ValueError("Invalid value for `money`, must not be `None`") # noqa: E501 + + self._money = money + + @property + def low_price(self): + """Gets the low_price of this FuturesGridCreateParams. # noqa: E501 + + + :return: The low_price of this FuturesGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._low_price + + @low_price.setter + def low_price(self, low_price): + """Sets the low_price of this FuturesGridCreateParams. + + + :param low_price: The low_price of this FuturesGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and low_price is None: # noqa: E501 + raise ValueError("Invalid value for `low_price`, must not be `None`") # noqa: E501 + + self._low_price = low_price + + @property + def high_price(self): + """Gets the high_price of this FuturesGridCreateParams. # noqa: E501 + + + :return: The high_price of this FuturesGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._high_price + + @high_price.setter + def high_price(self, high_price): + """Sets the high_price of this FuturesGridCreateParams. + + + :param high_price: The high_price of this FuturesGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and high_price is None: # noqa: E501 + raise ValueError("Invalid value for `high_price`, must not be `None`") # noqa: E501 + + self._high_price = high_price + + @property + def grid_num(self): + """Gets the grid_num of this FuturesGridCreateParams. # noqa: E501 + + + :return: The grid_num of this FuturesGridCreateParams. # noqa: E501 + :rtype: int + """ + return self._grid_num + + @grid_num.setter + def grid_num(self, grid_num): + """Sets the grid_num of this FuturesGridCreateParams. + + + :param grid_num: The grid_num of this FuturesGridCreateParams. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and grid_num is None: # noqa: E501 + raise ValueError("Invalid value for `grid_num`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + grid_num is not None and grid_num < 1): # noqa: E501 + raise ValueError("Invalid value for `grid_num`, must be a value greater than or equal to `1`") # noqa: E501 + + self._grid_num = grid_num + + @property + def price_type(self): + """Gets the price_type of this FuturesGridCreateParams. # noqa: E501 + + + :return: The price_type of this FuturesGridCreateParams. # noqa: E501 + :rtype: int + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this FuturesGridCreateParams. + + + :param price_type: The price_type of this FuturesGridCreateParams. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and price_type is None: # noqa: E501 + raise ValueError("Invalid value for `price_type`, must not be `None`") # noqa: E501 + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def leverage(self): + """Gets the leverage of this FuturesGridCreateParams. # noqa: E501 + + + :return: The leverage of this FuturesGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this FuturesGridCreateParams. + + + :param leverage: The leverage of this FuturesGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and leverage is None: # noqa: E501 + raise ValueError("Invalid value for `leverage`, must not be `None`") # noqa: E501 + + self._leverage = leverage + + @property + def direction(self): + """Gets the direction of this FuturesGridCreateParams. # noqa: E501 + + + :return: The direction of this FuturesGridCreateParams. # noqa: E501 + :rtype: FuturesDirection + """ + return self._direction + + @direction.setter + def direction(self, direction): + """Sets the direction of this FuturesGridCreateParams. + + + :param direction: The direction of this FuturesGridCreateParams. # noqa: E501 + :type: FuturesDirection + """ + + self._direction = direction + + @property + def trigger_price(self): + """Gets the trigger_price of this FuturesGridCreateParams. # noqa: E501 + + + :return: The trigger_price of this FuturesGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this FuturesGridCreateParams. + + + :param trigger_price: The trigger_price of this FuturesGridCreateParams. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def stop_profit(self): + """Gets the stop_profit of this FuturesGridCreateParams. # noqa: E501 + + + :return: The stop_profit of this FuturesGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._stop_profit + + @stop_profit.setter + def stop_profit(self, stop_profit): + """Sets the stop_profit of this FuturesGridCreateParams. + + + :param stop_profit: The stop_profit of this FuturesGridCreateParams. # noqa: E501 + :type: str + """ + + self._stop_profit = stop_profit + + @property + def stop_loss(self): + """Gets the stop_loss of this FuturesGridCreateParams. # noqa: E501 + + + :return: The stop_loss of this FuturesGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._stop_loss + + @stop_loss.setter + def stop_loss(self, stop_loss): + """Sets the stop_loss of this FuturesGridCreateParams. + + + :param stop_loss: The stop_loss of this FuturesGridCreateParams. # noqa: E501 + :type: str + """ + + self._stop_loss = stop_loss + + @property + def profit_sharing_ratio(self): + """Gets the profit_sharing_ratio of this FuturesGridCreateParams. # noqa: E501 + + + :return: The profit_sharing_ratio of this FuturesGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._profit_sharing_ratio + + @profit_sharing_ratio.setter + def profit_sharing_ratio(self, profit_sharing_ratio): + """Sets the profit_sharing_ratio of this FuturesGridCreateParams. + + + :param profit_sharing_ratio: The profit_sharing_ratio of this FuturesGridCreateParams. # noqa: E501 + :type: str + """ + + self._profit_sharing_ratio = profit_sharing_ratio + + @property + def is_use_base(self): + """Gets the is_use_base of this FuturesGridCreateParams. # noqa: E501 + + + :return: The is_use_base of this FuturesGridCreateParams. # noqa: E501 + :rtype: bool + """ + return self._is_use_base + + @is_use_base.setter + def is_use_base(self, is_use_base): + """Sets the is_use_base of this FuturesGridCreateParams. + + + :param is_use_base: The is_use_base of this FuturesGridCreateParams. # noqa: E501 + :type: bool + """ + + self._is_use_base = is_use_base + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FuturesGridCreateParams): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesGridCreateParams): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_grid_create_request.py b/gate_api/models/futures_grid_create_request.py new file mode 100644 index 00000000..d8dc038d --- /dev/null +++ b/gate_api/models/futures_grid_create_request.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FuturesGridCreateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_type': 'str', + 'market': 'str', + 'create_params': 'FuturesGridCreateParams' + } + + attribute_map = { + 'strategy_type': 'strategy_type', + 'market': 'market', + 'create_params': 'create_params' + } + + def __init__(self, strategy_type=None, market=None, create_params=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, FuturesGridCreateParams, Configuration) -> None + """FuturesGridCreateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_type = None + self._market = None + self._create_params = None + self.discriminator = None + + self.strategy_type = strategy_type + self.market = market + self.create_params = create_params + + @property + def strategy_type(self): + """Gets the strategy_type of this FuturesGridCreateRequest. # noqa: E501 + + + :return: The strategy_type of this FuturesGridCreateRequest. # noqa: E501 + :rtype: str + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this FuturesGridCreateRequest. + + + :param strategy_type: The strategy_type of this FuturesGridCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + allowed_values = ["futures_grid"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and strategy_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `strategy_type` ({0}), must be one of {1}" # noqa: E501 + .format(strategy_type, allowed_values) + ) + + self._strategy_type = strategy_type + + @property + def market(self): + """Gets the market of this FuturesGridCreateRequest. # noqa: E501 + + + :return: The market of this FuturesGridCreateRequest. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this FuturesGridCreateRequest. + + + :param market: The market of this FuturesGridCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def create_params(self): + """Gets the create_params of this FuturesGridCreateRequest. # noqa: E501 + + + :return: The create_params of this FuturesGridCreateRequest. # noqa: E501 + :rtype: FuturesGridCreateParams + """ + return self._create_params + + @create_params.setter + def create_params(self, create_params): + """Sets the create_params of this FuturesGridCreateRequest. + + + :param create_params: The create_params of this FuturesGridCreateRequest. # noqa: E501 + :type: FuturesGridCreateParams + """ + if self.local_vars_configuration.client_side_validation and create_params is None: # noqa: E501 + raise ValueError("Invalid value for `create_params`, must not be `None`") # noqa: E501 + + self._create_params = create_params + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FuturesGridCreateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesGridCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_initial_order.py b/gate_api/models/futures_initial_order.py index 09270e41..991aa8b8 100644 --- a/gate_api/models/futures_initial_order.py +++ b/gate_api/models/futures_initial_order.py @@ -35,6 +35,7 @@ class FuturesInitialOrder(object): openapi_types = { 'contract': 'str', 'size': 'int', + 'amount': 'str', 'price': 'str', 'close': 'bool', 'tif': 'str', @@ -48,6 +49,7 @@ class FuturesInitialOrder(object): attribute_map = { 'contract': 'contract', 'size': 'size', + 'amount': 'amount', 'price': 'price', 'close': 'close', 'tif': 'tif', @@ -58,8 +60,8 @@ class FuturesInitialOrder(object): 'is_close': 'is_close' } - def __init__(self, contract=None, size=None, price=None, close=False, tif='gtc', text=None, reduce_only=False, auto_size=None, is_reduce_only=None, is_close=None, local_vars_configuration=None): # noqa: E501 - # type: (str, int, str, bool, str, str, bool, str, bool, bool, Configuration) -> None + def __init__(self, contract=None, size=None, amount=None, price=None, close=False, tif='gtc', text=None, reduce_only=False, auto_size=None, is_reduce_only=None, is_close=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, str, str, bool, str, str, bool, str, bool, bool, Configuration) -> None """FuturesInitialOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -67,6 +69,7 @@ def __init__(self, contract=None, size=None, price=None, close=False, tif='gtc', self._contract = None self._size = None + self._amount = None self._price = None self._close = None self._tif = None @@ -80,6 +83,8 @@ def __init__(self, contract=None, size=None, price=None, close=False, tif='gtc', self.contract = contract if size is not None: self.size = size + if amount is not None: + self.amount = amount self.price = price if close is not None: self.close = close @@ -144,6 +149,29 @@ def size(self, size): self._size = size + @property + def amount(self): + """Gets the amount of this FuturesInitialOrder. # noqa: E501 + + Same as `size`; used for decimal contract size. When both `size` and `amount` are provided, `amount` takes precedence. # noqa: E501 + + :return: The amount of this FuturesInitialOrder. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this FuturesInitialOrder. + + Same as `size`; used for decimal contract size. When both `size` and `amount` are provided, `amount` takes precedence. # noqa: E501 + + :param amount: The amount of this FuturesInitialOrder. # noqa: E501 + :type: str + """ + + self._amount = amount + @property def price(self): """Gets the price of this FuturesInitialOrder. # noqa: E501 @@ -173,7 +201,7 @@ def price(self, price): def close(self): """Gets the close of this FuturesInitialOrder. # noqa: E501 - In One-way Mode, when closing all positions, this must be set to true to perform the closing operation When partially closing positions in One-way Mode or Hedge Mode, you can omit close or set close=false # noqa: E501 + When fully closing a position in single-position mode, close must be set to true to execute the close operation. When partially closing a position in single-position mode or in dual-position mode, close can be left unset or set to false. # noqa: E501 :return: The close of this FuturesInitialOrder. # noqa: E501 :rtype: bool @@ -184,7 +212,7 @@ def close(self): def close(self, close): """Sets the close of this FuturesInitialOrder. - In One-way Mode, when closing all positions, this must be set to true to perform the closing operation When partially closing positions in One-way Mode or Hedge Mode, you can omit close or set close=false # noqa: E501 + When fully closing a position in single-position mode, close must be set to true to execute the close operation. When partially closing a position in single-position mode or in dual-position mode, close can be left unset or set to false. # noqa: E501 :param close: The close of this FuturesInitialOrder. # noqa: E501 :type: bool diff --git a/gate_api/models/futures_leverage.py b/gate_api/models/futures_leverage.py new file mode 100644 index 00000000..5828639b --- /dev/null +++ b/gate_api/models/futures_leverage.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FuturesLeverage(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'lever': 'str' + } + + attribute_map = { + 'lever': 'Lever' + } + + def __init__(self, lever=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """FuturesLeverage - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._lever = None + self.discriminator = None + + if lever is not None: + self.lever = lever + + @property + def lever(self): + """Gets the lever of this FuturesLeverage. # noqa: E501 + + Leverage # noqa: E501 + + :return: The lever of this FuturesLeverage. # noqa: E501 + :rtype: str + """ + return self._lever + + @lever.setter + def lever(self, lever): + """Sets the lever of this FuturesLeverage. + + Leverage # noqa: E501 + + :param lever: The lever of this FuturesLeverage. # noqa: E501 + :type: str + """ + + self._lever = lever + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FuturesLeverage): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesLeverage): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_liq_order.py b/gate_api/models/futures_liq_order.py index 8d3c0441..b9117596 100644 --- a/gate_api/models/futures_liq_order.py +++ b/gate_api/models/futures_liq_order.py @@ -225,7 +225,7 @@ def fill_price(self, fill_price): def left(self): """Gets the left of this FuturesLiqOrder. # noqa: E501 - System liquidation order maker size # noqa: E501 + Reserved field with no current business significance. # noqa: E501 :return: The left of this FuturesLiqOrder. # noqa: E501 :rtype: str @@ -236,7 +236,7 @@ def left(self): def left(self, left): """Sets the left of this FuturesLiqOrder. - System liquidation order maker size # noqa: E501 + Reserved field with no current business significance. # noqa: E501 :param left: The left of this FuturesLiqOrder. # noqa: E501 :type: str diff --git a/gate_api/models/futures_order.py b/gate_api/models/futures_order.py index de59c09e..99ad5d73 100644 --- a/gate_api/models/futures_order.py +++ b/gate_api/models/futures_order.py @@ -61,9 +61,13 @@ class FuturesOrder(object): 'stp_act': 'str', 'amend_text': 'str', 'pid': 'int', - 'order_value': 'str', - 'trade_value': 'str', - 'market_order_slip_ratio': 'str' + 'market_order_slip_ratio': 'str', + 'pos_margin_mode': 'str', + 'action_mode': 'str', + 'tpsl_tp_trigger_price': 'str', + 'tpsl_sl_trigger_price': 'str', + 'tpsl_tp_bbo_type': 'str', + 'tpsl_sl_bbo_type': 'str' } attribute_map = { @@ -95,13 +99,17 @@ class FuturesOrder(object): 'stp_act': 'stp_act', 'amend_text': 'amend_text', 'pid': 'pid', - 'order_value': 'order_value', - 'trade_value': 'trade_value', - 'market_order_slip_ratio': 'market_order_slip_ratio' + 'market_order_slip_ratio': 'market_order_slip_ratio', + 'pos_margin_mode': 'pos_margin_mode', + 'action_mode': 'action_mode', + 'tpsl_tp_trigger_price': 'tpsl_tp_trigger_price', + 'tpsl_sl_trigger_price': 'tpsl_sl_trigger_price', + 'tpsl_tp_bbo_type': 'tpsl_tp_bbo_type', + 'tpsl_sl_bbo_type': 'tpsl_sl_bbo_type' } - def __init__(self, id=None, user=None, create_time=None, update_time=None, finish_time=None, finish_as=None, status=None, contract=None, size=None, iceberg=None, price=None, close=False, is_close=None, reduce_only=False, is_reduce_only=None, is_liq=None, tif='gtc', left=None, fill_price=None, text=None, tkfr=None, mkfr=None, refu=None, auto_size=None, stp_id=None, stp_act=None, amend_text=None, pid=None, order_value=None, trade_value=None, market_order_slip_ratio=None, local_vars_configuration=None): # noqa: E501 - # type: (int, int, float, float, float, str, str, str, str, str, str, bool, bool, bool, bool, bool, str, str, str, str, str, str, int, str, int, str, str, int, str, str, str, Configuration) -> None + def __init__(self, id=None, user=None, create_time=None, update_time=None, finish_time=None, finish_as=None, status=None, contract=None, size=None, iceberg=None, price=None, close=False, is_close=None, reduce_only=False, is_reduce_only=None, is_liq=None, tif='gtc', left=None, fill_price=None, text=None, tkfr=None, mkfr=None, refu=None, auto_size=None, stp_id=None, stp_act=None, amend_text=None, pid=None, market_order_slip_ratio=None, pos_margin_mode=None, action_mode=None, tpsl_tp_trigger_price=None, tpsl_sl_trigger_price=None, tpsl_tp_bbo_type=None, tpsl_sl_bbo_type=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, float, float, float, str, str, str, str, str, str, bool, bool, bool, bool, bool, str, str, str, str, str, str, int, str, int, str, str, int, str, str, str, str, str, str, str, Configuration) -> None """FuturesOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -135,9 +143,13 @@ def __init__(self, id=None, user=None, create_time=None, update_time=None, finis self._stp_act = None self._amend_text = None self._pid = None - self._order_value = None - self._trade_value = None self._market_order_slip_ratio = None + self._pos_margin_mode = None + self._action_mode = None + self._tpsl_tp_trigger_price = None + self._tpsl_sl_trigger_price = None + self._tpsl_tp_bbo_type = None + self._tpsl_sl_bbo_type = None self.discriminator = None if id is not None: @@ -193,12 +205,20 @@ def __init__(self, id=None, user=None, create_time=None, update_time=None, finis self.amend_text = amend_text if pid is not None: self.pid = pid - if order_value is not None: - self.order_value = order_value - if trade_value is not None: - self.trade_value = trade_value if market_order_slip_ratio is not None: self.market_order_slip_ratio = market_order_slip_ratio + if pos_margin_mode is not None: + self.pos_margin_mode = pos_margin_mode + if action_mode is not None: + self.action_mode = action_mode + if tpsl_tp_trigger_price is not None: + self.tpsl_tp_trigger_price = tpsl_tp_trigger_price + if tpsl_sl_trigger_price is not None: + self.tpsl_sl_trigger_price = tpsl_sl_trigger_price + if tpsl_tp_bbo_type is not None: + self.tpsl_tp_bbo_type = tpsl_tp_bbo_type + if tpsl_sl_bbo_type is not None: + self.tpsl_sl_bbo_type = tpsl_sl_bbo_type @property def id(self): @@ -881,73 +901,165 @@ def pid(self, pid): self._pid = pid @property - def order_value(self): - """Gets the order_value of this FuturesOrder. # noqa: E501 + def market_order_slip_ratio(self): + """Gets the market_order_slip_ratio of this FuturesOrder. # noqa: E501 - order's value # noqa: E501 + Custom maximum slippage rate for market orders. If not provided, the default contract settings will be used # noqa: E501 - :return: The order_value of this FuturesOrder. # noqa: E501 + :return: The market_order_slip_ratio of this FuturesOrder. # noqa: E501 :rtype: str """ - return self._order_value + return self._market_order_slip_ratio - @order_value.setter - def order_value(self, order_value): - """Sets the order_value of this FuturesOrder. + @market_order_slip_ratio.setter + def market_order_slip_ratio(self, market_order_slip_ratio): + """Sets the market_order_slip_ratio of this FuturesOrder. - order's value # noqa: E501 + Custom maximum slippage rate for market orders. If not provided, the default contract settings will be used # noqa: E501 - :param order_value: The order_value of this FuturesOrder. # noqa: E501 + :param market_order_slip_ratio: The market_order_slip_ratio of this FuturesOrder. # noqa: E501 :type: str """ - self._order_value = order_value + self._market_order_slip_ratio = market_order_slip_ratio @property - def trade_value(self): - """Gets the trade_value of this FuturesOrder. # noqa: E501 + def pos_margin_mode(self): + """Gets the pos_margin_mode of this FuturesOrder. # noqa: E501 - trade value # noqa: E501 + Position Margin Mode isolated - Isolated Margin, cross - Cross Margin, only passed in simple split position mode # noqa: E501 - :return: The trade_value of this FuturesOrder. # noqa: E501 + :return: The pos_margin_mode of this FuturesOrder. # noqa: E501 :rtype: str """ - return self._trade_value + return self._pos_margin_mode - @trade_value.setter - def trade_value(self, trade_value): - """Sets the trade_value of this FuturesOrder. + @pos_margin_mode.setter + def pos_margin_mode(self, pos_margin_mode): + """Sets the pos_margin_mode of this FuturesOrder. - trade value # noqa: E501 + Position Margin Mode isolated - Isolated Margin, cross - Cross Margin, only passed in simple split position mode # noqa: E501 - :param trade_value: The trade_value of this FuturesOrder. # noqa: E501 + :param pos_margin_mode: The pos_margin_mode of this FuturesOrder. # noqa: E501 :type: str """ - self._trade_value = trade_value + self._pos_margin_mode = pos_margin_mode @property - def market_order_slip_ratio(self): - """Gets the market_order_slip_ratio of this FuturesOrder. # noqa: E501 + def action_mode(self): + """Gets the action_mode of this FuturesOrder. # noqa: E501 - Custom maximum slippage rate for market orders. If not provided, the default contract settings will be used # noqa: E501 + Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) # noqa: E501 - :return: The market_order_slip_ratio of this FuturesOrder. # noqa: E501 + :return: The action_mode of this FuturesOrder. # noqa: E501 :rtype: str """ - return self._market_order_slip_ratio + return self._action_mode - @market_order_slip_ratio.setter - def market_order_slip_ratio(self, market_order_slip_ratio): - """Sets the market_order_slip_ratio of this FuturesOrder. + @action_mode.setter + def action_mode(self, action_mode): + """Sets the action_mode of this FuturesOrder. - Custom maximum slippage rate for market orders. If not provided, the default contract settings will be used # noqa: E501 + Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) # noqa: E501 - :param market_order_slip_ratio: The market_order_slip_ratio of this FuturesOrder. # noqa: E501 + :param action_mode: The action_mode of this FuturesOrder. # noqa: E501 :type: str """ - self._market_order_slip_ratio = market_order_slip_ratio + self._action_mode = action_mode + + @property + def tpsl_tp_trigger_price(self): + """Gets the tpsl_tp_trigger_price of this FuturesOrder. # noqa: E501 + + Take profit price # noqa: E501 + + :return: The tpsl_tp_trigger_price of this FuturesOrder. # noqa: E501 + :rtype: str + """ + return self._tpsl_tp_trigger_price + + @tpsl_tp_trigger_price.setter + def tpsl_tp_trigger_price(self, tpsl_tp_trigger_price): + """Sets the tpsl_tp_trigger_price of this FuturesOrder. + + Take profit price # noqa: E501 + + :param tpsl_tp_trigger_price: The tpsl_tp_trigger_price of this FuturesOrder. # noqa: E501 + :type: str + """ + + self._tpsl_tp_trigger_price = tpsl_tp_trigger_price + + @property + def tpsl_sl_trigger_price(self): + """Gets the tpsl_sl_trigger_price of this FuturesOrder. # noqa: E501 + + Stop loss price # noqa: E501 + + :return: The tpsl_sl_trigger_price of this FuturesOrder. # noqa: E501 + :rtype: str + """ + return self._tpsl_sl_trigger_price + + @tpsl_sl_trigger_price.setter + def tpsl_sl_trigger_price(self, tpsl_sl_trigger_price): + """Sets the tpsl_sl_trigger_price of this FuturesOrder. + + Stop loss price # noqa: E501 + + :param tpsl_sl_trigger_price: The tpsl_sl_trigger_price of this FuturesOrder. # noqa: E501 + :type: str + """ + + self._tpsl_sl_trigger_price = tpsl_sl_trigger_price + + @property + def tpsl_tp_bbo_type(self): + """Gets the tpsl_tp_bbo_type of this FuturesOrder. # noqa: E501 + + Take profit BBO type # noqa: E501 + + :return: The tpsl_tp_bbo_type of this FuturesOrder. # noqa: E501 + :rtype: str + """ + return self._tpsl_tp_bbo_type + + @tpsl_tp_bbo_type.setter + def tpsl_tp_bbo_type(self, tpsl_tp_bbo_type): + """Sets the tpsl_tp_bbo_type of this FuturesOrder. + + Take profit BBO type # noqa: E501 + + :param tpsl_tp_bbo_type: The tpsl_tp_bbo_type of this FuturesOrder. # noqa: E501 + :type: str + """ + + self._tpsl_tp_bbo_type = tpsl_tp_bbo_type + + @property + def tpsl_sl_bbo_type(self): + """Gets the tpsl_sl_bbo_type of this FuturesOrder. # noqa: E501 + + Stop loss BBO type # noqa: E501 + + :return: The tpsl_sl_bbo_type of this FuturesOrder. # noqa: E501 + :rtype: str + """ + return self._tpsl_sl_bbo_type + + @tpsl_sl_bbo_type.setter + def tpsl_sl_bbo_type(self, tpsl_sl_bbo_type): + """Sets the tpsl_sl_bbo_type of this FuturesOrder. + + Stop loss BBO type # noqa: E501 + + :param tpsl_sl_bbo_type: The tpsl_sl_bbo_type of this FuturesOrder. # noqa: E501 + :type: str + """ + + self._tpsl_sl_bbo_type = tpsl_sl_bbo_type def to_dict(self): """Returns the model properties as a dict""" diff --git a/gate_api/models/futures_order_amendment.py b/gate_api/models/futures_order_amendment.py index fe5c6a47..777547a6 100644 --- a/gate_api/models/futures_order_amendment.py +++ b/gate_api/models/futures_order_amendment.py @@ -36,18 +36,20 @@ class FuturesOrderAmendment(object): 'size': 'str', 'price': 'str', 'amend_text': 'str', - 'text': 'str' + 'text': 'str', + 'action_mode': 'str' } attribute_map = { 'size': 'size', 'price': 'price', 'amend_text': 'amend_text', - 'text': 'text' + 'text': 'text', + 'action_mode': 'action_mode' } - def __init__(self, size=None, price=None, amend_text=None, text=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, Configuration) -> None + def __init__(self, size=None, price=None, amend_text=None, text=None, action_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None """FuturesOrderAmendment - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -57,6 +59,7 @@ def __init__(self, size=None, price=None, amend_text=None, text=None, local_vars self._price = None self._amend_text = None self._text = None + self._action_mode = None self.discriminator = None if size is not None: @@ -67,6 +70,8 @@ def __init__(self, size=None, price=None, amend_text=None, text=None, local_vars self.amend_text = amend_text if text is not None: self.text = text + if action_mode is not None: + self.action_mode = action_mode @property def size(self): @@ -160,6 +165,29 @@ def text(self, text): self._text = text + @property + def action_mode(self): + """Gets the action_mode of this FuturesOrderAmendment. # noqa: E501 + + Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) # noqa: E501 + + :return: The action_mode of this FuturesOrderAmendment. # noqa: E501 + :rtype: str + """ + return self._action_mode + + @action_mode.setter + def action_mode(self, action_mode): + """Sets the action_mode of this FuturesOrderAmendment. + + Processing Mode When placing an order, different fields are returned based on the action_mode - `ACK`: Asynchronous mode, returns only key order fields - `RESULT`: No clearing information - `FULL`: Full mode (default) # noqa: E501 + + :param action_mode: The action_mode of this FuturesOrderAmendment. # noqa: E501 + :type: str + """ + + self._action_mode = action_mode + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/futures_order_timerange.py b/gate_api/models/futures_order_timerange.py new file mode 100644 index 00000000..eee7da69 --- /dev/null +++ b/gate_api/models/futures_order_timerange.py @@ -0,0 +1,1024 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class FuturesOrderTimerange(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'user': 'int', + 'create_time': 'float', + 'update_time': 'str', + 'finish_time': 'str', + 'finish_as': 'str', + 'status': 'str', + 'contract': 'str', + 'size': 'str', + 'iceberg': 'str', + 'price': 'str', + 'close': 'bool', + 'is_close': 'bool', + 'reduce_only': 'bool', + 'is_reduce_only': 'bool', + 'is_liq': 'bool', + 'tif': 'str', + 'left': 'str', + 'fill_price': 'str', + 'text': 'str', + 'tkfr': 'str', + 'mkfr': 'str', + 'refu': 'int', + 'auto_size': 'str', + 'stp_id': 'int', + 'stp_act': 'str', + 'amend_text': 'str', + 'pid': 'int', + 'market_order_slip_ratio': 'str', + 'pos_margin_mode': 'str', + 'tpsl_tp_trigger_price': 'str', + 'tpsl_sl_trigger_price': 'str' + } + + attribute_map = { + 'id': 'id', + 'user': 'user', + 'create_time': 'create_time', + 'update_time': 'update_time', + 'finish_time': 'finish_time', + 'finish_as': 'finish_as', + 'status': 'status', + 'contract': 'contract', + 'size': 'size', + 'iceberg': 'iceberg', + 'price': 'price', + 'close': 'close', + 'is_close': 'is_close', + 'reduce_only': 'reduce_only', + 'is_reduce_only': 'is_reduce_only', + 'is_liq': 'is_liq', + 'tif': 'tif', + 'left': 'left', + 'fill_price': 'fill_price', + 'text': 'text', + 'tkfr': 'tkfr', + 'mkfr': 'mkfr', + 'refu': 'refu', + 'auto_size': 'auto_size', + 'stp_id': 'stp_id', + 'stp_act': 'stp_act', + 'amend_text': 'amend_text', + 'pid': 'pid', + 'market_order_slip_ratio': 'market_order_slip_ratio', + 'pos_margin_mode': 'pos_margin_mode', + 'tpsl_tp_trigger_price': 'tpsl_tp_trigger_price', + 'tpsl_sl_trigger_price': 'tpsl_sl_trigger_price' + } + + def __init__(self, id=None, user=None, create_time=None, update_time=None, finish_time=None, finish_as=None, status=None, contract=None, size=None, iceberg=None, price=None, close=False, is_close=None, reduce_only=False, is_reduce_only=None, is_liq=None, tif='gtc', left=None, fill_price=None, text=None, tkfr=None, mkfr=None, refu=None, auto_size=None, stp_id=None, stp_act=None, amend_text=None, pid=None, market_order_slip_ratio=None, pos_margin_mode=None, tpsl_tp_trigger_price=None, tpsl_sl_trigger_price=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, float, str, str, str, str, str, str, str, str, bool, bool, bool, bool, bool, str, str, str, str, str, str, int, str, int, str, str, int, str, str, str, str, Configuration) -> None + """FuturesOrderTimerange - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._user = None + self._create_time = None + self._update_time = None + self._finish_time = None + self._finish_as = None + self._status = None + self._contract = None + self._size = None + self._iceberg = None + self._price = None + self._close = None + self._is_close = None + self._reduce_only = None + self._is_reduce_only = None + self._is_liq = None + self._tif = None + self._left = None + self._fill_price = None + self._text = None + self._tkfr = None + self._mkfr = None + self._refu = None + self._auto_size = None + self._stp_id = None + self._stp_act = None + self._amend_text = None + self._pid = None + self._market_order_slip_ratio = None + self._pos_margin_mode = None + self._tpsl_tp_trigger_price = None + self._tpsl_sl_trigger_price = None + self.discriminator = None + + if id is not None: + self.id = id + if user is not None: + self.user = user + if create_time is not None: + self.create_time = create_time + if update_time is not None: + self.update_time = update_time + if finish_time is not None: + self.finish_time = finish_time + if finish_as is not None: + self.finish_as = finish_as + if status is not None: + self.status = status + self.contract = contract + self.size = size + if iceberg is not None: + self.iceberg = iceberg + self.price = price + if close is not None: + self.close = close + if is_close is not None: + self.is_close = is_close + if reduce_only is not None: + self.reduce_only = reduce_only + if is_reduce_only is not None: + self.is_reduce_only = is_reduce_only + if is_liq is not None: + self.is_liq = is_liq + if tif is not None: + self.tif = tif + if left is not None: + self.left = left + if fill_price is not None: + self.fill_price = fill_price + if text is not None: + self.text = text + if tkfr is not None: + self.tkfr = tkfr + if mkfr is not None: + self.mkfr = mkfr + if refu is not None: + self.refu = refu + if auto_size is not None: + self.auto_size = auto_size + if stp_id is not None: + self.stp_id = stp_id + if stp_act is not None: + self.stp_act = stp_act + if amend_text is not None: + self.amend_text = amend_text + if pid is not None: + self.pid = pid + if market_order_slip_ratio is not None: + self.market_order_slip_ratio = market_order_slip_ratio + if pos_margin_mode is not None: + self.pos_margin_mode = pos_margin_mode + if tpsl_tp_trigger_price is not None: + self.tpsl_tp_trigger_price = tpsl_tp_trigger_price + if tpsl_sl_trigger_price is not None: + self.tpsl_sl_trigger_price = tpsl_sl_trigger_price + + @property + def id(self): + """Gets the id of this FuturesOrderTimerange. # noqa: E501 + + Futures order ID # noqa: E501 + + :return: The id of this FuturesOrderTimerange. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FuturesOrderTimerange. + + Futures order ID # noqa: E501 + + :param id: The id of this FuturesOrderTimerange. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def user(self): + """Gets the user of this FuturesOrderTimerange. # noqa: E501 + + User ID # noqa: E501 + + :return: The user of this FuturesOrderTimerange. # noqa: E501 + :rtype: int + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this FuturesOrderTimerange. + + User ID # noqa: E501 + + :param user: The user of this FuturesOrderTimerange. # noqa: E501 + :type: int + """ + + self._user = user + + @property + def create_time(self): + """Gets the create_time of this FuturesOrderTimerange. # noqa: E501 + + Creation time of order # noqa: E501 + + :return: The create_time of this FuturesOrderTimerange. # noqa: E501 + :rtype: float + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this FuturesOrderTimerange. + + Creation time of order # noqa: E501 + + :param create_time: The create_time of this FuturesOrderTimerange. # noqa: E501 + :type: float + """ + + self._create_time = create_time + + @property + def update_time(self): + """Gets the update_time of this FuturesOrderTimerange. # noqa: E501 + + OrderUpdateTime # noqa: E501 + + :return: The update_time of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this FuturesOrderTimerange. + + OrderUpdateTime # noqa: E501 + + :param update_time: The update_time of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._update_time = update_time + + @property + def finish_time(self): + """Gets the finish_time of this FuturesOrderTimerange. # noqa: E501 + + Order finished time. Not returned if order is open # noqa: E501 + + :return: The finish_time of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._finish_time + + @finish_time.setter + def finish_time(self, finish_time): + """Sets the finish_time of this FuturesOrderTimerange. + + Order finished time. Not returned if order is open # noqa: E501 + + :param finish_time: The finish_time of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._finish_time = finish_time + + @property + def finish_as(self): + """Gets the finish_as of this FuturesOrderTimerange. # noqa: E501 + + How the order was finished: - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set - position_closed: cancelled because the position was closed - reduce_out: only reduce positions by excluding hard-to-fill orders - stp: cancelled because self trade prevention # noqa: E501 + + :return: The finish_as of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._finish_as + + @finish_as.setter + def finish_as(self, finish_as): + """Sets the finish_as of this FuturesOrderTimerange. + + How the order was finished: - filled: all filled - cancelled: manually cancelled - liquidated: cancelled because of liquidation - ioc: time in force is `IOC`, finish immediately - auto_deleveraged: finished by ADL - reduce_only: cancelled because of increasing position while `reduce-only` set - position_closed: cancelled because the position was closed - reduce_out: only reduce positions by excluding hard-to-fill orders - stp: cancelled because self trade prevention # noqa: E501 + + :param finish_as: The finish_as of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + allowed_values = ["filled", "cancelled", "liquidated", "ioc", "auto_deleveraged", "reduce_only", "position_closed", "reduce_out", "stp"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and finish_as not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `finish_as` ({0}), must be one of {1}" # noqa: E501 + .format(finish_as, allowed_values) + ) + + self._finish_as = finish_as + + @property + def status(self): + """Gets the status of this FuturesOrderTimerange. # noqa: E501 + + Order status - `open`: Pending - `finished`: Completed # noqa: E501 + + :return: The status of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this FuturesOrderTimerange. + + Order status - `open`: Pending - `finished`: Completed # noqa: E501 + + :param status: The status of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + allowed_values = ["open", "finished"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def contract(self): + """Gets the contract of this FuturesOrderTimerange. # noqa: E501 + + Futures contract # noqa: E501 + + :return: The contract of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this FuturesOrderTimerange. + + Futures contract # noqa: E501 + + :param contract: The contract of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and contract is None: # noqa: E501 + raise ValueError("Invalid value for `contract`, must not be `None`") # noqa: E501 + + self._contract = contract + + @property + def size(self): + """Gets the size of this FuturesOrderTimerange. # noqa: E501 + + Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. # noqa: E501 + + :return: The size of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this FuturesOrderTimerange. + + Required. Trading quantity. Positive for buy, negative for sell. Set to 0 for close position orders. # noqa: E501 + + :param size: The size of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and size is None: # noqa: E501 + raise ValueError("Invalid value for `size`, must not be `None`") # noqa: E501 + + self._size = size + + @property + def iceberg(self): + """Gets the iceberg of this FuturesOrderTimerange. # noqa: E501 + + Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. # noqa: E501 + + :return: The iceberg of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._iceberg + + @iceberg.setter + def iceberg(self, iceberg): + """Sets the iceberg of this FuturesOrderTimerange. + + Display size for iceberg orders. 0 for non-iceberg orders. Note that hidden portions are charged taker fees. # noqa: E501 + + :param iceberg: The iceberg of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._iceberg = iceberg + + @property + def price(self): + """Gets the price of this FuturesOrderTimerange. # noqa: E501 + + Required. Order Price; a price of 0 with `tif` as `ioc` represents a market order. # noqa: E501 + + :return: The price of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this FuturesOrderTimerange. + + Required. Order Price; a price of 0 with `tif` as `ioc` represents a market order. # noqa: E501 + + :param price: The price of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price is None: # noqa: E501 + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + @property + def close(self): + """Gets the close of this FuturesOrderTimerange. # noqa: E501 + + Set as `true` to close the position, with `size` set to 0 # noqa: E501 + + :return: The close of this FuturesOrderTimerange. # noqa: E501 + :rtype: bool + """ + return self._close + + @close.setter + def close(self, close): + """Sets the close of this FuturesOrderTimerange. + + Set as `true` to close the position, with `size` set to 0 # noqa: E501 + + :param close: The close of this FuturesOrderTimerange. # noqa: E501 + :type: bool + """ + + self._close = close + + @property + def is_close(self): + """Gets the is_close of this FuturesOrderTimerange. # noqa: E501 + + Is the order to close position # noqa: E501 + + :return: The is_close of this FuturesOrderTimerange. # noqa: E501 + :rtype: bool + """ + return self._is_close + + @is_close.setter + def is_close(self, is_close): + """Sets the is_close of this FuturesOrderTimerange. + + Is the order to close position # noqa: E501 + + :param is_close: The is_close of this FuturesOrderTimerange. # noqa: E501 + :type: bool + """ + + self._is_close = is_close + + @property + def reduce_only(self): + """Gets the reduce_only of this FuturesOrderTimerange. # noqa: E501 + + Set as `true` to be reduce-only order # noqa: E501 + + :return: The reduce_only of this FuturesOrderTimerange. # noqa: E501 + :rtype: bool + """ + return self._reduce_only + + @reduce_only.setter + def reduce_only(self, reduce_only): + """Sets the reduce_only of this FuturesOrderTimerange. + + Set as `true` to be reduce-only order # noqa: E501 + + :param reduce_only: The reduce_only of this FuturesOrderTimerange. # noqa: E501 + :type: bool + """ + + self._reduce_only = reduce_only + + @property + def is_reduce_only(self): + """Gets the is_reduce_only of this FuturesOrderTimerange. # noqa: E501 + + Is the order reduce-only # noqa: E501 + + :return: The is_reduce_only of this FuturesOrderTimerange. # noqa: E501 + :rtype: bool + """ + return self._is_reduce_only + + @is_reduce_only.setter + def is_reduce_only(self, is_reduce_only): + """Sets the is_reduce_only of this FuturesOrderTimerange. + + Is the order reduce-only # noqa: E501 + + :param is_reduce_only: The is_reduce_only of this FuturesOrderTimerange. # noqa: E501 + :type: bool + """ + + self._is_reduce_only = is_reduce_only + + @property + def is_liq(self): + """Gets the is_liq of this FuturesOrderTimerange. # noqa: E501 + + Is the order for liquidation # noqa: E501 + + :return: The is_liq of this FuturesOrderTimerange. # noqa: E501 + :rtype: bool + """ + return self._is_liq + + @is_liq.setter + def is_liq(self, is_liq): + """Sets the is_liq of this FuturesOrderTimerange. + + Is the order for liquidation # noqa: E501 + + :param is_liq: The is_liq of this FuturesOrderTimerange. # noqa: E501 + :type: bool + """ + + self._is_liq = is_liq + + @property + def tif(self): + """Gets the tif of this FuturesOrderTimerange. # noqa: E501 + + Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none # noqa: E501 + + :return: The tif of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._tif + + @tif.setter + def tif(self, tif): + """Sets the tif of this FuturesOrderTimerange. + + Time in force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only - poc: PendingOrCancelled, makes a post-only order that always enjoys a maker fee - fok: FillOrKill, fill either completely or none # noqa: E501 + + :param tif: The tif of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + allowed_values = ["gtc", "ioc", "poc", "fok"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and tif not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `tif` ({0}), must be one of {1}" # noqa: E501 + .format(tif, allowed_values) + ) + + self._tif = tif + + @property + def left(self): + """Gets the left of this FuturesOrderTimerange. # noqa: E501 + + Unfilled quantity # noqa: E501 + + :return: The left of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._left + + @left.setter + def left(self, left): + """Sets the left of this FuturesOrderTimerange. + + Unfilled quantity # noqa: E501 + + :param left: The left of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._left = left + + @property + def fill_price(self): + """Gets the fill_price of this FuturesOrderTimerange. # noqa: E501 + + Fill price # noqa: E501 + + :return: The fill_price of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._fill_price + + @fill_price.setter + def fill_price(self, fill_price): + """Sets the fill_price of this FuturesOrderTimerange. + + Fill price # noqa: E501 + + :param fill_price: The fill_price of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._fill_price = fill_price + + @property + def text(self): + """Gets the text of this FuturesOrderTimerange. # noqa: E501 + + Custom order information. If not empty, must follow the rules below: 1. Prefixed with `t-` 2. No longer than 28 bytes without `t-` prefix 3. Can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) In addition to user-defined information, the following are internal reserved fields that identify the order source: - web: Web - api: API call - app: Mobile app - auto_deleveraging: Automatic deleveraging - liquidation: Forced liquidation of positions under the old classic mode - liq-xxx: a. Forced liquidation of positions under the new classic mode, including isolated margin, one-way cross margin, and non-hedged positions under two-way cross margin. b. Forced liquidation of isolated positions under the unified account single-currency margin mode - hedge-liq-xxx: Forced liquidation of hedged positions under the new classic mode two-way cross margin, i.e., simultaneously closing long and short positions - pm_liquidate: Forced liquidation under unified account multi-currency margin mode - comb_margin_liquidate: Forced liquidation under unified account portfolio margin mode - scm_liquidate: Forced liquidation of positions under unified account single-currency margin mode - insurance: Insurance - clear: Contract delisting withdrawal # noqa: E501 + + :return: The text of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this FuturesOrderTimerange. + + Custom order information. If not empty, must follow the rules below: 1. Prefixed with `t-` 2. No longer than 28 bytes without `t-` prefix 3. Can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) In addition to user-defined information, the following are internal reserved fields that identify the order source: - web: Web - api: API call - app: Mobile app - auto_deleveraging: Automatic deleveraging - liquidation: Forced liquidation of positions under the old classic mode - liq-xxx: a. Forced liquidation of positions under the new classic mode, including isolated margin, one-way cross margin, and non-hedged positions under two-way cross margin. b. Forced liquidation of isolated positions under the unified account single-currency margin mode - hedge-liq-xxx: Forced liquidation of hedged positions under the new classic mode two-way cross margin, i.e., simultaneously closing long and short positions - pm_liquidate: Forced liquidation under unified account multi-currency margin mode - comb_margin_liquidate: Forced liquidation under unified account portfolio margin mode - scm_liquidate: Forced liquidation of positions under unified account single-currency margin mode - insurance: Insurance - clear: Contract delisting withdrawal # noqa: E501 + + :param text: The text of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def tkfr(self): + """Gets the tkfr of this FuturesOrderTimerange. # noqa: E501 + + Taker fee # noqa: E501 + + :return: The tkfr of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._tkfr + + @tkfr.setter + def tkfr(self, tkfr): + """Sets the tkfr of this FuturesOrderTimerange. + + Taker fee # noqa: E501 + + :param tkfr: The tkfr of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._tkfr = tkfr + + @property + def mkfr(self): + """Gets the mkfr of this FuturesOrderTimerange. # noqa: E501 + + Maker fee # noqa: E501 + + :return: The mkfr of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._mkfr + + @mkfr.setter + def mkfr(self, mkfr): + """Sets the mkfr of this FuturesOrderTimerange. + + Maker fee # noqa: E501 + + :param mkfr: The mkfr of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._mkfr = mkfr + + @property + def refu(self): + """Gets the refu of this FuturesOrderTimerange. # noqa: E501 + + Referrer user ID # noqa: E501 + + :return: The refu of this FuturesOrderTimerange. # noqa: E501 + :rtype: int + """ + return self._refu + + @refu.setter + def refu(self, refu): + """Sets the refu of this FuturesOrderTimerange. + + Referrer user ID # noqa: E501 + + :param refu: The refu of this FuturesOrderTimerange. # noqa: E501 + :type: int + """ + + self._refu = refu + + @property + def auto_size(self): + """Gets the auto_size of this FuturesOrderTimerange. # noqa: E501 + + Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 # noqa: E501 + + :return: The auto_size of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._auto_size + + @auto_size.setter + def auto_size(self, auto_size): + """Sets the auto_size of this FuturesOrderTimerange. + + Set side to close dual-mode position. `close_long` closes the long side; while `close_short` the short one. Note `size` also needs to be set to 0 # noqa: E501 + + :param auto_size: The auto_size of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + allowed_values = ["close_long", "close_short"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and auto_size not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `auto_size` ({0}), must be one of {1}" # noqa: E501 + .format(auto_size, allowed_values) + ) + + self._auto_size = auto_size + + @property + def stp_id(self): + """Gets the stp_id of this FuturesOrderTimerange. # noqa: E501 + + Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` # noqa: E501 + + :return: The stp_id of this FuturesOrderTimerange. # noqa: E501 + :rtype: int + """ + return self._stp_id + + @stp_id.setter + def stp_id(self, stp_id): + """Sets the stp_id of this FuturesOrderTimerange. + + Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` # noqa: E501 + + :param stp_id: The stp_id of this FuturesOrderTimerange. # noqa: E501 + :type: int + """ + + self._stp_id = stp_id + + @property + def stp_act(self): + """Gets the stp_act of this FuturesOrderTimerange. # noqa: E501 + + Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies 1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy. 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter. 3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-' - cn: Cancel newest, cancel new orders and keep old ones - co: Cancel oldest, cancel old orders and keep new ones - cb: Cancel both, both old and new orders will be cancelled # noqa: E501 + + :return: The stp_act of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._stp_act + + @stp_act.setter + def stp_act(self, stp_act): + """Sets the stp_act of this FuturesOrderTimerange. + + Self-Trading Prevention Action. Users can use this field to set self-trade prevention strategies 1. After users join the `STP Group`, they can pass `stp_act` to limit the user's self-trade prevention strategy. If `stp_act` is not passed, the default is `cn` strategy. 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter. 3. If the user did not use `stp_act` when placing the order, `stp_act` will return '-' - cn: Cancel newest, cancel new orders and keep old ones - co: Cancel oldest, cancel old orders and keep new ones - cb: Cancel both, both old and new orders will be cancelled # noqa: E501 + + :param stp_act: The stp_act of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + allowed_values = ["co", "cn", "cb", "-"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and stp_act not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `stp_act` ({0}), must be one of {1}" # noqa: E501 + .format(stp_act, allowed_values) + ) + + self._stp_act = stp_act + + @property + def amend_text(self): + """Gets the amend_text of this FuturesOrderTimerange. # noqa: E501 + + The custom data that the user remarked when amending the order # noqa: E501 + + :return: The amend_text of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._amend_text + + @amend_text.setter + def amend_text(self, amend_text): + """Sets the amend_text of this FuturesOrderTimerange. + + The custom data that the user remarked when amending the order # noqa: E501 + + :param amend_text: The amend_text of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._amend_text = amend_text + + @property + def pid(self): + """Gets the pid of this FuturesOrderTimerange. # noqa: E501 + + Position ID # noqa: E501 + + :return: The pid of this FuturesOrderTimerange. # noqa: E501 + :rtype: int + """ + return self._pid + + @pid.setter + def pid(self, pid): + """Sets the pid of this FuturesOrderTimerange. + + Position ID # noqa: E501 + + :param pid: The pid of this FuturesOrderTimerange. # noqa: E501 + :type: int + """ + + self._pid = pid + + @property + def market_order_slip_ratio(self): + """Gets the market_order_slip_ratio of this FuturesOrderTimerange. # noqa: E501 + + Custom maximum slippage rate for market orders. If not provided, the default contract settings will be used # noqa: E501 + + :return: The market_order_slip_ratio of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._market_order_slip_ratio + + @market_order_slip_ratio.setter + def market_order_slip_ratio(self, market_order_slip_ratio): + """Sets the market_order_slip_ratio of this FuturesOrderTimerange. + + Custom maximum slippage rate for market orders. If not provided, the default contract settings will be used # noqa: E501 + + :param market_order_slip_ratio: The market_order_slip_ratio of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._market_order_slip_ratio = market_order_slip_ratio + + @property + def pos_margin_mode(self): + """Gets the pos_margin_mode of this FuturesOrderTimerange. # noqa: E501 + + Position Margin Mode isolated - Isolated Margin, cross - Cross Margin, only passed in simple split position mode # noqa: E501 + + :return: The pos_margin_mode of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._pos_margin_mode + + @pos_margin_mode.setter + def pos_margin_mode(self, pos_margin_mode): + """Sets the pos_margin_mode of this FuturesOrderTimerange. + + Position Margin Mode isolated - Isolated Margin, cross - Cross Margin, only passed in simple split position mode # noqa: E501 + + :param pos_margin_mode: The pos_margin_mode of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._pos_margin_mode = pos_margin_mode + + @property + def tpsl_tp_trigger_price(self): + """Gets the tpsl_tp_trigger_price of this FuturesOrderTimerange. # noqa: E501 + + Take profit price # noqa: E501 + + :return: The tpsl_tp_trigger_price of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._tpsl_tp_trigger_price + + @tpsl_tp_trigger_price.setter + def tpsl_tp_trigger_price(self, tpsl_tp_trigger_price): + """Sets the tpsl_tp_trigger_price of this FuturesOrderTimerange. + + Take profit price # noqa: E501 + + :param tpsl_tp_trigger_price: The tpsl_tp_trigger_price of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._tpsl_tp_trigger_price = tpsl_tp_trigger_price + + @property + def tpsl_sl_trigger_price(self): + """Gets the tpsl_sl_trigger_price of this FuturesOrderTimerange. # noqa: E501 + + Stop loss price # noqa: E501 + + :return: The tpsl_sl_trigger_price of this FuturesOrderTimerange. # noqa: E501 + :rtype: str + """ + return self._tpsl_sl_trigger_price + + @tpsl_sl_trigger_price.setter + def tpsl_sl_trigger_price(self, tpsl_sl_trigger_price): + """Sets the tpsl_sl_trigger_price of this FuturesOrderTimerange. + + Stop loss price # noqa: E501 + + :param tpsl_sl_trigger_price: The tpsl_sl_trigger_price of this FuturesOrderTimerange. # noqa: E501 + :type: str + """ + + self._tpsl_sl_trigger_price = tpsl_sl_trigger_price + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FuturesOrderTimerange): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FuturesOrderTimerange): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_position_cross_mode.py b/gate_api/models/futures_position_cross_mode.py index 4f4a83c5..a3e61c3e 100644 --- a/gate_api/models/futures_position_cross_mode.py +++ b/gate_api/models/futures_position_cross_mode.py @@ -60,7 +60,7 @@ def __init__(self, mode=None, contract=None, local_vars_configuration=None): # def mode(self): """Gets the mode of this FuturesPositionCrossMode. # noqa: E501 - Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode # noqa: E501 + Cross/isolated margin mode. ISOLATED - isolated margin, CROSS - cross margin # noqa: E501 :return: The mode of this FuturesPositionCrossMode. # noqa: E501 :rtype: str @@ -71,7 +71,7 @@ def mode(self): def mode(self, mode): """Sets the mode of this FuturesPositionCrossMode. - Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode # noqa: E501 + Cross/isolated margin mode. ISOLATED - isolated margin, CROSS - cross margin # noqa: E501 :param mode: The mode of this FuturesPositionCrossMode. # noqa: E501 :type: str diff --git a/gate_api/models/futures_premium_index.py b/gate_api/models/futures_premium_index.py index f02adc1a..626dd30c 100644 --- a/gate_api/models/futures_premium_index.py +++ b/gate_api/models/futures_premium_index.py @@ -123,7 +123,7 @@ def c(self, c): def h(self): """Gets the h of this FuturesPremiumIndex. # noqa: E501 - Highest price # noqa: E501 + High price # noqa: E501 :return: The h of this FuturesPremiumIndex. # noqa: E501 :rtype: str @@ -134,7 +134,7 @@ def h(self): def h(self, h): """Sets the h of this FuturesPremiumIndex. - Highest price # noqa: E501 + High price # noqa: E501 :param h: The h of this FuturesPremiumIndex. # noqa: E501 :type: str @@ -146,7 +146,7 @@ def h(self, h): def l(self): """Gets the l of this FuturesPremiumIndex. # noqa: E501 - Lowest price # noqa: E501 + Low price # noqa: E501 :return: The l of this FuturesPremiumIndex. # noqa: E501 :rtype: str @@ -157,7 +157,7 @@ def l(self): def l(self, l): """Sets the l of this FuturesPremiumIndex. - Lowest price # noqa: E501 + Low price # noqa: E501 :param l: The l of this FuturesPremiumIndex. # noqa: E501 :type: str diff --git a/gate_api/models/futures_price_triggered_order.py b/gate_api/models/futures_price_triggered_order.py index 14e16ae0..625fbf97 100644 --- a/gate_api/models/futures_price_triggered_order.py +++ b/gate_api/models/futures_price_triggered_order.py @@ -36,6 +36,7 @@ class FuturesPriceTriggeredOrder(object): 'initial': 'FuturesInitialOrder', 'trigger': 'FuturesPriceTrigger', 'id': 'int', + 'id_string': 'str', 'user': 'int', 'create_time': 'float', 'finish_time': 'float', @@ -44,13 +45,15 @@ class FuturesPriceTriggeredOrder(object): 'finish_as': 'str', 'reason': 'str', 'order_type': 'str', - 'me_order_id': 'int' + 'me_order_id': 'int', + 'pos_margin_mode': 'str' } attribute_map = { 'initial': 'initial', 'trigger': 'trigger', 'id': 'id', + 'id_string': 'id_string', 'user': 'user', 'create_time': 'create_time', 'finish_time': 'finish_time', @@ -59,11 +62,12 @@ class FuturesPriceTriggeredOrder(object): 'finish_as': 'finish_as', 'reason': 'reason', 'order_type': 'order_type', - 'me_order_id': 'me_order_id' + 'me_order_id': 'me_order_id', + 'pos_margin_mode': 'pos_margin_mode' } - def __init__(self, initial=None, trigger=None, id=None, user=None, create_time=None, finish_time=None, trade_id=None, status=None, finish_as=None, reason=None, order_type=None, me_order_id=None, local_vars_configuration=None): # noqa: E501 - # type: (FuturesInitialOrder, FuturesPriceTrigger, int, int, float, float, int, str, str, str, str, int, Configuration) -> None + def __init__(self, initial=None, trigger=None, id=None, id_string=None, user=None, create_time=None, finish_time=None, trade_id=None, status=None, finish_as=None, reason=None, order_type=None, me_order_id=None, pos_margin_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (FuturesInitialOrder, FuturesPriceTrigger, int, str, int, float, float, int, str, str, str, str, int, str, Configuration) -> None """FuturesPriceTriggeredOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -72,6 +76,7 @@ def __init__(self, initial=None, trigger=None, id=None, user=None, create_time=N self._initial = None self._trigger = None self._id = None + self._id_string = None self._user = None self._create_time = None self._finish_time = None @@ -81,12 +86,15 @@ def __init__(self, initial=None, trigger=None, id=None, user=None, create_time=N self._reason = None self._order_type = None self._me_order_id = None + self._pos_margin_mode = None self.discriminator = None self.initial = initial self.trigger = trigger if id is not None: self.id = id + if id_string is not None: + self.id_string = id_string if user is not None: self.user = user if create_time is not None: @@ -105,6 +113,8 @@ def __init__(self, initial=None, trigger=None, id=None, user=None, create_time=N self.order_type = order_type if me_order_id is not None: self.me_order_id = me_order_id + if pos_margin_mode is not None: + self.pos_margin_mode = pos_margin_mode @property def initial(self): @@ -175,6 +185,29 @@ def id(self, id): self._id = id + @property + def id_string(self): + """Gets the id_string of this FuturesPriceTriggeredOrder. # noqa: E501 + + String form of the auto order ID; the same order as numeric `id`, as the decimal string of `id` to avoid int64 precision loss in JavaScript and similar environments. Prefer this field to display the order ID or when a string unique identifier is needed; one-to-one with `id`. Same meaning as the field of the same name in futures price-trigger REST APIs and in `futures.orders` / `futures.autoorders` WebSocket pushes. # noqa: E501 + + :return: The id_string of this FuturesPriceTriggeredOrder. # noqa: E501 + :rtype: str + """ + return self._id_string + + @id_string.setter + def id_string(self, id_string): + """Sets the id_string of this FuturesPriceTriggeredOrder. + + String form of the auto order ID; the same order as numeric `id`, as the decimal string of `id` to avoid int64 precision loss in JavaScript and similar environments. Prefer this field to display the order ID or when a string unique identifier is needed; one-to-one with `id`. Same meaning as the field of the same name in futures price-trigger REST APIs and in `futures.orders` / `futures.autoorders` WebSocket pushes. # noqa: E501 + + :param id_string: The id_string of this FuturesPriceTriggeredOrder. # noqa: E501 + :type: str + """ + + self._id_string = id_string + @property def user(self): """Gets the user of this FuturesPriceTriggeredOrder. # noqa: E501 @@ -394,6 +427,35 @@ def me_order_id(self, me_order_id): self._me_order_id = me_order_id + @property + def pos_margin_mode(self): + """Gets the pos_margin_mode of this FuturesPriceTriggeredOrder. # noqa: E501 + + Position margin mode: `isolated` (isolated margin) or `cross` (cross margin). Returned by the server in simple split-position mode; when writing, use only the values below. # noqa: E501 + + :return: The pos_margin_mode of this FuturesPriceTriggeredOrder. # noqa: E501 + :rtype: str + """ + return self._pos_margin_mode + + @pos_margin_mode.setter + def pos_margin_mode(self, pos_margin_mode): + """Sets the pos_margin_mode of this FuturesPriceTriggeredOrder. + + Position margin mode: `isolated` (isolated margin) or `cross` (cross margin). Returned by the server in simple split-position mode; when writing, use only the values below. # noqa: E501 + + :param pos_margin_mode: The pos_margin_mode of this FuturesPriceTriggeredOrder. # noqa: E501 + :type: str + """ + allowed_values = ["isolated", "cross"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and pos_margin_mode not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `pos_margin_mode` ({0}), must be one of {1}" # noqa: E501 + .format(pos_margin_mode, allowed_values) + ) + + self._pos_margin_mode = pos_margin_mode + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/futures_update_price_triggered_order.py b/gate_api/models/futures_update_price_triggered_order.py index f64ff01a..20c846d2 100644 --- a/gate_api/models/futures_update_price_triggered_order.py +++ b/gate_api/models/futures_update_price_triggered_order.py @@ -35,27 +35,29 @@ class FuturesUpdatePriceTriggeredOrder(object): openapi_types = { 'settle': 'str', 'order_id': 'int', - 'contact': 'str', 'size': 'int', + 'amount': 'str', 'price': 'str', 'trigger_price': 'str', 'price_type': 'int', - 'auto_size': 'str' + 'auto_size': 'str', + 'close': 'bool' } attribute_map = { 'settle': 'settle', 'order_id': 'order_id', - 'contact': 'contact', 'size': 'size', + 'amount': 'amount', 'price': 'price', 'trigger_price': 'trigger_price', 'price_type': 'price_type', - 'auto_size': 'auto_size' + 'auto_size': 'auto_size', + 'close': 'close' } - def __init__(self, settle=None, order_id=None, contact=None, size=None, price=None, trigger_price=None, price_type=None, auto_size=None, local_vars_configuration=None): # noqa: E501 - # type: (str, int, str, int, str, str, int, str, Configuration) -> None + def __init__(self, settle=None, order_id=None, size=None, amount=None, price=None, trigger_price=None, price_type=None, auto_size=None, close=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, int, str, str, str, int, str, bool, Configuration) -> None """FuturesUpdatePriceTriggeredOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -63,22 +65,22 @@ def __init__(self, settle=None, order_id=None, contact=None, size=None, price=No self._settle = None self._order_id = None - self._contact = None self._size = None + self._amount = None self._price = None self._trigger_price = None self._price_type = None self._auto_size = None + self._close = None self.discriminator = None if settle is not None: self.settle = settle - if order_id is not None: - self.order_id = order_id - if contact is not None: - self.contact = contact + self.order_id = order_id if size is not None: self.size = size + if amount is not None: + self.amount = amount if price is not None: self.price = price if trigger_price is not None: @@ -87,6 +89,8 @@ def __init__(self, settle=None, order_id=None, contact=None, size=None, price=No self.price_type = price_type if auto_size is not None: self.auto_size = auto_size + if close is not None: + self.close = close @property def settle(self): @@ -131,32 +135,11 @@ def order_id(self, order_id): :param order_id: The order_id of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 :type: int """ + if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 + raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 self._order_id = order_id - @property - def contact(self): - """Gets the contact of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 - - The order ID of the modified price-triggered order. This ID is returned upon successful creation of the price-triggered order. Note: This ID must be passed in both the request path and request body. # noqa: E501 - - :return: The contact of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 - :rtype: str - """ - return self._contact - - @contact.setter - def contact(self, contact): - """Sets the contact of this FuturesUpdatePriceTriggeredOrder. - - The order ID of the modified price-triggered order. This ID is returned upon successful creation of the price-triggered order. Note: This ID must be passed in both the request path and request body. # noqa: E501 - - :param contact: The contact of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 - :type: str - """ - - self._contact = contact - @property def size(self): """Gets the size of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 @@ -180,6 +163,29 @@ def size(self, size): self._size = size + @property + def amount(self): + """Gets the amount of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 + + Same as `size`; used for decimal contract size. When both `size` and `amount` are provided, `amount` takes precedence. # noqa: E501 + + :return: The amount of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this FuturesUpdatePriceTriggeredOrder. + + Same as `size`; used for decimal contract size. When both `size` and `amount` are provided, `amount` takes precedence. # noqa: E501 + + :param amount: The amount of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 + :type: str + """ + + self._amount = amount + @property def price(self): """Gets the price of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 @@ -278,6 +284,29 @@ def auto_size(self, auto_size): self._auto_size = auto_size + @property + def close(self): + """Gets the close of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 + + When fully closing a position in single-position mode, close must be set to true to execute the close operation. When partially closing a position in single-position mode or in dual-position mode, close can be left unset or set to false. # noqa: E501 + + :return: The close of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 + :rtype: bool + """ + return self._close + + @close.setter + def close(self, close): + """Sets the close of this FuturesUpdatePriceTriggeredOrder. + + When fully closing a position in single-position mode, close must be set to true to execute the close operation. When partially closing a position in single-position mode or in dual-position mode, close can be left unset or set to false. # noqa: E501 + + :param close: The close of this FuturesUpdatePriceTriggeredOrder. # noqa: E501 + :type: bool + """ + + self._close = close + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/gate_error_response.py b/gate_api/models/gate_error_response.py new file mode 100644 index 00000000..97ec5856 --- /dev/null +++ b/gate_api/models/gate_error_response.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GateErrorResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label': 'str', + 'message': 'str' + } + + attribute_map = { + 'label': 'label', + 'message': 'message' + } + + def __init__(self, label=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """GateErrorResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._label = None + self._message = None + self.discriminator = None + + if label is not None: + self.label = label + if message is not None: + self.message = message + + @property + def label(self): + """Gets the label of this GateErrorResponse. # noqa: E501 + + Error label # noqa: E501 + + :return: The label of this GateErrorResponse. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this GateErrorResponse. + + Error label # noqa: E501 + + :param label: The label of this GateErrorResponse. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this GateErrorResponse. # noqa: E501 + + Detailed error message # noqa: E501 + + :return: The message of this GateErrorResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this GateErrorResponse. + + Detailed error message # noqa: E501 + + :param message: The message of this GateErrorResponse. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GateErrorResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GateErrorResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_beginner_task_list_error.py b/gate_api/models/get_beginner_task_list_error.py new file mode 100644 index 00000000..e12c7b39 --- /dev/null +++ b/gate_api/models/get_beginner_task_list_error.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetBeginnerTaskListError(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label': 'str', + 'message': 'str' + } + + attribute_map = { + 'label': 'label', + 'message': 'message' + } + + def __init__(self, label=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """GetBeginnerTaskListError - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._label = None + self._message = None + self.discriminator = None + + if label is not None: + self.label = label + if message is not None: + self.message = message + + @property + def label(self): + """Gets the label of this GetBeginnerTaskListError. # noqa: E501 + + Error identifier code # noqa: E501 + + :return: The label of this GetBeginnerTaskListError. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this GetBeginnerTaskListError. + + Error identifier code # noqa: E501 + + :param label: The label of this GetBeginnerTaskListError. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this GetBeginnerTaskListError. # noqa: E501 + + Error details # noqa: E501 + + :return: The message of this GetBeginnerTaskListError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this GetBeginnerTaskListError. + + Error details # noqa: E501 + + :param message: The message of this GetBeginnerTaskListError. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetBeginnerTaskListError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetBeginnerTaskListError): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_chase_order_detail_resp.py b/gate_api/models/get_chase_order_detail_resp.py new file mode 100644 index 00000000..c3836d26 --- /dev/null +++ b/gate_api/models/get_chase_order_detail_resp.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetChaseOrderDetailResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order': 'ChaseOrder' + } + + attribute_map = { + 'order': 'order' + } + + def __init__(self, order=None, local_vars_configuration=None): # noqa: E501 + # type: (ChaseOrder, Configuration) -> None + """GetChaseOrderDetailResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order = None + self.discriminator = None + + if order is not None: + self.order = order + + @property + def order(self): + """Gets the order of this GetChaseOrderDetailResp. # noqa: E501 + + + :return: The order of this GetChaseOrderDetailResp. # noqa: E501 + :rtype: ChaseOrder + """ + return self._order + + @order.setter + def order(self, order): + """Sets the order of this GetChaseOrderDetailResp. + + + :param order: The order of this GetChaseOrderDetailResp. # noqa: E501 + :type: ChaseOrder + """ + + self._order = order + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetChaseOrderDetailResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetChaseOrderDetailResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_chase_orders_resp.py b/gate_api/models/get_chase_orders_resp.py new file mode 100644 index 00000000..bdbb47e3 --- /dev/null +++ b/gate_api/models/get_chase_orders_resp.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetChaseOrdersResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'orders': 'list[ChaseOrder]' + } + + attribute_map = { + 'orders': 'orders' + } + + def __init__(self, orders=None, local_vars_configuration=None): # noqa: E501 + # type: (list[ChaseOrder], Configuration) -> None + """GetChaseOrdersResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._orders = None + self.discriminator = None + + if orders is not None: + self.orders = orders + + @property + def orders(self): + """Gets the orders of this GetChaseOrdersResp. # noqa: E501 + + + :return: The orders of this GetChaseOrdersResp. # noqa: E501 + :rtype: list[ChaseOrder] + """ + return self._orders + + @orders.setter + def orders(self, orders): + """Sets the orders of this GetChaseOrdersResp. + + + :param orders: The orders of this GetChaseOrdersResp. # noqa: E501 + :type: list[ChaseOrder] + """ + + self._orders = orders + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetChaseOrdersResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetChaseOrdersResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_chats_list_request.py b/gate_api/models/get_chats_list_request.py new file mode 100644 index 00000000..7c418379 --- /dev/null +++ b/gate_api/models/get_chats_list_request.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetChatsListRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'txid': 'int', + 'lastreceived': 'int', + 'firstreceived': 'int' + } + + attribute_map = { + 'txid': 'txid', + 'lastreceived': 'lastreceived', + 'firstreceived': 'firstreceived' + } + + def __init__(self, txid=None, lastreceived=None, firstreceived=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, Configuration) -> None + """GetChatsListRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._txid = None + self._lastreceived = None + self._firstreceived = None + self.discriminator = None + + if txid is not None: + self.txid = txid + if lastreceived is not None: + self.lastreceived = lastreceived + if firstreceived is not None: + self.firstreceived = firstreceived + + @property + def txid(self): + """Gets the txid of this GetChatsListRequest. # noqa: E501 + + Order ID; omit or `0` to return the latest order with chat for the user. # noqa: E501 + + :return: The txid of this GetChatsListRequest. # noqa: E501 + :rtype: int + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this GetChatsListRequest. + + Order ID; omit or `0` to return the latest order with chat for the user. # noqa: E501 + + :param txid: The txid of this GetChatsListRequest. # noqa: E501 + :type: int + """ + + self._txid = txid + + @property + def lastreceived(self): + """Gets the lastreceived of this GetChatsListRequest. # noqa: E501 + + Timestamp of the last received message for backward incremental fetch; omit on first load. # noqa: E501 + + :return: The lastreceived of this GetChatsListRequest. # noqa: E501 + :rtype: int + """ + return self._lastreceived + + @lastreceived.setter + def lastreceived(self, lastreceived): + """Sets the lastreceived of this GetChatsListRequest. + + Timestamp of the last received message for backward incremental fetch; omit on first load. # noqa: E501 + + :param lastreceived: The lastreceived of this GetChatsListRequest. # noqa: E501 + :type: int + """ + + self._lastreceived = lastreceived + + @property + def firstreceived(self): + """Gets the firstreceived of this GetChatsListRequest. # noqa: E501 + + Timestamp of first received message for paging backward; omit on first load. # noqa: E501 + + :return: The firstreceived of this GetChatsListRequest. # noqa: E501 + :rtype: int + """ + return self._firstreceived + + @firstreceived.setter + def firstreceived(self, firstreceived): + """Sets the firstreceived of this GetChatsListRequest. + + Timestamp of first received message for paging backward; omit on first load. # noqa: E501 + + :param firstreceived: The firstreceived of this GetChatsListRequest. # noqa: E501 + :type: int + """ + + self._firstreceived = firstreceived + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetChatsListRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetChatsListRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_completed_transaction_list_request.py b/gate_api/models/get_completed_transaction_list_request.py new file mode 100644 index 00000000..3d6551b4 --- /dev/null +++ b/gate_api/models/get_completed_transaction_list_request.py @@ -0,0 +1,377 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetCompletedTransactionListRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'crypto_currency': 'str', + 'fiat_currency': 'str', + 'select_type': 'str', + 'status': 'str', + 'txid': 'int', + 'start_time': 'int', + 'end_time': 'int', + 'query_dispute': 'int', + 'page': 'int', + 'per_page': 'int' + } + + attribute_map = { + 'crypto_currency': 'crypto_currency', + 'fiat_currency': 'fiat_currency', + 'select_type': 'select_type', + 'status': 'status', + 'txid': 'txid', + 'start_time': 'start_time', + 'end_time': 'end_time', + 'query_dispute': 'query_dispute', + 'page': 'page', + 'per_page': 'per_page' + } + + def __init__(self, crypto_currency=None, fiat_currency=None, select_type=None, status=None, txid=None, start_time=None, end_time=None, query_dispute=None, page=None, per_page=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, int, int, int, int, int, Configuration) -> None + """GetCompletedTransactionListRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._crypto_currency = None + self._fiat_currency = None + self._select_type = None + self._status = None + self._txid = None + self._start_time = None + self._end_time = None + self._query_dispute = None + self._page = None + self._per_page = None + self.discriminator = None + + self.crypto_currency = crypto_currency + self.fiat_currency = fiat_currency + if select_type is not None: + self.select_type = select_type + if status is not None: + self.status = status + if txid is not None: + self.txid = txid + if start_time is not None: + self.start_time = start_time + if end_time is not None: + self.end_time = end_time + if query_dispute is not None: + self.query_dispute = query_dispute + if page is not None: + self.page = page + if per_page is not None: + self.per_page = per_page + + @property + def crypto_currency(self): + """Gets the crypto_currency of this GetCompletedTransactionListRequest. # noqa: E501 + + Cryptocurrency symbol. # noqa: E501 + + :return: The crypto_currency of this GetCompletedTransactionListRequest. # noqa: E501 + :rtype: str + """ + return self._crypto_currency + + @crypto_currency.setter + def crypto_currency(self, crypto_currency): + """Sets the crypto_currency of this GetCompletedTransactionListRequest. + + Cryptocurrency symbol. # noqa: E501 + + :param crypto_currency: The crypto_currency of this GetCompletedTransactionListRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and crypto_currency is None: # noqa: E501 + raise ValueError("Invalid value for `crypto_currency`, must not be `None`") # noqa: E501 + + self._crypto_currency = crypto_currency + + @property + def fiat_currency(self): + """Gets the fiat_currency of this GetCompletedTransactionListRequest. # noqa: E501 + + Fiat currency # noqa: E501 + + :return: The fiat_currency of this GetCompletedTransactionListRequest. # noqa: E501 + :rtype: str + """ + return self._fiat_currency + + @fiat_currency.setter + def fiat_currency(self, fiat_currency): + """Sets the fiat_currency of this GetCompletedTransactionListRequest. + + Fiat currency # noqa: E501 + + :param fiat_currency: The fiat_currency of this GetCompletedTransactionListRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fiat_currency is None: # noqa: E501 + raise ValueError("Invalid value for `fiat_currency`, must not be `None`") # noqa: E501 + + self._fiat_currency = fiat_currency + + @property + def select_type(self): + """Gets the select_type of this GetCompletedTransactionListRequest. # noqa: E501 + + Order side filter: `buy` buy orders; `sell` sell orders; empty: all. # noqa: E501 + + :return: The select_type of this GetCompletedTransactionListRequest. # noqa: E501 + :rtype: str + """ + return self._select_type + + @select_type.setter + def select_type(self, select_type): + """Sets the select_type of this GetCompletedTransactionListRequest. + + Order side filter: `buy` buy orders; `sell` sell orders; empty: all. # noqa: E501 + + :param select_type: The select_type of this GetCompletedTransactionListRequest. # noqa: E501 + :type: str + """ + + self._select_type = select_type + + @property + def status(self): + """Gets the status of this GetCompletedTransactionListRequest. # noqa: E501 + + Order status filter. `closed`: filled (`ACCEPT`, `BCLOSED`); `cancel`: canceled (`CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`); `locked`: locked (`LOCKED`); `open`: unpaid (`OPEN`); `paid`: paid (`PAID`); `completed`: finished or canceled (`CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`, `ACCEPT`, `BCLOSED`); Empty or omitted uses the endpoint default range. # noqa: E501 + + :return: The status of this GetCompletedTransactionListRequest. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this GetCompletedTransactionListRequest. + + Order status filter. `closed`: filled (`ACCEPT`, `BCLOSED`); `cancel`: canceled (`CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`); `locked`: locked (`LOCKED`); `open`: unpaid (`OPEN`); `paid`: paid (`PAID`); `completed`: finished or canceled (`CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`, `ACCEPT`, `BCLOSED`); Empty or omitted uses the endpoint default range. # noqa: E501 + + :param status: The status of this GetCompletedTransactionListRequest. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def txid(self): + """Gets the txid of this GetCompletedTransactionListRequest. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this GetCompletedTransactionListRequest. # noqa: E501 + :rtype: int + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this GetCompletedTransactionListRequest. + + Order ID # noqa: E501 + + :param txid: The txid of this GetCompletedTransactionListRequest. # noqa: E501 + :type: int + """ + + self._txid = txid + + @property + def start_time(self): + """Gets the start_time of this GetCompletedTransactionListRequest. # noqa: E501 + + Start timestamp, default is 00:00 89 days ago # noqa: E501 + + :return: The start_time of this GetCompletedTransactionListRequest. # noqa: E501 + :rtype: int + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this GetCompletedTransactionListRequest. + + Start timestamp, default is 00:00 89 days ago # noqa: E501 + + :param start_time: The start_time of this GetCompletedTransactionListRequest. # noqa: E501 + :type: int + """ + + self._start_time = start_time + + @property + def end_time(self): + """Gets the end_time of this GetCompletedTransactionListRequest. # noqa: E501 + + End timestamp, default is 23:59:59 today # noqa: E501 + + :return: The end_time of this GetCompletedTransactionListRequest. # noqa: E501 + :rtype: int + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this GetCompletedTransactionListRequest. + + End timestamp, default is 23:59:59 today # noqa: E501 + + :param end_time: The end_time of this GetCompletedTransactionListRequest. # noqa: E501 + :type: int + """ + + self._end_time = end_time + + @property + def query_dispute(self): + """Gets the query_dispute of this GetCompletedTransactionListRequest. # noqa: E501 + + Whether to flag dispute status in the response. `1`: yes; `0`: no. # noqa: E501 + + :return: The query_dispute of this GetCompletedTransactionListRequest. # noqa: E501 + :rtype: int + """ + return self._query_dispute + + @query_dispute.setter + def query_dispute(self, query_dispute): + """Sets the query_dispute of this GetCompletedTransactionListRequest. + + Whether to flag dispute status in the response. `1`: yes; `0`: no. # noqa: E501 + + :param query_dispute: The query_dispute of this GetCompletedTransactionListRequest. # noqa: E501 + :type: int + """ + + self._query_dispute = query_dispute + + @property + def page(self): + """Gets the page of this GetCompletedTransactionListRequest. # noqa: E501 + + Page number starting at 1; values below 1 are treated as 1. # noqa: E501 + + :return: The page of this GetCompletedTransactionListRequest. # noqa: E501 + :rtype: int + """ + return self._page + + @page.setter + def page(self, page): + """Sets the page of this GetCompletedTransactionListRequest. + + Page number starting at 1; values below 1 are treated as 1. # noqa: E501 + + :param page: The page of this GetCompletedTransactionListRequest. # noqa: E501 + :type: int + """ + + self._page = page + + @property + def per_page(self): + """Gets the per_page of this GetCompletedTransactionListRequest. # noqa: E501 + + Orders per page; default 10, max 200. # noqa: E501 + + :return: The per_page of this GetCompletedTransactionListRequest. # noqa: E501 + :rtype: int + """ + return self._per_page + + @per_page.setter + def per_page(self, per_page): + """Sets the per_page of this GetCompletedTransactionListRequest. + + Orders per page; default 10, max 200. # noqa: E501 + + :param per_page: The per_page of this GetCompletedTransactionListRequest. # noqa: E501 + :type: int + """ + + self._per_page = per_page + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetCompletedTransactionListRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetCompletedTransactionListRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_counterparty_user_info_request.py b/gate_api/models/get_counterparty_user_info_request.py new file mode 100644 index 00000000..c9968a5c --- /dev/null +++ b/gate_api/models/get_counterparty_user_info_request.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetCounterpartyUserInfoRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'biz_uid': 'str' + } + + attribute_map = { + 'biz_uid': 'biz_uid' + } + + def __init__(self, biz_uid=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """GetCounterpartyUserInfoRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._biz_uid = None + self.discriminator = None + + self.biz_uid = biz_uid + + @property + def biz_uid(self): + """Gets the biz_uid of this GetCounterpartyUserInfoRequest. # noqa: E501 + + Counterparty crypto UID from order list or detail field `its_uid`. # noqa: E501 + + :return: The biz_uid of this GetCounterpartyUserInfoRequest. # noqa: E501 + :rtype: str + """ + return self._biz_uid + + @biz_uid.setter + def biz_uid(self, biz_uid): + """Sets the biz_uid of this GetCounterpartyUserInfoRequest. + + Counterparty crypto UID from order list or detail field `its_uid`. # noqa: E501 + + :param biz_uid: The biz_uid of this GetCounterpartyUserInfoRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and biz_uid is None: # noqa: E501 + raise ValueError("Invalid value for `biz_uid`, must not be `None`") # noqa: E501 + + self._biz_uid = biz_uid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetCounterpartyUserInfoRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetCounterpartyUserInfoRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_my_activity_entry_response.py b/gate_api/models/get_my_activity_entry_response.py new file mode 100644 index 00000000..6922d14f --- /dev/null +++ b/gate_api/models/get_my_activity_entry_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetMyActivityEntryResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'GetMyActivityEntryResponseData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, GetMyActivityEntryResponseData, int, Configuration) -> None + """GetMyActivityEntryResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this GetMyActivityEntryResponse. # noqa: E501 + + Response status code, 0 means success # noqa: E501 + + :return: The code of this GetMyActivityEntryResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this GetMyActivityEntryResponse. + + Response status code, 0 means success # noqa: E501 + + :param code: The code of this GetMyActivityEntryResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this GetMyActivityEntryResponse. # noqa: E501 + + 响应消息,成功时为 \"success\" # noqa: E501 + + :return: The message of this GetMyActivityEntryResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this GetMyActivityEntryResponse. + + 响应消息,成功时为 \"success\" # noqa: E501 + + :param message: The message of this GetMyActivityEntryResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this GetMyActivityEntryResponse. # noqa: E501 + + + :return: The data of this GetMyActivityEntryResponse. # noqa: E501 + :rtype: GetMyActivityEntryResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this GetMyActivityEntryResponse. + + + :param data: The data of this GetMyActivityEntryResponse. # noqa: E501 + :type: GetMyActivityEntryResponseData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this GetMyActivityEntryResponse. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this GetMyActivityEntryResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this GetMyActivityEntryResponse. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this GetMyActivityEntryResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetMyActivityEntryResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetMyActivityEntryResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_my_activity_entry_response_data.py b/gate_api/models/get_my_activity_entry_response_data.py new file mode 100644 index 00000000..466154b5 --- /dev/null +++ b/gate_api/models/get_my_activity_entry_response_data.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetMyActivityEntryResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'icon_url': 'str', + 'icon_url_dark': 'str', + 'source_type': 'str', + 'title': 'str', + 'url_type': 'str', + 'url': 'str' + } + + attribute_map = { + 'icon_url': 'icon_url', + 'icon_url_dark': 'icon_url_dark', + 'source_type': 'source_type', + 'title': 'title', + 'url_type': 'url_type', + 'url': 'url' + } + + def __init__(self, icon_url=None, icon_url_dark=None, source_type=None, title=None, url_type=None, url=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """GetMyActivityEntryResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._icon_url = None + self._icon_url_dark = None + self._source_type = None + self._title = None + self._url_type = None + self._url = None + self.discriminator = None + + self.icon_url = icon_url + self.icon_url_dark = icon_url_dark + self.source_type = source_type + self.title = title + self.url_type = url_type + self.url = url + + @property + def icon_url(self): + """Gets the icon_url of this GetMyActivityEntryResponseData. # noqa: E501 + + Activity entry icon URL (light mode) # noqa: E501 + + :return: The icon_url of this GetMyActivityEntryResponseData. # noqa: E501 + :rtype: str + """ + return self._icon_url + + @icon_url.setter + def icon_url(self, icon_url): + """Sets the icon_url of this GetMyActivityEntryResponseData. + + Activity entry icon URL (light mode) # noqa: E501 + + :param icon_url: The icon_url of this GetMyActivityEntryResponseData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and icon_url is None: # noqa: E501 + raise ValueError("Invalid value for `icon_url`, must not be `None`") # noqa: E501 + + self._icon_url = icon_url + + @property + def icon_url_dark(self): + """Gets the icon_url_dark of this GetMyActivityEntryResponseData. # noqa: E501 + + Activity entry icon URL (dark mode) # noqa: E501 + + :return: The icon_url_dark of this GetMyActivityEntryResponseData. # noqa: E501 + :rtype: str + """ + return self._icon_url_dark + + @icon_url_dark.setter + def icon_url_dark(self, icon_url_dark): + """Sets the icon_url_dark of this GetMyActivityEntryResponseData. + + Activity entry icon URL (dark mode) # noqa: E501 + + :param icon_url_dark: The icon_url_dark of this GetMyActivityEntryResponseData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and icon_url_dark is None: # noqa: E501 + raise ValueError("Invalid value for `icon_url_dark`, must not be `None`") # noqa: E501 + + self._icon_url_dark = icon_url_dark + + @property + def source_type(self): + """Gets the source_type of this GetMyActivityEntryResponseData. # noqa: E501 + + Source type, e.g., activity for campaign # noqa: E501 + + :return: The source_type of this GetMyActivityEntryResponseData. # noqa: E501 + :rtype: str + """ + return self._source_type + + @source_type.setter + def source_type(self, source_type): + """Sets the source_type of this GetMyActivityEntryResponseData. + + Source type, e.g., activity for campaign # noqa: E501 + + :param source_type: The source_type of this GetMyActivityEntryResponseData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and source_type is None: # noqa: E501 + raise ValueError("Invalid value for `source_type`, must not be `None`") # noqa: E501 + + self._source_type = source_type + + @property + def title(self): + """Gets the title of this GetMyActivityEntryResponseData. # noqa: E501 + + Activity entry title # noqa: E501 + + :return: The title of this GetMyActivityEntryResponseData. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this GetMyActivityEntryResponseData. + + Activity entry title # noqa: E501 + + :param title: The title of this GetMyActivityEntryResponseData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and title is None: # noqa: E501 + raise ValueError("Invalid value for `title`, must not be `None`") # noqa: E501 + + self._title = title + + @property + def url_type(self): + """Gets the url_type of this GetMyActivityEntryResponseData. # noqa: E501 + + Redirect link type, e.g., h5 for H5 page # noqa: E501 + + :return: The url_type of this GetMyActivityEntryResponseData. # noqa: E501 + :rtype: str + """ + return self._url_type + + @url_type.setter + def url_type(self, url_type): + """Sets the url_type of this GetMyActivityEntryResponseData. + + Redirect link type, e.g., h5 for H5 page # noqa: E501 + + :param url_type: The url_type of this GetMyActivityEntryResponseData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and url_type is None: # noqa: E501 + raise ValueError("Invalid value for `url_type`, must not be `None`") # noqa: E501 + + self._url_type = url_type + + @property + def url(self): + """Gets the url of this GetMyActivityEntryResponseData. # noqa: E501 + + Activity entry redirect URL # noqa: E501 + + :return: The url of this GetMyActivityEntryResponseData. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this GetMyActivityEntryResponseData. + + Activity entry redirect URL # noqa: E501 + + :param url: The url of this GetMyActivityEntryResponseData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and url is None: # noqa: E501 + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetMyActivityEntryResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetMyActivityEntryResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_myself_payment_request.py b/gate_api/models/get_myself_payment_request.py new file mode 100644 index 00000000..520c5634 --- /dev/null +++ b/gate_api/models/get_myself_payment_request.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetMyselfPaymentRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'fiat': 'str' + } + + attribute_map = { + 'fiat': 'fiat' + } + + def __init__(self, fiat=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """GetMyselfPaymentRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._fiat = None + self.discriminator = None + + if fiat is not None: + self.fiat = fiat + + @property + def fiat(self): + """Gets the fiat of this GetMyselfPaymentRequest. # noqa: E501 + + Fiat currency; omit to return all available payment methods. # noqa: E501 + + :return: The fiat of this GetMyselfPaymentRequest. # noqa: E501 + :rtype: str + """ + return self._fiat + + @fiat.setter + def fiat(self, fiat): + """Sets the fiat of this GetMyselfPaymentRequest. + + Fiat currency; omit to return all available payment methods. # noqa: E501 + + :param fiat: The fiat of this GetMyselfPaymentRequest. # noqa: E501 + :type: str + """ + + self._fiat = fiat + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetMyselfPaymentRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetMyselfPaymentRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_pending_transaction_list_request.py b/gate_api/models/get_pending_transaction_list_request.py new file mode 100644 index 00000000..ca40692f --- /dev/null +++ b/gate_api/models/get_pending_transaction_list_request.py @@ -0,0 +1,327 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetPendingTransactionListRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'crypto_currency': 'str', + 'fiat_currency': 'str', + 'order_tab': 'str', + 'select_type': 'str', + 'status': 'str', + 'txid': 'int', + 'start_time': 'int', + 'end_time': 'int' + } + + attribute_map = { + 'crypto_currency': 'crypto_currency', + 'fiat_currency': 'fiat_currency', + 'order_tab': 'order_tab', + 'select_type': 'select_type', + 'status': 'status', + 'txid': 'txid', + 'start_time': 'start_time', + 'end_time': 'end_time' + } + + def __init__(self, crypto_currency=None, fiat_currency=None, order_tab=None, select_type=None, status=None, txid=None, start_time=None, end_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, int, int, int, Configuration) -> None + """GetPendingTransactionListRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._crypto_currency = None + self._fiat_currency = None + self._order_tab = None + self._select_type = None + self._status = None + self._txid = None + self._start_time = None + self._end_time = None + self.discriminator = None + + self.crypto_currency = crypto_currency + self.fiat_currency = fiat_currency + if order_tab is not None: + self.order_tab = order_tab + if select_type is not None: + self.select_type = select_type + if status is not None: + self.status = status + if txid is not None: + self.txid = txid + if start_time is not None: + self.start_time = start_time + if end_time is not None: + self.end_time = end_time + + @property + def crypto_currency(self): + """Gets the crypto_currency of this GetPendingTransactionListRequest. # noqa: E501 + + Cryptocurrency symbol. # noqa: E501 + + :return: The crypto_currency of this GetPendingTransactionListRequest. # noqa: E501 + :rtype: str + """ + return self._crypto_currency + + @crypto_currency.setter + def crypto_currency(self, crypto_currency): + """Sets the crypto_currency of this GetPendingTransactionListRequest. + + Cryptocurrency symbol. # noqa: E501 + + :param crypto_currency: The crypto_currency of this GetPendingTransactionListRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and crypto_currency is None: # noqa: E501 + raise ValueError("Invalid value for `crypto_currency`, must not be `None`") # noqa: E501 + + self._crypto_currency = crypto_currency + + @property + def fiat_currency(self): + """Gets the fiat_currency of this GetPendingTransactionListRequest. # noqa: E501 + + Fiat currency # noqa: E501 + + :return: The fiat_currency of this GetPendingTransactionListRequest. # noqa: E501 + :rtype: str + """ + return self._fiat_currency + + @fiat_currency.setter + def fiat_currency(self, fiat_currency): + """Sets the fiat_currency of this GetPendingTransactionListRequest. + + Fiat currency # noqa: E501 + + :param fiat_currency: The fiat_currency of this GetPendingTransactionListRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fiat_currency is None: # noqa: E501 + raise ValueError("Invalid value for `fiat_currency`, must not be `None`") # noqa: E501 + + self._fiat_currency = fiat_currency + + @property + def order_tab(self): + """Gets the order_tab of this GetPendingTransactionListRequest. # noqa: E501 + + Order tab: `pending` in progress (`OPEN`, `PAID`, `LOCKED`, `TEMP`); `dispute` in dispute; default `pending`. # noqa: E501 + + :return: The order_tab of this GetPendingTransactionListRequest. # noqa: E501 + :rtype: str + """ + return self._order_tab + + @order_tab.setter + def order_tab(self, order_tab): + """Sets the order_tab of this GetPendingTransactionListRequest. + + Order tab: `pending` in progress (`OPEN`, `PAID`, `LOCKED`, `TEMP`); `dispute` in dispute; default `pending`. # noqa: E501 + + :param order_tab: The order_tab of this GetPendingTransactionListRequest. # noqa: E501 + :type: str + """ + allowed_values = ["pending", "dispute"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and order_tab not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `order_tab` ({0}), must be one of {1}" # noqa: E501 + .format(order_tab, allowed_values) + ) + + self._order_tab = order_tab + + @property + def select_type(self): + """Gets the select_type of this GetPendingTransactionListRequest. # noqa: E501 + + Order side filter: `buy` buy orders; `sell` sell orders; empty: all. # noqa: E501 + + :return: The select_type of this GetPendingTransactionListRequest. # noqa: E501 + :rtype: str + """ + return self._select_type + + @select_type.setter + def select_type(self, select_type): + """Sets the select_type of this GetPendingTransactionListRequest. + + Order side filter: `buy` buy orders; `sell` sell orders; empty: all. # noqa: E501 + + :param select_type: The select_type of this GetPendingTransactionListRequest. # noqa: E501 + :type: str + """ + + self._select_type = select_type + + @property + def status(self): + """Gets the status of this GetPendingTransactionListRequest. # noqa: E501 + + Order status filter. `open` unpaid (`OPEN`); `paid` paid (`PAID`); `locked` locked (`LOCKED`); `dispute` in dispute; empty or omitted uses the default range for `order_tab`. # noqa: E501 + + :return: The status of this GetPendingTransactionListRequest. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this GetPendingTransactionListRequest. + + Order status filter. `open` unpaid (`OPEN`); `paid` paid (`PAID`); `locked` locked (`LOCKED`); `dispute` in dispute; empty or omitted uses the default range for `order_tab`. # noqa: E501 + + :param status: The status of this GetPendingTransactionListRequest. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def txid(self): + """Gets the txid of this GetPendingTransactionListRequest. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this GetPendingTransactionListRequest. # noqa: E501 + :rtype: int + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this GetPendingTransactionListRequest. + + Order ID # noqa: E501 + + :param txid: The txid of this GetPendingTransactionListRequest. # noqa: E501 + :type: int + """ + + self._txid = txid + + @property + def start_time(self): + """Gets the start_time of this GetPendingTransactionListRequest. # noqa: E501 + + Start timestamp, default is 00:00 89 days ago # noqa: E501 + + :return: The start_time of this GetPendingTransactionListRequest. # noqa: E501 + :rtype: int + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this GetPendingTransactionListRequest. + + Start timestamp, default is 00:00 89 days ago # noqa: E501 + + :param start_time: The start_time of this GetPendingTransactionListRequest. # noqa: E501 + :type: int + """ + + self._start_time = start_time + + @property + def end_time(self): + """Gets the end_time of this GetPendingTransactionListRequest. # noqa: E501 + + End timestamp, default is 23:59:59 today # noqa: E501 + + :return: The end_time of this GetPendingTransactionListRequest. # noqa: E501 + :rtype: int + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this GetPendingTransactionListRequest. + + End timestamp, default is 23:59:59 today # noqa: E501 + + :param end_time: The end_time of this GetPendingTransactionListRequest. # noqa: E501 + :type: int + """ + + self._end_time = end_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetPendingTransactionListRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetPendingTransactionListRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_transaction_details_request.py b/gate_api/models/get_transaction_details_request.py new file mode 100644 index 00000000..41be6e32 --- /dev/null +++ b/gate_api/models/get_transaction_details_request.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetTransactionDetailsRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'txid': 'int', + 'channel': 'str' + } + + attribute_map = { + 'txid': 'txid', + 'channel': 'channel' + } + + def __init__(self, txid=None, channel=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """GetTransactionDetailsRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._txid = None + self._channel = None + self.discriminator = None + + self.txid = txid + if channel is not None: + self.channel = channel + + @property + def txid(self): + """Gets the txid of this GetTransactionDetailsRequest. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this GetTransactionDetailsRequest. # noqa: E501 + :rtype: int + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this GetTransactionDetailsRequest. + + Order ID # noqa: E501 + + :param txid: The txid of this GetTransactionDetailsRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and txid is None: # noqa: E501 + raise ValueError("Invalid value for `txid`, must not be `None`") # noqa: E501 + + self._txid = txid + + @property + def channel(self): + """Gets the channel of this GetTransactionDetailsRequest. # noqa: E501 + + Channel tag: omit or empty for normal P2P; use `web3` for Web3 orders. # noqa: E501 + + :return: The channel of this GetTransactionDetailsRequest. # noqa: E501 + :rtype: str + """ + return self._channel + + @channel.setter + def channel(self, channel): + """Sets the channel of this GetTransactionDetailsRequest. + + Channel tag: omit or empty for normal P2P; use `web3` for Web3 orders. # noqa: E501 + + :param channel: The channel of this GetTransactionDetailsRequest. # noqa: E501 + :type: str + """ + + self._channel = channel + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetTransactionDetailsRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetTransactionDetailsRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_user_coupon_detail_response.py b/gate_api/models/get_user_coupon_detail_response.py new file mode 100644 index 00000000..0afc11a3 --- /dev/null +++ b/gate_api/models/get_user_coupon_detail_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetUserCouponDetailResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'GetUserCouponDetailResponseData' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data' + } + + def __init__(self, code=None, label=None, message=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, GetUserCouponDetailResponseData, Configuration) -> None + """GetUserCouponDetailResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self.discriminator = None + + if code is not None: + self.code = code + if label is not None: + self.label = label + if message is not None: + self.message = message + if data is not None: + self.data = data + + @property + def code(self): + """Gets the code of this GetUserCouponDetailResponse. # noqa: E501 + + Response code. `0` = success; `2002` = user not logged in; `50105` = parameter validation failed; `10001` = coupon record does not exist or does not belong to current user; `10000` = invalid parameter (e.g., task coupon missing coupon_info) # noqa: E501 + + :return: The code of this GetUserCouponDetailResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this GetUserCouponDetailResponse. + + Response code. `0` = success; `2002` = user not logged in; `50105` = parameter validation failed; `10001` = coupon record does not exist or does not belong to current user; `10000` = invalid parameter (e.g., task coupon missing coupon_info) # noqa: E501 + + :param code: The code of this GetUserCouponDetailResponse. # noqa: E501 + :type: int + """ + allowed_values = [0, 2002, 50105, 10001, 10000] # noqa: E501 + if self.local_vars_configuration.client_side_validation and code not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 + .format(code, allowed_values) + ) + + self._code = code + + @property + def label(self): + """Gets the label of this GetUserCouponDetailResponse. # noqa: E501 + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :return: The label of this GetUserCouponDetailResponse. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this GetUserCouponDetailResponse. + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :param label: The label of this GetUserCouponDetailResponse. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this GetUserCouponDetailResponse. # noqa: E501 + + + :return: The message of this GetUserCouponDetailResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this GetUserCouponDetailResponse. + + + :param message: The message of this GetUserCouponDetailResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this GetUserCouponDetailResponse. # noqa: E501 + + + :return: The data of this GetUserCouponDetailResponse. # noqa: E501 + :rtype: GetUserCouponDetailResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this GetUserCouponDetailResponse. + + + :param data: The data of this GetUserCouponDetailResponse. # noqa: E501 + :type: GetUserCouponDetailResponseData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetUserCouponDetailResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetUserCouponDetailResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_user_coupon_detail_response_data.py b/gate_api/models/get_user_coupon_detail_response_data.py new file mode 100644 index 00000000..5697d2b3 --- /dev/null +++ b/gate_api/models/get_user_coupon_detail_response_data.py @@ -0,0 +1,857 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetUserCouponDetailResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'details_id': 'int', + 'coupon_type': 'str', + 'name': 'str', + 'amount': 'str', + 'origin_amount': 'str', + 'currency': 'str', + 'rule_new': 'str', + 'status': 'str', + 'jump_url': 'ListUserCouponsResponseDataJumpUrl', + 'help_url': 'ListUserCouponsResponseDataHelpUrl', + 'expire_time': 'int', + 'expire_time_order_by': 'int', + 'expire_second': 'int', + 'has_usage_history': 'bool', + 'has_progress': 'bool', + 'progress_config': 'ListUserCouponsResponseDataProgressConfig', + 'activation_info': 'object', + 'is_task_coupon': 'int', + 'upgrade_toast': 'bool', + 'from_task': 'bool', + 'task_title': 'str', + 'task_desc': 'str', + 'task_start_at': 'int', + 'task_expire_at': 'int', + 'task_completed_at': 'int', + 'extra': 'list[list[object]]' + } + + attribute_map = { + 'id': 'id', + 'details_id': 'details_id', + 'coupon_type': 'coupon_type', + 'name': 'name', + 'amount': 'amount', + 'origin_amount': 'origin_amount', + 'currency': 'currency', + 'rule_new': 'rule_new', + 'status': 'status', + 'jump_url': 'jump_url', + 'help_url': 'help_url', + 'expire_time': 'expire_time', + 'expire_time_order_by': 'expire_time_order_by', + 'expire_second': 'expire_second', + 'has_usage_history': 'has_usage_history', + 'has_progress': 'has_progress', + 'progress_config': 'progress_config', + 'activation_info': 'activation_info', + 'is_task_coupon': 'is_task_coupon', + 'upgrade_toast': 'upgrade_toast', + 'from_task': 'from_task', + 'task_title': 'task_title', + 'task_desc': 'task_desc', + 'task_start_at': 'task_start_at', + 'task_expire_at': 'task_expire_at', + 'task_completed_at': 'task_completed_at', + 'extra': 'extra' + } + + def __init__(self, id=None, details_id=None, coupon_type=None, name=None, amount=None, origin_amount=None, currency=None, rule_new=None, status=None, jump_url=None, help_url=None, expire_time=None, expire_time_order_by=None, expire_second=None, has_usage_history=None, has_progress=None, progress_config=None, activation_info=None, is_task_coupon=None, upgrade_toast=None, from_task=None, task_title=None, task_desc=None, task_start_at=None, task_expire_at=None, task_completed_at=None, extra=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, str, str, str, str, ListUserCouponsResponseDataJumpUrl, ListUserCouponsResponseDataHelpUrl, int, int, int, bool, bool, ListUserCouponsResponseDataProgressConfig, object, int, bool, bool, str, str, int, int, int, list[list[object]], Configuration) -> None + """GetUserCouponDetailResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._details_id = None + self._coupon_type = None + self._name = None + self._amount = None + self._origin_amount = None + self._currency = None + self._rule_new = None + self._status = None + self._jump_url = None + self._help_url = None + self._expire_time = None + self._expire_time_order_by = None + self._expire_second = None + self._has_usage_history = None + self._has_progress = None + self._progress_config = None + self._activation_info = None + self._is_task_coupon = None + self._upgrade_toast = None + self._from_task = None + self._task_title = None + self._task_desc = None + self._task_start_at = None + self._task_expire_at = None + self._task_completed_at = None + self._extra = None + self.discriminator = None + + if id is not None: + self.id = id + if details_id is not None: + self.details_id = details_id + if coupon_type is not None: + self.coupon_type = coupon_type + if name is not None: + self.name = name + if amount is not None: + self.amount = amount + if origin_amount is not None: + self.origin_amount = origin_amount + if currency is not None: + self.currency = currency + if rule_new is not None: + self.rule_new = rule_new + if status is not None: + self.status = status + if jump_url is not None: + self.jump_url = jump_url + if help_url is not None: + self.help_url = help_url + if expire_time is not None: + self.expire_time = expire_time + if expire_time_order_by is not None: + self.expire_time_order_by = expire_time_order_by + if expire_second is not None: + self.expire_second = expire_second + if has_usage_history is not None: + self.has_usage_history = has_usage_history + if has_progress is not None: + self.has_progress = has_progress + if progress_config is not None: + self.progress_config = progress_config + if activation_info is not None: + self.activation_info = activation_info + if is_task_coupon is not None: + self.is_task_coupon = is_task_coupon + if upgrade_toast is not None: + self.upgrade_toast = upgrade_toast + if from_task is not None: + self.from_task = from_task + if task_title is not None: + self.task_title = task_title + if task_desc is not None: + self.task_desc = task_desc + if task_start_at is not None: + self.task_start_at = task_start_at + if task_expire_at is not None: + self.task_expire_at = task_expire_at + if task_completed_at is not None: + self.task_completed_at = task_completed_at + if extra is not None: + self.extra = extra + + @property + def id(self): + """Gets the id of this GetUserCouponDetailResponseData. # noqa: E501 + + Coupon distribution record ID (coupon_send_issuing_log.id) # noqa: E501 + + :return: The id of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this GetUserCouponDetailResponseData. + + Coupon distribution record ID (coupon_send_issuing_log.id) # noqa: E501 + + :param id: The id of this GetUserCouponDetailResponseData. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def details_id(self): + """Gets the details_id of this GetUserCouponDetailResponseData. # noqa: E501 + + User coupon detail table primary key (separate table per type). This field is 0 for task coupons # noqa: E501 + + :return: The details_id of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: int + """ + return self._details_id + + @details_id.setter + def details_id(self, details_id): + """Sets the details_id of this GetUserCouponDetailResponseData. + + User coupon detail table primary key (separate table per type). This field is 0 for task coupons # noqa: E501 + + :param details_id: The details_id of this GetUserCouponDetailResponseData. # noqa: E501 + :type: int + """ + + self._details_id = details_id + + @property + def coupon_type(self): + """Gets the coupon_type of this GetUserCouponDetailResponseData. # noqa: E501 + + Coupon type, enum values same as the `coupon_type` parameter # noqa: E501 + + :return: The coupon_type of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: str + """ + return self._coupon_type + + @coupon_type.setter + def coupon_type(self, coupon_type): + """Sets the coupon_type of this GetUserCouponDetailResponseData. + + Coupon type, enum values same as the `coupon_type` parameter # noqa: E501 + + :param coupon_type: The coupon_type of this GetUserCouponDetailResponseData. # noqa: E501 + :type: str + """ + + self._coupon_type = coupon_type + + @property + def name(self): + """Gets the name of this GetUserCouponDetailResponseData. # noqa: E501 + + Coupon display name (i18n translated) # noqa: E501 + + :return: The name of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this GetUserCouponDetailResponseData. + + Coupon display name (i18n translated) # noqa: E501 + + :param name: The name of this GetUserCouponDetailResponseData. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def amount(self): + """Gets the amount of this GetUserCouponDetailResponseData. # noqa: E501 + + Coupon denomination (formatted string with thousand separators). Meaning by type: point card = balance, interest rate boost coupon = rate percentage (e.g., '5%'), VIP trial card = VIP level number, position voucher = face value x leverage, others = face value # noqa: E501 + + :return: The amount of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this GetUserCouponDetailResponseData. + + Coupon denomination (formatted string with thousand separators). Meaning by type: point card = balance, interest rate boost coupon = rate percentage (e.g., '5%'), VIP trial card = VIP level number, position voucher = face value x leverage, others = face value # noqa: E501 + + :param amount: The amount of this GetUserCouponDetailResponseData. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def origin_amount(self): + """Gets the origin_amount of this GetUserCouponDetailResponseData. # noqa: E501 + + Original denomination (string with trailing zeros removed). Only returned for point card type, other types do not have this field # noqa: E501 + + :return: The origin_amount of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: str + """ + return self._origin_amount + + @origin_amount.setter + def origin_amount(self, origin_amount): + """Sets the origin_amount of this GetUserCouponDetailResponseData. + + Original denomination (string with trailing zeros removed). Only returned for point card type, other types do not have this field # noqa: E501 + + :param origin_amount: The origin_amount of this GetUserCouponDetailResponseData. # noqa: E501 + :type: str + """ + + self._origin_amount = origin_amount + + @property + def currency(self): + """Gets the currency of this GetUserCouponDetailResponseData. # noqa: E501 + + Denomination unit. Point card = 'POINT', interest rate boost coupon = 'APR', VIP trial card = 'VIP', Alpha cash coupon = base currency, others = uppercase currency symbol (e.g., 'USDT'/'GT') # noqa: E501 + + :return: The currency of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this GetUserCouponDetailResponseData. + + Denomination unit. Point card = 'POINT', interest rate boost coupon = 'APR', VIP trial card = 'VIP', Alpha cash coupon = base currency, others = uppercase currency symbol (e.g., 'USDT'/'GT') # noqa: E501 + + :param currency: The currency of this GetUserCouponDetailResponseData. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def rule_new(self): + """Gets the rule_new of this GetUserCouponDetailResponseData. # noqa: E501 + + Coupon usage rule text (i18n translated). Only has value in the detail endpoint, fixed as empty string in the list endpoint # noqa: E501 + + :return: The rule_new of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: str + """ + return self._rule_new + + @rule_new.setter + def rule_new(self, rule_new): + """Sets the rule_new of this GetUserCouponDetailResponseData. + + Coupon usage rule text (i18n translated). Only has value in the detail endpoint, fixed as empty string in the list endpoint # noqa: E501 + + :param rule_new: The rule_new of this GetUserCouponDetailResponseData. # noqa: E501 + :type: str + """ + + self._rule_new = rule_new + + @property + def status(self): + """Gets the status of this GetUserCouponDetailResponseData. # noqa: E501 + + Coupon status. Regular coupon: NOT_ACTIVE (pending activation), ACTIVATED (activated), TO_BE_USED (to be used), EXPIRED (expired), RECYCLED (recycled), INVALID (invalidated), USED (used), UNKNOWN (unknown), LOCKED (locked, P2P only). Task coupon: TASK_START (task not started), TASK_WAIT (task in progress), TASK_DONE (task completed, processing), TASK_EXPIRED (task not completed, expired), TASK_NOT_STARTED_EXPIRED (not started, expired), TASK_RECEIVE_SUCCESS (reward claimed successfully), TASK_RECEIVE_FAIL (reward claim failed) # noqa: E501 + + :return: The status of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this GetUserCouponDetailResponseData. + + Coupon status. Regular coupon: NOT_ACTIVE (pending activation), ACTIVATED (activated), TO_BE_USED (to be used), EXPIRED (expired), RECYCLED (recycled), INVALID (invalidated), USED (used), UNKNOWN (unknown), LOCKED (locked, P2P only). Task coupon: TASK_START (task not started), TASK_WAIT (task in progress), TASK_DONE (task completed, processing), TASK_EXPIRED (task not completed, expired), TASK_NOT_STARTED_EXPIRED (not started, expired), TASK_RECEIVE_SUCCESS (reward claimed successfully), TASK_RECEIVE_FAIL (reward claim failed) # noqa: E501 + + :param status: The status of this GetUserCouponDetailResponseData. # noqa: E501 + :type: str + """ + allowed_values = ["NOT_ACTIVE", "ACTIVATED", "TO_BE_USED", "EXPIRED", "RECYCLED", "INVALID", "USED", "UNKNOWN", "LOCKED", "TASK_START", "TASK_WAIT", "TASK_DONE", "TASK_EXPIRED", "TASK_NOT_STARTED_EXPIRED", "TASK_RECEIVE_SUCCESS", "TASK_RECEIVE_FAIL"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def jump_url(self): + """Gets the jump_url of this GetUserCouponDetailResponseData. # noqa: E501 + + + :return: The jump_url of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: ListUserCouponsResponseDataJumpUrl + """ + return self._jump_url + + @jump_url.setter + def jump_url(self, jump_url): + """Sets the jump_url of this GetUserCouponDetailResponseData. + + + :param jump_url: The jump_url of this GetUserCouponDetailResponseData. # noqa: E501 + :type: ListUserCouponsResponseDataJumpUrl + """ + + self._jump_url = jump_url + + @property + def help_url(self): + """Gets the help_url of this GetUserCouponDetailResponseData. # noqa: E501 + + + :return: The help_url of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: ListUserCouponsResponseDataHelpUrl + """ + return self._help_url + + @help_url.setter + def help_url(self, help_url): + """Sets the help_url of this GetUserCouponDetailResponseData. + + + :param help_url: The help_url of this GetUserCouponDetailResponseData. # noqa: E501 + :type: ListUserCouponsResponseDataHelpUrl + """ + + self._help_url = help_url + + @property + def expire_time(self): + """Gets the expire_time of this GetUserCouponDetailResponseData. # noqa: E501 + + Expiration time (Unix timestamp). Some types replace this with actual expiration time after activation/use. Point card type returns 0. Rules by type: cash=not_received_expired_timest; contract_bonus=uses expired_timest after activation/use; contract_bonus_new=always uses expired_timest; position_voucher/tradfi_position_voucher=uses expire_time after use; robot_bonus=not_received_expired_timest; commission_rebate=uses use_deadline after use; crypto_loan_interest=not_using_expired_timest; copy_trading=not_using_expired_timest; alpha_voucher=not_received_expired_timest; etf_voucher=not_using_expired_timest # noqa: E501 + + :return: The expire_time of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: int + """ + return self._expire_time + + @expire_time.setter + def expire_time(self, expire_time): + """Sets the expire_time of this GetUserCouponDetailResponseData. + + Expiration time (Unix timestamp). Some types replace this with actual expiration time after activation/use. Point card type returns 0. Rules by type: cash=not_received_expired_timest; contract_bonus=uses expired_timest after activation/use; contract_bonus_new=always uses expired_timest; position_voucher/tradfi_position_voucher=uses expire_time after use; robot_bonus=not_received_expired_timest; commission_rebate=uses use_deadline after use; crypto_loan_interest=not_using_expired_timest; copy_trading=not_using_expired_timest; alpha_voucher=not_received_expired_timest; etf_voucher=not_using_expired_timest # noqa: E501 + + :param expire_time: The expire_time of this GetUserCouponDetailResponseData. # noqa: E501 + :type: int + """ + + self._expire_time = expire_time + + @property + def expire_time_order_by(self): + """Gets the expire_time_order_by of this GetUserCouponDetailResponseData. # noqa: E501 + + Sorting expiration time (from the original expiration time of the distribution record, unaffected by activation) # noqa: E501 + + :return: The expire_time_order_by of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: int + """ + return self._expire_time_order_by + + @expire_time_order_by.setter + def expire_time_order_by(self, expire_time_order_by): + """Sets the expire_time_order_by of this GetUserCouponDetailResponseData. + + Sorting expiration time (from the original expiration time of the distribution record, unaffected by activation) # noqa: E501 + + :param expire_time_order_by: The expire_time_order_by of this GetUserCouponDetailResponseData. # noqa: E501 + :type: int + """ + + self._expire_time_order_by = expire_time_order_by + + @property + def expire_second(self): + """Gets the expire_second of this GetUserCouponDetailResponseData. # noqa: E501 + + Seconds remaining until expiration, returns 0 if expired or point card type # noqa: E501 + + :return: The expire_second of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: int + """ + return self._expire_second + + @expire_second.setter + def expire_second(self, expire_second): + """Sets the expire_second of this GetUserCouponDetailResponseData. + + Seconds remaining until expiration, returns 0 if expired or point card type # noqa: E501 + + :param expire_second: The expire_second of this GetUserCouponDetailResponseData. # noqa: E501 + :type: int + """ + + self._expire_second = expire_second + + @property + def has_usage_history(self): + """Gets the has_usage_history of this GetUserCouponDetailResponseData. # noqa: E501 + + Whether there is a usage history. Fixed as true for point card type, determined by type for others # noqa: E501 + + :return: The has_usage_history of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: bool + """ + return self._has_usage_history + + @has_usage_history.setter + def has_usage_history(self, has_usage_history): + """Sets the has_usage_history of this GetUserCouponDetailResponseData. + + Whether there is a usage history. Fixed as true for point card type, determined by type for others # noqa: E501 + + :param has_usage_history: The has_usage_history of this GetUserCouponDetailResponseData. # noqa: E501 + :type: bool + """ + + self._has_usage_history = has_usage_history + + @property + def has_progress(self): + """Gets the has_progress of this GetUserCouponDetailResponseData. # noqa: E501 + + Whether to display a progress bar. Only true for commission_rebate, interest_voucher, and qualifying task coupons # noqa: E501 + + :return: The has_progress of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: bool + """ + return self._has_progress + + @has_progress.setter + def has_progress(self, has_progress): + """Sets the has_progress of this GetUserCouponDetailResponseData. + + Whether to display a progress bar. Only true for commission_rebate, interest_voucher, and qualifying task coupons # noqa: E501 + + :param has_progress: The has_progress of this GetUserCouponDetailResponseData. # noqa: E501 + :type: bool + """ + + self._has_progress = has_progress + + @property + def progress_config(self): + """Gets the progress_config of this GetUserCouponDetailResponseData. # noqa: E501 + + + :return: The progress_config of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: ListUserCouponsResponseDataProgressConfig + """ + return self._progress_config + + @progress_config.setter + def progress_config(self, progress_config): + """Sets the progress_config of this GetUserCouponDetailResponseData. + + + :param progress_config: The progress_config of this GetUserCouponDetailResponseData. # noqa: E501 + :type: ListUserCouponsResponseDataProgressConfig + """ + + self._progress_config = progress_config + + @property + def activation_info(self): + """Gets the activation_info of this GetUserCouponDetailResponseData. # noqa: E501 + + Type-specific activation information. Types without specific fields return empty object {}. Fields by type: interest_voucher={supported_pairs (applicable trading pairs), transaction_type}; contract_bonus_new={received_expired_hour (valid hours after activation)}; contract_bonus={check_unified_account_mode, received_expired_days (valid days after activation), abtest}; commission_rebate={market (spot/margin/futures/alpha/etf/tradfi), market_name (market display name)}; robot_bonus={designated_bots (ENABLED = designated strategies only / DISABLED = unrestricted)}; position_voucher={symbols (applicable trading pairs, empty = unrestricted), leverage, need_user_funds (0 = no user funds required / 1 = user funds required), user_funds_amount, position_bonus (original face value)}; tradfi_position_voucher={symbols, leverage, position_bonus}; etf_voucher={currency_markets (ETF market list, comma-separated), amount (original face value)} # noqa: E501 + + :return: The activation_info of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: object + """ + return self._activation_info + + @activation_info.setter + def activation_info(self, activation_info): + """Sets the activation_info of this GetUserCouponDetailResponseData. + + Type-specific activation information. Types without specific fields return empty object {}. Fields by type: interest_voucher={supported_pairs (applicable trading pairs), transaction_type}; contract_bonus_new={received_expired_hour (valid hours after activation)}; contract_bonus={check_unified_account_mode, received_expired_days (valid days after activation), abtest}; commission_rebate={market (spot/margin/futures/alpha/etf/tradfi), market_name (market display name)}; robot_bonus={designated_bots (ENABLED = designated strategies only / DISABLED = unrestricted)}; position_voucher={symbols (applicable trading pairs, empty = unrestricted), leverage, need_user_funds (0 = no user funds required / 1 = user funds required), user_funds_amount, position_bonus (original face value)}; tradfi_position_voucher={symbols, leverage, position_bonus}; etf_voucher={currency_markets (ETF market list, comma-separated), amount (original face value)} # noqa: E501 + + :param activation_info: The activation_info of this GetUserCouponDetailResponseData. # noqa: E501 + :type: object + """ + + self._activation_info = activation_info + + @property + def is_task_coupon(self): + """Gets the is_task_coupon of this GetUserCouponDetailResponseData. # noqa: E501 + + Whether it is a task coupon. `0` = regular coupon; `1` = task coupon # noqa: E501 + + :return: The is_task_coupon of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: int + """ + return self._is_task_coupon + + @is_task_coupon.setter + def is_task_coupon(self, is_task_coupon): + """Sets the is_task_coupon of this GetUserCouponDetailResponseData. + + Whether it is a task coupon. `0` = regular coupon; `1` = task coupon # noqa: E501 + + :param is_task_coupon: The is_task_coupon of this GetUserCouponDetailResponseData. # noqa: E501 + :type: int + """ + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and is_task_coupon not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `is_task_coupon` ({0}), must be one of {1}" # noqa: E501 + .format(is_task_coupon, allowed_values) + ) + + self._is_task_coupon = is_task_coupon + + @property + def upgrade_toast(self): + """Gets the upgrade_toast of this GetUserCouponDetailResponseData. # noqa: E501 + + Whether to prompt the user to upgrade the App (true when the app version is too old to support the coupon) # noqa: E501 + + :return: The upgrade_toast of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: bool + """ + return self._upgrade_toast + + @upgrade_toast.setter + def upgrade_toast(self, upgrade_toast): + """Sets the upgrade_toast of this GetUserCouponDetailResponseData. + + Whether to prompt the user to upgrade the App (true when the app version is too old to support the coupon) # noqa: E501 + + :param upgrade_toast: The upgrade_toast of this GetUserCouponDetailResponseData. # noqa: E501 + :type: bool + """ + + self._upgrade_toast = upgrade_toast + + @property + def from_task(self): + """Gets the from_task of this GetUserCouponDetailResponseData. # noqa: E501 + + [Detail endpoint only] Whether this regular coupon was obtained by completing a task (a sub-coupon automatically issued after task completion). Regular coupons may be true, task coupons are always false # noqa: E501 + + :return: The from_task of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: bool + """ + return self._from_task + + @from_task.setter + def from_task(self, from_task): + """Sets the from_task of this GetUserCouponDetailResponseData. + + [Detail endpoint only] Whether this regular coupon was obtained by completing a task (a sub-coupon automatically issued after task completion). Regular coupons may be true, task coupons are always false # noqa: E501 + + :param from_task: The from_task of this GetUserCouponDetailResponseData. # noqa: E501 + :type: bool + """ + + self._from_task = from_task + + @property + def task_title(self): + """Gets the task_title of this GetUserCouponDetailResponseData. # noqa: E501 + + Task title. Task coupons have value; regular coupons return empty string (but task_title is not assigned when from_task=true) # noqa: E501 + + :return: The task_title of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: str + """ + return self._task_title + + @task_title.setter + def task_title(self, task_title): + """Sets the task_title of this GetUserCouponDetailResponseData. + + Task title. Task coupons have value; regular coupons return empty string (but task_title is not assigned when from_task=true) # noqa: E501 + + :param task_title: The task_title of this GetUserCouponDetailResponseData. # noqa: E501 + :type: str + """ + + self._task_title = task_title + + @property + def task_desc(self): + """Gets the task_desc of this GetUserCouponDetailResponseData. # noqa: E501 + + Task description. Task coupons have value; regular coupons return empty string # noqa: E501 + + :return: The task_desc of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: str + """ + return self._task_desc + + @task_desc.setter + def task_desc(self, task_desc): + """Sets the task_desc of this GetUserCouponDetailResponseData. + + Task description. Task coupons have value; regular coupons return empty string # noqa: E501 + + :param task_desc: The task_desc of this GetUserCouponDetailResponseData. # noqa: E501 + :type: str + """ + + self._task_desc = task_desc + + @property + def task_start_at(self): + """Gets the task_start_at of this GetUserCouponDetailResponseData. # noqa: E501 + + Task start timestamp (Unix). Task coupon: has value when in TASK_EXPIRED status, otherwise 0; regular coupon (from_task=true): start time of the source task # noqa: E501 + + :return: The task_start_at of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: int + """ + return self._task_start_at + + @task_start_at.setter + def task_start_at(self, task_start_at): + """Sets the task_start_at of this GetUserCouponDetailResponseData. + + Task start timestamp (Unix). Task coupon: has value when in TASK_EXPIRED status, otherwise 0; regular coupon (from_task=true): start time of the source task # noqa: E501 + + :param task_start_at: The task_start_at of this GetUserCouponDetailResponseData. # noqa: E501 + :type: int + """ + + self._task_start_at = task_start_at + + @property + def task_expire_at(self): + """Gets the task_expire_at of this GetUserCouponDetailResponseData. # noqa: E501 + + Task validity expiration timestamp (Unix). Task coupon: claim validity deadline (0 means unlimited); regular coupon: fixed at 0 # noqa: E501 + + :return: The task_expire_at of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: int + """ + return self._task_expire_at + + @task_expire_at.setter + def task_expire_at(self, task_expire_at): + """Sets the task_expire_at of this GetUserCouponDetailResponseData. + + Task validity expiration timestamp (Unix). Task coupon: claim validity deadline (0 means unlimited); regular coupon: fixed at 0 # noqa: E501 + + :param task_expire_at: The task_expire_at of this GetUserCouponDetailResponseData. # noqa: E501 + :type: int + """ + + self._task_expire_at = task_expire_at + + @property + def task_completed_at(self): + """Gets the task_completed_at of this GetUserCouponDetailResponseData. # noqa: E501 + + Task completion timestamp (Unix). Task coupon: task completion time (0 means not completed); regular coupon (from_task=true): completion time of the source task # noqa: E501 + + :return: The task_completed_at of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: int + """ + return self._task_completed_at + + @task_completed_at.setter + def task_completed_at(self, task_completed_at): + """Sets the task_completed_at of this GetUserCouponDetailResponseData. + + Task completion timestamp (Unix). Task coupon: task completion time (0 means not completed); regular coupon (from_task=true): completion time of the source task # noqa: E501 + + :param task_completed_at: The task_completed_at of this GetUserCouponDetailResponseData. # noqa: E501 + :type: int + """ + + self._task_completed_at = task_completed_at + + @property + def extra(self): + """Gets the extra of this GetUserCouponDetailResponseData. # noqa: E501 + + [Detail endpoint only] Coupon detail attributes organized by display blocks. The frontend renders them as separate sections. Point card type always returns empty array []. Other types return a 2D array composed of blocks: block 1 = coupon name/source/status, block 2 = coupon core attributes, block 3 = time information. Each item contains: type (display type: string/timestamp/day/hour/status/btn), key (label text, i18n translated), value (string or integer, timestamp type is Unix timestamp) # noqa: E501 + + :return: The extra of this GetUserCouponDetailResponseData. # noqa: E501 + :rtype: list[list[object]] + """ + return self._extra + + @extra.setter + def extra(self, extra): + """Sets the extra of this GetUserCouponDetailResponseData. + + [Detail endpoint only] Coupon detail attributes organized by display blocks. The frontend renders them as separate sections. Point card type always returns empty array []. Other types return a 2D array composed of blocks: block 1 = coupon name/source/status, block 2 = coupon core attributes, block 3 = time information. Each item contains: type (display type: string/timestamp/day/hour/status/btn), key (label text, i18n translated), value (string or integer, timestamp type is Unix timestamp) # noqa: E501 + + :param extra: The extra of this GetUserCouponDetailResponseData. # noqa: E501 + :type: list[list[object]] + """ + + self._extra = extra + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetUserCouponDetailResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetUserCouponDetailResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/get_user_identity_error.py b/gate_api/models/get_user_identity_error.py new file mode 100644 index 00000000..b4ebcd98 --- /dev/null +++ b/gate_api/models/get_user_identity_error.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class GetUserIdentityError(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label': 'str', + 'message': 'str' + } + + attribute_map = { + 'label': 'label', + 'message': 'message' + } + + def __init__(self, label=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """GetUserIdentityError - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._label = None + self._message = None + self.discriminator = None + + if label is not None: + self.label = label + if message is not None: + self.message = message + + @property + def label(self): + """Gets the label of this GetUserIdentityError. # noqa: E501 + + Error identifier code # noqa: E501 + + :return: The label of this GetUserIdentityError. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this GetUserIdentityError. + + Error identifier code # noqa: E501 + + :param label: The label of this GetUserIdentityError. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this GetUserIdentityError. # noqa: E501 + + Error details # noqa: E501 + + :return: The message of this GetUserIdentityError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this GetUserIdentityError. + + Error details # noqa: E501 + + :param message: The message of this GetUserIdentityError. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetUserIdentityError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetUserIdentityError): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/structured_buy.py b/gate_api/models/i18n_txt.py similarity index 66% rename from gate_api/models/structured_buy.py rename to gate_api/models/i18n_txt.py index 285adf7d..957b2b56 100644 --- a/gate_api/models/structured_buy.py +++ b/gate_api/models/i18n_txt.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class StructuredBuy(object): +class I18nTxt(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -33,76 +33,72 @@ class StructuredBuy(object): and the value is json key in definition. """ openapi_types = { - 'pid': 'str', - 'amount': 'str' + 'lang': 'str', + 'value': 'str' } attribute_map = { - 'pid': 'pid', - 'amount': 'amount' + 'lang': 'lang', + 'value': 'value' } - def __init__(self, pid=None, amount=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, lang=None, value=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, Configuration) -> None - """StructuredBuy - a model defined in OpenAPI""" # noqa: E501 + """I18nTxt - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration - self._pid = None - self._amount = None + self._lang = None + self._value = None self.discriminator = None - if pid is not None: - self.pid = pid - if amount is not None: - self.amount = amount + if lang is not None: + self.lang = lang + if value is not None: + self.value = value @property - def pid(self): - """Gets the pid of this StructuredBuy. # noqa: E501 + def lang(self): + """Gets the lang of this I18nTxt. # noqa: E501 - Product ID # noqa: E501 - :return: The pid of this StructuredBuy. # noqa: E501 + :return: The lang of this I18nTxt. # noqa: E501 :rtype: str """ - return self._pid + return self._lang - @pid.setter - def pid(self, pid): - """Sets the pid of this StructuredBuy. + @lang.setter + def lang(self, lang): + """Sets the lang of this I18nTxt. - Product ID # noqa: E501 - :param pid: The pid of this StructuredBuy. # noqa: E501 + :param lang: The lang of this I18nTxt. # noqa: E501 :type: str """ - self._pid = pid + self._lang = lang @property - def amount(self): - """Gets the amount of this StructuredBuy. # noqa: E501 + def value(self): + """Gets the value of this I18nTxt. # noqa: E501 - Buy Quantity # noqa: E501 - :return: The amount of this StructuredBuy. # noqa: E501 + :return: The value of this I18nTxt. # noqa: E501 :rtype: str """ - return self._amount + return self._value - @amount.setter - def amount(self, amount): - """Sets the amount of this StructuredBuy. + @value.setter + def value(self, value): + """Sets the value of this I18nTxt. - Buy Quantity # noqa: E501 - :param amount: The amount of this StructuredBuy. # noqa: E501 + :param value: The value of this I18nTxt. # noqa: E501 :type: str """ - self._amount = amount + self._value = value def to_dict(self): """Returns the model properties as a dict""" @@ -138,14 +134,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, StructuredBuy): + if not isinstance(other, I18nTxt): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, StructuredBuy): + if not isinstance(other, I18nTxt): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/infinite_grid_create_params.py b/gate_api/models/infinite_grid_create_params.py new file mode 100644 index 00000000..2d83765a --- /dev/null +++ b/gate_api/models/infinite_grid_create_params.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class InfiniteGridCreateParams(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'money': 'str', + 'price_floor': 'str', + 'profit_per_grid': 'str', + 'grid_num': 'int', + 'price_type': 'int', + 'trigger_price': 'str', + 'stop_profit': 'str', + 'stop_loss': 'str', + 'profit_sharing_ratio': 'str', + 'is_use_base': 'bool' + } + + attribute_map = { + 'money': 'money', + 'price_floor': 'price_floor', + 'profit_per_grid': 'profit_per_grid', + 'grid_num': 'grid_num', + 'price_type': 'price_type', + 'trigger_price': 'trigger_price', + 'stop_profit': 'stop_profit', + 'stop_loss': 'stop_loss', + 'profit_sharing_ratio': 'profit_sharing_ratio', + 'is_use_base': 'is_use_base' + } + + def __init__(self, money=None, price_floor=None, profit_per_grid=None, grid_num=None, price_type=None, trigger_price=None, stop_profit=None, stop_loss=None, profit_sharing_ratio=None, is_use_base=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, int, str, str, str, str, bool, Configuration) -> None + """InfiniteGridCreateParams - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._money = None + self._price_floor = None + self._profit_per_grid = None + self._grid_num = None + self._price_type = None + self._trigger_price = None + self._stop_profit = None + self._stop_loss = None + self._profit_sharing_ratio = None + self._is_use_base = None + self.discriminator = None + + self.money = money + self.price_floor = price_floor + self.profit_per_grid = profit_per_grid + if grid_num is not None: + self.grid_num = grid_num + if price_type is not None: + self.price_type = price_type + if trigger_price is not None: + self.trigger_price = trigger_price + if stop_profit is not None: + self.stop_profit = stop_profit + if stop_loss is not None: + self.stop_loss = stop_loss + if profit_sharing_ratio is not None: + self.profit_sharing_ratio = profit_sharing_ratio + if is_use_base is not None: + self.is_use_base = is_use_base + + @property + def money(self): + """Gets the money of this InfiniteGridCreateParams. # noqa: E501 + + + :return: The money of this InfiniteGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this InfiniteGridCreateParams. + + + :param money: The money of this InfiniteGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and money is None: # noqa: E501 + raise ValueError("Invalid value for `money`, must not be `None`") # noqa: E501 + + self._money = money + + @property + def price_floor(self): + """Gets the price_floor of this InfiniteGridCreateParams. # noqa: E501 + + price floor # noqa: E501 + + :return: The price_floor of this InfiniteGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._price_floor + + @price_floor.setter + def price_floor(self, price_floor): + """Sets the price_floor of this InfiniteGridCreateParams. + + price floor # noqa: E501 + + :param price_floor: The price_floor of this InfiniteGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price_floor is None: # noqa: E501 + raise ValueError("Invalid value for `price_floor`, must not be `None`") # noqa: E501 + + self._price_floor = price_floor + + @property + def profit_per_grid(self): + """Gets the profit_per_grid of this InfiniteGridCreateParams. # noqa: E501 + + Profit per square # noqa: E501 + + :return: The profit_per_grid of this InfiniteGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._profit_per_grid + + @profit_per_grid.setter + def profit_per_grid(self, profit_per_grid): + """Sets the profit_per_grid of this InfiniteGridCreateParams. + + Profit per square # noqa: E501 + + :param profit_per_grid: The profit_per_grid of this InfiniteGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and profit_per_grid is None: # noqa: E501 + raise ValueError("Invalid value for `profit_per_grid`, must not be `None`") # noqa: E501 + + self._profit_per_grid = profit_per_grid + + @property + def grid_num(self): + """Gets the grid_num of this InfiniteGridCreateParams. # noqa: E501 + + Optional; may be omitted like in the app. # noqa: E501 + + :return: The grid_num of this InfiniteGridCreateParams. # noqa: E501 + :rtype: int + """ + return self._grid_num + + @grid_num.setter + def grid_num(self, grid_num): + """Sets the grid_num of this InfiniteGridCreateParams. + + Optional; may be omitted like in the app. # noqa: E501 + + :param grid_num: The grid_num of this InfiniteGridCreateParams. # noqa: E501 + :type: int + """ + if (self.local_vars_configuration.client_side_validation and + grid_num is not None and grid_num < 1): # noqa: E501 + raise ValueError("Invalid value for `grid_num`, must be a value greater than or equal to `1`") # noqa: E501 + + self._grid_num = grid_num + + @property + def price_type(self): + """Gets the price_type of this InfiniteGridCreateParams. # noqa: E501 + + Optional. `0` arithmetic grid; `1` geometric; omit for server defaults. # noqa: E501 + + :return: The price_type of this InfiniteGridCreateParams. # noqa: E501 + :rtype: int + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this InfiniteGridCreateParams. + + Optional. `0` arithmetic grid; `1` geometric; omit for server defaults. # noqa: E501 + + :param price_type: The price_type of this InfiniteGridCreateParams. # noqa: E501 + :type: int + """ + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def trigger_price(self): + """Gets the trigger_price of this InfiniteGridCreateParams. # noqa: E501 + + + :return: The trigger_price of this InfiniteGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this InfiniteGridCreateParams. + + + :param trigger_price: The trigger_price of this InfiniteGridCreateParams. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def stop_profit(self): + """Gets the stop_profit of this InfiniteGridCreateParams. # noqa: E501 + + + :return: The stop_profit of this InfiniteGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._stop_profit + + @stop_profit.setter + def stop_profit(self, stop_profit): + """Sets the stop_profit of this InfiniteGridCreateParams. + + + :param stop_profit: The stop_profit of this InfiniteGridCreateParams. # noqa: E501 + :type: str + """ + + self._stop_profit = stop_profit + + @property + def stop_loss(self): + """Gets the stop_loss of this InfiniteGridCreateParams. # noqa: E501 + + + :return: The stop_loss of this InfiniteGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._stop_loss + + @stop_loss.setter + def stop_loss(self, stop_loss): + """Sets the stop_loss of this InfiniteGridCreateParams. + + + :param stop_loss: The stop_loss of this InfiniteGridCreateParams. # noqa: E501 + :type: str + """ + + self._stop_loss = stop_loss + + @property + def profit_sharing_ratio(self): + """Gets the profit_sharing_ratio of this InfiniteGridCreateParams. # noqa: E501 + + + :return: The profit_sharing_ratio of this InfiniteGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._profit_sharing_ratio + + @profit_sharing_ratio.setter + def profit_sharing_ratio(self, profit_sharing_ratio): + """Sets the profit_sharing_ratio of this InfiniteGridCreateParams. + + + :param profit_sharing_ratio: The profit_sharing_ratio of this InfiniteGridCreateParams. # noqa: E501 + :type: str + """ + + self._profit_sharing_ratio = profit_sharing_ratio + + @property + def is_use_base(self): + """Gets the is_use_base of this InfiniteGridCreateParams. # noqa: E501 + + + :return: The is_use_base of this InfiniteGridCreateParams. # noqa: E501 + :rtype: bool + """ + return self._is_use_base + + @is_use_base.setter + def is_use_base(self, is_use_base): + """Sets the is_use_base of this InfiniteGridCreateParams. + + + :param is_use_base: The is_use_base of this InfiniteGridCreateParams. # noqa: E501 + :type: bool + """ + + self._is_use_base = is_use_base + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InfiniteGridCreateParams): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, InfiniteGridCreateParams): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/infinite_grid_create_request.py b/gate_api/models/infinite_grid_create_request.py new file mode 100644 index 00000000..4ef37580 --- /dev/null +++ b/gate_api/models/infinite_grid_create_request.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class InfiniteGridCreateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_type': 'str', + 'market': 'str', + 'create_params': 'InfiniteGridCreateParams' + } + + attribute_map = { + 'strategy_type': 'strategy_type', + 'market': 'market', + 'create_params': 'create_params' + } + + def __init__(self, strategy_type=None, market=None, create_params=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, InfiniteGridCreateParams, Configuration) -> None + """InfiniteGridCreateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_type = None + self._market = None + self._create_params = None + self.discriminator = None + + self.strategy_type = strategy_type + self.market = market + self.create_params = create_params + + @property + def strategy_type(self): + """Gets the strategy_type of this InfiniteGridCreateRequest. # noqa: E501 + + + :return: The strategy_type of this InfiniteGridCreateRequest. # noqa: E501 + :rtype: str + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this InfiniteGridCreateRequest. + + + :param strategy_type: The strategy_type of this InfiniteGridCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + allowed_values = ["infinite_grid"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and strategy_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `strategy_type` ({0}), must be one of {1}" # noqa: E501 + .format(strategy_type, allowed_values) + ) + + self._strategy_type = strategy_type + + @property + def market(self): + """Gets the market of this InfiniteGridCreateRequest. # noqa: E501 + + + :return: The market of this InfiniteGridCreateRequest. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this InfiniteGridCreateRequest. + + + :param market: The market of this InfiniteGridCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def create_params(self): + """Gets the create_params of this InfiniteGridCreateRequest. # noqa: E501 + + + :return: The create_params of this InfiniteGridCreateRequest. # noqa: E501 + :rtype: InfiniteGridCreateParams + """ + return self._create_params + + @create_params.setter + def create_params(self, create_params): + """Sets the create_params of this InfiniteGridCreateRequest. + + + :param create_params: The create_params of this InfiniteGridCreateRequest. # noqa: E501 + :type: InfiniteGridCreateParams + """ + if self.local_vars_configuration.client_side_validation and create_params is None: # noqa: E501 + raise ValueError("Invalid value for `create_params`, must not be `None`") # noqa: E501 + + self._create_params = create_params + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InfiniteGridCreateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, InfiniteGridCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/inline_response200.py b/gate_api/models/inline_response200.py index 171fd148..6c45cfd2 100644 --- a/gate_api/models/inline_response200.py +++ b/gate_api/models/inline_response200.py @@ -33,72 +33,247 @@ class InlineResponse200(object): and the value is json key in definition. """ openapi_types = { - 'time': 'int', - 'value': 'str' + 'exchange_type': 'str', + 'spot_maker_fee': 'str', + 'spot_taker_fee': 'str', + 'spot_rpi_maker_fee': 'str', + 'future_maker_fee': 'str', + 'future_taker_fee': 'str', + 'future_rpi_maker_fee': 'str', + 'special_fee_list': 'list[CrossexSpecialFee]' } attribute_map = { - 'time': 'time', - 'value': 'value' + 'exchange_type': 'exchange_type', + 'spot_maker_fee': 'spot_maker_fee', + 'spot_taker_fee': 'spot_taker_fee', + 'spot_rpi_maker_fee': 'spot_rpi_maker_fee', + 'future_maker_fee': 'future_maker_fee', + 'future_taker_fee': 'future_taker_fee', + 'future_rpi_maker_fee': 'future_rpi_maker_fee', + 'special_fee_list': 'special_fee_list' } - def __init__(self, time=None, value=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, Configuration) -> None + def __init__(self, exchange_type=None, spot_maker_fee=None, spot_taker_fee=None, spot_rpi_maker_fee=None, future_maker_fee=None, future_taker_fee=None, future_rpi_maker_fee=None, special_fee_list=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, list[CrossexSpecialFee], Configuration) -> None """InlineResponse200 - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration - self._time = None - self._value = None + self._exchange_type = None + self._spot_maker_fee = None + self._spot_taker_fee = None + self._spot_rpi_maker_fee = None + self._future_maker_fee = None + self._future_taker_fee = None + self._future_rpi_maker_fee = None + self._special_fee_list = None self.discriminator = None - if time is not None: - self.time = time - if value is not None: - self.value = value + if exchange_type is not None: + self.exchange_type = exchange_type + self.spot_maker_fee = spot_maker_fee + self.spot_taker_fee = spot_taker_fee + if spot_rpi_maker_fee is not None: + self.spot_rpi_maker_fee = spot_rpi_maker_fee + self.future_maker_fee = future_maker_fee + self.future_taker_fee = future_taker_fee + if future_rpi_maker_fee is not None: + self.future_rpi_maker_fee = future_rpi_maker_fee + self.special_fee_list = special_fee_list @property - def time(self): - """Gets the time of this InlineResponse200. # noqa: E501 + def exchange_type(self): + """Gets the exchange_type of this InlineResponse200. # noqa: E501 + Exchange # noqa: E501 - :return: The time of this InlineResponse200. # noqa: E501 - :rtype: int + :return: The exchange_type of this InlineResponse200. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this InlineResponse200. + + Exchange # noqa: E501 + + :param exchange_type: The exchange_type of this InlineResponse200. # noqa: E501 + :type: str + """ + + self._exchange_type = exchange_type + + @property + def spot_maker_fee(self): + """Gets the spot_maker_fee of this InlineResponse200. # noqa: E501 + + spotMakerfee rate # noqa: E501 + + :return: The spot_maker_fee of this InlineResponse200. # noqa: E501 + :rtype: str + """ + return self._spot_maker_fee + + @spot_maker_fee.setter + def spot_maker_fee(self, spot_maker_fee): + """Sets the spot_maker_fee of this InlineResponse200. + + spotMakerfee rate # noqa: E501 + + :param spot_maker_fee: The spot_maker_fee of this InlineResponse200. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and spot_maker_fee is None: # noqa: E501 + raise ValueError("Invalid value for `spot_maker_fee`, must not be `None`") # noqa: E501 + + self._spot_maker_fee = spot_maker_fee + + @property + def spot_taker_fee(self): + """Gets the spot_taker_fee of this InlineResponse200. # noqa: E501 + + spotTakerfee rate # noqa: E501 + + :return: The spot_taker_fee of this InlineResponse200. # noqa: E501 + :rtype: str + """ + return self._spot_taker_fee + + @spot_taker_fee.setter + def spot_taker_fee(self, spot_taker_fee): + """Sets the spot_taker_fee of this InlineResponse200. + + spotTakerfee rate # noqa: E501 + + :param spot_taker_fee: The spot_taker_fee of this InlineResponse200. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and spot_taker_fee is None: # noqa: E501 + raise ValueError("Invalid value for `spot_taker_fee`, must not be `None`") # noqa: E501 + + self._spot_taker_fee = spot_taker_fee + + @property + def spot_rpi_maker_fee(self): + """Gets the spot_rpi_maker_fee of this InlineResponse200. # noqa: E501 + + Spot RPI order maker fee rate # noqa: E501 + + :return: The spot_rpi_maker_fee of this InlineResponse200. # noqa: E501 + :rtype: str + """ + return self._spot_rpi_maker_fee + + @spot_rpi_maker_fee.setter + def spot_rpi_maker_fee(self, spot_rpi_maker_fee): + """Sets the spot_rpi_maker_fee of this InlineResponse200. + + Spot RPI order maker fee rate # noqa: E501 + + :param spot_rpi_maker_fee: The spot_rpi_maker_fee of this InlineResponse200. # noqa: E501 + :type: str + """ + + self._spot_rpi_maker_fee = spot_rpi_maker_fee + + @property + def future_maker_fee(self): + """Gets the future_maker_fee of this InlineResponse200. # noqa: E501 + + contractMakerfee rate # noqa: E501 + + :return: The future_maker_fee of this InlineResponse200. # noqa: E501 + :rtype: str + """ + return self._future_maker_fee + + @future_maker_fee.setter + def future_maker_fee(self, future_maker_fee): + """Sets the future_maker_fee of this InlineResponse200. + + contractMakerfee rate # noqa: E501 + + :param future_maker_fee: The future_maker_fee of this InlineResponse200. # noqa: E501 + :type: str """ - return self._time + if self.local_vars_configuration.client_side_validation and future_maker_fee is None: # noqa: E501 + raise ValueError("Invalid value for `future_maker_fee`, must not be `None`") # noqa: E501 - @time.setter - def time(self, time): - """Sets the time of this InlineResponse200. + self._future_maker_fee = future_maker_fee + @property + def future_taker_fee(self): + """Gets the future_taker_fee of this InlineResponse200. # noqa: E501 + + contractTakerfee rate # noqa: E501 - :param time: The time of this InlineResponse200. # noqa: E501 - :type: int + :return: The future_taker_fee of this InlineResponse200. # noqa: E501 + :rtype: str """ + return self._future_taker_fee - self._time = time + @future_taker_fee.setter + def future_taker_fee(self, future_taker_fee): + """Sets the future_taker_fee of this InlineResponse200. + + contractTakerfee rate # noqa: E501 + + :param future_taker_fee: The future_taker_fee of this InlineResponse200. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and future_taker_fee is None: # noqa: E501 + raise ValueError("Invalid value for `future_taker_fee`, must not be `None`") # noqa: E501 + + self._future_taker_fee = future_taker_fee @property - def value(self): - """Gets the value of this InlineResponse200. # noqa: E501 + def future_rpi_maker_fee(self): + """Gets the future_rpi_maker_fee of this InlineResponse200. # noqa: E501 + Futures RPI order maker fee rate # noqa: E501 - :return: The value of this InlineResponse200. # noqa: E501 + :return: The future_rpi_maker_fee of this InlineResponse200. # noqa: E501 :rtype: str """ - return self._value + return self._future_rpi_maker_fee - @value.setter - def value(self, value): - """Sets the value of this InlineResponse200. + @future_rpi_maker_fee.setter + def future_rpi_maker_fee(self, future_rpi_maker_fee): + """Sets the future_rpi_maker_fee of this InlineResponse200. + Futures RPI order maker fee rate # noqa: E501 - :param value: The value of this InlineResponse200. # noqa: E501 + :param future_rpi_maker_fee: The future_rpi_maker_fee of this InlineResponse200. # noqa: E501 :type: str """ - self._value = value + self._future_rpi_maker_fee = future_rpi_maker_fee + + @property + def special_fee_list(self): + """Gets the special_fee_list of this InlineResponse200. # noqa: E501 + + + :return: The special_fee_list of this InlineResponse200. # noqa: E501 + :rtype: list[CrossexSpecialFee] + """ + return self._special_fee_list + + @special_fee_list.setter + def special_fee_list(self, special_fee_list): + """Sets the special_fee_list of this InlineResponse200. + + + :param special_fee_list: The special_fee_list of this InlineResponse200. # noqa: E501 + :type: list[CrossexSpecialFee] + """ + if self.local_vars_configuration.client_side_validation and special_fee_list is None: # noqa: E501 + raise ValueError("Invalid value for `special_fee_list`, must not be `None`") # noqa: E501 + + self._special_fee_list = special_fee_list def to_dict(self): """Returns the model properties as a dict""" diff --git a/gate_api/models/inline_response2001.py b/gate_api/models/inline_response2001.py index bbecffb8..31631fa8 100644 --- a/gate_api/models/inline_response2001.py +++ b/gate_api/models/inline_response2001.py @@ -33,74 +33,358 @@ class InlineResponse2001(object): and the value is json key in definition. """ openapi_types = { - 'currency': 'str', - 'est_rate': 'str' + 'symbol': 'str', + 'last_price': 'str', + 'open_24h': 'str', + 'low_24h': 'str', + 'high_24h': 'str', + 'volume_24h_base': 'str', + 'volume_24h_quote': 'str', + 'mark_price': 'str', + 'index_price': 'str', + 'open_interest': 'str', + 'open_interest_quote': 'str', + 'timestamp': 'str' } attribute_map = { - 'currency': 'currency', - 'est_rate': 'est_rate' + 'symbol': 'symbol', + 'last_price': 'last_price', + 'open_24h': 'open_24h', + 'low_24h': 'low_24h', + 'high_24h': 'high_24h', + 'volume_24h_base': 'volume_24h_base', + 'volume_24h_quote': 'volume_24h_quote', + 'mark_price': 'mark_price', + 'index_price': 'index_price', + 'open_interest': 'open_interest', + 'open_interest_quote': 'open_interest_quote', + 'timestamp': 'timestamp' } - def __init__(self, currency=None, est_rate=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, Configuration) -> None + def __init__(self, symbol=None, last_price=None, open_24h=None, low_24h=None, high_24h=None, volume_24h_base=None, volume_24h_quote=None, mark_price=None, index_price=None, open_interest=None, open_interest_quote=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None """InlineResponse2001 - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration - self._currency = None - self._est_rate = None + self._symbol = None + self._last_price = None + self._open_24h = None + self._low_24h = None + self._high_24h = None + self._volume_24h_base = None + self._volume_24h_quote = None + self._mark_price = None + self._index_price = None + self._open_interest = None + self._open_interest_quote = None + self._timestamp = None self.discriminator = None - if currency is not None: - self.currency = currency - if est_rate is not None: - self.est_rate = est_rate + self.symbol = symbol + if last_price is not None: + self.last_price = last_price + if open_24h is not None: + self.open_24h = open_24h + if low_24h is not None: + self.low_24h = low_24h + if high_24h is not None: + self.high_24h = high_24h + if volume_24h_base is not None: + self.volume_24h_base = volume_24h_base + if volume_24h_quote is not None: + self.volume_24h_quote = volume_24h_quote + if mark_price is not None: + self.mark_price = mark_price + if index_price is not None: + self.index_price = index_price + if open_interest is not None: + self.open_interest = open_interest + if open_interest_quote is not None: + self.open_interest_quote = open_interest_quote + self.timestamp = timestamp @property - def currency(self): - """Gets the currency of this InlineResponse2001. # noqa: E501 + def symbol(self): + """Gets the symbol of this InlineResponse2001. # noqa: E501 + Trading Pair # noqa: E501 - :return: The currency of this InlineResponse2001. # noqa: E501 + :return: The symbol of this InlineResponse2001. # noqa: E501 :rtype: str """ - return self._currency + return self._symbol - @currency.setter - def currency(self, currency): - """Sets the currency of this InlineResponse2001. + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this InlineResponse2001. + Trading Pair # noqa: E501 - :param currency: The currency of this InlineResponse2001. # noqa: E501 + :param symbol: The symbol of this InlineResponse2001. # noqa: E501 :type: str """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 - self._currency = currency + self._symbol = symbol @property - def est_rate(self): - """Gets the est_rate of this InlineResponse2001. # noqa: E501 + def last_price(self): + """Gets the last_price of this InlineResponse2001. # noqa: E501 - Estimated Annualized Rate, e.g., `est_rate`: `0.8014` represents an annualized rate of 80.14% # noqa: E501 + Last price # noqa: E501 - :return: The est_rate of this InlineResponse2001. # noqa: E501 + :return: The last_price of this InlineResponse2001. # noqa: E501 :rtype: str """ - return self._est_rate + return self._last_price - @est_rate.setter - def est_rate(self, est_rate): - """Sets the est_rate of this InlineResponse2001. + @last_price.setter + def last_price(self, last_price): + """Sets the last_price of this InlineResponse2001. - Estimated Annualized Rate, e.g., `est_rate`: `0.8014` represents an annualized rate of 80.14% # noqa: E501 + Last price # noqa: E501 - :param est_rate: The est_rate of this InlineResponse2001. # noqa: E501 + :param last_price: The last_price of this InlineResponse2001. # noqa: E501 :type: str """ - self._est_rate = est_rate + self._last_price = last_price + + @property + def open_24h(self): + """Gets the open_24h of this InlineResponse2001. # noqa: E501 + + 24-hour opening price # noqa: E501 + + :return: The open_24h of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._open_24h + + @open_24h.setter + def open_24h(self, open_24h): + """Sets the open_24h of this InlineResponse2001. + + 24-hour opening price # noqa: E501 + + :param open_24h: The open_24h of this InlineResponse2001. # noqa: E501 + :type: str + """ + + self._open_24h = open_24h + + @property + def low_24h(self): + """Gets the low_24h of this InlineResponse2001. # noqa: E501 + + 24h Low # noqa: E501 + + :return: The low_24h of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._low_24h + + @low_24h.setter + def low_24h(self, low_24h): + """Sets the low_24h of this InlineResponse2001. + + 24h Low # noqa: E501 + + :param low_24h: The low_24h of this InlineResponse2001. # noqa: E501 + :type: str + """ + + self._low_24h = low_24h + + @property + def high_24h(self): + """Gets the high_24h of this InlineResponse2001. # noqa: E501 + + 24h High # noqa: E501 + + :return: The high_24h of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._high_24h + + @high_24h.setter + def high_24h(self, high_24h): + """Sets the high_24h of this InlineResponse2001. + + 24h High # noqa: E501 + + :param high_24h: The high_24h of this InlineResponse2001. # noqa: E501 + :type: str + """ + + self._high_24h = high_24h + + @property + def volume_24h_base(self): + """Gets the volume_24h_base of this InlineResponse2001. # noqa: E501 + + 24-hour trading volume in base currency # noqa: E501 + + :return: The volume_24h_base of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._volume_24h_base + + @volume_24h_base.setter + def volume_24h_base(self, volume_24h_base): + """Sets the volume_24h_base of this InlineResponse2001. + + 24-hour trading volume in base currency # noqa: E501 + + :param volume_24h_base: The volume_24h_base of this InlineResponse2001. # noqa: E501 + :type: str + """ + + self._volume_24h_base = volume_24h_base + + @property + def volume_24h_quote(self): + """Gets the volume_24h_quote of this InlineResponse2001. # noqa: E501 + + 24-hour trading volume in quote currency # noqa: E501 + + :return: The volume_24h_quote of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._volume_24h_quote + + @volume_24h_quote.setter + def volume_24h_quote(self, volume_24h_quote): + """Sets the volume_24h_quote of this InlineResponse2001. + + 24-hour trading volume in quote currency # noqa: E501 + + :param volume_24h_quote: The volume_24h_quote of this InlineResponse2001. # noqa: E501 + :type: str + """ + + self._volume_24h_quote = volume_24h_quote + + @property + def mark_price(self): + """Gets the mark_price of this InlineResponse2001. # noqa: E501 + + Mark price # noqa: E501 + + :return: The mark_price of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._mark_price + + @mark_price.setter + def mark_price(self, mark_price): + """Sets the mark_price of this InlineResponse2001. + + Mark price # noqa: E501 + + :param mark_price: The mark_price of this InlineResponse2001. # noqa: E501 + :type: str + """ + + self._mark_price = mark_price + + @property + def index_price(self): + """Gets the index_price of this InlineResponse2001. # noqa: E501 + + Index price # noqa: E501 + + :return: The index_price of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._index_price + + @index_price.setter + def index_price(self, index_price): + """Sets the index_price of this InlineResponse2001. + + Index price # noqa: E501 + + :param index_price: The index_price of this InlineResponse2001. # noqa: E501 + :type: str + """ + + self._index_price = index_price + + @property + def open_interest(self): + """Gets the open_interest of this InlineResponse2001. # noqa: E501 + + Open interest # noqa: E501 + + :return: The open_interest of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._open_interest + + @open_interest.setter + def open_interest(self, open_interest): + """Sets the open_interest of this InlineResponse2001. + + Open interest # noqa: E501 + + :param open_interest: The open_interest of this InlineResponse2001. # noqa: E501 + :type: str + """ + + self._open_interest = open_interest + + @property + def open_interest_quote(self): + """Gets the open_interest_quote of this InlineResponse2001. # noqa: E501 + + Open interest (in quote currency) # noqa: E501 + + :return: The open_interest_quote of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._open_interest_quote + + @open_interest_quote.setter + def open_interest_quote(self, open_interest_quote): + """Sets the open_interest_quote of this InlineResponse2001. + + Open interest (in quote currency) # noqa: E501 + + :param open_interest_quote: The open_interest_quote of this InlineResponse2001. # noqa: E501 + :type: str + """ + + self._open_interest_quote = open_interest_quote + + @property + def timestamp(self): + """Gets the timestamp of this InlineResponse2001. # noqa: E501 + + Update timestamp # noqa: E501 + + :return: The timestamp of this InlineResponse2001. # noqa: E501 + :rtype: str + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this InlineResponse2001. + + Update timestamp # noqa: E501 + + :param timestamp: The timestamp of this InlineResponse2001. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp def to_dict(self): """Returns the model properties as a dict""" diff --git a/gate_api/models/inline_response2002.py b/gate_api/models/inline_response2002.py new file mode 100644 index 00000000..a7d16d52 --- /dev/null +++ b/gate_api/models/inline_response2002.py @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class InlineResponse2002(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'funding_rate': 'str', + 'funding_interval': 'str', + 'funding_time': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'funding_rate': 'funding_rate', + 'funding_interval': 'funding_interval', + 'funding_time': 'funding_time' + } + + def __init__(self, symbol=None, funding_rate=None, funding_interval=None, funding_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """InlineResponse2002 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._funding_rate = None + self._funding_interval = None + self._funding_time = None + self.discriminator = None + + self.symbol = symbol + self.funding_rate = funding_rate + self.funding_interval = funding_interval + self.funding_time = funding_time + + @property + def symbol(self): + """Gets the symbol of this InlineResponse2002. # noqa: E501 + + Currency # noqa: E501 + + :return: The symbol of this InlineResponse2002. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this InlineResponse2002. + + Currency # noqa: E501 + + :param symbol: The symbol of this InlineResponse2002. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def funding_rate(self): + """Gets the funding_rate of this InlineResponse2002. # noqa: E501 + + Funding rate # noqa: E501 + + :return: The funding_rate of this InlineResponse2002. # noqa: E501 + :rtype: str + """ + return self._funding_rate + + @funding_rate.setter + def funding_rate(self, funding_rate): + """Sets the funding_rate of this InlineResponse2002. + + Funding rate # noqa: E501 + + :param funding_rate: The funding_rate of this InlineResponse2002. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and funding_rate is None: # noqa: E501 + raise ValueError("Invalid value for `funding_rate`, must not be `None`") # noqa: E501 + + self._funding_rate = funding_rate + + @property + def funding_interval(self): + """Gets the funding_interval of this InlineResponse2002. # noqa: E501 + + Tier # noqa: E501 + + :return: The funding_interval of this InlineResponse2002. # noqa: E501 + :rtype: str + """ + return self._funding_interval + + @funding_interval.setter + def funding_interval(self, funding_interval): + """Sets the funding_interval of this InlineResponse2002. + + Tier # noqa: E501 + + :param funding_interval: The funding_interval of this InlineResponse2002. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and funding_interval is None: # noqa: E501 + raise ValueError("Invalid value for `funding_interval`, must not be `None`") # noqa: E501 + + self._funding_interval = funding_interval + + @property + def funding_time(self): + """Gets the funding_time of this InlineResponse2002. # noqa: E501 + + Next funding time # noqa: E501 + + :return: The funding_time of this InlineResponse2002. # noqa: E501 + :rtype: str + """ + return self._funding_time + + @funding_time.setter + def funding_time(self, funding_time): + """Sets the funding_time of this InlineResponse2002. + + Next funding time # noqa: E501 + + :param funding_time: The funding_time of this InlineResponse2002. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and funding_time is None: # noqa: E501 + raise ValueError("Invalid value for `funding_time`, must not be `None`") # noqa: E501 + + self._funding_time = funding_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse2002): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, InlineResponse2002): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/klines.py b/gate_api/models/klines.py new file mode 100644 index 00000000..df18d22b --- /dev/null +++ b/gate_api/models/klines.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Klines(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'KlinesData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, KlinesData, Configuration) -> None + """Klines - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this Klines. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this Klines. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this Klines. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this Klines. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this Klines. # noqa: E501 + + + :return: The data of this Klines. # noqa: E501 + :rtype: KlinesData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this Klines. + + + :param data: The data of this Klines. # noqa: E501 + :type: KlinesData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Klines): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Klines): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/klines_data.py b/gate_api/models/klines_data.py new file mode 100644 index 00000000..272dd608 --- /dev/null +++ b/gate_api/models/klines_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class KlinesData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[KlinesDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[KlinesDataList], Configuration) -> None + """KlinesData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this KlinesData. # noqa: E501 + + Kline data list # noqa: E501 + + :return: The list of this KlinesData. # noqa: E501 + :rtype: list[KlinesDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this KlinesData. + + Kline data list # noqa: E501 + + :param list: The list of this KlinesData. # noqa: E501 + :type: list[KlinesDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, KlinesData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, KlinesData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/klines_data_list.py b/gate_api/models/klines_data_list.py new file mode 100644 index 00000000..75b5c3f5 --- /dev/null +++ b/gate_api/models/klines_data_list.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class KlinesDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'o': 'str', + 'c': 'str', + 'h': 'str', + 'l': 'str', + 't': 'int' + } + + attribute_map = { + 'o': 'o', + 'c': 'c', + 'h': 'h', + 'l': 'l', + 't': 't' + } + + def __init__(self, o=None, c=None, h=None, l=None, t=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, Configuration) -> None + """KlinesDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._o = None + self._c = None + self._h = None + self._l = None + self._t = None + self.discriminator = None + + if o is not None: + self.o = o + if c is not None: + self.c = c + if h is not None: + self.h = h + if l is not None: + self.l = l + if t is not None: + self.t = t + + @property + def o(self): + """Gets the o of this KlinesDataList. # noqa: E501 + + Open price # noqa: E501 + + :return: The o of this KlinesDataList. # noqa: E501 + :rtype: str + """ + return self._o + + @o.setter + def o(self, o): + """Sets the o of this KlinesDataList. + + Open price # noqa: E501 + + :param o: The o of this KlinesDataList. # noqa: E501 + :type: str + """ + + self._o = o + + @property + def c(self): + """Gets the c of this KlinesDataList. # noqa: E501 + + Close price # noqa: E501 + + :return: The c of this KlinesDataList. # noqa: E501 + :rtype: str + """ + return self._c + + @c.setter + def c(self, c): + """Sets the c of this KlinesDataList. + + Close price # noqa: E501 + + :param c: The c of this KlinesDataList. # noqa: E501 + :type: str + """ + + self._c = c + + @property + def h(self): + """Gets the h of this KlinesDataList. # noqa: E501 + + High price # noqa: E501 + + :return: The h of this KlinesDataList. # noqa: E501 + :rtype: str + """ + return self._h + + @h.setter + def h(self, h): + """Sets the h of this KlinesDataList. + + High price # noqa: E501 + + :param h: The h of this KlinesDataList. # noqa: E501 + :type: str + """ + + self._h = h + + @property + def l(self): + """Gets the l of this KlinesDataList. # noqa: E501 + + Low price # noqa: E501 + + :return: The l of this KlinesDataList. # noqa: E501 + :rtype: str + """ + return self._l + + @l.setter + def l(self, l): + """Sets the l of this KlinesDataList. + + Low price # noqa: E501 + + :param l: The l of this KlinesDataList. # noqa: E501 + :type: str + """ + + self._l = l + + @property + def t(self): + """Gets the t of this KlinesDataList. # noqa: E501 + + Timestamp (Unix seconds) # noqa: E501 + + :return: The t of this KlinesDataList. # noqa: E501 + :rtype: int + """ + return self._t + + @t.setter + def t(self, t): + """Sets the t of this KlinesDataList. + + Timestamp (Unix seconds) # noqa: E501 + + :param t: The t of this KlinesDataList. # noqa: E501 + :type: int + """ + + self._t = t + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, KlinesDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, KlinesDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/ladder_apr.py b/gate_api/models/ladder_apr.py new file mode 100644 index 00000000..d406b3f5 --- /dev/null +++ b/gate_api/models/ladder_apr.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class LadderApr(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'apr': 'str', + 'left': 'str', + 'right': 'str' + } + + attribute_map = { + 'apr': 'apr', + 'left': 'left', + 'right': 'right' + } + + def __init__(self, apr=None, left=None, right=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """LadderApr - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._apr = None + self._left = None + self._right = None + self.discriminator = None + + self.apr = apr + self.left = left + self.right = right + + @property + def apr(self): + """Gets the apr of this LadderApr. # noqa: E501 + + Annualized interest rate # noqa: E501 + + :return: The apr of this LadderApr. # noqa: E501 + :rtype: str + """ + return self._apr + + @apr.setter + def apr(self, apr): + """Sets the apr of this LadderApr. + + Annualized interest rate # noqa: E501 + + :param apr: The apr of this LadderApr. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and apr is None: # noqa: E501 + raise ValueError("Invalid value for `apr`, must not be `None`") # noqa: E501 + + self._apr = apr + + @property + def left(self): + """Gets the left of this LadderApr. # noqa: E501 + + Range lower limit # noqa: E501 + + :return: The left of this LadderApr. # noqa: E501 + :rtype: str + """ + return self._left + + @left.setter + def left(self, left): + """Sets the left of this LadderApr. + + Range lower limit # noqa: E501 + + :param left: The left of this LadderApr. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and left is None: # noqa: E501 + raise ValueError("Invalid value for `left`, must not be `None`") # noqa: E501 + + self._left = left + + @property + def right(self): + """Gets the right of this LadderApr. # noqa: E501 + + Range upper limit # noqa: E501 + + :return: The right of this LadderApr. # noqa: E501 + :rtype: str + """ + return self._right + + @right.setter + def right(self, right): + """Sets the right of this LadderApr. + + Range upper limit # noqa: E501 + + :param right: The right of this LadderApr. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and right is None: # noqa: E501 + raise ValueError("Invalid value for `right`, must not be `None`") # noqa: E501 + + self._right = right + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LadderApr): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, LadderApr): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_borrowable1.py b/gate_api/models/leverage_failed_currencies.py similarity index 69% rename from gate_api/models/unified_borrowable1.py rename to gate_api/models/leverage_failed_currencies.py index 626d1afa..d18e6266 100644 --- a/gate_api/models/unified_borrowable1.py +++ b/gate_api/models/leverage_failed_currencies.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class UnifiedBorrowable1(object): +class LeverageFailedCurrencies(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -34,75 +34,75 @@ class UnifiedBorrowable1(object): """ openapi_types = { 'currency': 'str', - 'amount': 'str' + 'reason': 'str' } attribute_map = { 'currency': 'currency', - 'amount': 'amount' + 'reason': 'reason' } - def __init__(self, currency=None, amount=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, currency=None, reason=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, Configuration) -> None - """UnifiedBorrowable1 - a model defined in OpenAPI""" # noqa: E501 + """LeverageFailedCurrencies - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._currency = None - self._amount = None + self._reason = None self.discriminator = None if currency is not None: self.currency = currency - if amount is not None: - self.amount = amount + if reason is not None: + self.reason = reason @property def currency(self): - """Gets the currency of this UnifiedBorrowable1. # noqa: E501 + """Gets the currency of this LeverageFailedCurrencies. # noqa: E501 - Currency detail # noqa: E501 + Currency for which the update failed # noqa: E501 - :return: The currency of this UnifiedBorrowable1. # noqa: E501 + :return: The currency of this LeverageFailedCurrencies. # noqa: E501 :rtype: str """ return self._currency @currency.setter def currency(self, currency): - """Sets the currency of this UnifiedBorrowable1. + """Sets the currency of this LeverageFailedCurrencies. - Currency detail # noqa: E501 + Currency for which the update failed # noqa: E501 - :param currency: The currency of this UnifiedBorrowable1. # noqa: E501 + :param currency: The currency of this LeverageFailedCurrencies. # noqa: E501 :type: str """ self._currency = currency @property - def amount(self): - """Gets the amount of this UnifiedBorrowable1. # noqa: E501 + def reason(self): + """Gets the reason of this LeverageFailedCurrencies. # noqa: E501 - Maximum borrowable amount # noqa: E501 + Reason the leverage update failed # noqa: E501 - :return: The amount of this UnifiedBorrowable1. # noqa: E501 + :return: The reason of this LeverageFailedCurrencies. # noqa: E501 :rtype: str """ - return self._amount + return self._reason - @amount.setter - def amount(self, amount): - """Sets the amount of this UnifiedBorrowable1. + @reason.setter + def reason(self, reason): + """Sets the reason of this LeverageFailedCurrencies. - Maximum borrowable amount # noqa: E501 + Reason the leverage update failed # noqa: E501 - :param amount: The amount of this UnifiedBorrowable1. # noqa: E501 + :param reason: The reason of this LeverageFailedCurrencies. # noqa: E501 :type: str """ - self._amount = amount + self._reason = reason def to_dict(self): """Returns the model properties as a dict""" @@ -138,14 +138,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, UnifiedBorrowable1): + if not isinstance(other, LeverageFailedCurrencies): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, UnifiedBorrowable1): + if not isinstance(other, LeverageFailedCurrencies): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_activities_response.py b/gate_api/models/list_activities_response.py new file mode 100644 index 00000000..7be58af1 --- /dev/null +++ b/gate_api/models/list_activities_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListActivitiesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'ListActivitiesResponseData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, ListActivitiesResponseData, int, Configuration) -> None + """ListActivitiesResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ListActivitiesResponse. # noqa: E501 + + Response status code, 0 means success # noqa: E501 + + :return: The code of this ListActivitiesResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ListActivitiesResponse. + + Response status code, 0 means success # noqa: E501 + + :param code: The code of this ListActivitiesResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this ListActivitiesResponse. # noqa: E501 + + 响应消息,成功时为 \"success\" # noqa: E501 + + :return: The message of this ListActivitiesResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ListActivitiesResponse. + + 响应消息,成功时为 \"success\" # noqa: E501 + + :param message: The message of this ListActivitiesResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ListActivitiesResponse. # noqa: E501 + + + :return: The data of this ListActivitiesResponse. # noqa: E501 + :rtype: ListActivitiesResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ListActivitiesResponse. + + + :param data: The data of this ListActivitiesResponse. # noqa: E501 + :type: ListActivitiesResponseData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ListActivitiesResponse. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ListActivitiesResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ListActivitiesResponse. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ListActivitiesResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListActivitiesResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListActivitiesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_activities_response_data.py b/gate_api/models/list_activities_response_data.py new file mode 100644 index 00000000..2ee64414 --- /dev/null +++ b/gate_api/models/list_activities_response_data.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListActivitiesResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[ListActivitiesResponseDataList]', + 'page': 'int', + 'page_size': 'int', + 'page_count': 'int', + 'total_count': 'int', + 'url': 'str' + } + + attribute_map = { + 'list': 'list', + 'page': 'page', + 'page_size': 'pageSize', + 'page_count': 'pageCount', + 'total_count': 'totalCount', + 'url': 'url' + } + + def __init__(self, list=None, page=None, page_size=None, page_count=None, total_count=None, url=None, local_vars_configuration=None): # noqa: E501 + # type: (list[ListActivitiesResponseDataList], int, int, int, int, str, Configuration) -> None + """ListActivitiesResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self._page = None + self._page_size = None + self._page_count = None + self._total_count = None + self._url = None + self.discriminator = None + + self.list = list + self.page = page + self.page_size = page_size + self.page_count = page_count + self.total_count = total_count + self.url = url + + @property + def list(self): + """Gets the list of this ListActivitiesResponseData. # noqa: E501 + + Activity list # noqa: E501 + + :return: The list of this ListActivitiesResponseData. # noqa: E501 + :rtype: list[ListActivitiesResponseDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this ListActivitiesResponseData. + + Activity list # noqa: E501 + + :param list: The list of this ListActivitiesResponseData. # noqa: E501 + :type: list[ListActivitiesResponseDataList] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + @property + def page(self): + """Gets the page of this ListActivitiesResponseData. # noqa: E501 + + Current page number # noqa: E501 + + :return: The page of this ListActivitiesResponseData. # noqa: E501 + :rtype: int + """ + return self._page + + @page.setter + def page(self, page): + """Sets the page of this ListActivitiesResponseData. + + Current page number # noqa: E501 + + :param page: The page of this ListActivitiesResponseData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page is None: # noqa: E501 + raise ValueError("Invalid value for `page`, must not be `None`") # noqa: E501 + + self._page = page + + @property + def page_size(self): + """Gets the page_size of this ListActivitiesResponseData. # noqa: E501 + + Items per page # noqa: E501 + + :return: The page_size of this ListActivitiesResponseData. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListActivitiesResponseData. + + Items per page # noqa: E501 + + :param page_size: The page_size of this ListActivitiesResponseData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page_size is None: # noqa: E501 + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def page_count(self): + """Gets the page_count of this ListActivitiesResponseData. # noqa: E501 + + Total pages # noqa: E501 + + :return: The page_count of this ListActivitiesResponseData. # noqa: E501 + :rtype: int + """ + return self._page_count + + @page_count.setter + def page_count(self, page_count): + """Sets the page_count of this ListActivitiesResponseData. + + Total pages # noqa: E501 + + :param page_count: The page_count of this ListActivitiesResponseData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page_count is None: # noqa: E501 + raise ValueError("Invalid value for `page_count`, must not be `None`") # noqa: E501 + + self._page_count = page_count + + @property + def total_count(self): + """Gets the total_count of this ListActivitiesResponseData. # noqa: E501 + + Total Records # noqa: E501 + + :return: The total_count of this ListActivitiesResponseData. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ListActivitiesResponseData. + + Total Records # noqa: E501 + + :param total_count: The total_count of this ListActivitiesResponseData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total_count is None: # noqa: E501 + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + @property + def url(self): + """Gets the url of this ListActivitiesResponseData. # noqa: E501 + + Activity Center page link # noqa: E501 + + :return: The url of this ListActivitiesResponseData. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ListActivitiesResponseData. + + Activity Center page link # noqa: E501 + + :param url: The url of this ListActivitiesResponseData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and url is None: # noqa: E501 + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListActivitiesResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListActivitiesResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_activities_response_data_list.py b/gate_api/models/list_activities_response_data_list.py new file mode 100644 index 00000000..7a2d2fe2 --- /dev/null +++ b/gate_api/models/list_activities_response_data_list.py @@ -0,0 +1,675 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListActivitiesResponseDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'type_id': 'int', + 'type_name': 'str', + 'competition_name': 'str', + 'start_at': 'int', + 'end_at': 'int', + 'img': 'str', + 'img_dark': 'str', + 'url': 'str', + 'hot': 'int', + 'master_one_line': 'str', + 'master_two_line': 'str', + 'slave_one_line': 'str', + 'slave_two_line': 'str', + 'competition_title': 'str', + 'top_id': 'int', + 'parent_id': 'int', + 'new_img': 'str', + 'new_img_dark': 'str', + 'tag': 'list[str]' + } + + attribute_map = { + 'id': 'id', + 'type_id': 'type_id', + 'type_name': 'type_name', + 'competition_name': 'competition_name', + 'start_at': 'start_at', + 'end_at': 'end_at', + 'img': 'img', + 'img_dark': 'img_dark', + 'url': 'url', + 'hot': 'hot', + 'master_one_line': 'master_one_line', + 'master_two_line': 'master_two_line', + 'slave_one_line': 'slave_one_line', + 'slave_two_line': 'slave_two_line', + 'competition_title': 'competition_title', + 'top_id': 'top_id', + 'parent_id': 'parent_id', + 'new_img': 'new_img', + 'new_img_dark': 'new_img_dark', + 'tag': 'tag' + } + + def __init__(self, id=None, type_id=None, type_name=None, competition_name=None, start_at=None, end_at=None, img=None, img_dark=None, url=None, hot=None, master_one_line=None, master_two_line=None, slave_one_line=None, slave_two_line=None, competition_title=None, top_id=None, parent_id=None, new_img=None, new_img_dark=None, tag=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, int, int, str, str, str, int, str, str, str, str, str, int, int, str, str, list[str], Configuration) -> None + """ListActivitiesResponseDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._type_id = None + self._type_name = None + self._competition_name = None + self._start_at = None + self._end_at = None + self._img = None + self._img_dark = None + self._url = None + self._hot = None + self._master_one_line = None + self._master_two_line = None + self._slave_one_line = None + self._slave_two_line = None + self._competition_title = None + self._top_id = None + self._parent_id = None + self._new_img = None + self._new_img_dark = None + self._tag = None + self.discriminator = None + + self.id = id + self.type_id = type_id + self.type_name = type_name + self.competition_name = competition_name + self.start_at = start_at + self.end_at = end_at + self.img = img + self.img_dark = img_dark + self.url = url + self.hot = hot + self.master_one_line = master_one_line + self.master_two_line = master_two_line + self.slave_one_line = slave_one_line + self.slave_two_line = slave_two_line + self.competition_title = competition_title + self.top_id = top_id + self.parent_id = parent_id + self.new_img = new_img + self.new_img_dark = new_img_dark + self.tag = tag + + @property + def id(self): + """Gets the id of this ListActivitiesResponseDataList. # noqa: E501 + + Activity ID # noqa: E501 + + :return: The id of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ListActivitiesResponseDataList. + + Activity ID # noqa: E501 + + :param id: The id of this ListActivitiesResponseDataList. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def type_id(self): + """Gets the type_id of this ListActivitiesResponseDataList. # noqa: E501 + + Activity type ID # noqa: E501 + + :return: The type_id of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: int + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id): + """Sets the type_id of this ListActivitiesResponseDataList. + + Activity type ID # noqa: E501 + + :param type_id: The type_id of this ListActivitiesResponseDataList. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and type_id is None: # noqa: E501 + raise ValueError("Invalid value for `type_id`, must not be `None`") # noqa: E501 + + self._type_id = type_id + + @property + def type_name(self): + """Gets the type_name of this ListActivitiesResponseDataList. # noqa: E501 + + Activity type name # noqa: E501 + + :return: The type_name of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name): + """Sets the type_name of this ListActivitiesResponseDataList. + + Activity type name # noqa: E501 + + :param type_name: The type_name of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type_name is None: # noqa: E501 + raise ValueError("Invalid value for `type_name`, must not be `None`") # noqa: E501 + + self._type_name = type_name + + @property + def competition_name(self): + """Gets the competition_name of this ListActivitiesResponseDataList. # noqa: E501 + + Activity name # noqa: E501 + + :return: The competition_name of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._competition_name + + @competition_name.setter + def competition_name(self, competition_name): + """Sets the competition_name of this ListActivitiesResponseDataList. + + Activity name # noqa: E501 + + :param competition_name: The competition_name of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and competition_name is None: # noqa: E501 + raise ValueError("Invalid value for `competition_name`, must not be `None`") # noqa: E501 + + self._competition_name = competition_name + + @property + def start_at(self): + """Gets the start_at of this ListActivitiesResponseDataList. # noqa: E501 + + Activity start time (Unix timestamp, in seconds) # noqa: E501 + + :return: The start_at of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: int + """ + return self._start_at + + @start_at.setter + def start_at(self, start_at): + """Sets the start_at of this ListActivitiesResponseDataList. + + Activity start time (Unix timestamp, in seconds) # noqa: E501 + + :param start_at: The start_at of this ListActivitiesResponseDataList. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and start_at is None: # noqa: E501 + raise ValueError("Invalid value for `start_at`, must not be `None`") # noqa: E501 + + self._start_at = start_at + + @property + def end_at(self): + """Gets the end_at of this ListActivitiesResponseDataList. # noqa: E501 + + Activity end time (Unix timestamp, in seconds) # noqa: E501 + + :return: The end_at of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: int + """ + return self._end_at + + @end_at.setter + def end_at(self, end_at): + """Sets the end_at of this ListActivitiesResponseDataList. + + Activity end time (Unix timestamp, in seconds) # noqa: E501 + + :param end_at: The end_at of this ListActivitiesResponseDataList. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and end_at is None: # noqa: E501 + raise ValueError("Invalid value for `end_at`, must not be `None`") # noqa: E501 + + self._end_at = end_at + + @property + def img(self): + """Gets the img of this ListActivitiesResponseDataList. # noqa: E501 + + Activity image URL (light mode) # noqa: E501 + + :return: The img of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._img + + @img.setter + def img(self, img): + """Sets the img of this ListActivitiesResponseDataList. + + Activity image URL (light mode) # noqa: E501 + + :param img: The img of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and img is None: # noqa: E501 + raise ValueError("Invalid value for `img`, must not be `None`") # noqa: E501 + + self._img = img + + @property + def img_dark(self): + """Gets the img_dark of this ListActivitiesResponseDataList. # noqa: E501 + + Activity image URL (dark mode) # noqa: E501 + + :return: The img_dark of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._img_dark + + @img_dark.setter + def img_dark(self, img_dark): + """Sets the img_dark of this ListActivitiesResponseDataList. + + Activity image URL (dark mode) # noqa: E501 + + :param img_dark: The img_dark of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and img_dark is None: # noqa: E501 + raise ValueError("Invalid value for `img_dark`, must not be `None`") # noqa: E501 + + self._img_dark = img_dark + + @property + def url(self): + """Gets the url of this ListActivitiesResponseDataList. # noqa: E501 + + Activity redirect link # noqa: E501 + + :return: The url of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ListActivitiesResponseDataList. + + Activity redirect link # noqa: E501 + + :param url: The url of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and url is None: # noqa: E501 + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + + @property + def hot(self): + """Gets the hot of this ListActivitiesResponseDataList. # noqa: E501 + + Popularity score # noqa: E501 + + :return: The hot of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: int + """ + return self._hot + + @hot.setter + def hot(self, hot): + """Sets the hot of this ListActivitiesResponseDataList. + + Popularity score # noqa: E501 + + :param hot: The hot of this ListActivitiesResponseDataList. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and hot is None: # noqa: E501 + raise ValueError("Invalid value for `hot`, must not be `None`") # noqa: E501 + + self._hot = hot + + @property + def master_one_line(self): + """Gets the master_one_line of this ListActivitiesResponseDataList. # noqa: E501 + + Main title first line # noqa: E501 + + :return: The master_one_line of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._master_one_line + + @master_one_line.setter + def master_one_line(self, master_one_line): + """Sets the master_one_line of this ListActivitiesResponseDataList. + + Main title first line # noqa: E501 + + :param master_one_line: The master_one_line of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and master_one_line is None: # noqa: E501 + raise ValueError("Invalid value for `master_one_line`, must not be `None`") # noqa: E501 + + self._master_one_line = master_one_line + + @property + def master_two_line(self): + """Gets the master_two_line of this ListActivitiesResponseDataList. # noqa: E501 + + Main title second line # noqa: E501 + + :return: The master_two_line of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._master_two_line + + @master_two_line.setter + def master_two_line(self, master_two_line): + """Sets the master_two_line of this ListActivitiesResponseDataList. + + Main title second line # noqa: E501 + + :param master_two_line: The master_two_line of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and master_two_line is None: # noqa: E501 + raise ValueError("Invalid value for `master_two_line`, must not be `None`") # noqa: E501 + + self._master_two_line = master_two_line + + @property + def slave_one_line(self): + """Gets the slave_one_line of this ListActivitiesResponseDataList. # noqa: E501 + + Subtitle first line # noqa: E501 + + :return: The slave_one_line of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._slave_one_line + + @slave_one_line.setter + def slave_one_line(self, slave_one_line): + """Sets the slave_one_line of this ListActivitiesResponseDataList. + + Subtitle first line # noqa: E501 + + :param slave_one_line: The slave_one_line of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and slave_one_line is None: # noqa: E501 + raise ValueError("Invalid value for `slave_one_line`, must not be `None`") # noqa: E501 + + self._slave_one_line = slave_one_line + + @property + def slave_two_line(self): + """Gets the slave_two_line of this ListActivitiesResponseDataList. # noqa: E501 + + Subtitle second line # noqa: E501 + + :return: The slave_two_line of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._slave_two_line + + @slave_two_line.setter + def slave_two_line(self, slave_two_line): + """Sets the slave_two_line of this ListActivitiesResponseDataList. + + Subtitle second line # noqa: E501 + + :param slave_two_line: The slave_two_line of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and slave_two_line is None: # noqa: E501 + raise ValueError("Invalid value for `slave_two_line`, must not be `None`") # noqa: E501 + + self._slave_two_line = slave_two_line + + @property + def competition_title(self): + """Gets the competition_title of this ListActivitiesResponseDataList. # noqa: E501 + + Activity title # noqa: E501 + + :return: The competition_title of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._competition_title + + @competition_title.setter + def competition_title(self, competition_title): + """Sets the competition_title of this ListActivitiesResponseDataList. + + Activity title # noqa: E501 + + :param competition_title: The competition_title of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and competition_title is None: # noqa: E501 + raise ValueError("Invalid value for `competition_title`, must not be `None`") # noqa: E501 + + self._competition_title = competition_title + + @property + def top_id(self): + """Gets the top_id of this ListActivitiesResponseDataList. # noqa: E501 + + Pin ID, 0 means not pinned # noqa: E501 + + :return: The top_id of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: int + """ + return self._top_id + + @top_id.setter + def top_id(self, top_id): + """Sets the top_id of this ListActivitiesResponseDataList. + + Pin ID, 0 means not pinned # noqa: E501 + + :param top_id: The top_id of this ListActivitiesResponseDataList. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and top_id is None: # noqa: E501 + raise ValueError("Invalid value for `top_id`, must not be `None`") # noqa: E501 + + self._top_id = top_id + + @property + def parent_id(self): + """Gets the parent_id of this ListActivitiesResponseDataList. # noqa: E501 + + Parent activity ID, 0 means no parent activity # noqa: E501 + + :return: The parent_id of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: int + """ + return self._parent_id + + @parent_id.setter + def parent_id(self, parent_id): + """Sets the parent_id of this ListActivitiesResponseDataList. + + Parent activity ID, 0 means no parent activity # noqa: E501 + + :param parent_id: The parent_id of this ListActivitiesResponseDataList. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and parent_id is None: # noqa: E501 + raise ValueError("Invalid value for `parent_id`, must not be `None`") # noqa: E501 + + self._parent_id = parent_id + + @property + def new_img(self): + """Gets the new_img of this ListActivitiesResponseDataList. # noqa: E501 + + New activity image URL (light mode) # noqa: E501 + + :return: The new_img of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._new_img + + @new_img.setter + def new_img(self, new_img): + """Sets the new_img of this ListActivitiesResponseDataList. + + New activity image URL (light mode) # noqa: E501 + + :param new_img: The new_img of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and new_img is None: # noqa: E501 + raise ValueError("Invalid value for `new_img`, must not be `None`") # noqa: E501 + + self._new_img = new_img + + @property + def new_img_dark(self): + """Gets the new_img_dark of this ListActivitiesResponseDataList. # noqa: E501 + + New activity image URL (dark mode) # noqa: E501 + + :return: The new_img_dark of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._new_img_dark + + @new_img_dark.setter + def new_img_dark(self, new_img_dark): + """Sets the new_img_dark of this ListActivitiesResponseDataList. + + New activity image URL (dark mode) # noqa: E501 + + :param new_img_dark: The new_img_dark of this ListActivitiesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and new_img_dark is None: # noqa: E501 + raise ValueError("Invalid value for `new_img_dark`, must not be `None`") # noqa: E501 + + self._new_img_dark = new_img_dark + + @property + def tag(self): + """Gets the tag of this ListActivitiesResponseDataList. # noqa: E501 + + Activity tag list # noqa: E501 + + :return: The tag of this ListActivitiesResponseDataList. # noqa: E501 + :rtype: list[str] + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ListActivitiesResponseDataList. + + Activity tag list # noqa: E501 + + :param tag: The tag of this ListActivitiesResponseDataList. # noqa: E501 + :type: list[str] + """ + if self.local_vars_configuration.client_side_validation and tag is None: # noqa: E501 + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListActivitiesResponseDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListActivitiesResponseDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_activity_types_response.py b/gate_api/models/list_activity_types_response.py new file mode 100644 index 00000000..9dfae25b --- /dev/null +++ b/gate_api/models/list_activity_types_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListActivityTypesResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'ListActivityTypesResponseData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, ListActivityTypesResponseData, int, Configuration) -> None + """ListActivityTypesResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ListActivityTypesResponse. # noqa: E501 + + Response status code, 0 means success # noqa: E501 + + :return: The code of this ListActivityTypesResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ListActivityTypesResponse. + + Response status code, 0 means success # noqa: E501 + + :param code: The code of this ListActivityTypesResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this ListActivityTypesResponse. # noqa: E501 + + 响应消息,成功时为 \"success\" # noqa: E501 + + :return: The message of this ListActivityTypesResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ListActivityTypesResponse. + + 响应消息,成功时为 \"success\" # noqa: E501 + + :param message: The message of this ListActivityTypesResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ListActivityTypesResponse. # noqa: E501 + + + :return: The data of this ListActivityTypesResponse. # noqa: E501 + :rtype: ListActivityTypesResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ListActivityTypesResponse. + + + :param data: The data of this ListActivityTypesResponse. # noqa: E501 + :type: ListActivityTypesResponseData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ListActivityTypesResponse. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this ListActivityTypesResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ListActivityTypesResponse. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this ListActivityTypesResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListActivityTypesResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListActivityTypesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_activity_types_response_data.py b/gate_api/models/list_activity_types_response_data.py new file mode 100644 index 00000000..fcb8a81c --- /dev/null +++ b/gate_api/models/list_activity_types_response_data.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListActivityTypesResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[ListActivityTypesResponseDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[ListActivityTypesResponseDataList], Configuration) -> None + """ListActivityTypesResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + self.list = list + + @property + def list(self): + """Gets the list of this ListActivityTypesResponseData. # noqa: E501 + + Activity type list # noqa: E501 + + :return: The list of this ListActivityTypesResponseData. # noqa: E501 + :rtype: list[ListActivityTypesResponseDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this ListActivityTypesResponseData. + + Activity type list # noqa: E501 + + :param list: The list of this ListActivityTypesResponseData. # noqa: E501 + :type: list[ListActivityTypesResponseDataList] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListActivityTypesResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListActivityTypesResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_activity_types_response_data_list.py b/gate_api/models/list_activity_types_response_data_list.py new file mode 100644 index 00000000..9fc060d3 --- /dev/null +++ b/gate_api/models/list_activity_types_response_data_list.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListActivityTypesResponseDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """ListActivityTypesResponseDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._name = None + self.discriminator = None + + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this ListActivityTypesResponseDataList. # noqa: E501 + + Activity type ID # noqa: E501 + + :return: The id of this ListActivityTypesResponseDataList. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ListActivityTypesResponseDataList. + + Activity type ID # noqa: E501 + + :param id: The id of this ListActivityTypesResponseDataList. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this ListActivityTypesResponseDataList. # noqa: E501 + + Activity type name # noqa: E501 + + :return: The name of this ListActivityTypesResponseDataList. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ListActivityTypesResponseDataList. + + Activity type name # noqa: E501 + + :param name: The name of this ListActivityTypesResponseDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListActivityTypesResponseDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListActivityTypesResponseDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_earn_fixed_term_history_response.py b/gate_api/models/list_earn_fixed_term_history_response.py new file mode 100644 index 00000000..1326f78b --- /dev/null +++ b/gate_api/models/list_earn_fixed_term_history_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListEarnFixedTermHistoryResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'ListEarnFixedTermHistoryResponseData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, ListEarnFixedTermHistoryResponseData, int, Configuration) -> None + """ListEarnFixedTermHistoryResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ListEarnFixedTermHistoryResponse. # noqa: E501 + + Return code, 0 means success # noqa: E501 + + :return: The code of this ListEarnFixedTermHistoryResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ListEarnFixedTermHistoryResponse. + + Return code, 0 means success # noqa: E501 + + :param code: The code of this ListEarnFixedTermHistoryResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this ListEarnFixedTermHistoryResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this ListEarnFixedTermHistoryResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ListEarnFixedTermHistoryResponse. + + Response message # noqa: E501 + + :param message: The message of this ListEarnFixedTermHistoryResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this ListEarnFixedTermHistoryResponse. # noqa: E501 + + + :return: The data of this ListEarnFixedTermHistoryResponse. # noqa: E501 + :rtype: ListEarnFixedTermHistoryResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ListEarnFixedTermHistoryResponse. + + + :param data: The data of this ListEarnFixedTermHistoryResponse. # noqa: E501 + :type: ListEarnFixedTermHistoryResponseData + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ListEarnFixedTermHistoryResponse. # noqa: E501 + + Response timestamp (in seconds) # noqa: E501 + + :return: The timestamp of this ListEarnFixedTermHistoryResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ListEarnFixedTermHistoryResponse. + + Response timestamp (in seconds) # noqa: E501 + + :param timestamp: The timestamp of this ListEarnFixedTermHistoryResponse. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListEarnFixedTermHistoryResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListEarnFixedTermHistoryResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_earn_fixed_term_history_response_data.py b/gate_api/models/list_earn_fixed_term_history_response_data.py new file mode 100644 index 00000000..3f9dada1 --- /dev/null +++ b/gate_api/models/list_earn_fixed_term_history_response_data.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListEarnFixedTermHistoryResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[FixedTermHistoryRecord]', + 'total': 'int' + } + + attribute_map = { + 'list': 'list', + 'total': 'total' + } + + def __init__(self, list=None, total=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FixedTermHistoryRecord], int, Configuration) -> None + """ListEarnFixedTermHistoryResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self._total = None + self.discriminator = None + + if list is not None: + self.list = list + if total is not None: + self.total = total + + @property + def list(self): + """Gets the list of this ListEarnFixedTermHistoryResponseData. # noqa: E501 + + + :return: The list of this ListEarnFixedTermHistoryResponseData. # noqa: E501 + :rtype: list[FixedTermHistoryRecord] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this ListEarnFixedTermHistoryResponseData. + + + :param list: The list of this ListEarnFixedTermHistoryResponseData. # noqa: E501 + :type: list[FixedTermHistoryRecord] + """ + + self._list = list + + @property + def total(self): + """Gets the total of this ListEarnFixedTermHistoryResponseData. # noqa: E501 + + Total Records # noqa: E501 + + :return: The total of this ListEarnFixedTermHistoryResponseData. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this ListEarnFixedTermHistoryResponseData. + + Total Records # noqa: E501 + + :param total: The total of this ListEarnFixedTermHistoryResponseData. # noqa: E501 + :type: int + """ + + self._total = total + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListEarnFixedTermHistoryResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListEarnFixedTermHistoryResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_earn_fixed_term_lends_response.py b/gate_api/models/list_earn_fixed_term_lends_response.py new file mode 100644 index 00000000..702359f9 --- /dev/null +++ b/gate_api/models/list_earn_fixed_term_lends_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListEarnFixedTermLendsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'ListEarnFixedTermLendsResponseData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, ListEarnFixedTermLendsResponseData, int, Configuration) -> None + """ListEarnFixedTermLendsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ListEarnFixedTermLendsResponse. # noqa: E501 + + Return code, 0 means success # noqa: E501 + + :return: The code of this ListEarnFixedTermLendsResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ListEarnFixedTermLendsResponse. + + Return code, 0 means success # noqa: E501 + + :param code: The code of this ListEarnFixedTermLendsResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this ListEarnFixedTermLendsResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this ListEarnFixedTermLendsResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ListEarnFixedTermLendsResponse. + + Response message # noqa: E501 + + :param message: The message of this ListEarnFixedTermLendsResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ListEarnFixedTermLendsResponse. # noqa: E501 + + + :return: The data of this ListEarnFixedTermLendsResponse. # noqa: E501 + :rtype: ListEarnFixedTermLendsResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ListEarnFixedTermLendsResponse. + + + :param data: The data of this ListEarnFixedTermLendsResponse. # noqa: E501 + :type: ListEarnFixedTermLendsResponseData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ListEarnFixedTermLendsResponse. # noqa: E501 + + Response timestamp (in seconds) # noqa: E501 + + :return: The timestamp of this ListEarnFixedTermLendsResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ListEarnFixedTermLendsResponse. + + Response timestamp (in seconds) # noqa: E501 + + :param timestamp: The timestamp of this ListEarnFixedTermLendsResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListEarnFixedTermLendsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListEarnFixedTermLendsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_earn_fixed_term_lends_response_data.py b/gate_api/models/list_earn_fixed_term_lends_response_data.py new file mode 100644 index 00000000..635563a2 --- /dev/null +++ b/gate_api/models/list_earn_fixed_term_lends_response_data.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListEarnFixedTermLendsResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[FixedTermLendOrder]', + 'total': 'int' + } + + attribute_map = { + 'list': 'list', + 'total': 'total' + } + + def __init__(self, list=None, total=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FixedTermLendOrder], int, Configuration) -> None + """ListEarnFixedTermLendsResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self._total = None + self.discriminator = None + + self.list = list + self.total = total + + @property + def list(self): + """Gets the list of this ListEarnFixedTermLendsResponseData. # noqa: E501 + + Subscription order list # noqa: E501 + + :return: The list of this ListEarnFixedTermLendsResponseData. # noqa: E501 + :rtype: list[FixedTermLendOrder] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this ListEarnFixedTermLendsResponseData. + + Subscription order list # noqa: E501 + + :param list: The list of this ListEarnFixedTermLendsResponseData. # noqa: E501 + :type: list[FixedTermLendOrder] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + @property + def total(self): + """Gets the total of this ListEarnFixedTermLendsResponseData. # noqa: E501 + + Total Records # noqa: E501 + + :return: The total of this ListEarnFixedTermLendsResponseData. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this ListEarnFixedTermLendsResponseData. + + Total Records # noqa: E501 + + :param total: The total of this ListEarnFixedTermLendsResponseData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListEarnFixedTermLendsResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListEarnFixedTermLendsResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_earn_fixed_term_products_by_asset_response.py b/gate_api/models/list_earn_fixed_term_products_by_asset_response.py new file mode 100644 index 00000000..b9d470ca --- /dev/null +++ b/gate_api/models/list_earn_fixed_term_products_by_asset_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListEarnFixedTermProductsByAssetResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'ListEarnFixedTermProductsByAssetResponseData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, ListEarnFixedTermProductsByAssetResponseData, int, Configuration) -> None + """ListEarnFixedTermProductsByAssetResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + + Return code, 0 means success # noqa: E501 + + :return: The code of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ListEarnFixedTermProductsByAssetResponse. + + Return code, 0 means success # noqa: E501 + + :param code: The code of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ListEarnFixedTermProductsByAssetResponse. + + Response message # noqa: E501 + + :param message: The message of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + + + :return: The data of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + :rtype: ListEarnFixedTermProductsByAssetResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ListEarnFixedTermProductsByAssetResponse. + + + :param data: The data of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + :type: ListEarnFixedTermProductsByAssetResponseData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + + Response timestamp (in seconds) # noqa: E501 + + :return: The timestamp of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ListEarnFixedTermProductsByAssetResponse. + + Response timestamp (in seconds) # noqa: E501 + + :param timestamp: The timestamp of this ListEarnFixedTermProductsByAssetResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListEarnFixedTermProductsByAssetResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListEarnFixedTermProductsByAssetResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_earn_fixed_term_products_by_asset_response_data.py b/gate_api/models/list_earn_fixed_term_products_by_asset_response_data.py new file mode 100644 index 00000000..587ea155 --- /dev/null +++ b/gate_api/models/list_earn_fixed_term_products_by_asset_response_data.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListEarnFixedTermProductsByAssetResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[FixedTermProductSimple]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FixedTermProductSimple], Configuration) -> None + """ListEarnFixedTermProductsByAssetResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + self.list = list + + @property + def list(self): + """Gets the list of this ListEarnFixedTermProductsByAssetResponseData. # noqa: E501 + + Product list # noqa: E501 + + :return: The list of this ListEarnFixedTermProductsByAssetResponseData. # noqa: E501 + :rtype: list[FixedTermProductSimple] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this ListEarnFixedTermProductsByAssetResponseData. + + Product list # noqa: E501 + + :param list: The list of this ListEarnFixedTermProductsByAssetResponseData. # noqa: E501 + :type: list[FixedTermProductSimple] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListEarnFixedTermProductsByAssetResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListEarnFixedTermProductsByAssetResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_earn_fixed_term_products_response.py b/gate_api/models/list_earn_fixed_term_products_response.py new file mode 100644 index 00000000..c85145f3 --- /dev/null +++ b/gate_api/models/list_earn_fixed_term_products_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListEarnFixedTermProductsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'ListEarnFixedTermProductsResponseData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, ListEarnFixedTermProductsResponseData, int, Configuration) -> None + """ListEarnFixedTermProductsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this ListEarnFixedTermProductsResponse. # noqa: E501 + + Return code, 0 means success # noqa: E501 + + :return: The code of this ListEarnFixedTermProductsResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ListEarnFixedTermProductsResponse. + + Return code, 0 means success # noqa: E501 + + :param code: The code of this ListEarnFixedTermProductsResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this ListEarnFixedTermProductsResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this ListEarnFixedTermProductsResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ListEarnFixedTermProductsResponse. + + Response message # noqa: E501 + + :param message: The message of this ListEarnFixedTermProductsResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this ListEarnFixedTermProductsResponse. # noqa: E501 + + + :return: The data of this ListEarnFixedTermProductsResponse. # noqa: E501 + :rtype: ListEarnFixedTermProductsResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ListEarnFixedTermProductsResponse. + + + :param data: The data of this ListEarnFixedTermProductsResponse. # noqa: E501 + :type: ListEarnFixedTermProductsResponseData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this ListEarnFixedTermProductsResponse. # noqa: E501 + + Response timestamp (in seconds) # noqa: E501 + + :return: The timestamp of this ListEarnFixedTermProductsResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this ListEarnFixedTermProductsResponse. + + Response timestamp (in seconds) # noqa: E501 + + :param timestamp: The timestamp of this ListEarnFixedTermProductsResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListEarnFixedTermProductsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListEarnFixedTermProductsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_earn_fixed_term_products_response_data.py b/gate_api/models/list_earn_fixed_term_products_response_data.py new file mode 100644 index 00000000..059d6a68 --- /dev/null +++ b/gate_api/models/list_earn_fixed_term_products_response_data.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListEarnFixedTermProductsResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[FixedTermProduct]', + 'total': 'int' + } + + attribute_map = { + 'list': 'list', + 'total': 'total' + } + + def __init__(self, list=None, total=None, local_vars_configuration=None): # noqa: E501 + # type: (list[FixedTermProduct], int, Configuration) -> None + """ListEarnFixedTermProductsResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self._total = None + self.discriminator = None + + self.list = list + self.total = total + + @property + def list(self): + """Gets the list of this ListEarnFixedTermProductsResponseData. # noqa: E501 + + Product list # noqa: E501 + + :return: The list of this ListEarnFixedTermProductsResponseData. # noqa: E501 + :rtype: list[FixedTermProduct] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this ListEarnFixedTermProductsResponseData. + + Product list # noqa: E501 + + :param list: The list of this ListEarnFixedTermProductsResponseData. # noqa: E501 + :type: list[FixedTermProduct] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + @property + def total(self): + """Gets the total of this ListEarnFixedTermProductsResponseData. # noqa: E501 + + Total Records # noqa: E501 + + :return: The total of this ListEarnFixedTermProductsResponseData. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this ListEarnFixedTermProductsResponseData. + + Total Records # noqa: E501 + + :param total: The total of this ListEarnFixedTermProductsResponseData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListEarnFixedTermProductsResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListEarnFixedTermProductsResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_resp.py b/gate_api/models/list_live_replay_error.py similarity index 60% rename from gate_api/models/repay_resp.py rename to gate_api/models/list_live_replay_error.py index f35f6bc3..2ebf9911 100644 --- a/gate_api/models/repay_resp.py +++ b/gate_api/models/list_live_replay_error.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class RepayResp(object): +class ListLiveReplayError(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -33,76 +33,76 @@ class RepayResp(object): and the value is json key in definition. """ openapi_types = { - 'repaid_principal': 'str', - 'repaid_interest': 'str' + 'label': 'str', + 'message': 'str' } attribute_map = { - 'repaid_principal': 'repaid_principal', - 'repaid_interest': 'repaid_interest' + 'label': 'label', + 'message': 'message' } - def __init__(self, repaid_principal=None, repaid_interest=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, label=None, message=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, Configuration) -> None - """RepayResp - a model defined in OpenAPI""" # noqa: E501 + """ListLiveReplayError - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration - self._repaid_principal = None - self._repaid_interest = None + self._label = None + self._message = None self.discriminator = None - if repaid_principal is not None: - self.repaid_principal = repaid_principal - if repaid_interest is not None: - self.repaid_interest = repaid_interest + if label is not None: + self.label = label + if message is not None: + self.message = message @property - def repaid_principal(self): - """Gets the repaid_principal of this RepayResp. # noqa: E501 + def label(self): + """Gets the label of this ListLiveReplayError. # noqa: E501 - Principal # noqa: E501 + Error identifier code # noqa: E501 - :return: The repaid_principal of this RepayResp. # noqa: E501 + :return: The label of this ListLiveReplayError. # noqa: E501 :rtype: str """ - return self._repaid_principal + return self._label - @repaid_principal.setter - def repaid_principal(self, repaid_principal): - """Sets the repaid_principal of this RepayResp. + @label.setter + def label(self, label): + """Sets the label of this ListLiveReplayError. - Principal # noqa: E501 + Error identifier code # noqa: E501 - :param repaid_principal: The repaid_principal of this RepayResp. # noqa: E501 + :param label: The label of this ListLiveReplayError. # noqa: E501 :type: str """ - self._repaid_principal = repaid_principal + self._label = label @property - def repaid_interest(self): - """Gets the repaid_interest of this RepayResp. # noqa: E501 + def message(self): + """Gets the message of this ListLiveReplayError. # noqa: E501 - Interest # noqa: E501 + Error details # noqa: E501 - :return: The repaid_interest of this RepayResp. # noqa: E501 + :return: The message of this ListLiveReplayError. # noqa: E501 :rtype: str """ - return self._repaid_interest + return self._message - @repaid_interest.setter - def repaid_interest(self, repaid_interest): - """Sets the repaid_interest of this RepayResp. + @message.setter + def message(self, message): + """Sets the message of this ListLiveReplayError. - Interest # noqa: E501 + Error details # noqa: E501 - :param repaid_interest: The repaid_interest of this RepayResp. # noqa: E501 + :param message: The message of this ListLiveReplayError. # noqa: E501 :type: str """ - self._repaid_interest = repaid_interest + self._message = message def to_dict(self): """Returns the model properties as a dict""" @@ -138,14 +138,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, RepayResp): + if not isinstance(other, ListLiveReplayError): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, RepayResp): + if not isinstance(other, ListLiveReplayError): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_live_replay_response.py b/gate_api/models/list_live_replay_response.py new file mode 100644 index 00000000..8fe1e410 --- /dev/null +++ b/gate_api/models/list_live_replay_response.py @@ -0,0 +1,233 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListLiveReplayResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'request_id': 'str', + 'data': 'ListLiveReplayResponseData' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'request_id': 'request_id', + 'data': 'data' + } + + def __init__(self, code=None, label=None, message=None, request_id=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, ListLiveReplayResponseData, Configuration) -> None + """ListLiveReplayResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._request_id = None + self._data = None + self.discriminator = None + + if code is not None: + self.code = code + if label is not None: + self.label = label + if message is not None: + self.message = message + if request_id is not None: + self.request_id = request_id + if data is not None: + self.data = data + + @property + def code(self): + """Gets the code of this ListLiveReplayResponse. # noqa: E501 + + Status code, 200 = success # noqa: E501 + + :return: The code of this ListLiveReplayResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ListLiveReplayResponse. + + Status code, 200 = success # noqa: E501 + + :param code: The code of this ListLiveReplayResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def label(self): + """Gets the label of this ListLiveReplayResponse. # noqa: E501 + + Status label # noqa: E501 + + :return: The label of this ListLiveReplayResponse. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ListLiveReplayResponse. + + Status label # noqa: E501 + + :param label: The label of this ListLiveReplayResponse. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ListLiveReplayResponse. # noqa: E501 + + Status message # noqa: E501 + + :return: The message of this ListLiveReplayResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ListLiveReplayResponse. + + Status message # noqa: E501 + + :param message: The message of this ListLiveReplayResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def request_id(self): + """Gets the request_id of this ListLiveReplayResponse. # noqa: E501 + + Request ID # noqa: E501 + + :return: The request_id of this ListLiveReplayResponse. # noqa: E501 + :rtype: str + """ + return self._request_id + + @request_id.setter + def request_id(self, request_id): + """Sets the request_id of this ListLiveReplayResponse. + + Request ID # noqa: E501 + + :param request_id: The request_id of this ListLiveReplayResponse. # noqa: E501 + :type: str + """ + + self._request_id = request_id + + @property + def data(self): + """Gets the data of this ListLiveReplayResponse. # noqa: E501 + + + :return: The data of this ListLiveReplayResponse. # noqa: E501 + :rtype: ListLiveReplayResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ListLiveReplayResponse. + + + :param data: The data of this ListLiveReplayResponse. # noqa: E501 + :type: ListLiveReplayResponseData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListLiveReplayResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListLiveReplayResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_live_replay_response_data.py b/gate_api/models/list_live_replay_response_data.py new file mode 100644 index 00000000..9a947a36 --- /dev/null +++ b/gate_api/models/list_live_replay_response_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListLiveReplayResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[ListLiveReplayResponseDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[ListLiveReplayResponseDataList], Configuration) -> None + """ListLiveReplayResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this ListLiveReplayResponseData. # noqa: E501 + + Live stream/replay list # noqa: E501 + + :return: The list of this ListLiveReplayResponseData. # noqa: E501 + :rtype: list[ListLiveReplayResponseDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this ListLiveReplayResponseData. + + Live stream/replay list # noqa: E501 + + :param list: The list of this ListLiveReplayResponseData. # noqa: E501 + :type: list[ListLiveReplayResponseDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListLiveReplayResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListLiveReplayResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_live_replay_response_data_list.py b/gate_api/models/list_live_replay_response_data_list.py new file mode 100644 index 00000000..42cdd12b --- /dev/null +++ b/gate_api/models/list_live_replay_response_data_list.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListLiveReplayResponseDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'content_type': 'str', + 'live': 'ListLiveReplayResponseDataLive', + 'video': 'ListLiveReplayResponseDataVideo' + } + + attribute_map = { + 'content_type': 'content_type', + 'live': 'live', + 'video': 'video' + } + + def __init__(self, content_type=None, live=None, video=None, local_vars_configuration=None): # noqa: E501 + # type: (str, ListLiveReplayResponseDataLive, ListLiveReplayResponseDataVideo, Configuration) -> None + """ListLiveReplayResponseDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._content_type = None + self._live = None + self._video = None + self.discriminator = None + + if content_type is not None: + self.content_type = content_type + if live is not None: + self.live = live + if video is not None: + self.video = video + + @property + def content_type(self): + """Gets the content_type of this ListLiveReplayResponseDataList. # noqa: E501 + + Content type: streaming = live broadcast, video = replay video # noqa: E501 + + :return: The content_type of this ListLiveReplayResponseDataList. # noqa: E501 + :rtype: str + """ + return self._content_type + + @content_type.setter + def content_type(self, content_type): + """Sets the content_type of this ListLiveReplayResponseDataList. + + Content type: streaming = live broadcast, video = replay video # noqa: E501 + + :param content_type: The content_type of this ListLiveReplayResponseDataList. # noqa: E501 + :type: str + """ + + self._content_type = content_type + + @property + def live(self): + """Gets the live of this ListLiveReplayResponseDataList. # noqa: E501 + + + :return: The live of this ListLiveReplayResponseDataList. # noqa: E501 + :rtype: ListLiveReplayResponseDataLive + """ + return self._live + + @live.setter + def live(self, live): + """Sets the live of this ListLiveReplayResponseDataList. + + + :param live: The live of this ListLiveReplayResponseDataList. # noqa: E501 + :type: ListLiveReplayResponseDataLive + """ + + self._live = live + + @property + def video(self): + """Gets the video of this ListLiveReplayResponseDataList. # noqa: E501 + + + :return: The video of this ListLiveReplayResponseDataList. # noqa: E501 + :rtype: ListLiveReplayResponseDataVideo + """ + return self._video + + @video.setter + def video(self, video): + """Sets the video of this ListLiveReplayResponseDataList. + + + :param video: The video of this ListLiveReplayResponseDataList. # noqa: E501 + :type: ListLiveReplayResponseDataVideo + """ + + self._video = video + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListLiveReplayResponseDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListLiveReplayResponseDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_live_replay_response_data_live.py b/gate_api/models/list_live_replay_response_data_live.py new file mode 100644 index 00000000..4b251174 --- /dev/null +++ b/gate_api/models/list_live_replay_response_data_live.py @@ -0,0 +1,429 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListLiveReplayResponseDataLive(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'uid': 'str', + 'chat_group_id': 'str', + 'name': 'str', + 'cover': 'str', + 'started_at': 'str', + 'subscription_required': 'bool', + 'hot_weight': 'int', + 'live_type': 'int', + 'session_id': 'str', + 'host': 'ListLiveReplayResponseDataLiveHost', + 'status': 'str' + } + + attribute_map = { + 'id': 'id', + 'uid': 'uid', + 'chat_group_id': 'chat_group_id', + 'name': 'name', + 'cover': 'cover', + 'started_at': 'started_at', + 'subscription_required': 'subscription_required', + 'hot_weight': 'hot_weight', + 'live_type': 'live_type', + 'session_id': 'session_id', + 'host': 'host', + 'status': 'status' + } + + def __init__(self, id=None, uid=None, chat_group_id=None, name=None, cover=None, started_at=None, subscription_required=None, hot_weight=None, live_type=None, session_id=None, host=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, bool, int, int, str, ListLiveReplayResponseDataLiveHost, str, Configuration) -> None + """ListLiveReplayResponseDataLive - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._uid = None + self._chat_group_id = None + self._name = None + self._cover = None + self._started_at = None + self._subscription_required = None + self._hot_weight = None + self._live_type = None + self._session_id = None + self._host = None + self._status = None + self.discriminator = None + + if id is not None: + self.id = id + if uid is not None: + self.uid = uid + if chat_group_id is not None: + self.chat_group_id = chat_group_id + if name is not None: + self.name = name + if cover is not None: + self.cover = cover + if started_at is not None: + self.started_at = started_at + if subscription_required is not None: + self.subscription_required = subscription_required + if hot_weight is not None: + self.hot_weight = hot_weight + if live_type is not None: + self.live_type = live_type + if session_id is not None: + self.session_id = session_id + if host is not None: + self.host = host + if status is not None: + self.status = status + + @property + def id(self): + """Gets the id of this ListLiveReplayResponseDataLive. # noqa: E501 + + Live ID # noqa: E501 + + :return: The id of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ListLiveReplayResponseDataLive. + + Live ID # noqa: E501 + + :param id: The id of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def uid(self): + """Gets the uid of this ListLiveReplayResponseDataLive. # noqa: E501 + + Anchor User ID # noqa: E501 + + :return: The uid of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this ListLiveReplayResponseDataLive. + + Anchor User ID # noqa: E501 + + :param uid: The uid of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: str + """ + + self._uid = uid + + @property + def chat_group_id(self): + """Gets the chat_group_id of this ListLiveReplayResponseDataLive. # noqa: E501 + + Chat group ID # noqa: E501 + + :return: The chat_group_id of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: str + """ + return self._chat_group_id + + @chat_group_id.setter + def chat_group_id(self, chat_group_id): + """Sets the chat_group_id of this ListLiveReplayResponseDataLive. + + Chat group ID # noqa: E501 + + :param chat_group_id: The chat_group_id of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: str + """ + + self._chat_group_id = chat_group_id + + @property + def name(self): + """Gets the name of this ListLiveReplayResponseDataLive. # noqa: E501 + + Live room name # noqa: E501 + + :return: The name of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ListLiveReplayResponseDataLive. + + Live room name # noqa: E501 + + :param name: The name of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def cover(self): + """Gets the cover of this ListLiveReplayResponseDataLive. # noqa: E501 + + Cover image URL # noqa: E501 + + :return: The cover of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: str + """ + return self._cover + + @cover.setter + def cover(self, cover): + """Sets the cover of this ListLiveReplayResponseDataLive. + + Cover image URL # noqa: E501 + + :param cover: The cover of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: str + """ + + self._cover = cover + + @property + def started_at(self): + """Gets the started_at of this ListLiveReplayResponseDataLive. # noqa: E501 + + Broadcast start time (Unix timestamp string) # noqa: E501 + + :return: The started_at of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: str + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this ListLiveReplayResponseDataLive. + + Broadcast start time (Unix timestamp string) # noqa: E501 + + :param started_at: The started_at of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: str + """ + + self._started_at = started_at + + @property + def subscription_required(self): + """Gets the subscription_required of this ListLiveReplayResponseDataLive. # noqa: E501 + + Whether subscription is required # noqa: E501 + + :return: The subscription_required of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: bool + """ + return self._subscription_required + + @subscription_required.setter + def subscription_required(self, subscription_required): + """Sets the subscription_required of this ListLiveReplayResponseDataLive. + + Whether subscription is required # noqa: E501 + + :param subscription_required: The subscription_required of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: bool + """ + + self._subscription_required = subscription_required + + @property + def hot_weight(self): + """Gets the hot_weight of this ListLiveReplayResponseDataLive. # noqa: E501 + + Popularity weight # noqa: E501 + + :return: The hot_weight of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: int + """ + return self._hot_weight + + @hot_weight.setter + def hot_weight(self, hot_weight): + """Sets the hot_weight of this ListLiveReplayResponseDataLive. + + Popularity weight # noqa: E501 + + :param hot_weight: The hot_weight of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: int + """ + + self._hot_weight = hot_weight + + @property + def live_type(self): + """Gets the live_type of this ListLiveReplayResponseDataLive. # noqa: E501 + + Live stream type # noqa: E501 + + :return: The live_type of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: int + """ + return self._live_type + + @live_type.setter + def live_type(self, live_type): + """Sets the live_type of this ListLiveReplayResponseDataLive. + + Live stream type # noqa: E501 + + :param live_type: The live_type of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: int + """ + + self._live_type = live_type + + @property + def session_id(self): + """Gets the session_id of this ListLiveReplayResponseDataLive. # noqa: E501 + + Session ID # noqa: E501 + + :return: The session_id of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: str + """ + return self._session_id + + @session_id.setter + def session_id(self, session_id): + """Sets the session_id of this ListLiveReplayResponseDataLive. + + Session ID # noqa: E501 + + :param session_id: The session_id of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: str + """ + + self._session_id = session_id + + @property + def host(self): + """Gets the host of this ListLiveReplayResponseDataLive. # noqa: E501 + + + :return: The host of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: ListLiveReplayResponseDataLiveHost + """ + return self._host + + @host.setter + def host(self, host): + """Sets the host of this ListLiveReplayResponseDataLive. + + + :param host: The host of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: ListLiveReplayResponseDataLiveHost + """ + + self._host = host + + @property + def status(self): + """Gets the status of this ListLiveReplayResponseDataLive. # noqa: E501 + + Live stream status (e.g., streaming) # noqa: E501 + + :return: The status of this ListLiveReplayResponseDataLive. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ListLiveReplayResponseDataLive. + + Live stream status (e.g., streaming) # noqa: E501 + + :param status: The status of this ListLiveReplayResponseDataLive. # noqa: E501 + :type: str + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListLiveReplayResponseDataLive): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListLiveReplayResponseDataLive): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_live_replay_response_data_live_host.py b/gate_api/models/list_live_replay_response_data_live_host.py new file mode 100644 index 00000000..80f16ac2 --- /dev/null +++ b/gate_api/models/list_live_replay_response_data_live_host.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListLiveReplayResponseDataLiveHost(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'name': 'str', + 'avatar': 'str', + 'fans': 'int', + 'tier': 'int' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'avatar': 'avatar', + 'fans': 'fans', + 'tier': 'tier' + } + + def __init__(self, id=None, name=None, avatar=None, fans=None, tier=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, int, Configuration) -> None + """ListLiveReplayResponseDataLiveHost - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._name = None + self._avatar = None + self._fans = None + self._tier = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + if avatar is not None: + self.avatar = avatar + if fans is not None: + self.fans = fans + if tier is not None: + self.tier = tier + + @property + def id(self): + """Gets the id of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + + Streamer ID # noqa: E501 + + :return: The id of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ListLiveReplayResponseDataLiveHost. + + Streamer ID # noqa: E501 + + :param id: The id of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + + Streamer nickname # noqa: E501 + + :return: The name of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ListLiveReplayResponseDataLiveHost. + + Streamer nickname # noqa: E501 + + :param name: The name of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def avatar(self): + """Gets the avatar of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + + Streamer avatar URL # noqa: E501 + + :return: The avatar of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + :rtype: str + """ + return self._avatar + + @avatar.setter + def avatar(self, avatar): + """Sets the avatar of this ListLiveReplayResponseDataLiveHost. + + Streamer avatar URL # noqa: E501 + + :param avatar: The avatar of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + :type: str + """ + + self._avatar = avatar + + @property + def fans(self): + """Gets the fans of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + + Follower count # noqa: E501 + + :return: The fans of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + :rtype: int + """ + return self._fans + + @fans.setter + def fans(self, fans): + """Sets the fans of this ListLiveReplayResponseDataLiveHost. + + Follower count # noqa: E501 + + :param fans: The fans of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + :type: int + """ + + self._fans = fans + + @property + def tier(self): + """Gets the tier of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + + Streamer level # noqa: E501 + + :return: The tier of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + :rtype: int + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this ListLiveReplayResponseDataLiveHost. + + Streamer level # noqa: E501 + + :param tier: The tier of this ListLiveReplayResponseDataLiveHost. # noqa: E501 + :type: int + """ + + self._tier = tier + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListLiveReplayResponseDataLiveHost): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListLiveReplayResponseDataLiveHost): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_live_replay_response_data_video.py b/gate_api/models/list_live_replay_response_data_video.py new file mode 100644 index 00000000..a3f537fa --- /dev/null +++ b/gate_api/models/list_live_replay_response_data_video.py @@ -0,0 +1,598 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListLiveReplayResponseDataVideo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'stream_id': 'str', + 'title': 'str', + 'avatar': 'str', + 'nick': 'str', + 'nick_en': 'str', + 'cover': 'str', + 'watched': 'int', + 'subscription_required': 'bool', + 'has_subscribed': 'bool', + 'duration': 'int', + 'weight': 'int', + 'moments_uid': 'str', + 'session_id': 'str', + 'ended_at_format': 'str', + 'ended_at_type': 'int', + 'tier': 'int', + 'tag': 'str' + } + + attribute_map = { + 'id': 'id', + 'stream_id': 'stream_id', + 'title': 'title', + 'avatar': 'avatar', + 'nick': 'nick', + 'nick_en': 'nick_en', + 'cover': 'cover', + 'watched': 'watched', + 'subscription_required': 'subscription_required', + 'has_subscribed': 'has_subscribed', + 'duration': 'duration', + 'weight': 'weight', + 'moments_uid': 'moments_uid', + 'session_id': 'session_id', + 'ended_at_format': 'ended_at_format', + 'ended_at_type': 'ended_at_type', + 'tier': 'tier', + 'tag': 'tag' + } + + def __init__(self, id=None, stream_id=None, title=None, avatar=None, nick=None, nick_en=None, cover=None, watched=None, subscription_required=None, has_subscribed=None, duration=None, weight=None, moments_uid=None, session_id=None, ended_at_format=None, ended_at_type=None, tier=None, tag=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, int, bool, bool, int, int, str, str, str, int, int, str, Configuration) -> None + """ListLiveReplayResponseDataVideo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._stream_id = None + self._title = None + self._avatar = None + self._nick = None + self._nick_en = None + self._cover = None + self._watched = None + self._subscription_required = None + self._has_subscribed = None + self._duration = None + self._weight = None + self._moments_uid = None + self._session_id = None + self._ended_at_format = None + self._ended_at_type = None + self._tier = None + self._tag = None + self.discriminator = None + + if id is not None: + self.id = id + if stream_id is not None: + self.stream_id = stream_id + if title is not None: + self.title = title + if avatar is not None: + self.avatar = avatar + if nick is not None: + self.nick = nick + if nick_en is not None: + self.nick_en = nick_en + if cover is not None: + self.cover = cover + if watched is not None: + self.watched = watched + if subscription_required is not None: + self.subscription_required = subscription_required + if has_subscribed is not None: + self.has_subscribed = has_subscribed + if duration is not None: + self.duration = duration + if weight is not None: + self.weight = weight + if moments_uid is not None: + self.moments_uid = moments_uid + if session_id is not None: + self.session_id = session_id + if ended_at_format is not None: + self.ended_at_format = ended_at_format + if ended_at_type is not None: + self.ended_at_type = ended_at_type + if tier is not None: + self.tier = tier + self.tag = tag + + @property + def id(self): + """Gets the id of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Video ID # noqa: E501 + + :return: The id of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ListLiveReplayResponseDataVideo. + + Video ID # noqa: E501 + + :param id: The id of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def stream_id(self): + """Gets the stream_id of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Live stream ID # noqa: E501 + + :return: The stream_id of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._stream_id + + @stream_id.setter + def stream_id(self, stream_id): + """Sets the stream_id of this ListLiveReplayResponseDataVideo. + + Live stream ID # noqa: E501 + + :param stream_id: The stream_id of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._stream_id = stream_id + + @property + def title(self): + """Gets the title of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Video Title # noqa: E501 + + :return: The title of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this ListLiveReplayResponseDataVideo. + + Video Title # noqa: E501 + + :param title: The title of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._title = title + + @property + def avatar(self): + """Gets the avatar of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Author avatar URL # noqa: E501 + + :return: The avatar of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._avatar + + @avatar.setter + def avatar(self, avatar): + """Sets the avatar of this ListLiveReplayResponseDataVideo. + + Author avatar URL # noqa: E501 + + :param avatar: The avatar of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._avatar = avatar + + @property + def nick(self): + """Gets the nick of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Author nickname # noqa: E501 + + :return: The nick of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._nick + + @nick.setter + def nick(self, nick): + """Sets the nick of this ListLiveReplayResponseDataVideo. + + Author nickname # noqa: E501 + + :param nick: The nick of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._nick = nick + + @property + def nick_en(self): + """Gets the nick_en of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Author English nickname # noqa: E501 + + :return: The nick_en of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._nick_en + + @nick_en.setter + def nick_en(self, nick_en): + """Sets the nick_en of this ListLiveReplayResponseDataVideo. + + Author English nickname # noqa: E501 + + :param nick_en: The nick_en of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._nick_en = nick_en + + @property + def cover(self): + """Gets the cover of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Cover image URL # noqa: E501 + + :return: The cover of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._cover + + @cover.setter + def cover(self, cover): + """Sets the cover of this ListLiveReplayResponseDataVideo. + + Cover image URL # noqa: E501 + + :param cover: The cover of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._cover = cover + + @property + def watched(self): + """Gets the watched of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Viewer count # noqa: E501 + + :return: The watched of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: int + """ + return self._watched + + @watched.setter + def watched(self, watched): + """Sets the watched of this ListLiveReplayResponseDataVideo. + + Viewer count # noqa: E501 + + :param watched: The watched of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: int + """ + + self._watched = watched + + @property + def subscription_required(self): + """Gets the subscription_required of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Whether subscription is required # noqa: E501 + + :return: The subscription_required of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: bool + """ + return self._subscription_required + + @subscription_required.setter + def subscription_required(self, subscription_required): + """Sets the subscription_required of this ListLiveReplayResponseDataVideo. + + Whether subscription is required # noqa: E501 + + :param subscription_required: The subscription_required of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: bool + """ + + self._subscription_required = subscription_required + + @property + def has_subscribed(self): + """Gets the has_subscribed of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Whether the current user has subscribed # noqa: E501 + + :return: The has_subscribed of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: bool + """ + return self._has_subscribed + + @has_subscribed.setter + def has_subscribed(self, has_subscribed): + """Sets the has_subscribed of this ListLiveReplayResponseDataVideo. + + Whether the current user has subscribed # noqa: E501 + + :param has_subscribed: The has_subscribed of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: bool + """ + + self._has_subscribed = has_subscribed + + @property + def duration(self): + """Gets the duration of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Video duration (in seconds) # noqa: E501 + + :return: The duration of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: int + """ + return self._duration + + @duration.setter + def duration(self, duration): + """Sets the duration of this ListLiveReplayResponseDataVideo. + + Video duration (in seconds) # noqa: E501 + + :param duration: The duration of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: int + """ + + self._duration = duration + + @property + def weight(self): + """Gets the weight of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Sort weight # noqa: E501 + + :return: The weight of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: int + """ + return self._weight + + @weight.setter + def weight(self, weight): + """Sets the weight of this ListLiveReplayResponseDataVideo. + + Sort weight # noqa: E501 + + :param weight: The weight of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: int + """ + + self._weight = weight + + @property + def moments_uid(self): + """Gets the moments_uid of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Square user ID # noqa: E501 + + :return: The moments_uid of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._moments_uid + + @moments_uid.setter + def moments_uid(self, moments_uid): + """Sets the moments_uid of this ListLiveReplayResponseDataVideo. + + Square user ID # noqa: E501 + + :param moments_uid: The moments_uid of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._moments_uid = moments_uid + + @property + def session_id(self): + """Gets the session_id of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Session ID # noqa: E501 + + :return: The session_id of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._session_id + + @session_id.setter + def session_id(self, session_id): + """Sets the session_id of this ListLiveReplayResponseDataVideo. + + Session ID # noqa: E501 + + :param session_id: The session_id of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._session_id = session_id + + @property + def ended_at_format(self): + """Gets the ended_at_format of this ListLiveReplayResponseDataVideo. # noqa: E501 + + End time format # noqa: E501 + + :return: The ended_at_format of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._ended_at_format + + @ended_at_format.setter + def ended_at_format(self, ended_at_format): + """Sets the ended_at_format of this ListLiveReplayResponseDataVideo. + + End time format # noqa: E501 + + :param ended_at_format: The ended_at_format of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._ended_at_format = ended_at_format + + @property + def ended_at_type(self): + """Gets the ended_at_type of this ListLiveReplayResponseDataVideo. # noqa: E501 + + End time type # noqa: E501 + + :return: The ended_at_type of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: int + """ + return self._ended_at_type + + @ended_at_type.setter + def ended_at_type(self, ended_at_type): + """Sets the ended_at_type of this ListLiveReplayResponseDataVideo. + + End time type # noqa: E501 + + :param ended_at_type: The ended_at_type of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: int + """ + + self._ended_at_type = ended_at_type + + @property + def tier(self): + """Gets the tier of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Author level # noqa: E501 + + :return: The tier of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: int + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this ListLiveReplayResponseDataVideo. + + Author level # noqa: E501 + + :param tier: The tier of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: int + """ + + self._tier = tier + + @property + def tag(self): + """Gets the tag of this ListLiveReplayResponseDataVideo. # noqa: E501 + + Tag # noqa: E501 + + :return: The tag of this ListLiveReplayResponseDataVideo. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ListLiveReplayResponseDataVideo. + + Tag # noqa: E501 + + :param tag: The tag of this ListLiveReplayResponseDataVideo. # noqa: E501 + :type: str + """ + + self._tag = tag + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListLiveReplayResponseDataVideo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListLiveReplayResponseDataVideo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_square_ai_search_error.py b/gate_api/models/list_square_ai_search_error.py new file mode 100644 index 00000000..b3a6d1d5 --- /dev/null +++ b/gate_api/models/list_square_ai_search_error.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListSquareAiSearchError(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label': 'str', + 'message': 'str' + } + + attribute_map = { + 'label': 'label', + 'message': 'message' + } + + def __init__(self, label=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """ListSquareAiSearchError - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._label = None + self._message = None + self.discriminator = None + + if label is not None: + self.label = label + if message is not None: + self.message = message + + @property + def label(self): + """Gets the label of this ListSquareAiSearchError. # noqa: E501 + + Error identifier code # noqa: E501 + + :return: The label of this ListSquareAiSearchError. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ListSquareAiSearchError. + + Error identifier code # noqa: E501 + + :param label: The label of this ListSquareAiSearchError. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ListSquareAiSearchError. # noqa: E501 + + Error details # noqa: E501 + + :return: The message of this ListSquareAiSearchError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ListSquareAiSearchError. + + Error details # noqa: E501 + + :param message: The message of this ListSquareAiSearchError. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListSquareAiSearchError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListSquareAiSearchError): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_square_ai_search_response.py b/gate_api/models/list_square_ai_search_response.py new file mode 100644 index 00000000..8389ccbd --- /dev/null +++ b/gate_api/models/list_square_ai_search_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListSquareAiSearchResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'msg': 'str', + 'data': 'ListSquareAiSearchResponseData' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'msg': 'msg', + 'data': 'data' + } + + def __init__(self, code=None, label=None, msg=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, ListSquareAiSearchResponseData, Configuration) -> None + """ListSquareAiSearchResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._msg = None + self._data = None + self.discriminator = None + + if code is not None: + self.code = code + if label is not None: + self.label = label + if msg is not None: + self.msg = msg + if data is not None: + self.data = data + + @property + def code(self): + """Gets the code of this ListSquareAiSearchResponse. # noqa: E501 + + Status code, 0 = success # noqa: E501 + + :return: The code of this ListSquareAiSearchResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ListSquareAiSearchResponse. + + Status code, 0 = success # noqa: E501 + + :param code: The code of this ListSquareAiSearchResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def label(self): + """Gets the label of this ListSquareAiSearchResponse. # noqa: E501 + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :return: The label of this ListSquareAiSearchResponse. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ListSquareAiSearchResponse. + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :param label: The label of this ListSquareAiSearchResponse. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def msg(self): + """Gets the msg of this ListSquareAiSearchResponse. # noqa: E501 + + Status message # noqa: E501 + + :return: The msg of this ListSquareAiSearchResponse. # noqa: E501 + :rtype: str + """ + return self._msg + + @msg.setter + def msg(self, msg): + """Sets the msg of this ListSquareAiSearchResponse. + + Status message # noqa: E501 + + :param msg: The msg of this ListSquareAiSearchResponse. # noqa: E501 + :type: str + """ + + self._msg = msg + + @property + def data(self): + """Gets the data of this ListSquareAiSearchResponse. # noqa: E501 + + + :return: The data of this ListSquareAiSearchResponse. # noqa: E501 + :rtype: ListSquareAiSearchResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ListSquareAiSearchResponse. + + + :param data: The data of this ListSquareAiSearchResponse. # noqa: E501 + :type: ListSquareAiSearchResponseData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListSquareAiSearchResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListSquareAiSearchResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_square_ai_search_response_data.py b/gate_api/models/list_square_ai_search_response_data.py new file mode 100644 index 00000000..20ed5932 --- /dev/null +++ b/gate_api/models/list_square_ai_search_response_data.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListSquareAiSearchResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'total': 'int', + 'items': 'list[ListSquareAiSearchResponseDataItems]' + } + + attribute_map = { + 'total': 'total', + 'items': 'items' + } + + def __init__(self, total=None, items=None, local_vars_configuration=None): # noqa: E501 + # type: (int, list[ListSquareAiSearchResponseDataItems], Configuration) -> None + """ListSquareAiSearchResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._items = None + self.discriminator = None + + if total is not None: + self.total = total + if items is not None: + self.items = items + + @property + def total(self): + """Gets the total of this ListSquareAiSearchResponseData. # noqa: E501 + + Total number of results # noqa: E501 + + :return: The total of this ListSquareAiSearchResponseData. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this ListSquareAiSearchResponseData. + + Total number of results # noqa: E501 + + :param total: The total of this ListSquareAiSearchResponseData. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def items(self): + """Gets the items of this ListSquareAiSearchResponseData. # noqa: E501 + + Search result list # noqa: E501 + + :return: The items of this ListSquareAiSearchResponseData. # noqa: E501 + :rtype: list[ListSquareAiSearchResponseDataItems] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this ListSquareAiSearchResponseData. + + Search result list # noqa: E501 + + :param items: The items of this ListSquareAiSearchResponseData. # noqa: E501 + :type: list[ListSquareAiSearchResponseDataItems] + """ + + self._items = items + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListSquareAiSearchResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListSquareAiSearchResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_square_ai_search_response_data_items.py b/gate_api/models/list_square_ai_search_response_data_items.py new file mode 100644 index 00000000..28b4777f --- /dev/null +++ b/gate_api/models/list_square_ai_search_response_data_items.py @@ -0,0 +1,291 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListSquareAiSearchResponseDataItems(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'content': 'str', + 'image': 'str', + 'avatar': 'str', + 'nickname': 'str', + 'like_count': 'int', + 'page_view': 'int' + } + + attribute_map = { + 'id': 'id', + 'content': 'content', + 'image': 'image', + 'avatar': 'avatar', + 'nickname': 'nickname', + 'like_count': 'like_count', + 'page_view': 'page_view' + } + + def __init__(self, id=None, content=None, image=None, avatar=None, nickname=None, like_count=None, page_view=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, int, int, Configuration) -> None + """ListSquareAiSearchResponseDataItems - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._content = None + self._image = None + self._avatar = None + self._nickname = None + self._like_count = None + self._page_view = None + self.discriminator = None + + if id is not None: + self.id = id + if content is not None: + self.content = content + if image is not None: + self.image = image + if avatar is not None: + self.avatar = avatar + if nickname is not None: + self.nickname = nickname + if like_count is not None: + self.like_count = like_count + if page_view is not None: + self.page_view = page_view + + @property + def id(self): + """Gets the id of this ListSquareAiSearchResponseDataItems. # noqa: E501 + + Post ID # noqa: E501 + + :return: The id of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ListSquareAiSearchResponseDataItems. + + Post ID # noqa: E501 + + :param id: The id of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def content(self): + """Gets the content of this ListSquareAiSearchResponseDataItems. # noqa: E501 + + Post content # noqa: E501 + + :return: The content of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :rtype: str + """ + return self._content + + @content.setter + def content(self, content): + """Sets the content of this ListSquareAiSearchResponseDataItems. + + Post content # noqa: E501 + + :param content: The content of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :type: str + """ + + self._content = content + + @property + def image(self): + """Gets the image of this ListSquareAiSearchResponseDataItems. # noqa: E501 + + First image URL # noqa: E501 + + :return: The image of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :rtype: str + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this ListSquareAiSearchResponseDataItems. + + First image URL # noqa: E501 + + :param image: The image of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :type: str + """ + + self._image = image + + @property + def avatar(self): + """Gets the avatar of this ListSquareAiSearchResponseDataItems. # noqa: E501 + + Author avatar # noqa: E501 + + :return: The avatar of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :rtype: str + """ + return self._avatar + + @avatar.setter + def avatar(self, avatar): + """Sets the avatar of this ListSquareAiSearchResponseDataItems. + + Author avatar # noqa: E501 + + :param avatar: The avatar of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :type: str + """ + + self._avatar = avatar + + @property + def nickname(self): + """Gets the nickname of this ListSquareAiSearchResponseDataItems. # noqa: E501 + + Author nickname # noqa: E501 + + :return: The nickname of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :rtype: str + """ + return self._nickname + + @nickname.setter + def nickname(self, nickname): + """Sets the nickname of this ListSquareAiSearchResponseDataItems. + + Author nickname # noqa: E501 + + :param nickname: The nickname of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :type: str + """ + + self._nickname = nickname + + @property + def like_count(self): + """Gets the like_count of this ListSquareAiSearchResponseDataItems. # noqa: E501 + + Like count # noqa: E501 + + :return: The like_count of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :rtype: int + """ + return self._like_count + + @like_count.setter + def like_count(self, like_count): + """Sets the like_count of this ListSquareAiSearchResponseDataItems. + + Like count # noqa: E501 + + :param like_count: The like_count of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :type: int + """ + + self._like_count = like_count + + @property + def page_view(self): + """Gets the page_view of this ListSquareAiSearchResponseDataItems. # noqa: E501 + + View count # noqa: E501 + + :return: The page_view of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :rtype: int + """ + return self._page_view + + @page_view.setter + def page_view(self, page_view): + """Sets the page_view of this ListSquareAiSearchResponseDataItems. + + View count # noqa: E501 + + :param page_view: The page_view of this ListSquareAiSearchResponseDataItems. # noqa: E501 + :type: int + """ + + self._page_view = page_view + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListSquareAiSearchResponseDataItems): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListSquareAiSearchResponseDataItems): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_user_coupons_response.py b/gate_api/models/list_user_coupons_response.py new file mode 100644 index 00000000..b41a9696 --- /dev/null +++ b/gate_api/models/list_user_coupons_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListUserCouponsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'label': 'str', + 'message': 'str', + 'data': 'ListUserCouponsResponseData' + } + + attribute_map = { + 'code': 'code', + 'label': 'label', + 'message': 'message', + 'data': 'data' + } + + def __init__(self, code=None, label=None, message=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, ListUserCouponsResponseData, Configuration) -> None + """ListUserCouponsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._label = None + self._message = None + self._data = None + self.discriminator = None + + if code is not None: + self.code = code + if label is not None: + self.label = label + if message is not None: + self.message = message + if data is not None: + self.data = data + + @property + def code(self): + """Gets the code of this ListUserCouponsResponse. # noqa: E501 + + Response Code. `0` = Success; `2002` = User not logged in; `50105` = Input parameter validation failed # noqa: E501 + + :return: The code of this ListUserCouponsResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ListUserCouponsResponse. + + Response Code. `0` = Success; `2002` = User not logged in; `50105` = Input parameter validation failed # noqa: E501 + + :param code: The code of this ListUserCouponsResponse. # noqa: E501 + :type: int + """ + allowed_values = [0, 2002, 50105] # noqa: E501 + if self.local_vars_configuration.client_side_validation and code not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 + .format(code, allowed_values) + ) + + self._code = code + + @property + def label(self): + """Gets the label of this ListUserCouponsResponse. # noqa: E501 + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :return: The label of this ListUserCouponsResponse. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this ListUserCouponsResponse. + + Error identifier code. Empty string on success, machine-readable error label on error # noqa: E501 + + :param label: The label of this ListUserCouponsResponse. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this ListUserCouponsResponse. # noqa: E501 + + + :return: The message of this ListUserCouponsResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ListUserCouponsResponse. + + + :param message: The message of this ListUserCouponsResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this ListUserCouponsResponse. # noqa: E501 + + + :return: The data of this ListUserCouponsResponse. # noqa: E501 + :rtype: ListUserCouponsResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ListUserCouponsResponse. + + + :param data: The data of this ListUserCouponsResponse. # noqa: E501 + :type: ListUserCouponsResponseData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListUserCouponsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListUserCouponsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_user_coupons_response_data.py b/gate_api/models/list_user_coupons_response_data.py new file mode 100644 index 00000000..1f4813a6 --- /dev/null +++ b/gate_api/models/list_user_coupons_response_data.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListUserCouponsResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'next_page': 'bool', + 'list': 'list[ListUserCouponsResponseDataList]' + } + + attribute_map = { + 'next_page': 'next_page', + 'list': 'list' + } + + def __init__(self, next_page=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (bool, list[ListUserCouponsResponseDataList], Configuration) -> None + """ListUserCouponsResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._next_page = None + self._list = None + self.discriminator = None + + if next_page is not None: + self.next_page = next_page + if list is not None: + self.list = list + + @property + def next_page(self): + """Gets the next_page of this ListUserCouponsResponseData. # noqa: E501 + + Whether there is a next page. `true` means more data is available. Pass the `id` of the last record as `last_id` and `expire_time_order_by` as `expire_time` in the next request # noqa: E501 + + :return: The next_page of this ListUserCouponsResponseData. # noqa: E501 + :rtype: bool + """ + return self._next_page + + @next_page.setter + def next_page(self, next_page): + """Sets the next_page of this ListUserCouponsResponseData. + + Whether there is a next page. `true` means more data is available. Pass the `id` of the last record as `last_id` and `expire_time_order_by` as `expire_time` in the next request # noqa: E501 + + :param next_page: The next_page of this ListUserCouponsResponseData. # noqa: E501 + :type: bool + """ + + self._next_page = next_page + + @property + def list(self): + """Gets the list of this ListUserCouponsResponseData. # noqa: E501 + + Coupon object array, see field details below # noqa: E501 + + :return: The list of this ListUserCouponsResponseData. # noqa: E501 + :rtype: list[ListUserCouponsResponseDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this ListUserCouponsResponseData. + + Coupon object array, see field details below # noqa: E501 + + :param list: The list of this ListUserCouponsResponseData. # noqa: E501 + :type: list[ListUserCouponsResponseDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListUserCouponsResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListUserCouponsResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_user_coupons_response_data_help_url.py b/gate_api/models/list_user_coupons_response_data_help_url.py new file mode 100644 index 00000000..1f060a56 --- /dev/null +++ b/gate_api/models/list_user_coupons_response_data_help_url.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListUserCouponsResponseDataHelpUrl(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'web': 'str', + 'app': 'str' + } + + attribute_map = { + 'web': 'web', + 'app': 'app' + } + + def __init__(self, web=None, app=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """ListUserCouponsResponseDataHelpUrl - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._web = None + self._app = None + self.discriminator = None + + if web is not None: + self.web = web + if app is not None: + self.app = app + + @property + def web(self): + """Gets the web of this ListUserCouponsResponseDataHelpUrl. # noqa: E501 + + Web Help Link # noqa: E501 + + :return: The web of this ListUserCouponsResponseDataHelpUrl. # noqa: E501 + :rtype: str + """ + return self._web + + @web.setter + def web(self, web): + """Sets the web of this ListUserCouponsResponseDataHelpUrl. + + Web Help Link # noqa: E501 + + :param web: The web of this ListUserCouponsResponseDataHelpUrl. # noqa: E501 + :type: str + """ + + self._web = web + + @property + def app(self): + """Gets the app of this ListUserCouponsResponseDataHelpUrl. # noqa: E501 + + App Help Link # noqa: E501 + + :return: The app of this ListUserCouponsResponseDataHelpUrl. # noqa: E501 + :rtype: str + """ + return self._app + + @app.setter + def app(self, app): + """Sets the app of this ListUserCouponsResponseDataHelpUrl. + + App Help Link # noqa: E501 + + :param app: The app of this ListUserCouponsResponseDataHelpUrl. # noqa: E501 + :type: str + """ + + self._app = app + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListUserCouponsResponseDataHelpUrl): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListUserCouponsResponseDataHelpUrl): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_user_coupons_response_data_jump_url.py b/gate_api/models/list_user_coupons_response_data_jump_url.py new file mode 100644 index 00000000..e98a119c --- /dev/null +++ b/gate_api/models/list_user_coupons_response_data_jump_url.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListUserCouponsResponseDataJumpUrl(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'web': 'str', + 'app': 'str', + 'mini_app': 'str' + } + + attribute_map = { + 'web': 'web', + 'app': 'app', + 'mini_app': 'mini_app' + } + + def __init__(self, web=None, app=None, mini_app=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """ListUserCouponsResponseDataJumpUrl - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._web = None + self._app = None + self._mini_app = None + self.discriminator = None + + if web is not None: + self.web = web + if app is not None: + self.app = app + if mini_app is not None: + self.mini_app = mini_app + + @property + def web(self): + """Gets the web of this ListUserCouponsResponseDataJumpUrl. # noqa: E501 + + Web Redirect Link # noqa: E501 + + :return: The web of this ListUserCouponsResponseDataJumpUrl. # noqa: E501 + :rtype: str + """ + return self._web + + @web.setter + def web(self, web): + """Sets the web of this ListUserCouponsResponseDataJumpUrl. + + Web Redirect Link # noqa: E501 + + :param web: The web of this ListUserCouponsResponseDataJumpUrl. # noqa: E501 + :type: str + """ + + self._web = web + + @property + def app(self): + """Gets the app of this ListUserCouponsResponseDataJumpUrl. # noqa: E501 + + App Redirect Link # noqa: E501 + + :return: The app of this ListUserCouponsResponseDataJumpUrl. # noqa: E501 + :rtype: str + """ + return self._app + + @app.setter + def app(self, app): + """Sets the app of this ListUserCouponsResponseDataJumpUrl. + + App Redirect Link # noqa: E501 + + :param app: The app of this ListUserCouponsResponseDataJumpUrl. # noqa: E501 + :type: str + """ + + self._app = app + + @property + def mini_app(self): + """Gets the mini_app of this ListUserCouponsResponseDataJumpUrl. # noqa: E501 + + Mini Program Redirect Link (empty string for most types) # noqa: E501 + + :return: The mini_app of this ListUserCouponsResponseDataJumpUrl. # noqa: E501 + :rtype: str + """ + return self._mini_app + + @mini_app.setter + def mini_app(self, mini_app): + """Sets the mini_app of this ListUserCouponsResponseDataJumpUrl. + + Mini Program Redirect Link (empty string for most types) # noqa: E501 + + :param mini_app: The mini_app of this ListUserCouponsResponseDataJumpUrl. # noqa: E501 + :type: str + """ + + self._mini_app = mini_app + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListUserCouponsResponseDataJumpUrl): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListUserCouponsResponseDataJumpUrl): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_user_coupons_response_data_list.py b/gate_api/models/list_user_coupons_response_data_list.py new file mode 100644 index 00000000..d38e91fe --- /dev/null +++ b/gate_api/models/list_user_coupons_response_data_list.py @@ -0,0 +1,829 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListUserCouponsResponseDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'details_id': 'int', + 'coupon_type': 'str', + 'name': 'str', + 'amount': 'str', + 'origin_amount': 'str', + 'currency': 'str', + 'rule_new': 'str', + 'status': 'str', + 'jump_url': 'ListUserCouponsResponseDataJumpUrl', + 'help_url': 'ListUserCouponsResponseDataHelpUrl', + 'expire_time': 'int', + 'expire_time_order_by': 'int', + 'expire_second': 'int', + 'has_usage_history': 'bool', + 'has_progress': 'bool', + 'progress_config': 'ListUserCouponsResponseDataProgressConfig', + 'activation_info': 'object', + 'is_task_coupon': 'int', + 'upgrade_toast': 'bool', + 'task_title': 'str', + 'task_desc': 'str', + 'task_start_at': 'int', + 'task_expire_at': 'int', + 'task_completed_at': 'int', + 'extra': 'list[object]' + } + + attribute_map = { + 'id': 'id', + 'details_id': 'details_id', + 'coupon_type': 'coupon_type', + 'name': 'name', + 'amount': 'amount', + 'origin_amount': 'origin_amount', + 'currency': 'currency', + 'rule_new': 'rule_new', + 'status': 'status', + 'jump_url': 'jump_url', + 'help_url': 'help_url', + 'expire_time': 'expire_time', + 'expire_time_order_by': 'expire_time_order_by', + 'expire_second': 'expire_second', + 'has_usage_history': 'has_usage_history', + 'has_progress': 'has_progress', + 'progress_config': 'progress_config', + 'activation_info': 'activation_info', + 'is_task_coupon': 'is_task_coupon', + 'upgrade_toast': 'upgrade_toast', + 'task_title': 'task_title', + 'task_desc': 'task_desc', + 'task_start_at': 'task_start_at', + 'task_expire_at': 'task_expire_at', + 'task_completed_at': 'task_completed_at', + 'extra': 'extra' + } + + def __init__(self, id=None, details_id=None, coupon_type=None, name=None, amount=None, origin_amount=None, currency=None, rule_new=None, status=None, jump_url=None, help_url=None, expire_time=None, expire_time_order_by=None, expire_second=None, has_usage_history=None, has_progress=None, progress_config=None, activation_info=None, is_task_coupon=None, upgrade_toast=None, task_title=None, task_desc=None, task_start_at=None, task_expire_at=None, task_completed_at=None, extra=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, str, str, str, str, str, ListUserCouponsResponseDataJumpUrl, ListUserCouponsResponseDataHelpUrl, int, int, int, bool, bool, ListUserCouponsResponseDataProgressConfig, object, int, bool, str, str, int, int, int, list[object], Configuration) -> None + """ListUserCouponsResponseDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._details_id = None + self._coupon_type = None + self._name = None + self._amount = None + self._origin_amount = None + self._currency = None + self._rule_new = None + self._status = None + self._jump_url = None + self._help_url = None + self._expire_time = None + self._expire_time_order_by = None + self._expire_second = None + self._has_usage_history = None + self._has_progress = None + self._progress_config = None + self._activation_info = None + self._is_task_coupon = None + self._upgrade_toast = None + self._task_title = None + self._task_desc = None + self._task_start_at = None + self._task_expire_at = None + self._task_completed_at = None + self._extra = None + self.discriminator = None + + if id is not None: + self.id = id + if details_id is not None: + self.details_id = details_id + if coupon_type is not None: + self.coupon_type = coupon_type + if name is not None: + self.name = name + if amount is not None: + self.amount = amount + if origin_amount is not None: + self.origin_amount = origin_amount + if currency is not None: + self.currency = currency + if rule_new is not None: + self.rule_new = rule_new + if status is not None: + self.status = status + if jump_url is not None: + self.jump_url = jump_url + if help_url is not None: + self.help_url = help_url + if expire_time is not None: + self.expire_time = expire_time + if expire_time_order_by is not None: + self.expire_time_order_by = expire_time_order_by + if expire_second is not None: + self.expire_second = expire_second + if has_usage_history is not None: + self.has_usage_history = has_usage_history + if has_progress is not None: + self.has_progress = has_progress + if progress_config is not None: + self.progress_config = progress_config + if activation_info is not None: + self.activation_info = activation_info + if is_task_coupon is not None: + self.is_task_coupon = is_task_coupon + if upgrade_toast is not None: + self.upgrade_toast = upgrade_toast + if task_title is not None: + self.task_title = task_title + if task_desc is not None: + self.task_desc = task_desc + if task_start_at is not None: + self.task_start_at = task_start_at + if task_expire_at is not None: + self.task_expire_at = task_expire_at + if task_completed_at is not None: + self.task_completed_at = task_completed_at + if extra is not None: + self.extra = extra + + @property + def id(self): + """Gets the id of this ListUserCouponsResponseDataList. # noqa: E501 + + Coupon distribution record ID (coupon_send_issuing_log.id), used as `last_id` for cursor-based pagination # noqa: E501 + + :return: The id of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ListUserCouponsResponseDataList. + + Coupon distribution record ID (coupon_send_issuing_log.id), used as `last_id` for cursor-based pagination # noqa: E501 + + :param id: The id of this ListUserCouponsResponseDataList. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def details_id(self): + """Gets the details_id of this ListUserCouponsResponseDataList. # noqa: E501 + + User coupon detail table primary key (separate table per type). This field is 0 for task coupons, has value for regular coupons # noqa: E501 + + :return: The details_id of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: int + """ + return self._details_id + + @details_id.setter + def details_id(self, details_id): + """Sets the details_id of this ListUserCouponsResponseDataList. + + User coupon detail table primary key (separate table per type). This field is 0 for task coupons, has value for regular coupons # noqa: E501 + + :param details_id: The details_id of this ListUserCouponsResponseDataList. # noqa: E501 + :type: int + """ + + self._details_id = details_id + + @property + def coupon_type(self): + """Gets the coupon_type of this ListUserCouponsResponseDataList. # noqa: E501 + + Coupon type, enum values same as the `type` parameter # noqa: E501 + + :return: The coupon_type of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: str + """ + return self._coupon_type + + @coupon_type.setter + def coupon_type(self, coupon_type): + """Sets the coupon_type of this ListUserCouponsResponseDataList. + + Coupon type, enum values same as the `type` parameter # noqa: E501 + + :param coupon_type: The coupon_type of this ListUserCouponsResponseDataList. # noqa: E501 + :type: str + """ + + self._coupon_type = coupon_type + + @property + def name(self): + """Gets the name of this ListUserCouponsResponseDataList. # noqa: E501 + + Coupon display name (i18n translated) # noqa: E501 + + :return: The name of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ListUserCouponsResponseDataList. + + Coupon display name (i18n translated) # noqa: E501 + + :param name: The name of this ListUserCouponsResponseDataList. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def amount(self): + """Gets the amount of this ListUserCouponsResponseDataList. # noqa: E501 + + Coupon denomination (formatted string with thousand separators). Meaning by type: point card = balance, interest rate boost coupon = interest rate percentage (e.g., '5%'), VIP trial card = VIP level number, position voucher = face value × leverage, others = face value # noqa: E501 + + :return: The amount of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this ListUserCouponsResponseDataList. + + Coupon denomination (formatted string with thousand separators). Meaning by type: point card = balance, interest rate boost coupon = interest rate percentage (e.g., '5%'), VIP trial card = VIP level number, position voucher = face value × leverage, others = face value # noqa: E501 + + :param amount: The amount of this ListUserCouponsResponseDataList. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def origin_amount(self): + """Gets the origin_amount of this ListUserCouponsResponseDataList. # noqa: E501 + + Original denomination (string with trailing zeros removed). Only returned for point card type, other types do not have this field # noqa: E501 + + :return: The origin_amount of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: str + """ + return self._origin_amount + + @origin_amount.setter + def origin_amount(self, origin_amount): + """Sets the origin_amount of this ListUserCouponsResponseDataList. + + Original denomination (string with trailing zeros removed). Only returned for point card type, other types do not have this field # noqa: E501 + + :param origin_amount: The origin_amount of this ListUserCouponsResponseDataList. # noqa: E501 + :type: str + """ + + self._origin_amount = origin_amount + + @property + def currency(self): + """Gets the currency of this ListUserCouponsResponseDataList. # noqa: E501 + + Denomination unit. Point card = 'POINT', interest rate boost coupon = 'APR', VIP trial card = 'VIP', Alpha cash coupon = base currency, others = uppercase currency symbol (e.g., 'USDT'/'GT') # noqa: E501 + + :return: The currency of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this ListUserCouponsResponseDataList. + + Denomination unit. Point card = 'POINT', interest rate boost coupon = 'APR', VIP trial card = 'VIP', Alpha cash coupon = base currency, others = uppercase currency symbol (e.g., 'USDT'/'GT') # noqa: E501 + + :param currency: The currency of this ListUserCouponsResponseDataList. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def rule_new(self): + """Gets the rule_new of this ListUserCouponsResponseDataList. # noqa: E501 + + Coupon usage rule text. List endpoint always returns empty string \"\", only detail endpoint returns actual value # noqa: E501 + + :return: The rule_new of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: str + """ + return self._rule_new + + @rule_new.setter + def rule_new(self, rule_new): + """Sets the rule_new of this ListUserCouponsResponseDataList. + + Coupon usage rule text. List endpoint always returns empty string \"\", only detail endpoint returns actual value # noqa: E501 + + :param rule_new: The rule_new of this ListUserCouponsResponseDataList. # noqa: E501 + :type: str + """ + + self._rule_new = rule_new + + @property + def status(self): + """Gets the status of this ListUserCouponsResponseDataList. # noqa: E501 + + Coupon status. Regular coupon: NOT_ACTIVE (pending activation), ACTIVATED (activated), TO_BE_USED (to be used), EXPIRED (expired), RECYCLED (recycled), INVALID (invalidated), USED (used), UNKNOWN (unknown), LOCKED (locked, P2P only). Task coupon: TASK_START (task not started), TASK_WAIT (task in progress), TASK_DONE (task completed, processing), TASK_EXPIRED (task not completed, expired), TASK_NOT_STARTED_EXPIRED (not started, expired), TASK_RECEIVE_SUCCESS (reward claimed successfully), TASK_RECEIVE_FAIL (reward claim failed) # noqa: E501 + + :return: The status of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ListUserCouponsResponseDataList. + + Coupon status. Regular coupon: NOT_ACTIVE (pending activation), ACTIVATED (activated), TO_BE_USED (to be used), EXPIRED (expired), RECYCLED (recycled), INVALID (invalidated), USED (used), UNKNOWN (unknown), LOCKED (locked, P2P only). Task coupon: TASK_START (task not started), TASK_WAIT (task in progress), TASK_DONE (task completed, processing), TASK_EXPIRED (task not completed, expired), TASK_NOT_STARTED_EXPIRED (not started, expired), TASK_RECEIVE_SUCCESS (reward claimed successfully), TASK_RECEIVE_FAIL (reward claim failed) # noqa: E501 + + :param status: The status of this ListUserCouponsResponseDataList. # noqa: E501 + :type: str + """ + allowed_values = ["NOT_ACTIVE", "ACTIVATED", "TO_BE_USED", "EXPIRED", "RECYCLED", "INVALID", "USED", "UNKNOWN", "LOCKED", "TASK_START", "TASK_WAIT", "TASK_DONE", "TASK_EXPIRED", "TASK_NOT_STARTED_EXPIRED", "TASK_RECEIVE_SUCCESS", "TASK_RECEIVE_FAIL"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def jump_url(self): + """Gets the jump_url of this ListUserCouponsResponseDataList. # noqa: E501 + + + :return: The jump_url of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: ListUserCouponsResponseDataJumpUrl + """ + return self._jump_url + + @jump_url.setter + def jump_url(self, jump_url): + """Sets the jump_url of this ListUserCouponsResponseDataList. + + + :param jump_url: The jump_url of this ListUserCouponsResponseDataList. # noqa: E501 + :type: ListUserCouponsResponseDataJumpUrl + """ + + self._jump_url = jump_url + + @property + def help_url(self): + """Gets the help_url of this ListUserCouponsResponseDataList. # noqa: E501 + + + :return: The help_url of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: ListUserCouponsResponseDataHelpUrl + """ + return self._help_url + + @help_url.setter + def help_url(self, help_url): + """Sets the help_url of this ListUserCouponsResponseDataList. + + + :param help_url: The help_url of this ListUserCouponsResponseDataList. # noqa: E501 + :type: ListUserCouponsResponseDataHelpUrl + """ + + self._help_url = help_url + + @property + def expire_time(self): + """Gets the expire_time of this ListUserCouponsResponseDataList. # noqa: E501 + + Expiration time (Unix timestamp). Some types replace this with actual expiration time after activation or use (e.g., contract_bonus uses expired_timest after activation). Point card type returns 0 # noqa: E501 + + :return: The expire_time of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: int + """ + return self._expire_time + + @expire_time.setter + def expire_time(self, expire_time): + """Sets the expire_time of this ListUserCouponsResponseDataList. + + Expiration time (Unix timestamp). Some types replace this with actual expiration time after activation or use (e.g., contract_bonus uses expired_timest after activation). Point card type returns 0 # noqa: E501 + + :param expire_time: The expire_time of this ListUserCouponsResponseDataList. # noqa: E501 + :type: int + """ + + self._expire_time = expire_time + + @property + def expire_time_order_by(self): + """Gets the expire_time_order_by of this ListUserCouponsResponseDataList. # noqa: E501 + + Sorting expiration time (from the original expiration time of the distribution record, unaffected by activation). Used as the `expire_time` parameter for the next request in cursor-based pagination # noqa: E501 + + :return: The expire_time_order_by of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: int + """ + return self._expire_time_order_by + + @expire_time_order_by.setter + def expire_time_order_by(self, expire_time_order_by): + """Sets the expire_time_order_by of this ListUserCouponsResponseDataList. + + Sorting expiration time (from the original expiration time of the distribution record, unaffected by activation). Used as the `expire_time` parameter for the next request in cursor-based pagination # noqa: E501 + + :param expire_time_order_by: The expire_time_order_by of this ListUserCouponsResponseDataList. # noqa: E501 + :type: int + """ + + self._expire_time_order_by = expire_time_order_by + + @property + def expire_second(self): + """Gets the expire_second of this ListUserCouponsResponseDataList. # noqa: E501 + + Seconds remaining until expiration. Returns 0 for expired or Point Card types # noqa: E501 + + :return: The expire_second of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: int + """ + return self._expire_second + + @expire_second.setter + def expire_second(self, expire_second): + """Sets the expire_second of this ListUserCouponsResponseDataList. + + Seconds remaining until expiration. Returns 0 for expired or Point Card types # noqa: E501 + + :param expire_second: The expire_second of this ListUserCouponsResponseDataList. # noqa: E501 + :type: int + """ + + self._expire_second = expire_second + + @property + def has_usage_history(self): + """Gets the has_usage_history of this ListUserCouponsResponseDataList. # noqa: E501 + + Whether there is a usage history. Fixed as true for point card type, determined by type for others # noqa: E501 + + :return: The has_usage_history of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: bool + """ + return self._has_usage_history + + @has_usage_history.setter + def has_usage_history(self, has_usage_history): + """Sets the has_usage_history of this ListUserCouponsResponseDataList. + + Whether there is a usage history. Fixed as true for point card type, determined by type for others # noqa: E501 + + :param has_usage_history: The has_usage_history of this ListUserCouponsResponseDataList. # noqa: E501 + :type: bool + """ + + self._has_usage_history = has_usage_history + + @property + def has_progress(self): + """Gets the has_progress of this ListUserCouponsResponseDataList. # noqa: E501 + + Whether to display a progress bar. Only true for commission_rebate, interest_voucher, and qualifying task coupons # noqa: E501 + + :return: The has_progress of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: bool + """ + return self._has_progress + + @has_progress.setter + def has_progress(self, has_progress): + """Sets the has_progress of this ListUserCouponsResponseDataList. + + Whether to display a progress bar. Only true for commission_rebate, interest_voucher, and qualifying task coupons # noqa: E501 + + :param has_progress: The has_progress of this ListUserCouponsResponseDataList. # noqa: E501 + :type: bool + """ + + self._has_progress = has_progress + + @property + def progress_config(self): + """Gets the progress_config of this ListUserCouponsResponseDataList. # noqa: E501 + + + :return: The progress_config of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: ListUserCouponsResponseDataProgressConfig + """ + return self._progress_config + + @progress_config.setter + def progress_config(self, progress_config): + """Sets the progress_config of this ListUserCouponsResponseDataList. + + + :param progress_config: The progress_config of this ListUserCouponsResponseDataList. # noqa: E501 + :type: ListUserCouponsResponseDataProgressConfig + """ + + self._progress_config = progress_config + + @property + def activation_info(self): + """Gets the activation_info of this ListUserCouponsResponseDataList. # noqa: E501 + + Type-specific activation information. Types without specific fields return empty object {}. Fields by type: interest_voucher={supported_pairs,transaction_type}; contract_bonus_new={received_expired_hour}; contract_bonus={check_unified_account_mode,received_expired_days,abtest}; commission_rebate={market,market_name}; robot_bonus={designated_bots}; position_voucher={symbols,leverage,need_user_funds,user_funds_amount,position_bonus}; tradfi_position_voucher={symbols,leverage,position_bonus}; etf_voucher={currency_markets,amount} # noqa: E501 + + :return: The activation_info of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: object + """ + return self._activation_info + + @activation_info.setter + def activation_info(self, activation_info): + """Sets the activation_info of this ListUserCouponsResponseDataList. + + Type-specific activation information. Types without specific fields return empty object {}. Fields by type: interest_voucher={supported_pairs,transaction_type}; contract_bonus_new={received_expired_hour}; contract_bonus={check_unified_account_mode,received_expired_days,abtest}; commission_rebate={market,market_name}; robot_bonus={designated_bots}; position_voucher={symbols,leverage,need_user_funds,user_funds_amount,position_bonus}; tradfi_position_voucher={symbols,leverage,position_bonus}; etf_voucher={currency_markets,amount} # noqa: E501 + + :param activation_info: The activation_info of this ListUserCouponsResponseDataList. # noqa: E501 + :type: object + """ + + self._activation_info = activation_info + + @property + def is_task_coupon(self): + """Gets the is_task_coupon of this ListUserCouponsResponseDataList. # noqa: E501 + + Whether it is a task coupon. `0` = regular coupon; `1` = task coupon # noqa: E501 + + :return: The is_task_coupon of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: int + """ + return self._is_task_coupon + + @is_task_coupon.setter + def is_task_coupon(self, is_task_coupon): + """Sets the is_task_coupon of this ListUserCouponsResponseDataList. + + Whether it is a task coupon. `0` = regular coupon; `1` = task coupon # noqa: E501 + + :param is_task_coupon: The is_task_coupon of this ListUserCouponsResponseDataList. # noqa: E501 + :type: int + """ + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and is_task_coupon not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `is_task_coupon` ({0}), must be one of {1}" # noqa: E501 + .format(is_task_coupon, allowed_values) + ) + + self._is_task_coupon = is_task_coupon + + @property + def upgrade_toast(self): + """Gets the upgrade_toast of this ListUserCouponsResponseDataList. # noqa: E501 + + Whether to prompt the user to upgrade the App (true when app version is too old to support the coupon). Triggered types: copy_trading/alpha_voucher (Android<7320000/iOS<202507320000), commission_rebate subtype tradfi (Android<8040000/iOS<202608040000), etf_voucher (Android<8090000/iOS<202608090000), tradfi_position_voucher (Android<8100000/iOS<202508240000) # noqa: E501 + + :return: The upgrade_toast of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: bool + """ + return self._upgrade_toast + + @upgrade_toast.setter + def upgrade_toast(self, upgrade_toast): + """Sets the upgrade_toast of this ListUserCouponsResponseDataList. + + Whether to prompt the user to upgrade the App (true when app version is too old to support the coupon). Triggered types: copy_trading/alpha_voucher (Android<7320000/iOS<202507320000), commission_rebate subtype tradfi (Android<8040000/iOS<202608040000), etf_voucher (Android<8090000/iOS<202608090000), tradfi_position_voucher (Android<8100000/iOS<202508240000) # noqa: E501 + + :param upgrade_toast: The upgrade_toast of this ListUserCouponsResponseDataList. # noqa: E501 + :type: bool + """ + + self._upgrade_toast = upgrade_toast + + @property + def task_title(self): + """Gets the task_title of this ListUserCouponsResponseDataList. # noqa: E501 + + Task title (only task coupons have value, regular coupons return empty string \"\") # noqa: E501 + + :return: The task_title of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: str + """ + return self._task_title + + @task_title.setter + def task_title(self, task_title): + """Sets the task_title of this ListUserCouponsResponseDataList. + + Task title (only task coupons have value, regular coupons return empty string \"\") # noqa: E501 + + :param task_title: The task_title of this ListUserCouponsResponseDataList. # noqa: E501 + :type: str + """ + + self._task_title = task_title + + @property + def task_desc(self): + """Gets the task_desc of this ListUserCouponsResponseDataList. # noqa: E501 + + Task description (only task coupons have value, regular coupons return empty string \"\") # noqa: E501 + + :return: The task_desc of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: str + """ + return self._task_desc + + @task_desc.setter + def task_desc(self, task_desc): + """Sets the task_desc of this ListUserCouponsResponseDataList. + + Task description (only task coupons have value, regular coupons return empty string \"\") # noqa: E501 + + :param task_desc: The task_desc of this ListUserCouponsResponseDataList. # noqa: E501 + :type: str + """ + + self._task_desc = task_desc + + @property + def task_start_at(self): + """Gets the task_start_at of this ListUserCouponsResponseDataList. # noqa: E501 + + Task start timestamp (Unix). Only has value for task coupons in TASK_EXPIRED status, otherwise 0 # noqa: E501 + + :return: The task_start_at of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: int + """ + return self._task_start_at + + @task_start_at.setter + def task_start_at(self, task_start_at): + """Sets the task_start_at of this ListUserCouponsResponseDataList. + + Task start timestamp (Unix). Only has value for task coupons in TASK_EXPIRED status, otherwise 0 # noqa: E501 + + :param task_start_at: The task_start_at of this ListUserCouponsResponseDataList. # noqa: E501 + :type: int + """ + + self._task_start_at = task_start_at + + @property + def task_expire_at(self): + """Gets the task_expire_at of this ListUserCouponsResponseDataList. # noqa: E501 + + Task expiration timestamp (Unix). Currently fixed at 0, reserved field # noqa: E501 + + :return: The task_expire_at of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: int + """ + return self._task_expire_at + + @task_expire_at.setter + def task_expire_at(self, task_expire_at): + """Sets the task_expire_at of this ListUserCouponsResponseDataList. + + Task expiration timestamp (Unix). Currently fixed at 0, reserved field # noqa: E501 + + :param task_expire_at: The task_expire_at of this ListUserCouponsResponseDataList. # noqa: E501 + :type: int + """ + + self._task_expire_at = task_expire_at + + @property + def task_completed_at(self): + """Gets the task_completed_at of this ListUserCouponsResponseDataList. # noqa: E501 + + Task completion timestamp (Unix). Currently fixed at 0, reserved field # noqa: E501 + + :return: The task_completed_at of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: int + """ + return self._task_completed_at + + @task_completed_at.setter + def task_completed_at(self, task_completed_at): + """Sets the task_completed_at of this ListUserCouponsResponseDataList. + + Task completion timestamp (Unix). Currently fixed at 0, reserved field # noqa: E501 + + :param task_completed_at: The task_completed_at of this ListUserCouponsResponseDataList. # noqa: E501 + :type: int + """ + + self._task_completed_at = task_completed_at + + @property + def extra(self): + """Gets the extra of this ListUserCouponsResponseDataList. # noqa: E501 + + Extension fields. List endpoint always returns empty array [], only the detail endpoint has values # noqa: E501 + + :return: The extra of this ListUserCouponsResponseDataList. # noqa: E501 + :rtype: list[object] + """ + return self._extra + + @extra.setter + def extra(self, extra): + """Sets the extra of this ListUserCouponsResponseDataList. + + Extension fields. List endpoint always returns empty array [], only the detail endpoint has values # noqa: E501 + + :param extra: The extra of this ListUserCouponsResponseDataList. # noqa: E501 + :type: list[object] + """ + + self._extra = extra + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListUserCouponsResponseDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListUserCouponsResponseDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/list_user_coupons_response_data_progress_config.py b/gate_api/models/list_user_coupons_response_data_progress_config.py new file mode 100644 index 00000000..af60d09e --- /dev/null +++ b/gate_api/models/list_user_coupons_response_data_progress_config.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class ListUserCouponsResponseDataProgressConfig(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'total_balance': 'str', + 'current_used': 'str', + 'current_achived': 'str', + 'currency': 'str' + } + + attribute_map = { + 'total_balance': 'total_balance', + 'current_used': 'current_used', + 'current_achived': 'current_achived', + 'currency': 'currency' + } + + def __init__(self, total_balance=None, current_used=None, current_achived=None, currency=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """ListUserCouponsResponseDataProgressConfig - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._total_balance = None + self._current_used = None + self._current_achived = None + self._currency = None + self.discriminator = None + + if total_balance is not None: + self.total_balance = total_balance + if current_used is not None: + self.current_used = current_used + if current_achived is not None: + self.current_achived = current_achived + if currency is not None: + self.currency = currency + + @property + def total_balance(self): + """Gets the total_balance of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + + Total Required Amount # noqa: E501 + + :return: The total_balance of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + :rtype: str + """ + return self._total_balance + + @total_balance.setter + def total_balance(self, total_balance): + """Sets the total_balance of this ListUserCouponsResponseDataProgressConfig. + + Total Required Amount # noqa: E501 + + :param total_balance: The total_balance of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + :type: str + """ + + self._total_balance = total_balance + + @property + def current_used(self): + """Gets the current_used of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + + Used Amount # noqa: E501 + + :return: The current_used of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + :rtype: str + """ + return self._current_used + + @current_used.setter + def current_used(self, current_used): + """Sets the current_used of this ListUserCouponsResponseDataProgressConfig. + + Used Amount # noqa: E501 + + :param current_used: The current_used of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + :type: str + """ + + self._current_used = current_used + + @property + def current_achived(self): + """Gets the current_achived of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + + Amount achieved (note: field name is spelled as achived) # noqa: E501 + + :return: The current_achived of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + :rtype: str + """ + return self._current_achived + + @current_achived.setter + def current_achived(self, current_achived): + """Sets the current_achived of this ListUserCouponsResponseDataProgressConfig. + + Amount achieved (note: field name is spelled as achived) # noqa: E501 + + :param current_achived: The current_achived of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + :type: str + """ + + self._current_achived = current_achived + + @property + def currency(self): + """Gets the currency of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + + Progress unit (e.g., 'USDT') # noqa: E501 + + :return: The currency of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this ListUserCouponsResponseDataProgressConfig. + + Progress unit (e.g., 'USDT') # noqa: E501 + + :param currency: The currency of this ListUserCouponsResponseDataProgressConfig. # noqa: E501 + :type: str + """ + + self._currency = currency + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListUserCouponsResponseDataProgressConfig): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListUserCouponsResponseDataProgressConfig): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/margin_grid_create_params.py b/gate_api/models/margin_grid_create_params.py new file mode 100644 index 00000000..7298a0fc --- /dev/null +++ b/gate_api/models/margin_grid_create_params.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class MarginGridCreateParams(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'money': 'str', + 'low_price': 'str', + 'high_price': 'str', + 'grid_num': 'int', + 'price_type': 'int', + 'leverage': 'str', + 'direction': 'FuturesDirection', + 'trigger_price': 'str', + 'stop_profit': 'str', + 'stop_loss': 'str', + 'profit_sharing_ratio': 'str', + 'is_use_base': 'bool' + } + + attribute_map = { + 'money': 'money', + 'low_price': 'low_price', + 'high_price': 'high_price', + 'grid_num': 'grid_num', + 'price_type': 'price_type', + 'leverage': 'leverage', + 'direction': 'direction', + 'trigger_price': 'trigger_price', + 'stop_profit': 'stop_profit', + 'stop_loss': 'stop_loss', + 'profit_sharing_ratio': 'profit_sharing_ratio', + 'is_use_base': 'is_use_base' + } + + def __init__(self, money=None, low_price=None, high_price=None, grid_num=None, price_type=None, leverage=None, direction=None, trigger_price=None, stop_profit=None, stop_loss=None, profit_sharing_ratio=None, is_use_base=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, int, str, FuturesDirection, str, str, str, str, bool, Configuration) -> None + """MarginGridCreateParams - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._money = None + self._low_price = None + self._high_price = None + self._grid_num = None + self._price_type = None + self._leverage = None + self._direction = None + self._trigger_price = None + self._stop_profit = None + self._stop_loss = None + self._profit_sharing_ratio = None + self._is_use_base = None + self.discriminator = None + + self.money = money + self.low_price = low_price + self.high_price = high_price + self.grid_num = grid_num + self.price_type = price_type + self.leverage = leverage + if direction is not None: + self.direction = direction + if trigger_price is not None: + self.trigger_price = trigger_price + if stop_profit is not None: + self.stop_profit = stop_profit + if stop_loss is not None: + self.stop_loss = stop_loss + if profit_sharing_ratio is not None: + self.profit_sharing_ratio = profit_sharing_ratio + if is_use_base is not None: + self.is_use_base = is_use_base + + @property + def money(self): + """Gets the money of this MarginGridCreateParams. # noqa: E501 + + + :return: The money of this MarginGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this MarginGridCreateParams. + + + :param money: The money of this MarginGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and money is None: # noqa: E501 + raise ValueError("Invalid value for `money`, must not be `None`") # noqa: E501 + + self._money = money + + @property + def low_price(self): + """Gets the low_price of this MarginGridCreateParams. # noqa: E501 + + + :return: The low_price of this MarginGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._low_price + + @low_price.setter + def low_price(self, low_price): + """Sets the low_price of this MarginGridCreateParams. + + + :param low_price: The low_price of this MarginGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and low_price is None: # noqa: E501 + raise ValueError("Invalid value for `low_price`, must not be `None`") # noqa: E501 + + self._low_price = low_price + + @property + def high_price(self): + """Gets the high_price of this MarginGridCreateParams. # noqa: E501 + + + :return: The high_price of this MarginGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._high_price + + @high_price.setter + def high_price(self, high_price): + """Sets the high_price of this MarginGridCreateParams. + + + :param high_price: The high_price of this MarginGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and high_price is None: # noqa: E501 + raise ValueError("Invalid value for `high_price`, must not be `None`") # noqa: E501 + + self._high_price = high_price + + @property + def grid_num(self): + """Gets the grid_num of this MarginGridCreateParams. # noqa: E501 + + + :return: The grid_num of this MarginGridCreateParams. # noqa: E501 + :rtype: int + """ + return self._grid_num + + @grid_num.setter + def grid_num(self, grid_num): + """Sets the grid_num of this MarginGridCreateParams. + + + :param grid_num: The grid_num of this MarginGridCreateParams. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and grid_num is None: # noqa: E501 + raise ValueError("Invalid value for `grid_num`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + grid_num is not None and grid_num < 1): # noqa: E501 + raise ValueError("Invalid value for `grid_num`, must be a value greater than or equal to `1`") # noqa: E501 + + self._grid_num = grid_num + + @property + def price_type(self): + """Gets the price_type of this MarginGridCreateParams. # noqa: E501 + + + :return: The price_type of this MarginGridCreateParams. # noqa: E501 + :rtype: int + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this MarginGridCreateParams. + + + :param price_type: The price_type of this MarginGridCreateParams. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and price_type is None: # noqa: E501 + raise ValueError("Invalid value for `price_type`, must not be `None`") # noqa: E501 + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def leverage(self): + """Gets the leverage of this MarginGridCreateParams. # noqa: E501 + + + :return: The leverage of this MarginGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this MarginGridCreateParams. + + + :param leverage: The leverage of this MarginGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and leverage is None: # noqa: E501 + raise ValueError("Invalid value for `leverage`, must not be `None`") # noqa: E501 + + self._leverage = leverage + + @property + def direction(self): + """Gets the direction of this MarginGridCreateParams. # noqa: E501 + + + :return: The direction of this MarginGridCreateParams. # noqa: E501 + :rtype: FuturesDirection + """ + return self._direction + + @direction.setter + def direction(self, direction): + """Sets the direction of this MarginGridCreateParams. + + + :param direction: The direction of this MarginGridCreateParams. # noqa: E501 + :type: FuturesDirection + """ + + self._direction = direction + + @property + def trigger_price(self): + """Gets the trigger_price of this MarginGridCreateParams. # noqa: E501 + + + :return: The trigger_price of this MarginGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this MarginGridCreateParams. + + + :param trigger_price: The trigger_price of this MarginGridCreateParams. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def stop_profit(self): + """Gets the stop_profit of this MarginGridCreateParams. # noqa: E501 + + + :return: The stop_profit of this MarginGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._stop_profit + + @stop_profit.setter + def stop_profit(self, stop_profit): + """Sets the stop_profit of this MarginGridCreateParams. + + + :param stop_profit: The stop_profit of this MarginGridCreateParams. # noqa: E501 + :type: str + """ + + self._stop_profit = stop_profit + + @property + def stop_loss(self): + """Gets the stop_loss of this MarginGridCreateParams. # noqa: E501 + + + :return: The stop_loss of this MarginGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._stop_loss + + @stop_loss.setter + def stop_loss(self, stop_loss): + """Sets the stop_loss of this MarginGridCreateParams. + + + :param stop_loss: The stop_loss of this MarginGridCreateParams. # noqa: E501 + :type: str + """ + + self._stop_loss = stop_loss + + @property + def profit_sharing_ratio(self): + """Gets the profit_sharing_ratio of this MarginGridCreateParams. # noqa: E501 + + + :return: The profit_sharing_ratio of this MarginGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._profit_sharing_ratio + + @profit_sharing_ratio.setter + def profit_sharing_ratio(self, profit_sharing_ratio): + """Sets the profit_sharing_ratio of this MarginGridCreateParams. + + + :param profit_sharing_ratio: The profit_sharing_ratio of this MarginGridCreateParams. # noqa: E501 + :type: str + """ + + self._profit_sharing_ratio = profit_sharing_ratio + + @property + def is_use_base(self): + """Gets the is_use_base of this MarginGridCreateParams. # noqa: E501 + + + :return: The is_use_base of this MarginGridCreateParams. # noqa: E501 + :rtype: bool + """ + return self._is_use_base + + @is_use_base.setter + def is_use_base(self, is_use_base): + """Sets the is_use_base of this MarginGridCreateParams. + + + :param is_use_base: The is_use_base of this MarginGridCreateParams. # noqa: E501 + :type: bool + """ + + self._is_use_base = is_use_base + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MarginGridCreateParams): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MarginGridCreateParams): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/margin_grid_create_request.py b/gate_api/models/margin_grid_create_request.py new file mode 100644 index 00000000..14914924 --- /dev/null +++ b/gate_api/models/margin_grid_create_request.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class MarginGridCreateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_type': 'str', + 'market': 'str', + 'create_params': 'MarginGridCreateParams' + } + + attribute_map = { + 'strategy_type': 'strategy_type', + 'market': 'market', + 'create_params': 'create_params' + } + + def __init__(self, strategy_type=None, market=None, create_params=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, MarginGridCreateParams, Configuration) -> None + """MarginGridCreateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_type = None + self._market = None + self._create_params = None + self.discriminator = None + + self.strategy_type = strategy_type + self.market = market + self.create_params = create_params + + @property + def strategy_type(self): + """Gets the strategy_type of this MarginGridCreateRequest. # noqa: E501 + + + :return: The strategy_type of this MarginGridCreateRequest. # noqa: E501 + :rtype: str + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this MarginGridCreateRequest. + + + :param strategy_type: The strategy_type of this MarginGridCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + allowed_values = ["margin_grid"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and strategy_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `strategy_type` ({0}), must be one of {1}" # noqa: E501 + .format(strategy_type, allowed_values) + ) + + self._strategy_type = strategy_type + + @property + def market(self): + """Gets the market of this MarginGridCreateRequest. # noqa: E501 + + + :return: The market of this MarginGridCreateRequest. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this MarginGridCreateRequest. + + + :param market: The market of this MarginGridCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def create_params(self): + """Gets the create_params of this MarginGridCreateRequest. # noqa: E501 + + + :return: The create_params of this MarginGridCreateRequest. # noqa: E501 + :rtype: MarginGridCreateParams + """ + return self._create_params + + @create_params.setter + def create_params(self, create_params): + """Sets the create_params of this MarginGridCreateRequest. + + + :param create_params: The create_params of this MarginGridCreateRequest. # noqa: E501 + :type: MarginGridCreateParams + """ + if self.local_vars_configuration.client_side_validation and create_params is None: # noqa: E501 + raise ValueError("Invalid value for `create_params`, must not be `None`") # noqa: E501 + + self._create_params = create_params + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MarginGridCreateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MarginGridCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/margin_market_leverage.py b/gate_api/models/margin_market_leverage.py index f0240103..6b91dff5 100644 --- a/gate_api/models/margin_market_leverage.py +++ b/gate_api/models/margin_market_leverage.py @@ -84,7 +84,7 @@ def currency_pair(self, currency_pair): def leverage(self): """Gets the leverage of this MarginMarketLeverage. # noqa: E501 - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :return: The leverage of this MarginMarketLeverage. # noqa: E501 :rtype: str @@ -95,7 +95,7 @@ def leverage(self): def leverage(self, leverage): """Sets the leverage of this MarginMarketLeverage. - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :param leverage: The leverage of this MarginMarketLeverage. # noqa: E501 :type: str diff --git a/gate_api/models/margin_tiers.py b/gate_api/models/margin_tiers.py index a1bb5e76..9ba7ba95 100644 --- a/gate_api/models/margin_tiers.py +++ b/gate_api/models/margin_tiers.py @@ -146,7 +146,7 @@ def lower_limit(self, lower_limit): def upper_limit(self): """Gets the upper_limit of this MarginTiers. # noqa: E501 - Upper limit, \"\" indicates greater than (the last tier) # noqa: E501 + Upper limit, `` indicates greater than (the last tier) # noqa: E501 :return: The upper_limit of this MarginTiers. # noqa: E501 :rtype: str @@ -157,7 +157,7 @@ def upper_limit(self): def upper_limit(self, upper_limit): """Sets the upper_limit of this MarginTiers. - Upper limit, \"\" indicates greater than (the last tier) # noqa: E501 + Upper limit, `` indicates greater than (the last tier) # noqa: E501 :param upper_limit: The upper_limit of this MarginTiers. # noqa: E501 :type: str @@ -169,7 +169,7 @@ def upper_limit(self, upper_limit): def leverage(self): """Gets the leverage of this MarginTiers. # noqa: E501 - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :return: The leverage of this MarginTiers. # noqa: E501 :rtype: str @@ -180,7 +180,7 @@ def leverage(self): def leverage(self, leverage): """Sets the leverage of this MarginTiers. - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :param leverage: The leverage of this MarginTiers. # noqa: E501 :type: str diff --git a/gate_api/models/mock_futures_order.py b/gate_api/models/mock_futures_order.py index 3adadb8f..55975337 100644 --- a/gate_api/models/mock_futures_order.py +++ b/gate_api/models/mock_futures_order.py @@ -64,7 +64,7 @@ def __init__(self, contract=None, size=None, left=None, local_vars_configuration def contract(self): """Gets the contract of this MockFuturesOrder. # noqa: E501 - Futures name, currently only supports USDT perpetual contracts for BTC and ETH # noqa: E501 + Perpetual contract name. Only USDT perpetual contracts for underlying currencies with active options trading are supported. # noqa: E501 :return: The contract of this MockFuturesOrder. # noqa: E501 :rtype: str @@ -75,7 +75,7 @@ def contract(self): def contract(self, contract): """Sets the contract of this MockFuturesOrder. - Futures name, currently only supports USDT perpetual contracts for BTC and ETH # noqa: E501 + Perpetual contract name. Only USDT perpetual contracts for underlying currencies with active options trading are supported. # noqa: E501 :param contract: The contract of this MockFuturesOrder. # noqa: E501 :type: str diff --git a/gate_api/models/mock_futures_position.py b/gate_api/models/mock_futures_position.py index 158c6a75..b882b1de 100644 --- a/gate_api/models/mock_futures_position.py +++ b/gate_api/models/mock_futures_position.py @@ -60,7 +60,7 @@ def __init__(self, contract=None, size=None, local_vars_configuration=None): # def contract(self): """Gets the contract of this MockFuturesPosition. # noqa: E501 - Futures name, currently only supports USDT perpetual contracts for BTC and ETH # noqa: E501 + Perpetual contract name. Only USDT perpetual contracts for underlying currencies with active options trading are supported. # noqa: E501 :return: The contract of this MockFuturesPosition. # noqa: E501 :rtype: str @@ -71,7 +71,7 @@ def contract(self): def contract(self, contract): """Sets the contract of this MockFuturesPosition. - Futures name, currently only supports USDT perpetual contracts for BTC and ETH # noqa: E501 + Perpetual contract name. Only USDT perpetual contracts for underlying currencies with active options trading are supported. # noqa: E501 :param contract: The contract of this MockFuturesPosition. # noqa: E501 :type: str diff --git a/gate_api/models/mock_options_order.py b/gate_api/models/mock_options_order.py index 7a5193c9..ad7227a8 100644 --- a/gate_api/models/mock_options_order.py +++ b/gate_api/models/mock_options_order.py @@ -64,7 +64,7 @@ def __init__(self, options_name=None, size=None, left=None, local_vars_configura def options_name(self): """Gets the options_name of this MockOptionsOrder. # noqa: E501 - Option name, currently only supports USDT options for BTC and ETH # noqa: E501 + Options contract name. Currently supports all options contract markets. # noqa: E501 :return: The options_name of this MockOptionsOrder. # noqa: E501 :rtype: str @@ -75,7 +75,7 @@ def options_name(self): def options_name(self, options_name): """Sets the options_name of this MockOptionsOrder. - Option name, currently only supports USDT options for BTC and ETH # noqa: E501 + Options contract name. Currently supports all options contract markets. # noqa: E501 :param options_name: The options_name of this MockOptionsOrder. # noqa: E501 :type: str diff --git a/gate_api/models/mock_options_position.py b/gate_api/models/mock_options_position.py index 3d274367..8972d078 100644 --- a/gate_api/models/mock_options_position.py +++ b/gate_api/models/mock_options_position.py @@ -60,7 +60,7 @@ def __init__(self, options_name=None, size=None, local_vars_configuration=None): def options_name(self): """Gets the options_name of this MockOptionsPosition. # noqa: E501 - Option name, currently only supports USDT options for BTC and ETH # noqa: E501 + Options contract name. Currently supports all options contract markets. # noqa: E501 :return: The options_name of this MockOptionsPosition. # noqa: E501 :rtype: str @@ -71,7 +71,7 @@ def options_name(self): def options_name(self, options_name): """Sets the options_name of this MockOptionsPosition. - Option name, currently only supports USDT options for BTC and ETH # noqa: E501 + Options contract name. Currently supports all options contract markets. # noqa: E501 :param options_name: The options_name of this MockOptionsPosition. # noqa: E501 :type: str diff --git a/gate_api/models/mock_spot_balance.py b/gate_api/models/mock_spot_balance.py index 721cf0b7..7e5fc527 100644 --- a/gate_api/models/mock_spot_balance.py +++ b/gate_api/models/mock_spot_balance.py @@ -85,7 +85,7 @@ def currency(self, currency): def equity(self): """Gets the equity of this MockSpotBalance. # noqa: E501 - Currency equity, where equity = balance - borrowed, represents the net delta exposure of your spot positions, which can be negative. Currently only supports BTC and ETH # noqa: E501 + Currency equity, where equity = balance - borrowed, represents the net delta exposure of your spot positions # noqa: E501 :return: The equity of this MockSpotBalance. # noqa: E501 :rtype: str @@ -96,7 +96,7 @@ def equity(self): def equity(self, equity): """Sets the equity of this MockSpotBalance. - Currency equity, where equity = balance - borrowed, represents the net delta exposure of your spot positions, which can be negative. Currently only supports BTC and ETH # noqa: E501 + Currency equity, where equity = balance - borrowed, represents the net delta exposure of your spot positions # noqa: E501 :param equity: The equity of this MockSpotBalance. # noqa: E501 :type: str diff --git a/gate_api/models/mock_spot_order.py b/gate_api/models/mock_spot_order.py index d8f70cbb..89f567d4 100644 --- a/gate_api/models/mock_spot_order.py +++ b/gate_api/models/mock_spot_order.py @@ -123,7 +123,7 @@ def order_price(self, order_price): def count(self): """Gets the count of this MockSpotOrder. # noqa: E501 - Initial order quantity for spot trading pairs, not involved in actual calculation. Currently only supports BTC and ETH Currently only supports three currencies: BTC, ETH # noqa: E501 + Initial order quantity for spot trading pairs, not involved in actual calculation. # noqa: E501 :return: The count of this MockSpotOrder. # noqa: E501 :rtype: str @@ -134,7 +134,7 @@ def count(self): def count(self, count): """Sets the count of this MockSpotOrder. - Initial order quantity for spot trading pairs, not involved in actual calculation. Currently only supports BTC and ETH Currently only supports three currencies: BTC, ETH # noqa: E501 + Initial order quantity for spot trading pairs, not involved in actual calculation. # noqa: E501 :param count: The count of this MockSpotOrder. # noqa: E501 :type: str diff --git a/gate_api/models/mt5_account.py b/gate_api/models/mt5_account.py new file mode 100644 index 00000000..f836a78f --- /dev/null +++ b/gate_api/models/mt5_account.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Mt5Account(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'timestamp': 'int', + 'data': 'Mt5AccountData' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, code=None, message=None, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, int, Mt5AccountData, Configuration) -> None + """Mt5Account - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._timestamp = None + self._data = None + self.discriminator = None + + if code is not None: + self.code = code + if message is not None: + self.message = message + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def code(self): + """Gets the code of this Mt5Account. # noqa: E501 + + Business Status Code; Non-zero Indicates Business Exception, Please Check Message # noqa: E501 + + :return: The code of this Mt5Account. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this Mt5Account. + + Business Status Code; Non-zero Indicates Business Exception, Please Check Message # noqa: E501 + + :param code: The code of this Mt5Account. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this Mt5Account. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this Mt5Account. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this Mt5Account. + + Response message # noqa: E501 + + :param message: The message of this Mt5Account. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def timestamp(self): + """Gets the timestamp of this Mt5Account. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this Mt5Account. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this Mt5Account. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this Mt5Account. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this Mt5Account. # noqa: E501 + + + :return: The data of this Mt5Account. # noqa: E501 + :rtype: Mt5AccountData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this Mt5Account. + + + :param data: The data of this Mt5Account. # noqa: E501 + :type: Mt5AccountData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Mt5Account): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Mt5Account): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/mt5_account_data.py b/gate_api/models/mt5_account_data.py new file mode 100644 index 00000000..23e36172 --- /dev/null +++ b/gate_api/models/mt5_account_data.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Mt5AccountData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'mt5_uid': 'int', + 'leverage': 'int', + 'stop_out_level': 'str', + 'status': 'int' + } + + attribute_map = { + 'mt5_uid': 'mt5_uid', + 'leverage': 'leverage', + 'stop_out_level': 'stop_out_level', + 'status': 'status' + } + + def __init__(self, mt5_uid=None, leverage=None, stop_out_level=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, int, Configuration) -> None + """Mt5AccountData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._mt5_uid = None + self._leverage = None + self._stop_out_level = None + self._status = None + self.discriminator = None + + if mt5_uid is not None: + self.mt5_uid = mt5_uid + if leverage is not None: + self.leverage = leverage + if stop_out_level is not None: + self.stop_out_level = stop_out_level + if status is not None: + self.status = status + + @property + def mt5_uid(self): + """Gets the mt5_uid of this Mt5AccountData. # noqa: E501 + + MT5 userID # noqa: E501 + + :return: The mt5_uid of this Mt5AccountData. # noqa: E501 + :rtype: int + """ + return self._mt5_uid + + @mt5_uid.setter + def mt5_uid(self, mt5_uid): + """Sets the mt5_uid of this Mt5AccountData. + + MT5 userID # noqa: E501 + + :param mt5_uid: The mt5_uid of this Mt5AccountData. # noqa: E501 + :type: int + """ + + self._mt5_uid = mt5_uid + + @property + def leverage(self): + """Gets the leverage of this Mt5AccountData. # noqa: E501 + + Leverage multiplier # noqa: E501 + + :return: The leverage of this Mt5AccountData. # noqa: E501 + :rtype: int + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this Mt5AccountData. + + Leverage multiplier # noqa: E501 + + :param leverage: The leverage of this Mt5AccountData. # noqa: E501 + :type: int + """ + + self._leverage = leverage + + @property + def stop_out_level(self): + """Gets the stop_out_level of this Mt5AccountData. # noqa: E501 + + Liquidation margin ratio # noqa: E501 + + :return: The stop_out_level of this Mt5AccountData. # noqa: E501 + :rtype: str + """ + return self._stop_out_level + + @stop_out_level.setter + def stop_out_level(self, stop_out_level): + """Sets the stop_out_level of this Mt5AccountData. + + Liquidation margin ratio # noqa: E501 + + :param stop_out_level: The stop_out_level of this Mt5AccountData. # noqa: E501 + :type: str + """ + + self._stop_out_level = stop_out_level + + @property + def status(self): + """Gets the status of this Mt5AccountData. # noqa: E501 + + Account status (1=not opened, 2=pending review, 3=active) # noqa: E501 + + :return: The status of this Mt5AccountData. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Mt5AccountData. + + Account status (1=not opened, 2=pending review, 3=active) # noqa: E501 + + :param status: The status of this Mt5AccountData. # noqa: E501 + :type: int + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Mt5AccountData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Mt5AccountData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/my_ads_list_request.py b/gate_api/models/my_ads_list_request.py new file mode 100644 index 00000000..5397e742 --- /dev/null +++ b/gate_api/models/my_ads_list_request.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class MyAdsListRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'fiat_unit': 'str', + 'trade_type': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'fiat_unit': 'fiat_unit', + 'trade_type': 'trade_type' + } + + def __init__(self, asset=None, fiat_unit=None, trade_type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """MyAdsListRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._fiat_unit = None + self._trade_type = None + self.discriminator = None + + if asset is not None: + self.asset = asset + if fiat_unit is not None: + self.fiat_unit = fiat_unit + if trade_type is not None: + self.trade_type = trade_type + + @property + def asset(self): + """Gets the asset of this MyAdsListRequest. # noqa: E501 + + Crypto asset; omit to skip asset filter. # noqa: E501 + + :return: The asset of this MyAdsListRequest. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this MyAdsListRequest. + + Crypto asset; omit to skip asset filter. # noqa: E501 + + :param asset: The asset of this MyAdsListRequest. # noqa: E501 + :type: str + """ + + self._asset = asset + + @property + def fiat_unit(self): + """Gets the fiat_unit of this MyAdsListRequest. # noqa: E501 + + Fiat currency; omit to skip fiat filter. # noqa: E501 + + :return: The fiat_unit of this MyAdsListRequest. # noqa: E501 + :rtype: str + """ + return self._fiat_unit + + @fiat_unit.setter + def fiat_unit(self, fiat_unit): + """Sets the fiat_unit of this MyAdsListRequest. + + Fiat currency; omit to skip fiat filter. # noqa: E501 + + :param fiat_unit: The fiat_unit of this MyAdsListRequest. # noqa: E501 + :type: str + """ + + self._fiat_unit = fiat_unit + + @property + def trade_type(self): + """Gets the trade_type of this MyAdsListRequest. # noqa: E501 + + Ad side: `buy` for buy-crypto ads, `sell` for sell-crypto ads; omit for all sides. # noqa: E501 + + :return: The trade_type of this MyAdsListRequest. # noqa: E501 + :rtype: str + """ + return self._trade_type + + @trade_type.setter + def trade_type(self, trade_type): + """Sets the trade_type of this MyAdsListRequest. + + Ad side: `buy` for buy-crypto ads, `sell` for sell-crypto ads; omit for all sides. # noqa: E501 + + :param trade_type: The trade_type of this MyAdsListRequest. # noqa: E501 + :type: str + """ + + self._trade_type = trade_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MyAdsListRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MyAdsListRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/options_account.py b/gate_api/models/options_account.py index 9226c755..b018d0c9 100644 --- a/gate_api/models/options_account.py +++ b/gate_api/models/options_account.py @@ -308,7 +308,7 @@ def liq_triggered(self, liq_triggered): def margin_mode(self): """Gets the margin_mode of this OptionsAccount. # noqa: E501 - 此字段表示统一账户所使用的保证金模式: - 0:经典现货保证金模式 - 1:跨币种保证金模式 - 2:组合保证金模式 - 3: 表示为单币种保证金模式 # noqa: E501 + This field indicates the margin mode used by the unified account: - 0: Classic Spot Margin Mode - 1: Cross-Currency Margin Mode - 2: Portfolio Margin Mode - 3: Single-Currency Margin Mode # noqa: E501 :return: The margin_mode of this OptionsAccount. # noqa: E501 :rtype: int @@ -319,7 +319,7 @@ def margin_mode(self): def margin_mode(self, margin_mode): """Sets the margin_mode of this OptionsAccount. - 此字段表示统一账户所使用的保证金模式: - 0:经典现货保证金模式 - 1:跨币种保证金模式 - 2:组合保证金模式 - 3: 表示为单币种保证金模式 # noqa: E501 + This field indicates the margin mode used by the unified account: - 0: Classic Spot Margin Mode - 1: Cross-Currency Margin Mode - 2: Portfolio Margin Mode - 3: Single-Currency Margin Mode # noqa: E501 :param margin_mode: The margin_mode of this OptionsAccount. # noqa: E501 :type: int diff --git a/gate_api/models/options_contract.py b/gate_api/models/options_contract.py index b3233296..0aae5c2c 100644 --- a/gate_api/models/options_contract.py +++ b/gate_api/models/options_contract.py @@ -522,7 +522,7 @@ def mark_price_round(self, mark_price_round): def order_size_min(self): """Gets the order_size_min of this OptionsContract. # noqa: E501 - Minimum order size allowed by the contract # noqa: E501 + Minimum order quantity # noqa: E501 :return: The order_size_min of this OptionsContract. # noqa: E501 :rtype: int @@ -533,7 +533,7 @@ def order_size_min(self): def order_size_min(self, order_size_min): """Sets the order_size_min of this OptionsContract. - Minimum order size allowed by the contract # noqa: E501 + Minimum order quantity # noqa: E501 :param order_size_min: The order_size_min of this OptionsContract. # noqa: E501 :type: int @@ -545,7 +545,7 @@ def order_size_min(self, order_size_min): def order_size_max(self): """Gets the order_size_max of this OptionsContract. # noqa: E501 - Maximum order size allowed by the contract # noqa: E501 + Maximum order quantity # noqa: E501 :return: The order_size_max of this OptionsContract. # noqa: E501 :rtype: int @@ -556,7 +556,7 @@ def order_size_max(self): def order_size_max(self, order_size_max): """Sets the order_size_max of this OptionsContract. - Maximum order size allowed by the contract # noqa: E501 + Maximum order quantity # noqa: E501 :param order_size_max: The order_size_max of this OptionsContract. # noqa: E501 :type: int diff --git a/gate_api/models/options_order_book.py b/gate_api/models/options_order_book.py index b23a917d..3cd0338f 100644 --- a/gate_api/models/options_order_book.py +++ b/gate_api/models/options_order_book.py @@ -36,8 +36,8 @@ class OptionsOrderBook(object): 'id': 'int', 'current': 'float', 'update': 'float', - 'asks': 'list[FuturesOrderBookItem1]', - 'bids': 'list[FuturesOrderBookItem1]' + 'asks': 'list[DeliveryOrderBookItem]', + 'bids': 'list[DeliveryOrderBookItem]' } attribute_map = { @@ -49,7 +49,7 @@ class OptionsOrderBook(object): } def __init__(self, id=None, current=None, update=None, asks=None, bids=None, local_vars_configuration=None): # noqa: E501 - # type: (int, float, float, list[FuturesOrderBookItem1], list[FuturesOrderBookItem1], Configuration) -> None + # type: (int, float, float, list[DeliveryOrderBookItem], list[DeliveryOrderBookItem], Configuration) -> None """OptionsOrderBook - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -147,7 +147,7 @@ def asks(self): Ask Depth # noqa: E501 :return: The asks of this OptionsOrderBook. # noqa: E501 - :rtype: list[FuturesOrderBookItem1] + :rtype: list[DeliveryOrderBookItem] """ return self._asks @@ -158,7 +158,7 @@ def asks(self, asks): Ask Depth # noqa: E501 :param asks: The asks of this OptionsOrderBook. # noqa: E501 - :type: list[FuturesOrderBookItem1] + :type: list[DeliveryOrderBookItem] """ if self.local_vars_configuration.client_side_validation and asks is None: # noqa: E501 raise ValueError("Invalid value for `asks`, must not be `None`") # noqa: E501 @@ -172,7 +172,7 @@ def bids(self): Bid Depth # noqa: E501 :return: The bids of this OptionsOrderBook. # noqa: E501 - :rtype: list[FuturesOrderBookItem1] + :rtype: list[DeliveryOrderBookItem] """ return self._bids @@ -183,7 +183,7 @@ def bids(self, bids): Bid Depth # noqa: E501 :param bids: The bids of this OptionsOrderBook. # noqa: E501 - :type: list[FuturesOrderBookItem1] + :type: list[DeliveryOrderBookItem] """ if self.local_vars_configuration.client_side_validation and bids is None: # noqa: E501 raise ValueError("Invalid value for `bids`, must not be `None`") # noqa: E501 diff --git a/gate_api/models/order.py b/gate_api/models/order.py index 1cd4210e..2d116060 100644 --- a/gate_api/models/order.py +++ b/gate_api/models/order.py @@ -69,7 +69,9 @@ class Order(object): 'stp_act': 'str', 'finish_as': 'str', 'action_mode': 'str', - 'slippage': 'str' + 'slippage': 'str', + 'stop_profit': 'SpotOrderStopProfit', + 'stop_loss': 'SpotOrderStopLoss' } attribute_map = { @@ -109,11 +111,13 @@ class Order(object): 'stp_act': 'stp_act', 'finish_as': 'finish_as', 'action_mode': 'action_mode', - 'slippage': 'slippage' + 'slippage': 'slippage', + 'stop_profit': 'stop_profit', + 'stop_loss': 'stop_loss' } - def __init__(self, id=None, text=None, amend_text=None, create_time=None, update_time=None, create_time_ms=None, update_time_ms=None, status=None, currency_pair=None, type='limit', account='spot', side=None, amount=None, price=None, time_in_force='gtc', iceberg=None, auto_borrow=None, auto_repay=None, left=None, filled_amount=None, fill_price=None, filled_total=None, avg_deal_price=None, fee=None, fee_currency=None, point_fee=None, gt_fee=None, gt_maker_fee=None, gt_taker_fee=None, gt_discount=None, rebated_fee=None, rebated_fee_currency=None, stp_id=None, stp_act=None, finish_as=None, action_mode=None, slippage=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, int, int, str, str, str, str, str, str, str, str, str, bool, bool, str, str, str, str, str, str, str, str, str, str, str, bool, str, str, int, str, str, str, str, Configuration) -> None + def __init__(self, id=None, text=None, amend_text=None, create_time=None, update_time=None, create_time_ms=None, update_time_ms=None, status=None, currency_pair=None, type='limit', account='spot', side=None, amount=None, price=None, time_in_force='gtc', iceberg=None, auto_borrow=None, auto_repay=None, left=None, filled_amount=None, fill_price=None, filled_total=None, avg_deal_price=None, fee=None, fee_currency=None, point_fee=None, gt_fee=None, gt_maker_fee=None, gt_taker_fee=None, gt_discount=None, rebated_fee=None, rebated_fee_currency=None, stp_id=None, stp_act=None, finish_as=None, action_mode=None, slippage=None, stop_profit=None, stop_loss=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, int, int, str, str, str, str, str, str, str, str, str, bool, bool, str, str, str, str, str, str, str, str, str, str, str, bool, str, str, int, str, str, str, str, SpotOrderStopProfit, SpotOrderStopLoss, Configuration) -> None """Order - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -156,6 +160,8 @@ def __init__(self, id=None, text=None, amend_text=None, create_time=None, update self._finish_as = None self._action_mode = None self._slippage = None + self._stop_profit = None + self._stop_loss = None self.discriminator = None if id is not None: @@ -229,6 +235,10 @@ def __init__(self, id=None, text=None, amend_text=None, create_time=None, update self.action_mode = action_mode if slippage is not None: self.slippage = slippage + if stop_profit is not None: + self.stop_profit = stop_profit + if stop_loss is not None: + self.stop_loss = stop_loss @property def id(self): @@ -257,7 +267,7 @@ def id(self, id): def text(self): """Gets the text of this Order. # noqa: E501 - User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 # noqa: E501 + User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 pm_liquidate, comb_margin_liquidate, and scm_liquidate represent cross-margin liquidation orders liquidate represents isolated-margin liquidation orders # noqa: E501 :return: The text of this Order. # noqa: E501 :rtype: str @@ -268,7 +278,7 @@ def text(self): def text(self, text): """Sets the text of this Order. - User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 # noqa: E501 + User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 pm_liquidate, comb_margin_liquidate, and scm_liquidate represent cross-margin liquidation orders liquidate represents isolated-margin liquidation orders # noqa: E501 :param text: The text of this Order. # noqa: E501 :type: str @@ -395,7 +405,7 @@ def update_time_ms(self, update_time_ms): def status(self): """Gets the status of this Order. # noqa: E501 - Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled # noqa: E501 + Order status - `open`: to be filled - `closed`: closed order - `cancelled`: cancelled # noqa: E501 :return: The status of this Order. # noqa: E501 :rtype: str @@ -406,7 +416,7 @@ def status(self): def status(self, status): """Sets the status of this Order. - Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled # noqa: E501 + Order status - `open`: to be filled - `closed`: closed order - `cancelled`: cancelled # noqa: E501 :param status: The status of this Order. # noqa: E501 :type: str @@ -532,7 +542,7 @@ def side(self, side): def amount(self): """Gets the amount of this Order. # noqa: E501 - Trading quantity When `type` is `limit`, it refers to the base currency (the currency being traded), such as `BTC` in `BTC_USDT` When `type` is `market`, it refers to different currencies based on the side: - `side`: `buy` refers to quote currency, `BTC_USDT` means `USDT` - `side`: `sell` refers to base currency, `BTC_USDT` means `BTC` # noqa: E501 + Trade amount When `type` is `limit`, this is the base currency to trade (the currency being bought or sold), e.g. `BTC` in `BTC_USDT`. When `type` is `market`, the meaning depends on the side: - `side`: `buy` refers to the quote currency, e.g. `USDT` in `BTC_USDT` - `side`: `sell` refers to the base currency, e.g. `BTC` in `BTC_USDT` # noqa: E501 :return: The amount of this Order. # noqa: E501 :rtype: str @@ -543,7 +553,7 @@ def amount(self): def amount(self, amount): """Sets the amount of this Order. - Trading quantity When `type` is `limit`, it refers to the base currency (the currency being traded), such as `BTC` in `BTC_USDT` When `type` is `market`, it refers to different currencies based on the side: - `side`: `buy` refers to quote currency, `BTC_USDT` means `USDT` - `side`: `sell` refers to base currency, `BTC_USDT` means `BTC` # noqa: E501 + Trade amount When `type` is `limit`, this is the base currency to trade (the currency being bought or sold), e.g. `BTC` in `BTC_USDT`. When `type` is `market`, the meaning depends on the side: - `side`: `buy` refers to the quote currency, e.g. `USDT` in `BTC_USDT` - `side`: `sell` refers to the base currency, e.g. `BTC` in `BTC_USDT` # noqa: E501 :param amount: The amount of this Order. # noqa: E501 :type: str @@ -1052,7 +1062,7 @@ def stp_act(self, stp_act): def finish_as(self): """Gets the finish_as of this Order. # noqa: E501 - Order completion statuses include: - open: Awaiting processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled due to liquidation - small: Order quantity too small - depth_not_enough: Cancelled due to insufficient market depth - trader_not_enough: Cancelled due to insufficient counterparty - ioc: Not immediately filled because tif is set to ioc - poc: Not met the order poc - fok: Not fully filled immediately because tif is set to fok - stp: Cancelled due to self-trade prevention - unknown: Unknown # noqa: E501 + How the order finished: - open: Pending processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled by liquidation - small: Order size too small - depth_not_enough: Cancelled due to insufficient order book depth - trader_not_enough: Cancelled due to insufficient counterparty liquidity - ioc: Not filled immediately because time-in-force is IOC - poc: Post-only requirement not met because time-in-force is set to poc (maker-only); rejected after being detected as taker - fok: Not fully filled immediately because time-in-force is FOK - stp: Cancelled due to self-trade prevention - price_protect_cancelled: Cancelled due to price protection - unknown: Unknown # noqa: E501 :return: The finish_as of this Order. # noqa: E501 :rtype: str @@ -1063,12 +1073,12 @@ def finish_as(self): def finish_as(self, finish_as): """Sets the finish_as of this Order. - Order completion statuses include: - open: Awaiting processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled due to liquidation - small: Order quantity too small - depth_not_enough: Cancelled due to insufficient market depth - trader_not_enough: Cancelled due to insufficient counterparty - ioc: Not immediately filled because tif is set to ioc - poc: Not met the order poc - fok: Not fully filled immediately because tif is set to fok - stp: Cancelled due to self-trade prevention - unknown: Unknown # noqa: E501 + How the order finished: - open: Pending processing - filled: Fully filled - cancelled: Cancelled by user - liquidate_cancelled: Cancelled by liquidation - small: Order size too small - depth_not_enough: Cancelled due to insufficient order book depth - trader_not_enough: Cancelled due to insufficient counterparty liquidity - ioc: Not filled immediately because time-in-force is IOC - poc: Post-only requirement not met because time-in-force is set to poc (maker-only); rejected after being detected as taker - fok: Not fully filled immediately because time-in-force is FOK - stp: Cancelled due to self-trade prevention - price_protect_cancelled: Cancelled due to price protection - unknown: Unknown # noqa: E501 :param finish_as: The finish_as of this Order. # noqa: E501 :type: str """ - allowed_values = ["open", "filled", "cancelled", "liquidate_cancelled", "depth_not_enough", "trader_not_enough", "small", "ioc", "poc", "fok", "stp", "unknown"] # noqa: E501 + allowed_values = ["open", "filled", "cancelled", "liquidate_cancelled", "depth_not_enough", "trader_not_enough", "small", "ioc", "poc", "fok", "stp", "price_protect_cancelled", "unknown"] # noqa: E501 if self.local_vars_configuration.client_side_validation and finish_as not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `finish_as` ({0}), must be one of {1}" # noqa: E501 @@ -1104,7 +1114,7 @@ def action_mode(self, action_mode): def slippage(self): """Gets the slippage of this Order. # noqa: E501 - Slippage, default limit range 0.0001-0.05, converted to percentage is 0.01%-5%, indicating the acceptable price difference for market order transactions # noqa: E501 + Maximum supported slippage ratio for Spot Market Order Placement, calculated based on the latest market price at the time of order placement as the benchmark (Example: 0.03 means 3%) # noqa: E501 :return: The slippage of this Order. # noqa: E501 :rtype: str @@ -1115,7 +1125,7 @@ def slippage(self): def slippage(self, slippage): """Sets the slippage of this Order. - Slippage, default limit range 0.0001-0.05, converted to percentage is 0.01%-5%, indicating the acceptable price difference for market order transactions # noqa: E501 + Maximum supported slippage ratio for Spot Market Order Placement, calculated based on the latest market price at the time of order placement as the benchmark (Example: 0.03 means 3%) # noqa: E501 :param slippage: The slippage of this Order. # noqa: E501 :type: str @@ -1123,6 +1133,48 @@ def slippage(self, slippage): self._slippage = slippage + @property + def stop_profit(self): + """Gets the stop_profit of this Order. # noqa: E501 + + + :return: The stop_profit of this Order. # noqa: E501 + :rtype: SpotOrderStopProfit + """ + return self._stop_profit + + @stop_profit.setter + def stop_profit(self, stop_profit): + """Sets the stop_profit of this Order. + + + :param stop_profit: The stop_profit of this Order. # noqa: E501 + :type: SpotOrderStopProfit + """ + + self._stop_profit = stop_profit + + @property + def stop_loss(self): + """Gets the stop_loss of this Order. # noqa: E501 + + + :return: The stop_loss of this Order. # noqa: E501 + :rtype: SpotOrderStopLoss + """ + return self._stop_loss + + @stop_loss.setter + def stop_loss(self, stop_loss): + """Sets the stop_loss of this Order. + + + :param stop_loss: The stop_loss of this Order. # noqa: E501 + :type: SpotOrderStopLoss + """ + + self._stop_loss = stop_loss + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/order_book2.py b/gate_api/models/order_book2.py new file mode 100644 index 00000000..a97e4b0f --- /dev/null +++ b/gate_api/models/order_book2.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderBook2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'OrderBook2Data', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (OrderBook2Data, int, Configuration) -> None + """OrderBook2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this OrderBook2. # noqa: E501 + + + :return: The data of this OrderBook2. # noqa: E501 + :rtype: OrderBook2Data + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OrderBook2. + + + :param data: The data of this OrderBook2. # noqa: E501 + :type: OrderBook2Data + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this OrderBook2. # noqa: E501 + + + :return: The timestamp of this OrderBook2. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OrderBook2. + + + :param timestamp: The timestamp of this OrderBook2. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderBook2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderBook2): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_book2_data.py b/gate_api/models/order_book2_data.py new file mode 100644 index 00000000..5e654693 --- /dev/null +++ b/gate_api/models/order_book2_data.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderBook2Data(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'bids': 'list[OrderBookPrice]', + 'asks': 'list[OrderBookPrice]' + } + + attribute_map = { + 'symbol': 'symbol', + 'bids': 'bids', + 'asks': 'asks' + } + + def __init__(self, symbol=None, bids=None, asks=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[OrderBookPrice], list[OrderBookPrice], Configuration) -> None + """OrderBook2Data - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._bids = None + self._asks = None + self.discriminator = None + + if symbol is not None: + self.symbol = symbol + if bids is not None: + self.bids = bids + if asks is not None: + self.asks = asks + + @property + def symbol(self): + """Gets the symbol of this OrderBook2Data. # noqa: E501 + + Symbol # noqa: E501 + + :return: The symbol of this OrderBook2Data. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this OrderBook2Data. + + Symbol # noqa: E501 + + :param symbol: The symbol of this OrderBook2Data. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def bids(self): + """Gets the bids of this OrderBook2Data. # noqa: E501 + + Bid orders # noqa: E501 + + :return: The bids of this OrderBook2Data. # noqa: E501 + :rtype: list[OrderBookPrice] + """ + return self._bids + + @bids.setter + def bids(self, bids): + """Sets the bids of this OrderBook2Data. + + Bid orders # noqa: E501 + + :param bids: The bids of this OrderBook2Data. # noqa: E501 + :type: list[OrderBookPrice] + """ + + self._bids = bids + + @property + def asks(self): + """Gets the asks of this OrderBook2Data. # noqa: E501 + + Ask orders # noqa: E501 + + :return: The asks of this OrderBook2Data. # noqa: E501 + :rtype: list[OrderBookPrice] + """ + return self._asks + + @asks.setter + def asks(self, asks): + """Sets the asks of this OrderBook2Data. + + Ask orders # noqa: E501 + + :param asks: The asks of this OrderBook2Data. # noqa: E501 + :type: list[OrderBookPrice] + """ + + self._asks = asks + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderBook2Data): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderBook2Data): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_book_price.py b/gate_api/models/order_book_price.py new file mode 100644 index 00000000..ffdd6e3b --- /dev/null +++ b/gate_api/models/order_book_price.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderBookPrice(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'p': 'str', + 'user_order': 'bool' + } + + attribute_map = { + 'p': 'p', + 'user_order': 'user_order' + } + + def __init__(self, p=None, user_order=None, local_vars_configuration=None): # noqa: E501 + # type: (str, bool, Configuration) -> None + """OrderBookPrice - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._p = None + self._user_order = None + self.discriminator = None + + if p is not None: + self.p = p + if user_order is not None: + self.user_order = user_order + + @property + def p(self): + """Gets the p of this OrderBookPrice. # noqa: E501 + + Price # noqa: E501 + + :return: The p of this OrderBookPrice. # noqa: E501 + :rtype: str + """ + return self._p + + @p.setter + def p(self, p): + """Sets the p of this OrderBookPrice. + + Price # noqa: E501 + + :param p: The p of this OrderBookPrice. # noqa: E501 + :type: str + """ + + self._p = p + + @property + def user_order(self): + """Gets the user_order of this OrderBookPrice. # noqa: E501 + + Whether it is the user's own order # noqa: E501 + + :return: The user_order of this OrderBookPrice. # noqa: E501 + :rtype: bool + """ + return self._user_order + + @user_order.setter + def user_order(self, user_order): + """Sets the user_order of this OrderBookPrice. + + Whether it is the user's own order # noqa: E501 + + :param user_order: The user_order of this OrderBookPrice. # noqa: E501 + :type: bool + """ + + self._user_order = user_order + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderBookPrice): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderBookPrice): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_cancel.py b/gate_api/models/order_cancel.py index ba1457ec..ca42703e 100644 --- a/gate_api/models/order_cancel.py +++ b/gate_api/models/order_cancel.py @@ -267,7 +267,7 @@ def id(self, id): def text(self): """Gets the text of this OrderCancel. # noqa: E501 - User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 # noqa: E501 + User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 # noqa: E501 :return: The text of this OrderCancel. # noqa: E501 :rtype: str @@ -278,7 +278,7 @@ def text(self): def text(self, text): """Sets the text of this OrderCancel. - User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 # noqa: E501 + User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) Besides user defined information, reserved contents are listed below, denoting how the order is created: - 101: from android - 102: from IOS - 103: from IPAD - 104: from webapp - 3: from web - 2: from apiv2 - apiv4: from apiv4 # noqa: E501 :param text: The text of this OrderCancel. # noqa: E501 :type: str @@ -474,7 +474,7 @@ def update_time_ms(self, update_time_ms): def status(self): """Gets the status of this OrderCancel. # noqa: E501 - Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled # noqa: E501 + Order status - `open`: to be filled - `closed`: closed order - `cancelled`: cancelled # noqa: E501 :return: The status of this OrderCancel. # noqa: E501 :rtype: str @@ -485,7 +485,7 @@ def status(self): def status(self, status): """Sets the status of this OrderCancel. - Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled # noqa: E501 + Order status - `open`: to be filled - `closed`: closed order - `cancelled`: cancelled # noqa: E501 :param status: The status of this OrderCancel. # noqa: E501 :type: str diff --git a/gate_api/models/order_create_v1_req.py b/gate_api/models/order_create_v1_req.py new file mode 100644 index 00000000..727a0eaf --- /dev/null +++ b/gate_api/models/order_create_v1_req.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderCreateV1Req(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + '_from': 'list[CreateParam]', + 'to': 'list[CreateParam]' + } + + attribute_map = { + '_from': 'from', + 'to': 'to' + } + + def __init__(self, _from=None, to=None, local_vars_configuration=None): # noqa: E501 + # type: (list[CreateParam], list[CreateParam], Configuration) -> None + """OrderCreateV1Req - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self.__from = None + self._to = None + self.discriminator = None + + self._from = _from + self.to = to + + @property + def _from(self): + """Gets the _from of this OrderCreateV1Req. # noqa: E501 + + Sell ​​side list, at least one item; each item is the currency and amount `amount` to be swapped out. # noqa: E501 + + :return: The _from of this OrderCreateV1Req. # noqa: E501 + :rtype: list[CreateParam] + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this OrderCreateV1Req. + + Sell ​​side list, at least one item; each item is the currency and amount `amount` to be swapped out. # noqa: E501 + + :param _from: The _from of this OrderCreateV1Req. # noqa: E501 + :type: list[CreateParam] + """ + if self.local_vars_configuration.client_side_validation and _from is None: # noqa: E501 + raise ValueError("Invalid value for `_from`, must not be `None`") # noqa: E501 + + self.__from = _from + + @property + def to(self): + """Gets the to of this OrderCreateV1Req. # noqa: E501 + + Target side list, at least one item; each item is the target currency and **amount** `amount` (non-proportional). The structural semantics are different from `OrderPreviewV1Req.to` (`PreviewToParam`, including `ratio`), so do not mix them. # noqa: E501 + + :return: The to of this OrderCreateV1Req. # noqa: E501 + :rtype: list[CreateParam] + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this OrderCreateV1Req. + + Target side list, at least one item; each item is the target currency and **amount** `amount` (non-proportional). The structural semantics are different from `OrderPreviewV1Req.to` (`PreviewToParam`, including `ratio`), so do not mix them. # noqa: E501 + + :param to: The to of this OrderCreateV1Req. # noqa: E501 + :type: list[CreateParam] + """ + if self.local_vars_configuration.client_side_validation and to is None: # noqa: E501 + raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501 + + self._to = to + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderCreateV1Req): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderCreateV1Req): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_create_v1_resp.py b/gate_api/models/order_create_v1_resp.py new file mode 100644 index 00000000..6c8a0384 --- /dev/null +++ b/gate_api/models/order_create_v1_resp.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderCreateV1Resp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order': 'CreateOrder' + } + + attribute_map = { + 'order': 'order' + } + + def __init__(self, order=None, local_vars_configuration=None): # noqa: E501 + # type: (CreateOrder, Configuration) -> None + """OrderCreateV1Resp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order = None + self.discriminator = None + + self.order = order + + @property + def order(self): + """Gets the order of this OrderCreateV1Resp. # noqa: E501 + + + :return: The order of this OrderCreateV1Resp. # noqa: E501 + :rtype: CreateOrder + """ + return self._order + + @order.setter + def order(self, order): + """Sets the order of this OrderCreateV1Resp. + + + :param order: The order of this OrderCreateV1Resp. # noqa: E501 + :type: CreateOrder + """ + if self.local_vars_configuration.client_side_validation and order is None: # noqa: E501 + raise ValueError("Invalid value for `order`, must not be `None`") # noqa: E501 + + self._order = order + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderCreateV1Resp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderCreateV1Resp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_history_list.py b/gate_api/models/order_history_list.py new file mode 100644 index 00000000..cd71a5e5 --- /dev/null +++ b/gate_api/models/order_history_list.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderHistoryList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'OrderHistoryListData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, OrderHistoryListData, Configuration) -> None + """OrderHistoryList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this OrderHistoryList. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this OrderHistoryList. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OrderHistoryList. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this OrderHistoryList. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this OrderHistoryList. # noqa: E501 + + + :return: The data of this OrderHistoryList. # noqa: E501 + :rtype: OrderHistoryListData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OrderHistoryList. + + + :param data: The data of this OrderHistoryList. # noqa: E501 + :type: OrderHistoryListData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderHistoryList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderHistoryList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_history_list2.py b/gate_api/models/order_history_list2.py new file mode 100644 index 00000000..0dc88f44 --- /dev/null +++ b/gate_api/models/order_history_list2.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderHistoryList2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'OrderHistoryList2Data', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (OrderHistoryList2Data, int, Configuration) -> None + """OrderHistoryList2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this OrderHistoryList2. # noqa: E501 + + + :return: The data of this OrderHistoryList2. # noqa: E501 + :rtype: OrderHistoryList2Data + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OrderHistoryList2. + + + :param data: The data of this OrderHistoryList2. # noqa: E501 + :type: OrderHistoryList2Data + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this OrderHistoryList2. # noqa: E501 + + + :return: The timestamp of this OrderHistoryList2. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OrderHistoryList2. + + + :param timestamp: The timestamp of this OrderHistoryList2. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderHistoryList2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderHistoryList2): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_history_list2_data.py b/gate_api/models/order_history_list2_data.py new file mode 100644 index 00000000..f51b2857 --- /dev/null +++ b/gate_api/models/order_history_list2_data.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderHistoryList2Data(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'total': 'int', + 'total_page': 'int', + 'list': 'list[OrderHistoryListItem]' + } + + attribute_map = { + 'total': 'total', + 'total_page': 'total_page', + 'list': 'list' + } + + def __init__(self, total=None, total_page=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, list[OrderHistoryListItem], Configuration) -> None + """OrderHistoryList2Data - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._total_page = None + self._list = None + self.discriminator = None + + if total is not None: + self.total = total + if total_page is not None: + self.total_page = total_page + if list is not None: + self.list = list + + @property + def total(self): + """Gets the total of this OrderHistoryList2Data. # noqa: E501 + + Total quantity # noqa: E501 + + :return: The total of this OrderHistoryList2Data. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this OrderHistoryList2Data. + + Total quantity # noqa: E501 + + :param total: The total of this OrderHistoryList2Data. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def total_page(self): + """Gets the total_page of this OrderHistoryList2Data. # noqa: E501 + + Total pages # noqa: E501 + + :return: The total_page of this OrderHistoryList2Data. # noqa: E501 + :rtype: int + """ + return self._total_page + + @total_page.setter + def total_page(self, total_page): + """Sets the total_page of this OrderHistoryList2Data. + + Total pages # noqa: E501 + + :param total_page: The total_page of this OrderHistoryList2Data. # noqa: E501 + :type: int + """ + + self._total_page = total_page + + @property + def list(self): + """Gets the list of this OrderHistoryList2Data. # noqa: E501 + + Query historical order list # noqa: E501 + + :return: The list of this OrderHistoryList2Data. # noqa: E501 + :rtype: list[OrderHistoryListItem] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this OrderHistoryList2Data. + + Query historical order list # noqa: E501 + + :param list: The list of this OrderHistoryList2Data. # noqa: E501 + :type: list[OrderHistoryListItem] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderHistoryList2Data): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderHistoryList2Data): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_history_list_data.py b/gate_api/models/order_history_list_data.py new file mode 100644 index 00000000..19f4994e --- /dev/null +++ b/gate_api/models/order_history_list_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderHistoryListData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[OrderHistoryListDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[OrderHistoryListDataList], Configuration) -> None + """OrderHistoryListData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this OrderHistoryListData. # noqa: E501 + + Historical order list # noqa: E501 + + :return: The list of this OrderHistoryListData. # noqa: E501 + :rtype: list[OrderHistoryListDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this OrderHistoryListData. + + Historical order list # noqa: E501 + + :param list: The list of this OrderHistoryListData. # noqa: E501 + :type: list[OrderHistoryListDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderHistoryListData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderHistoryListData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_history_list_data_list.py b/gate_api/models/order_history_list_data_list.py new file mode 100644 index 00000000..8a7f9490 --- /dev/null +++ b/gate_api/models/order_history_list_data_list.py @@ -0,0 +1,589 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderHistoryListDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'int', + 'symbol': 'str', + 'symbol_desc': 'str', + 'price_type': 'str', + 'order_opt_type': 'int', + 'state': 'int', + 'state_desc': 'str', + 'side': 'int', + 'volume': 'str', + 'fill_volume': 'str', + 'close_pnl': 'str', + 'price': 'str', + 'trigger_price': 'str', + 'price_tp': 'str', + 'price_sl': 'str', + 'time_setup': 'int', + 'time_done': 'int' + } + + attribute_map = { + 'order_id': 'order_id', + 'symbol': 'symbol', + 'symbol_desc': 'symbol_desc', + 'price_type': 'price_type', + 'order_opt_type': 'order_opt_type', + 'state': 'state', + 'state_desc': 'state_desc', + 'side': 'side', + 'volume': 'volume', + 'fill_volume': 'fill_volume', + 'close_pnl': 'close_pnl', + 'price': 'price', + 'trigger_price': 'trigger_price', + 'price_tp': 'price_tp', + 'price_sl': 'price_sl', + 'time_setup': 'time_setup', + 'time_done': 'time_done' + } + + def __init__(self, order_id=None, symbol=None, symbol_desc=None, price_type=None, order_opt_type=None, state=None, state_desc=None, side=None, volume=None, fill_volume=None, close_pnl=None, price=None, trigger_price=None, price_tp=None, price_sl=None, time_setup=None, time_done=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, int, int, str, int, str, str, str, str, str, str, str, int, int, Configuration) -> None + """OrderHistoryListDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._symbol = None + self._symbol_desc = None + self._price_type = None + self._order_opt_type = None + self._state = None + self._state_desc = None + self._side = None + self._volume = None + self._fill_volume = None + self._close_pnl = None + self._price = None + self._trigger_price = None + self._price_tp = None + self._price_sl = None + self._time_setup = None + self._time_done = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if symbol is not None: + self.symbol = symbol + if symbol_desc is not None: + self.symbol_desc = symbol_desc + if price_type is not None: + self.price_type = price_type + if order_opt_type is not None: + self.order_opt_type = order_opt_type + if state is not None: + self.state = state + if state_desc is not None: + self.state_desc = state_desc + if side is not None: + self.side = side + if volume is not None: + self.volume = volume + if fill_volume is not None: + self.fill_volume = fill_volume + if close_pnl is not None: + self.close_pnl = close_pnl + if price is not None: + self.price = price + if trigger_price is not None: + self.trigger_price = trigger_price + if price_tp is not None: + self.price_tp = price_tp + if price_sl is not None: + self.price_sl = price_sl + if time_setup is not None: + self.time_setup = time_setup + if time_done is not None: + self.time_done = time_done + + @property + def order_id(self): + """Gets the order_id of this OrderHistoryListDataList. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this OrderHistoryListDataList. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OrderHistoryListDataList. + + Order ID # noqa: E501 + + :param order_id: The order_id of this OrderHistoryListDataList. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def symbol(self): + """Gets the symbol of this OrderHistoryListDataList. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this OrderHistoryListDataList. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def symbol_desc(self): + """Gets the symbol_desc of this OrderHistoryListDataList. # noqa: E501 + + Symbol description # noqa: E501 + + :return: The symbol_desc of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._symbol_desc + + @symbol_desc.setter + def symbol_desc(self, symbol_desc): + """Sets the symbol_desc of this OrderHistoryListDataList. + + Symbol description # noqa: E501 + + :param symbol_desc: The symbol_desc of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + + self._symbol_desc = symbol_desc + + @property + def price_type(self): + """Gets the price_type of this OrderHistoryListDataList. # noqa: E501 + + Trade type (market=market price, trigger=trigger price) # noqa: E501 + + :return: The price_type of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this OrderHistoryListDataList. + + Trade type (market=market price, trigger=trigger price) # noqa: E501 + + :param price_type: The price_type of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + allowed_values = ["market", "trigger"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def order_opt_type(self): + """Gets the order_opt_type of this OrderHistoryListDataList. # noqa: E501 + + Order operation type (1=sell, 2=buy, 3=close long, 4=close short, 5=force close long, 6=force close short) # noqa: E501 + + :return: The order_opt_type of this OrderHistoryListDataList. # noqa: E501 + :rtype: int + """ + return self._order_opt_type + + @order_opt_type.setter + def order_opt_type(self, order_opt_type): + """Sets the order_opt_type of this OrderHistoryListDataList. + + Order operation type (1=sell, 2=buy, 3=close long, 4=close short, 5=force close long, 6=force close short) # noqa: E501 + + :param order_opt_type: The order_opt_type of this OrderHistoryListDataList. # noqa: E501 + :type: int + """ + allowed_values = [1, 2, 3, 4, 5, 6] # noqa: E501 + if self.local_vars_configuration.client_side_validation and order_opt_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `order_opt_type` ({0}), must be one of {1}" # noqa: E501 + .format(order_opt_type, allowed_values) + ) + + self._order_opt_type = order_opt_type + + @property + def state(self): + """Gets the state of this OrderHistoryListDataList. # noqa: E501 + + Order status code # noqa: E501 + + :return: The state of this OrderHistoryListDataList. # noqa: E501 + :rtype: int + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this OrderHistoryListDataList. + + Order status code # noqa: E501 + + :param state: The state of this OrderHistoryListDataList. # noqa: E501 + :type: int + """ + + self._state = state + + @property + def state_desc(self): + """Gets the state_desc of this OrderHistoryListDataList. # noqa: E501 + + Order status description # noqa: E501 + + :return: The state_desc of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._state_desc + + @state_desc.setter + def state_desc(self, state_desc): + """Sets the state_desc of this OrderHistoryListDataList. + + Order status description # noqa: E501 + + :param state_desc: The state_desc of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + + self._state_desc = state_desc + + @property + def side(self): + """Gets the side of this OrderHistoryListDataList. # noqa: E501 + + Side (1=sell, 2=buy) # noqa: E501 + + :return: The side of this OrderHistoryListDataList. # noqa: E501 + :rtype: int + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OrderHistoryListDataList. + + Side (1=sell, 2=buy) # noqa: E501 + + :param side: The side of this OrderHistoryListDataList. # noqa: E501 + :type: int + """ + allowed_values = [1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) + ) + + self._side = side + + @property + def volume(self): + """Gets the volume of this OrderHistoryListDataList. # noqa: E501 + + Order quantity # noqa: E501 + + :return: The volume of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this OrderHistoryListDataList. + + Order quantity # noqa: E501 + + :param volume: The volume of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + + self._volume = volume + + @property + def fill_volume(self): + """Gets the fill_volume of this OrderHistoryListDataList. # noqa: E501 + + Trading size # noqa: E501 + + :return: The fill_volume of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._fill_volume + + @fill_volume.setter + def fill_volume(self, fill_volume): + """Sets the fill_volume of this OrderHistoryListDataList. + + Trading size # noqa: E501 + + :param fill_volume: The fill_volume of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + + self._fill_volume = fill_volume + + @property + def close_pnl(self): + """Gets the close_pnl of this OrderHistoryListDataList. # noqa: E501 + + Close Position P&L # noqa: E501 + + :return: The close_pnl of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._close_pnl + + @close_pnl.setter + def close_pnl(self, close_pnl): + """Sets the close_pnl of this OrderHistoryListDataList. + + Close Position P&L # noqa: E501 + + :param close_pnl: The close_pnl of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + + self._close_pnl = close_pnl + + @property + def price(self): + """Gets the price of this OrderHistoryListDataList. # noqa: E501 + + Average fill price # noqa: E501 + + :return: The price of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OrderHistoryListDataList. + + Average fill price # noqa: E501 + + :param price: The price of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def trigger_price(self): + """Gets the trigger_price of this OrderHistoryListDataList. # noqa: E501 + + Trigger price # noqa: E501 + + :return: The trigger_price of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this OrderHistoryListDataList. + + Trigger price # noqa: E501 + + :param trigger_price: The trigger_price of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def price_tp(self): + """Gets the price_tp of this OrderHistoryListDataList. # noqa: E501 + + Take profit price # noqa: E501 + + :return: The price_tp of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._price_tp + + @price_tp.setter + def price_tp(self, price_tp): + """Sets the price_tp of this OrderHistoryListDataList. + + Take profit price # noqa: E501 + + :param price_tp: The price_tp of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + + self._price_tp = price_tp + + @property + def price_sl(self): + """Gets the price_sl of this OrderHistoryListDataList. # noqa: E501 + + Stop loss price # noqa: E501 + + :return: The price_sl of this OrderHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._price_sl + + @price_sl.setter + def price_sl(self, price_sl): + """Sets the price_sl of this OrderHistoryListDataList. + + Stop loss price # noqa: E501 + + :param price_sl: The price_sl of this OrderHistoryListDataList. # noqa: E501 + :type: str + """ + + self._price_sl = price_sl + + @property + def time_setup(self): + """Gets the time_setup of this OrderHistoryListDataList. # noqa: E501 + + Order time (Unix timestamp in seconds) # noqa: E501 + + :return: The time_setup of this OrderHistoryListDataList. # noqa: E501 + :rtype: int + """ + return self._time_setup + + @time_setup.setter + def time_setup(self, time_setup): + """Sets the time_setup of this OrderHistoryListDataList. + + Order time (Unix timestamp in seconds) # noqa: E501 + + :param time_setup: The time_setup of this OrderHistoryListDataList. # noqa: E501 + :type: int + """ + + self._time_setup = time_setup + + @property + def time_done(self): + """Gets the time_done of this OrderHistoryListDataList. # noqa: E501 + + End time (Unix timestamp in seconds) # noqa: E501 + + :return: The time_done of this OrderHistoryListDataList. # noqa: E501 + :rtype: int + """ + return self._time_done + + @time_done.setter + def time_done(self, time_done): + """Sets the time_done of this OrderHistoryListDataList. + + End time (Unix timestamp in seconds) # noqa: E501 + + :param time_done: The time_done of this OrderHistoryListDataList. # noqa: E501 + :type: int + """ + + self._time_done = time_done + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderHistoryListDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderHistoryListDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_history_list_item.py b/gate_api/models/order_history_list_item.py new file mode 100644 index 00000000..81d6e680 --- /dev/null +++ b/gate_api/models/order_history_list_item.py @@ -0,0 +1,655 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderHistoryListItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'symbol': 'str', + 'exchange': 'str', + 'quote_currency': 'str', + 'fx_rate': 'str', + 'symbol_desc': 'str', + 'price_type': 'str', + 'status': 'int', + 'status_desc': 'str', + 'status_detail': 'OrderHistoryListItemStatusDetail', + 'finish_as': 'int', + 'side': 'int', + 'time_in_force': 'str', + 'volume': 'str', + 'fill_volume': 'str', + 'price': 'str', + 'avg_fill_price': 'str', + 'commission': 'str', + 'time_setup': 'int', + 'time_done': 'int' + } + + attribute_map = { + 'order_id': 'order_id', + 'symbol': 'symbol', + 'exchange': 'exchange', + 'quote_currency': 'quote_currency', + 'fx_rate': 'fx_rate', + 'symbol_desc': 'symbol_desc', + 'price_type': 'price_type', + 'status': 'status', + 'status_desc': 'status_desc', + 'status_detail': 'status_detail', + 'finish_as': 'finish_as', + 'side': 'side', + 'time_in_force': 'time_in_force', + 'volume': 'volume', + 'fill_volume': 'fill_volume', + 'price': 'price', + 'avg_fill_price': 'avg_fill_price', + 'commission': 'commission', + 'time_setup': 'time_setup', + 'time_done': 'time_done' + } + + def __init__(self, order_id=None, symbol=None, exchange=None, quote_currency=None, fx_rate=None, symbol_desc=None, price_type=None, status=None, status_desc=None, status_detail=None, finish_as=None, side=None, time_in_force=None, volume=None, fill_volume=None, price=None, avg_fill_price=None, commission=None, time_setup=None, time_done=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, int, str, OrderHistoryListItemStatusDetail, int, int, str, str, str, str, str, str, int, int, Configuration) -> None + """OrderHistoryListItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._symbol = None + self._exchange = None + self._quote_currency = None + self._fx_rate = None + self._symbol_desc = None + self._price_type = None + self._status = None + self._status_desc = None + self._status_detail = None + self._finish_as = None + self._side = None + self._time_in_force = None + self._volume = None + self._fill_volume = None + self._price = None + self._avg_fill_price = None + self._commission = None + self._time_setup = None + self._time_done = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if symbol is not None: + self.symbol = symbol + if exchange is not None: + self.exchange = exchange + if quote_currency is not None: + self.quote_currency = quote_currency + if fx_rate is not None: + self.fx_rate = fx_rate + if symbol_desc is not None: + self.symbol_desc = symbol_desc + if price_type is not None: + self.price_type = price_type + if status is not None: + self.status = status + if status_desc is not None: + self.status_desc = status_desc + self.status_detail = status_detail + if finish_as is not None: + self.finish_as = finish_as + if side is not None: + self.side = side + if time_in_force is not None: + self.time_in_force = time_in_force + if volume is not None: + self.volume = volume + if fill_volume is not None: + self.fill_volume = fill_volume + if price is not None: + self.price = price + self.avg_fill_price = avg_fill_price + if commission is not None: + self.commission = commission + if time_setup is not None: + self.time_setup = time_setup + if time_done is not None: + self.time_done = time_done + + @property + def order_id(self): + """Gets the order_id of this OrderHistoryListItem. # noqa: E501 + + + :return: The order_id of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OrderHistoryListItem. + + + :param order_id: The order_id of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def symbol(self): + """Gets the symbol of this OrderHistoryListItem. # noqa: E501 + + + :return: The symbol of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this OrderHistoryListItem. + + + :param symbol: The symbol of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def exchange(self): + """Gets the exchange of this OrderHistoryListItem. # noqa: E501 + + Exchange, supports us, hk, and kr # noqa: E501 + + :return: The exchange of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this OrderHistoryListItem. + + Exchange, supports us, hk, and kr # noqa: E501 + + :param exchange: The exchange of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + allowed_values = ["us", "hk", "kr"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and exchange not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `exchange` ({0}), must be one of {1}" # noqa: E501 + .format(exchange, allowed_values) + ) + + self._exchange = exchange + + @property + def quote_currency(self): + """Gets the quote_currency of this OrderHistoryListItem. # noqa: E501 + + + :return: The quote_currency of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._quote_currency + + @quote_currency.setter + def quote_currency(self, quote_currency): + """Sets the quote_currency of this OrderHistoryListItem. + + + :param quote_currency: The quote_currency of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._quote_currency = quote_currency + + @property + def fx_rate(self): + """Gets the fx_rate of this OrderHistoryListItem. # noqa: E501 + + Quote currency to USD exchange rate # noqa: E501 + + :return: The fx_rate of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._fx_rate + + @fx_rate.setter + def fx_rate(self, fx_rate): + """Sets the fx_rate of this OrderHistoryListItem. + + Quote currency to USD exchange rate # noqa: E501 + + :param fx_rate: The fx_rate of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._fx_rate = fx_rate + + @property + def symbol_desc(self): + """Gets the symbol_desc of this OrderHistoryListItem. # noqa: E501 + + + :return: The symbol_desc of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._symbol_desc + + @symbol_desc.setter + def symbol_desc(self, symbol_desc): + """Sets the symbol_desc of this OrderHistoryListItem. + + + :param symbol_desc: The symbol_desc of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._symbol_desc = symbol_desc + + @property + def price_type(self): + """Gets the price_type of this OrderHistoryListItem. # noqa: E501 + + Price type (market = market order, limit = limit order) # noqa: E501 + + :return: The price_type of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this OrderHistoryListItem. + + Price type (market = market order, limit = limit order) # noqa: E501 + + :param price_type: The price_type of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + allowed_values = ["market", "limit"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def status(self): + """Gets the status of this OrderHistoryListItem. # noqa: E501 + + Order status # noqa: E501 + + :return: The status of this OrderHistoryListItem. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OrderHistoryListItem. + + Order status # noqa: E501 + + :param status: The status of this OrderHistoryListItem. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def status_desc(self): + """Gets the status_desc of this OrderHistoryListItem. # noqa: E501 + + Order status description # noqa: E501 + + :return: The status_desc of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._status_desc + + @status_desc.setter + def status_desc(self, status_desc): + """Sets the status_desc of this OrderHistoryListItem. + + Order status description # noqa: E501 + + :param status_desc: The status_desc of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._status_desc = status_desc + + @property + def status_detail(self): + """Gets the status_detail of this OrderHistoryListItem. # noqa: E501 + + + :return: The status_detail of this OrderHistoryListItem. # noqa: E501 + :rtype: OrderHistoryListItemStatusDetail + """ + return self._status_detail + + @status_detail.setter + def status_detail(self, status_detail): + """Sets the status_detail of this OrderHistoryListItem. + + + :param status_detail: The status_detail of this OrderHistoryListItem. # noqa: E501 + :type: OrderHistoryListItemStatusDetail + """ + + self._status_detail = status_detail + + @property + def finish_as(self): + """Gets the finish_as of this OrderHistoryListItem. # noqa: E501 + + Order completion reason # noqa: E501 + + :return: The finish_as of this OrderHistoryListItem. # noqa: E501 + :rtype: int + """ + return self._finish_as + + @finish_as.setter + def finish_as(self, finish_as): + """Sets the finish_as of this OrderHistoryListItem. + + Order completion reason # noqa: E501 + + :param finish_as: The finish_as of this OrderHistoryListItem. # noqa: E501 + :type: int + """ + + self._finish_as = finish_as + + @property + def side(self): + """Gets the side of this OrderHistoryListItem. # noqa: E501 + + Side (1=sell, 2=buy) # noqa: E501 + + :return: The side of this OrderHistoryListItem. # noqa: E501 + :rtype: int + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OrderHistoryListItem. + + Side (1=sell, 2=buy) # noqa: E501 + + :param side: The side of this OrderHistoryListItem. # noqa: E501 + :type: int + """ + allowed_values = [1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) + ) + + self._side = side + + @property + def time_in_force(self): + """Gets the time_in_force of this OrderHistoryListItem. # noqa: E501 + + Time in force. - day: Day order. # noqa: E501 + + :return: The time_in_force of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._time_in_force + + @time_in_force.setter + def time_in_force(self, time_in_force): + """Sets the time_in_force of this OrderHistoryListItem. + + Time in force. - day: Day order. # noqa: E501 + + :param time_in_force: The time_in_force of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + allowed_values = ["day"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and time_in_force not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `time_in_force` ({0}), must be one of {1}" # noqa: E501 + .format(time_in_force, allowed_values) + ) + + self._time_in_force = time_in_force + + @property + def volume(self): + """Gets the volume of this OrderHistoryListItem. # noqa: E501 + + + :return: The volume of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this OrderHistoryListItem. + + + :param volume: The volume of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._volume = volume + + @property + def fill_volume(self): + """Gets the fill_volume of this OrderHistoryListItem. # noqa: E501 + + + :return: The fill_volume of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._fill_volume + + @fill_volume.setter + def fill_volume(self, fill_volume): + """Sets the fill_volume of this OrderHistoryListItem. + + + :param fill_volume: The fill_volume of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._fill_volume = fill_volume + + @property + def price(self): + """Gets the price of this OrderHistoryListItem. # noqa: E501 + + + :return: The price of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OrderHistoryListItem. + + + :param price: The price of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def avg_fill_price(self): + """Gets the avg_fill_price of this OrderHistoryListItem. # noqa: E501 + + + :return: The avg_fill_price of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._avg_fill_price + + @avg_fill_price.setter + def avg_fill_price(self, avg_fill_price): + """Sets the avg_fill_price of this OrderHistoryListItem. + + + :param avg_fill_price: The avg_fill_price of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._avg_fill_price = avg_fill_price + + @property + def commission(self): + """Gets the commission of this OrderHistoryListItem. # noqa: E501 + + fee # noqa: E501 + + :return: The commission of this OrderHistoryListItem. # noqa: E501 + :rtype: str + """ + return self._commission + + @commission.setter + def commission(self, commission): + """Sets the commission of this OrderHistoryListItem. + + fee # noqa: E501 + + :param commission: The commission of this OrderHistoryListItem. # noqa: E501 + :type: str + """ + + self._commission = commission + + @property + def time_setup(self): + """Gets the time_setup of this OrderHistoryListItem. # noqa: E501 + + + :return: The time_setup of this OrderHistoryListItem. # noqa: E501 + :rtype: int + """ + return self._time_setup + + @time_setup.setter + def time_setup(self, time_setup): + """Sets the time_setup of this OrderHistoryListItem. + + + :param time_setup: The time_setup of this OrderHistoryListItem. # noqa: E501 + :type: int + """ + + self._time_setup = time_setup + + @property + def time_done(self): + """Gets the time_done of this OrderHistoryListItem. # noqa: E501 + + + :return: The time_done of this OrderHistoryListItem. # noqa: E501 + :rtype: int + """ + return self._time_done + + @time_done.setter + def time_done(self, time_done): + """Sets the time_done of this OrderHistoryListItem. + + + :param time_done: The time_done of this OrderHistoryListItem. # noqa: E501 + :type: int + """ + + self._time_done = time_done + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderHistoryListItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderHistoryListItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_history_list_item_status_detail.py b/gate_api/models/order_history_list_item_status_detail.py new file mode 100644 index 00000000..c28c0b2e --- /dev/null +++ b/gate_api/models/order_history_list_item_status_detail.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderHistoryListItemStatusDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'title': 'str', + 'message': 'str' + } + + attribute_map = { + 'title': 'title', + 'message': 'message' + } + + def __init__(self, title=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """OrderHistoryListItemStatusDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._title = None + self._message = None + self.discriminator = None + + if title is not None: + self.title = title + if message is not None: + self.message = message + + @property + def title(self): + """Gets the title of this OrderHistoryListItemStatusDetail. # noqa: E501 + + + :return: The title of this OrderHistoryListItemStatusDetail. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this OrderHistoryListItemStatusDetail. + + + :param title: The title of this OrderHistoryListItemStatusDetail. # noqa: E501 + :type: str + """ + + self._title = title + + @property + def message(self): + """Gets the message of this OrderHistoryListItemStatusDetail. # noqa: E501 + + + :return: The message of this OrderHistoryListItemStatusDetail. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OrderHistoryListItemStatusDetail. + + + :param message: The message of this OrderHistoryListItemStatusDetail. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderHistoryListItemStatusDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderHistoryListItemStatusDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_list.py b/gate_api/models/order_list.py new file mode 100644 index 00000000..0469d620 --- /dev/null +++ b/gate_api/models/order_list.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'OrderListData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, OrderListData, Configuration) -> None + """OrderList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this OrderList. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this OrderList. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OrderList. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this OrderList. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this OrderList. # noqa: E501 + + + :return: The data of this OrderList. # noqa: E501 + :rtype: OrderListData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OrderList. + + + :param data: The data of this OrderList. # noqa: E501 + :type: OrderListData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_list2.py b/gate_api/models/order_list2.py new file mode 100644 index 00000000..5be698a4 --- /dev/null +++ b/gate_api/models/order_list2.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderList2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'OrderList2Data', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (OrderList2Data, int, Configuration) -> None + """OrderList2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this OrderList2. # noqa: E501 + + + :return: The data of this OrderList2. # noqa: E501 + :rtype: OrderList2Data + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OrderList2. + + + :param data: The data of this OrderList2. # noqa: E501 + :type: OrderList2Data + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this OrderList2. # noqa: E501 + + + :return: The timestamp of this OrderList2. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OrderList2. + + + :param timestamp: The timestamp of this OrderList2. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderList2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderList2): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_list2_data.py b/gate_api/models/order_list2_data.py new file mode 100644 index 00000000..1a62b85d --- /dev/null +++ b/gate_api/models/order_list2_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderList2Data(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[OrderListItem]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[OrderListItem], Configuration) -> None + """OrderList2Data - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this OrderList2Data. # noqa: E501 + + Query active order list # noqa: E501 + + :return: The list of this OrderList2Data. # noqa: E501 + :rtype: list[OrderListItem] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this OrderList2Data. + + Query active order list # noqa: E501 + + :param list: The list of this OrderList2Data. # noqa: E501 + :type: list[OrderListItem] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderList2Data): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderList2Data): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_list_data.py b/gate_api/models/order_list_data.py new file mode 100644 index 00000000..fad8378a --- /dev/null +++ b/gate_api/models/order_list_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderListData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[OrderListDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[OrderListDataList], Configuration) -> None + """OrderListData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this OrderListData. # noqa: E501 + + Order list # noqa: E501 + + :return: The list of this OrderListData. # noqa: E501 + :rtype: list[OrderListDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this OrderListData. + + Order list # noqa: E501 + + :param list: The list of this OrderListData. # noqa: E501 + :type: list[OrderListDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderListData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderListData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_list_data_list.py b/gate_api/models/order_list_data_list.py new file mode 100644 index 00000000..f439c89e --- /dev/null +++ b/gate_api/models/order_list_data_list.py @@ -0,0 +1,477 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderListDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'int', + 'symbol': 'str', + 'symbol_desc': 'str', + 'price_type': 'str', + 'state': 'int', + 'state_desc': 'str', + 'finished': 'int', + 'side': 'int', + 'volume': 'str', + 'price': 'str', + 'price_tp': 'str', + 'price_sl': 'str', + 'time_setup': 'int' + } + + attribute_map = { + 'order_id': 'order_id', + 'symbol': 'symbol', + 'symbol_desc': 'symbol_desc', + 'price_type': 'price_type', + 'state': 'state', + 'state_desc': 'state_desc', + 'finished': 'finished', + 'side': 'side', + 'volume': 'volume', + 'price': 'price', + 'price_tp': 'price_tp', + 'price_sl': 'price_sl', + 'time_setup': 'time_setup' + } + + def __init__(self, order_id=None, symbol=None, symbol_desc=None, price_type=None, state=None, state_desc=None, finished=None, side=None, volume=None, price=None, price_tp=None, price_sl=None, time_setup=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, int, str, int, int, str, str, str, str, int, Configuration) -> None + """OrderListDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._symbol = None + self._symbol_desc = None + self._price_type = None + self._state = None + self._state_desc = None + self._finished = None + self._side = None + self._volume = None + self._price = None + self._price_tp = None + self._price_sl = None + self._time_setup = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if symbol is not None: + self.symbol = symbol + if symbol_desc is not None: + self.symbol_desc = symbol_desc + if price_type is not None: + self.price_type = price_type + if state is not None: + self.state = state + if state_desc is not None: + self.state_desc = state_desc + if finished is not None: + self.finished = finished + if side is not None: + self.side = side + if volume is not None: + self.volume = volume + if price is not None: + self.price = price + if price_tp is not None: + self.price_tp = price_tp + if price_sl is not None: + self.price_sl = price_sl + if time_setup is not None: + self.time_setup = time_setup + + @property + def order_id(self): + """Gets the order_id of this OrderListDataList. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this OrderListDataList. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OrderListDataList. + + Order ID # noqa: E501 + + :param order_id: The order_id of this OrderListDataList. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def symbol(self): + """Gets the symbol of this OrderListDataList. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this OrderListDataList. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this OrderListDataList. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this OrderListDataList. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def symbol_desc(self): + """Gets the symbol_desc of this OrderListDataList. # noqa: E501 + + Symbol description # noqa: E501 + + :return: The symbol_desc of this OrderListDataList. # noqa: E501 + :rtype: str + """ + return self._symbol_desc + + @symbol_desc.setter + def symbol_desc(self, symbol_desc): + """Sets the symbol_desc of this OrderListDataList. + + Symbol description # noqa: E501 + + :param symbol_desc: The symbol_desc of this OrderListDataList. # noqa: E501 + :type: str + """ + + self._symbol_desc = symbol_desc + + @property + def price_type(self): + """Gets the price_type of this OrderListDataList. # noqa: E501 + + Trade type (market=market price, trigger=trigger price) # noqa: E501 + + :return: The price_type of this OrderListDataList. # noqa: E501 + :rtype: str + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this OrderListDataList. + + Trade type (market=market price, trigger=trigger price) # noqa: E501 + + :param price_type: The price_type of this OrderListDataList. # noqa: E501 + :type: str + """ + allowed_values = ["market", "trigger"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def state(self): + """Gets the state of this OrderListDataList. # noqa: E501 + + Order status code # noqa: E501 + + :return: The state of this OrderListDataList. # noqa: E501 + :rtype: int + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this OrderListDataList. + + Order status code # noqa: E501 + + :param state: The state of this OrderListDataList. # noqa: E501 + :type: int + """ + + self._state = state + + @property + def state_desc(self): + """Gets the state_desc of this OrderListDataList. # noqa: E501 + + Order status description # noqa: E501 + + :return: The state_desc of this OrderListDataList. # noqa: E501 + :rtype: str + """ + return self._state_desc + + @state_desc.setter + def state_desc(self, state_desc): + """Sets the state_desc of this OrderListDataList. + + Order status description # noqa: E501 + + :param state_desc: The state_desc of this OrderListDataList. # noqa: E501 + :type: str + """ + + self._state_desc = state_desc + + @property + def finished(self): + """Gets the finished of this OrderListDataList. # noqa: E501 + + Is completed (0=shown in active order list, 1=not shown in active list) # noqa: E501 + + :return: The finished of this OrderListDataList. # noqa: E501 + :rtype: int + """ + return self._finished + + @finished.setter + def finished(self, finished): + """Sets the finished of this OrderListDataList. + + Is completed (0=shown in active order list, 1=not shown in active list) # noqa: E501 + + :param finished: The finished of this OrderListDataList. # noqa: E501 + :type: int + """ + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and finished not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `finished` ({0}), must be one of {1}" # noqa: E501 + .format(finished, allowed_values) + ) + + self._finished = finished + + @property + def side(self): + """Gets the side of this OrderListDataList. # noqa: E501 + + Side (1=sell, 2=buy) # noqa: E501 + + :return: The side of this OrderListDataList. # noqa: E501 + :rtype: int + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OrderListDataList. + + Side (1=sell, 2=buy) # noqa: E501 + + :param side: The side of this OrderListDataList. # noqa: E501 + :type: int + """ + allowed_values = [1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) + ) + + self._side = side + + @property + def volume(self): + """Gets the volume of this OrderListDataList. # noqa: E501 + + Order quantity # noqa: E501 + + :return: The volume of this OrderListDataList. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this OrderListDataList. + + Order quantity # noqa: E501 + + :param volume: The volume of this OrderListDataList. # noqa: E501 + :type: str + """ + + self._volume = volume + + @property + def price(self): + """Gets the price of this OrderListDataList. # noqa: E501 + + Trigger price # noqa: E501 + + :return: The price of this OrderListDataList. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OrderListDataList. + + Trigger price # noqa: E501 + + :param price: The price of this OrderListDataList. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def price_tp(self): + """Gets the price_tp of this OrderListDataList. # noqa: E501 + + Take profit price # noqa: E501 + + :return: The price_tp of this OrderListDataList. # noqa: E501 + :rtype: str + """ + return self._price_tp + + @price_tp.setter + def price_tp(self, price_tp): + """Sets the price_tp of this OrderListDataList. + + Take profit price # noqa: E501 + + :param price_tp: The price_tp of this OrderListDataList. # noqa: E501 + :type: str + """ + + self._price_tp = price_tp + + @property + def price_sl(self): + """Gets the price_sl of this OrderListDataList. # noqa: E501 + + Stop loss price # noqa: E501 + + :return: The price_sl of this OrderListDataList. # noqa: E501 + :rtype: str + """ + return self._price_sl + + @price_sl.setter + def price_sl(self, price_sl): + """Sets the price_sl of this OrderListDataList. + + Stop loss price # noqa: E501 + + :param price_sl: The price_sl of this OrderListDataList. # noqa: E501 + :type: str + """ + + self._price_sl = price_sl + + @property + def time_setup(self): + """Gets the time_setup of this OrderListDataList. # noqa: E501 + + Order time (Unix timestamp in seconds) # noqa: E501 + + :return: The time_setup of this OrderListDataList. # noqa: E501 + :rtype: int + """ + return self._time_setup + + @time_setup.setter + def time_setup(self, time_setup): + """Sets the time_setup of this OrderListDataList. + + Order time (Unix timestamp in seconds) # noqa: E501 + + :param time_setup: The time_setup of this OrderListDataList. # noqa: E501 + :type: int + """ + + self._time_setup = time_setup + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderListDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderListDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_list_item.py b/gate_api/models/order_list_item.py new file mode 100644 index 00000000..e5b4b5eb --- /dev/null +++ b/gate_api/models/order_list_item.py @@ -0,0 +1,825 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderListItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'symbol': 'str', + 'exchange': 'str', + 'quote_currency': 'str', + 'fx_rate': 'str', + 'symbol_desc': 'str', + 'trade_status': 'str', + 'trade_mode': 'int', + 'price_type': 'str', + 'side': 'int', + 'status': 'int', + 'volume': 'str', + 'fill_volume': 'str', + 'price': 'str', + 'time_setup': 'int', + 'time_update': 'int', + 'max_order_volume': 'str', + 'step_order_volume': 'str', + 'min_order_volume': 'str', + 'price_precision': 'int', + 'price_protection': 'str', + 'sell_price_protection': 'str', + 'buy_price_protection': 'str', + 'commission_rate': 'str', + 'slippage_rate': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'symbol': 'symbol', + 'exchange': 'exchange', + 'quote_currency': 'quote_currency', + 'fx_rate': 'fx_rate', + 'symbol_desc': 'symbol_desc', + 'trade_status': 'trade_status', + 'trade_mode': 'trade_mode', + 'price_type': 'price_type', + 'side': 'side', + 'status': 'status', + 'volume': 'volume', + 'fill_volume': 'fill_volume', + 'price': 'price', + 'time_setup': 'time_setup', + 'time_update': 'time_update', + 'max_order_volume': 'max_order_volume', + 'step_order_volume': 'step_order_volume', + 'min_order_volume': 'min_order_volume', + 'price_precision': 'price_precision', + 'price_protection': 'price_protection', + 'sell_price_protection': 'sell_price_protection', + 'buy_price_protection': 'buy_price_protection', + 'commission_rate': 'commission_rate', + 'slippage_rate': 'slippage_rate' + } + + def __init__(self, order_id=None, symbol=None, exchange=None, quote_currency=None, fx_rate=None, symbol_desc=None, trade_status=None, trade_mode=None, price_type=None, side=None, status=None, volume=None, fill_volume=None, price=None, time_setup=None, time_update=None, max_order_volume=None, step_order_volume=None, min_order_volume=None, price_precision=None, price_protection=None, sell_price_protection=None, buy_price_protection=None, commission_rate=None, slippage_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, int, str, int, int, str, str, str, int, int, str, str, str, int, str, str, str, str, str, Configuration) -> None + """OrderListItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._symbol = None + self._exchange = None + self._quote_currency = None + self._fx_rate = None + self._symbol_desc = None + self._trade_status = None + self._trade_mode = None + self._price_type = None + self._side = None + self._status = None + self._volume = None + self._fill_volume = None + self._price = None + self._time_setup = None + self._time_update = None + self._max_order_volume = None + self._step_order_volume = None + self._min_order_volume = None + self._price_precision = None + self._price_protection = None + self._sell_price_protection = None + self._buy_price_protection = None + self._commission_rate = None + self._slippage_rate = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if symbol is not None: + self.symbol = symbol + if exchange is not None: + self.exchange = exchange + if quote_currency is not None: + self.quote_currency = quote_currency + if fx_rate is not None: + self.fx_rate = fx_rate + if symbol_desc is not None: + self.symbol_desc = symbol_desc + if trade_status is not None: + self.trade_status = trade_status + if trade_mode is not None: + self.trade_mode = trade_mode + if price_type is not None: + self.price_type = price_type + if side is not None: + self.side = side + if status is not None: + self.status = status + if volume is not None: + self.volume = volume + if fill_volume is not None: + self.fill_volume = fill_volume + if price is not None: + self.price = price + if time_setup is not None: + self.time_setup = time_setup + if time_update is not None: + self.time_update = time_update + if max_order_volume is not None: + self.max_order_volume = max_order_volume + if step_order_volume is not None: + self.step_order_volume = step_order_volume + if min_order_volume is not None: + self.min_order_volume = min_order_volume + if price_precision is not None: + self.price_precision = price_precision + if price_protection is not None: + self.price_protection = price_protection + if sell_price_protection is not None: + self.sell_price_protection = sell_price_protection + if buy_price_protection is not None: + self.buy_price_protection = buy_price_protection + if commission_rate is not None: + self.commission_rate = commission_rate + if slippage_rate is not None: + self.slippage_rate = slippage_rate + + @property + def order_id(self): + """Gets the order_id of this OrderListItem. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OrderListItem. + + Order ID # noqa: E501 + + :param order_id: The order_id of this OrderListItem. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def symbol(self): + """Gets the symbol of this OrderListItem. # noqa: E501 + + Symbol # noqa: E501 + + :return: The symbol of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this OrderListItem. + + Symbol # noqa: E501 + + :param symbol: The symbol of this OrderListItem. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def exchange(self): + """Gets the exchange of this OrderListItem. # noqa: E501 + + Exchange, supports us, hk, and kr # noqa: E501 + + :return: The exchange of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this OrderListItem. + + Exchange, supports us, hk, and kr # noqa: E501 + + :param exchange: The exchange of this OrderListItem. # noqa: E501 + :type: str + """ + allowed_values = ["us", "hk", "kr"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and exchange not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `exchange` ({0}), must be one of {1}" # noqa: E501 + .format(exchange, allowed_values) + ) + + self._exchange = exchange + + @property + def quote_currency(self): + """Gets the quote_currency of this OrderListItem. # noqa: E501 + + Quote currency # noqa: E501 + + :return: The quote_currency of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._quote_currency + + @quote_currency.setter + def quote_currency(self, quote_currency): + """Sets the quote_currency of this OrderListItem. + + Quote currency # noqa: E501 + + :param quote_currency: The quote_currency of this OrderListItem. # noqa: E501 + :type: str + """ + + self._quote_currency = quote_currency + + @property + def fx_rate(self): + """Gets the fx_rate of this OrderListItem. # noqa: E501 + + Quote currency to USD exchange rate # noqa: E501 + + :return: The fx_rate of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._fx_rate + + @fx_rate.setter + def fx_rate(self, fx_rate): + """Sets the fx_rate of this OrderListItem. + + Quote currency to USD exchange rate # noqa: E501 + + :param fx_rate: The fx_rate of this OrderListItem. # noqa: E501 + :type: str + """ + + self._fx_rate = fx_rate + + @property + def symbol_desc(self): + """Gets the symbol_desc of this OrderListItem. # noqa: E501 + + Symbol description # noqa: E501 + + :return: The symbol_desc of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._symbol_desc + + @symbol_desc.setter + def symbol_desc(self, symbol_desc): + """Sets the symbol_desc of this OrderListItem. + + Symbol description # noqa: E501 + + :param symbol_desc: The symbol_desc of this OrderListItem. # noqa: E501 + :type: str + """ + + self._symbol_desc = symbol_desc + + @property + def trade_status(self): + """Gets the trade_status of this OrderListItem. # noqa: E501 + + Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. # noqa: E501 + + :return: The trade_status of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._trade_status + + @trade_status.setter + def trade_status(self, trade_status): + """Sets the trade_status of this OrderListItem. + + Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. # noqa: E501 + + :param trade_status: The trade_status of this OrderListItem. # noqa: E501 + :type: str + """ + allowed_values = ["pre_market", "open", "post_market", "closed", "gt_lp"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and trade_status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `trade_status` ({0}), must be one of {1}" # noqa: E501 + .format(trade_status, allowed_values) + ) + + self._trade_status = trade_status + + @property + def trade_mode(self): + """Gets the trade_mode of this OrderListItem. # noqa: E501 + + Current session trading mode. - 0: Trading disabled. - 1: Buy only. - 2: Sell only. - 4: Buy and sell supported. # noqa: E501 + + :return: The trade_mode of this OrderListItem. # noqa: E501 + :rtype: int + """ + return self._trade_mode + + @trade_mode.setter + def trade_mode(self, trade_mode): + """Sets the trade_mode of this OrderListItem. + + Current session trading mode. - 0: Trading disabled. - 1: Buy only. - 2: Sell only. - 4: Buy and sell supported. # noqa: E501 + + :param trade_mode: The trade_mode of this OrderListItem. # noqa: E501 + :type: int + """ + allowed_values = [0, 1, 2, 4] # noqa: E501 + if self.local_vars_configuration.client_side_validation and trade_mode not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `trade_mode` ({0}), must be one of {1}" # noqa: E501 + .format(trade_mode, allowed_values) + ) + + self._trade_mode = trade_mode + + @property + def price_type(self): + """Gets the price_type of this OrderListItem. # noqa: E501 + + Price type (market = market order, limit = limit order) # noqa: E501 + + :return: The price_type of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this OrderListItem. + + Price type (market = market order, limit = limit order) # noqa: E501 + + :param price_type: The price_type of this OrderListItem. # noqa: E501 + :type: str + """ + allowed_values = ["market", "limit"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def side(self): + """Gets the side of this OrderListItem. # noqa: E501 + + Side (1=sell, 2=buy) # noqa: E501 + + :return: The side of this OrderListItem. # noqa: E501 + :rtype: int + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OrderListItem. + + Side (1=sell, 2=buy) # noqa: E501 + + :param side: The side of this OrderListItem. # noqa: E501 + :type: int + """ + allowed_values = [1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) + ) + + self._side = side + + @property + def status(self): + """Gets the status of this OrderListItem. # noqa: E501 + + Order status # noqa: E501 + + :return: The status of this OrderListItem. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OrderListItem. + + Order status # noqa: E501 + + :param status: The status of this OrderListItem. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def volume(self): + """Gets the volume of this OrderListItem. # noqa: E501 + + Order quantity # noqa: E501 + + :return: The volume of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this OrderListItem. + + Order quantity # noqa: E501 + + :param volume: The volume of this OrderListItem. # noqa: E501 + :type: str + """ + + self._volume = volume + + @property + def fill_volume(self): + """Gets the fill_volume of this OrderListItem. # noqa: E501 + + Trading size # noqa: E501 + + :return: The fill_volume of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._fill_volume + + @fill_volume.setter + def fill_volume(self, fill_volume): + """Sets the fill_volume of this OrderListItem. + + Trading size # noqa: E501 + + :param fill_volume: The fill_volume of this OrderListItem. # noqa: E501 + :type: str + """ + + self._fill_volume = fill_volume + + @property + def price(self): + """Gets the price of this OrderListItem. # noqa: E501 + + Order price # noqa: E501 + + :return: The price of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OrderListItem. + + Order price # noqa: E501 + + :param price: The price of this OrderListItem. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def time_setup(self): + """Gets the time_setup of this OrderListItem. # noqa: E501 + + Order creation time (Unix timestamp, seconds) # noqa: E501 + + :return: The time_setup of this OrderListItem. # noqa: E501 + :rtype: int + """ + return self._time_setup + + @time_setup.setter + def time_setup(self, time_setup): + """Sets the time_setup of this OrderListItem. + + Order creation time (Unix timestamp, seconds) # noqa: E501 + + :param time_setup: The time_setup of this OrderListItem. # noqa: E501 + :type: int + """ + + self._time_setup = time_setup + + @property + def time_update(self): + """Gets the time_update of this OrderListItem. # noqa: E501 + + Order update time (Unix timestamp, seconds) # noqa: E501 + + :return: The time_update of this OrderListItem. # noqa: E501 + :rtype: int + """ + return self._time_update + + @time_update.setter + def time_update(self, time_update): + """Sets the time_update of this OrderListItem. + + Order update time (Unix timestamp, seconds) # noqa: E501 + + :param time_update: The time_update of this OrderListItem. # noqa: E501 + :type: int + """ + + self._time_update = time_update + + @property + def max_order_volume(self): + """Gets the max_order_volume of this OrderListItem. # noqa: E501 + + Maximum order quantity # noqa: E501 + + :return: The max_order_volume of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._max_order_volume + + @max_order_volume.setter + def max_order_volume(self, max_order_volume): + """Sets the max_order_volume of this OrderListItem. + + Maximum order quantity # noqa: E501 + + :param max_order_volume: The max_order_volume of this OrderListItem. # noqa: E501 + :type: str + """ + + self._max_order_volume = max_order_volume + + @property + def step_order_volume(self): + """Gets the step_order_volume of this OrderListItem. # noqa: E501 + + Order step size # noqa: E501 + + :return: The step_order_volume of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._step_order_volume + + @step_order_volume.setter + def step_order_volume(self, step_order_volume): + """Sets the step_order_volume of this OrderListItem. + + Order step size # noqa: E501 + + :param step_order_volume: The step_order_volume of this OrderListItem. # noqa: E501 + :type: str + """ + + self._step_order_volume = step_order_volume + + @property + def min_order_volume(self): + """Gets the min_order_volume of this OrderListItem. # noqa: E501 + + Minimum order quantity # noqa: E501 + + :return: The min_order_volume of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._min_order_volume + + @min_order_volume.setter + def min_order_volume(self, min_order_volume): + """Sets the min_order_volume of this OrderListItem. + + Minimum order quantity # noqa: E501 + + :param min_order_volume: The min_order_volume of this OrderListItem. # noqa: E501 + :type: str + """ + + self._min_order_volume = min_order_volume + + @property + def price_precision(self): + """Gets the price_precision of this OrderListItem. # noqa: E501 + + Price precision # noqa: E501 + + :return: The price_precision of this OrderListItem. # noqa: E501 + :rtype: int + """ + return self._price_precision + + @price_precision.setter + def price_precision(self, price_precision): + """Sets the price_precision of this OrderListItem. + + Price precision # noqa: E501 + + :param price_precision: The price_precision of this OrderListItem. # noqa: E501 + :type: int + """ + + self._price_precision = price_precision + + @property + def price_protection(self): + """Gets the price_protection of this OrderListItem. # noqa: E501 + + Price protection range # noqa: E501 + + :return: The price_protection of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._price_protection + + @price_protection.setter + def price_protection(self, price_protection): + """Sets the price_protection of this OrderListItem. + + Price protection range # noqa: E501 + + :param price_protection: The price_protection of this OrderListItem. # noqa: E501 + :type: str + """ + + self._price_protection = price_protection + + @property + def sell_price_protection(self): + """Gets the sell_price_protection of this OrderListItem. # noqa: E501 + + Sell price protection rate # noqa: E501 + + :return: The sell_price_protection of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._sell_price_protection + + @sell_price_protection.setter + def sell_price_protection(self, sell_price_protection): + """Sets the sell_price_protection of this OrderListItem. + + Sell price protection rate # noqa: E501 + + :param sell_price_protection: The sell_price_protection of this OrderListItem. # noqa: E501 + :type: str + """ + + self._sell_price_protection = sell_price_protection + + @property + def buy_price_protection(self): + """Gets the buy_price_protection of this OrderListItem. # noqa: E501 + + Buy price protection rate # noqa: E501 + + :return: The buy_price_protection of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._buy_price_protection + + @buy_price_protection.setter + def buy_price_protection(self, buy_price_protection): + """Sets the buy_price_protection of this OrderListItem. + + Buy price protection rate # noqa: E501 + + :param buy_price_protection: The buy_price_protection of this OrderListItem. # noqa: E501 + :type: str + """ + + self._buy_price_protection = buy_price_protection + + @property + def commission_rate(self): + """Gets the commission_rate of this OrderListItem. # noqa: E501 + + Fee Rate # noqa: E501 + + :return: The commission_rate of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._commission_rate + + @commission_rate.setter + def commission_rate(self, commission_rate): + """Sets the commission_rate of this OrderListItem. + + Fee Rate # noqa: E501 + + :param commission_rate: The commission_rate of this OrderListItem. # noqa: E501 + :type: str + """ + + self._commission_rate = commission_rate + + @property + def slippage_rate(self): + """Gets the slippage_rate of this OrderListItem. # noqa: E501 + + Slippage # noqa: E501 + + :return: The slippage_rate of this OrderListItem. # noqa: E501 + :rtype: str + """ + return self._slippage_rate + + @slippage_rate.setter + def slippage_rate(self, slippage_rate): + """Sets the slippage_rate of this OrderListItem. + + Slippage # noqa: E501 + + :param slippage_rate: The slippage_rate of this OrderListItem. # noqa: E501 + :type: str + """ + + self._slippage_rate = slippage_rate + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderListItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderListItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_list_struct_list.py b/gate_api/models/order_list_struct_list.py index f741dcf7..9493cbb0 100644 --- a/gate_api/models/order_list_struct_list.py +++ b/gate_api/models/order_list_struct_list.py @@ -188,7 +188,7 @@ def type(self, type): def status(self): """Gets the status of this OrderListStructList. # noqa: E501 - Status # noqa: E501 + Status. 1 - success, 3 - delayed redemption in progress, 6 - redemption cancellation order # noqa: E501 :return: The status of this OrderListStructList. # noqa: E501 :rtype: int @@ -199,7 +199,7 @@ def status(self): def status(self, status): """Sets the status of this OrderListStructList. - Status # noqa: E501 + Status. 1 - success, 3 - delayed redemption in progress, 6 - redemption cancellation order # noqa: E501 :param status: The status of this OrderListStructList. # noqa: E501 :type: int diff --git a/gate_api/models/order_list_v1_resp.py b/gate_api/models/order_list_v1_resp.py new file mode 100644 index 00000000..ed1f6647 --- /dev/null +++ b/gate_api/models/order_list_v1_resp.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderListV1Resp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'orders': 'list[CreateOrder]', + 'total': 'int' + } + + attribute_map = { + 'orders': 'orders', + 'total': 'total' + } + + def __init__(self, orders=None, total=None, local_vars_configuration=None): # noqa: E501 + # type: (list[CreateOrder], int, Configuration) -> None + """OrderListV1Resp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._orders = None + self._total = None + self.discriminator = None + + self.orders = orders + self.total = total + + @property + def orders(self): + """Gets the orders of this OrderListV1Resp. # noqa: E501 + + + :return: The orders of this OrderListV1Resp. # noqa: E501 + :rtype: list[CreateOrder] + """ + return self._orders + + @orders.setter + def orders(self, orders): + """Sets the orders of this OrderListV1Resp. + + + :param orders: The orders of this OrderListV1Resp. # noqa: E501 + :type: list[CreateOrder] + """ + if self.local_vars_configuration.client_side_validation and orders is None: # noqa: E501 + raise ValueError("Invalid value for `orders`, must not be `None`") # noqa: E501 + + self._orders = orders + + @property + def total(self): + """Gets the total of this OrderListV1Resp. # noqa: E501 + + + :return: The total of this OrderListV1Resp. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this OrderListV1Resp. + + + :param total: The total of this OrderListV1Resp. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderListV1Resp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderListV1Resp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_log.py b/gate_api/models/order_log.py new file mode 100644 index 00000000..ed491a0f --- /dev/null +++ b/gate_api/models/order_log.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderLog(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'OrderLogData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, OrderLogData, Configuration) -> None + """OrderLog - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this OrderLog. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this OrderLog. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OrderLog. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this OrderLog. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this OrderLog. # noqa: E501 + + + :return: The data of this OrderLog. # noqa: E501 + :rtype: OrderLogData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OrderLog. + + + :param data: The data of this OrderLog. # noqa: E501 + :type: OrderLogData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderLog): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderLog): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_log_data.py b/gate_api/models/order_log_data.py new file mode 100644 index 00000000..49526ff4 --- /dev/null +++ b/gate_api/models/order_log_data.py @@ -0,0 +1,331 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderLogData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'int', + 'log_id': 'int', + 'symbol': 'str', + 'price_type': 'str', + 'state': 'int', + 'side': 'int', + 'volume': 'str', + 'price': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'log_id': 'log_id', + 'symbol': 'symbol', + 'price_type': 'price_type', + 'state': 'state', + 'side': 'side', + 'volume': 'volume', + 'price': 'price' + } + + def __init__(self, order_id=None, log_id=None, symbol=None, price_type=None, state=None, side=None, volume=None, price=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, int, int, str, str, Configuration) -> None + """OrderLogData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._log_id = None + self._symbol = None + self._price_type = None + self._state = None + self._side = None + self._volume = None + self._price = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if log_id is not None: + self.log_id = log_id + if symbol is not None: + self.symbol = symbol + if price_type is not None: + self.price_type = price_type + if state is not None: + self.state = state + if side is not None: + self.side = side + if volume is not None: + self.volume = volume + if price is not None: + self.price = price + + @property + def order_id(self): + """Gets the order_id of this OrderLogData. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this OrderLogData. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OrderLogData. + + Order ID # noqa: E501 + + :param order_id: The order_id of this OrderLogData. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def log_id(self): + """Gets the log_id of this OrderLogData. # noqa: E501 + + logID # noqa: E501 + + :return: The log_id of this OrderLogData. # noqa: E501 + :rtype: int + """ + return self._log_id + + @log_id.setter + def log_id(self, log_id): + """Sets the log_id of this OrderLogData. + + logID # noqa: E501 + + :param log_id: The log_id of this OrderLogData. # noqa: E501 + :type: int + """ + + self._log_id = log_id + + @property + def symbol(self): + """Gets the symbol of this OrderLogData. # noqa: E501 + + Trading pair of the order # noqa: E501 + + :return: The symbol of this OrderLogData. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this OrderLogData. + + Trading pair of the order # noqa: E501 + + :param symbol: The symbol of this OrderLogData. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def price_type(self): + """Gets the price_type of this OrderLogData. # noqa: E501 + + Trade type (market=market price, trigger=trigger price) # noqa: E501 + + :return: The price_type of this OrderLogData. # noqa: E501 + :rtype: str + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this OrderLogData. + + Trade type (market=market price, trigger=trigger price) # noqa: E501 + + :param price_type: The price_type of this OrderLogData. # noqa: E501 + :type: str + """ + allowed_values = ["market", "trigger"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def state(self): + """Gets the state of this OrderLogData. # noqa: E501 + + Order status code (1=placed, 2=canceled, 3=partially filled, 4=filled, 5=rejected) # noqa: E501 + + :return: The state of this OrderLogData. # noqa: E501 + :rtype: int + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this OrderLogData. + + Order status code (1=placed, 2=canceled, 3=partially filled, 4=filled, 5=rejected) # noqa: E501 + + :param state: The state of this OrderLogData. # noqa: E501 + :type: int + """ + + self._state = state + + @property + def side(self): + """Gets the side of this OrderLogData. # noqa: E501 + + Side (1=sell, 2=buy) # noqa: E501 + + :return: The side of this OrderLogData. # noqa: E501 + :rtype: int + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OrderLogData. + + Side (1=sell, 2=buy) # noqa: E501 + + :param side: The side of this OrderLogData. # noqa: E501 + :type: int + """ + allowed_values = [1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) + ) + + self._side = side + + @property + def volume(self): + """Gets the volume of this OrderLogData. # noqa: E501 + + Order quantity # noqa: E501 + + :return: The volume of this OrderLogData. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this OrderLogData. + + Order quantity # noqa: E501 + + :param volume: The volume of this OrderLogData. # noqa: E501 + :type: str + """ + + self._volume = volume + + @property + def price(self): + """Gets the price of this OrderLogData. # noqa: E501 + + Average fill price # noqa: E501 + + :return: The price of this OrderLogData. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OrderLogData. + + Average fill price # noqa: E501 + + :param price: The price of this OrderLogData. # noqa: E501 + :type: str + """ + + self._price = price + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderLogData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderLogData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_patch.py b/gate_api/models/order_patch.py index 8e590359..f8dc4388 100644 --- a/gate_api/models/order_patch.py +++ b/gate_api/models/order_patch.py @@ -38,7 +38,9 @@ class OrderPatch(object): 'amount': 'str', 'price': 'str', 'amend_text': 'str', - 'action_mode': 'str' + 'action_mode': 'str', + 'stop_profit': 'SpotOrderStopProfit', + 'stop_loss': 'SpotOrderStopLoss' } attribute_map = { @@ -47,11 +49,13 @@ class OrderPatch(object): 'amount': 'amount', 'price': 'price', 'amend_text': 'amend_text', - 'action_mode': 'action_mode' + 'action_mode': 'action_mode', + 'stop_profit': 'stop_profit', + 'stop_loss': 'stop_loss' } - def __init__(self, currency_pair=None, account=None, amount=None, price=None, amend_text=None, action_mode=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, str, Configuration) -> None + def __init__(self, currency_pair=None, account=None, amount=None, price=None, amend_text=None, action_mode=None, stop_profit=None, stop_loss=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, SpotOrderStopProfit, SpotOrderStopLoss, Configuration) -> None """OrderPatch - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -63,6 +67,8 @@ def __init__(self, currency_pair=None, account=None, amount=None, price=None, am self._price = None self._amend_text = None self._action_mode = None + self._stop_profit = None + self._stop_loss = None self.discriminator = None if currency_pair is not None: @@ -77,6 +83,10 @@ def __init__(self, currency_pair=None, account=None, amount=None, price=None, am self.amend_text = amend_text if action_mode is not None: self.action_mode = action_mode + if stop_profit is not None: + self.stop_profit = stop_profit + if stop_loss is not None: + self.stop_loss = stop_loss @property def currency_pair(self): @@ -219,6 +229,48 @@ def action_mode(self, action_mode): self._action_mode = action_mode + @property + def stop_profit(self): + """Gets the stop_profit of this OrderPatch. # noqa: E501 + + + :return: The stop_profit of this OrderPatch. # noqa: E501 + :rtype: SpotOrderStopProfit + """ + return self._stop_profit + + @stop_profit.setter + def stop_profit(self, stop_profit): + """Sets the stop_profit of this OrderPatch. + + + :param stop_profit: The stop_profit of this OrderPatch. # noqa: E501 + :type: SpotOrderStopProfit + """ + + self._stop_profit = stop_profit + + @property + def stop_loss(self): + """Gets the stop_loss of this OrderPatch. # noqa: E501 + + + :return: The stop_loss of this OrderPatch. # noqa: E501 + :rtype: SpotOrderStopLoss + """ + return self._stop_loss + + @stop_loss.setter + def stop_loss(self, stop_loss): + """Sets the stop_loss of this OrderPatch. + + + :param stop_loss: The stop_loss of this OrderPatch. # noqa: E501 + :type: SpotOrderStopLoss + """ + + self._stop_loss = stop_loss + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/order_preview_v1_req.py b/gate_api/models/order_preview_v1_req.py new file mode 100644 index 00000000..3d88c8b6 --- /dev/null +++ b/gate_api/models/order_preview_v1_req.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderPreviewV1Req(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + '_from': 'list[PreviewFromParam]', + 'to': 'list[PreviewToParam]' + } + + attribute_map = { + '_from': 'from', + 'to': 'to' + } + + def __init__(self, _from=None, to=None, local_vars_configuration=None): # noqa: E501 + # type: (list[PreviewFromParam], list[PreviewToParam], Configuration) -> None + """OrderPreviewV1Req - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self.__from = None + self._to = None + self.discriminator = None + + self._from = _from + self.to = to + + @property + def _from(self): + """Gets the _from of this OrderPreviewV1Req. # noqa: E501 + + Sell ​​side; each item is the currency + the swap amount `amount` (string decimal). # noqa: E501 + + :return: The _from of this OrderPreviewV1Req. # noqa: E501 + :rtype: list[PreviewFromParam] + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this OrderPreviewV1Req. + + Sell ​​side; each item is the currency + the swap amount `amount` (string decimal). # noqa: E501 + + :param _from: The _from of this OrderPreviewV1Req. # noqa: E501 + :type: list[PreviewFromParam] + """ + if self.local_vars_configuration.client_side_validation and _from is None: # noqa: E501 + raise ValueError("Invalid value for `_from`, must not be `None`") # noqa: E501 + + self.__from = _from + + @property + def to(self): + """Gets the to of this OrderPreviewV1Req. # noqa: E501 + + Target side; each item is currency + **ratio** `ratio` (string decimal, such as `0.5`). Typical source: `GET /asset-swap/config` → `recommend_v2` `schemes[].name` / `schemes[].ratio` of the strategy under a certain group. # noqa: E501 + + :return: The to of this OrderPreviewV1Req. # noqa: E501 + :rtype: list[PreviewToParam] + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this OrderPreviewV1Req. + + Target side; each item is currency + **ratio** `ratio` (string decimal, such as `0.5`). Typical source: `GET /asset-swap/config` → `recommend_v2` `schemes[].name` / `schemes[].ratio` of the strategy under a certain group. # noqa: E501 + + :param to: The to of this OrderPreviewV1Req. # noqa: E501 + :type: list[PreviewToParam] + """ + if self.local_vars_configuration.client_side_validation and to is None: # noqa: E501 + raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501 + + self._to = to + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderPreviewV1Req): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderPreviewV1Req): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_preview_v1_resp.py b/gate_api/models/order_preview_v1_resp.py new file mode 100644 index 00000000..d2f995b6 --- /dev/null +++ b/gate_api/models/order_preview_v1_resp.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderPreviewV1Resp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order': 'PreviewOrder', + 'transaction_fee': 'str' + } + + attribute_map = { + 'order': 'order', + 'transaction_fee': 'transaction_fee' + } + + def __init__(self, order=None, transaction_fee=None, local_vars_configuration=None): # noqa: E501 + # type: (PreviewOrder, str, Configuration) -> None + """OrderPreviewV1Resp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order = None + self._transaction_fee = None + self.discriminator = None + + self.order = order + self.transaction_fee = transaction_fee + + @property + def order(self): + """Gets the order of this OrderPreviewV1Resp. # noqa: E501 + + + :return: The order of this OrderPreviewV1Resp. # noqa: E501 + :rtype: PreviewOrder + """ + return self._order + + @order.setter + def order(self, order): + """Sets the order of this OrderPreviewV1Resp. + + + :param order: The order of this OrderPreviewV1Resp. # noqa: E501 + :type: PreviewOrder + """ + if self.local_vars_configuration.client_side_validation and order is None: # noqa: E501 + raise ValueError("Invalid value for `order`, must not be `None`") # noqa: E501 + + self._order = order + + @property + def transaction_fee(self): + """Gets the transaction_fee of this OrderPreviewV1Resp. # noqa: E501 + + + :return: The transaction_fee of this OrderPreviewV1Resp. # noqa: E501 + :rtype: str + """ + return self._transaction_fee + + @transaction_fee.setter + def transaction_fee(self, transaction_fee): + """Sets the transaction_fee of this OrderPreviewV1Resp. + + + :param transaction_fee: The transaction_fee of this OrderPreviewV1Resp. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and transaction_fee is None: # noqa: E501 + raise ValueError("Invalid value for `transaction_fee`, must not be `None`") # noqa: E501 + + self._transaction_fee = transaction_fee + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderPreviewV1Resp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderPreviewV1Resp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/order_response.py b/gate_api/models/order_response.py new file mode 100644 index 00000000..f5d6ec2d --- /dev/null +++ b/gate_api/models/order_response.py @@ -0,0 +1,459 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OrderResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'tx_hash': 'str', + 'side': 'str', + 'usdt_amount': 'str', + 'currency': 'str', + 'currency_amount': 'str', + 'status': 'int', + 'gas_mode': 'str', + 'chain': 'str', + 'gas_fee': 'str', + 'transaction_fee': 'str', + 'failed_reason': 'str', + 'create_time': 'int' + } + + attribute_map = { + 'order_id': 'order_id', + 'tx_hash': 'tx_hash', + 'side': 'side', + 'usdt_amount': 'usdt_amount', + 'currency': 'currency', + 'currency_amount': 'currency_amount', + 'status': 'status', + 'gas_mode': 'gas_mode', + 'chain': 'chain', + 'gas_fee': 'gas_fee', + 'transaction_fee': 'transaction_fee', + 'failed_reason': 'failed_reason', + 'create_time': 'create_time' + } + + def __init__(self, order_id=None, tx_hash=None, side=None, usdt_amount=None, currency=None, currency_amount=None, status=None, gas_mode=None, chain=None, gas_fee=None, transaction_fee=None, failed_reason=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, int, str, str, str, str, str, int, Configuration) -> None + """OrderResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._tx_hash = None + self._side = None + self._usdt_amount = None + self._currency = None + self._currency_amount = None + self._status = None + self._gas_mode = None + self._chain = None + self._gas_fee = None + self._transaction_fee = None + self._failed_reason = None + self._create_time = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if tx_hash is not None: + self.tx_hash = tx_hash + if side is not None: + self.side = side + if usdt_amount is not None: + self.usdt_amount = usdt_amount + if currency is not None: + self.currency = currency + if currency_amount is not None: + self.currency_amount = currency_amount + if status is not None: + self.status = status + if gas_mode is not None: + self.gas_mode = gas_mode + if chain is not None: + self.chain = chain + if gas_fee is not None: + self.gas_fee = gas_fee + if transaction_fee is not None: + self.transaction_fee = transaction_fee + if failed_reason is not None: + self.failed_reason = failed_reason + if create_time is not None: + self.create_time = create_time + + @property + def order_id(self): + """Gets the order_id of this OrderResponse. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OrderResponse. + + Order ID # noqa: E501 + + :param order_id: The order_id of this OrderResponse. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def tx_hash(self): + """Gets the tx_hash of this OrderResponse. # noqa: E501 + + Transaction Hash # noqa: E501 + + :return: The tx_hash of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._tx_hash + + @tx_hash.setter + def tx_hash(self, tx_hash): + """Sets the tx_hash of this OrderResponse. + + Transaction Hash # noqa: E501 + + :param tx_hash: The tx_hash of this OrderResponse. # noqa: E501 + :type: str + """ + + self._tx_hash = tx_hash + + @property + def side(self): + """Gets the side of this OrderResponse. # noqa: E501 + + Buy or sell orders - buy - sell # noqa: E501 + + :return: The side of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OrderResponse. + + Buy or sell orders - buy - sell # noqa: E501 + + :param side: The side of this OrderResponse. # noqa: E501 + :type: str + """ + + self._side = side + + @property + def usdt_amount(self): + """Gets the usdt_amount of this OrderResponse. # noqa: E501 + + Amount (USDT) # noqa: E501 + + :return: The usdt_amount of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._usdt_amount + + @usdt_amount.setter + def usdt_amount(self, usdt_amount): + """Sets the usdt_amount of this OrderResponse. + + Amount (USDT) # noqa: E501 + + :param usdt_amount: The usdt_amount of this OrderResponse. # noqa: E501 + :type: str + """ + + self._usdt_amount = usdt_amount + + @property + def currency(self): + """Gets the currency of this OrderResponse. # noqa: E501 + + Token # noqa: E501 + + :return: The currency of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this OrderResponse. + + Token # noqa: E501 + + :param currency: The currency of this OrderResponse. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def currency_amount(self): + """Gets the currency_amount of this OrderResponse. # noqa: E501 + + Token amount # noqa: E501 + + :return: The currency_amount of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._currency_amount + + @currency_amount.setter + def currency_amount(self, currency_amount): + """Sets the currency_amount of this OrderResponse. + + Token amount # noqa: E501 + + :param currency_amount: The currency_amount of this OrderResponse. # noqa: E501 + :type: str + """ + + self._currency_amount = currency_amount + + @property + def status(self): + """Gets the status of this OrderResponse. # noqa: E501 + + Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed # noqa: E501 + + :return: The status of this OrderResponse. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OrderResponse. + + Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed # noqa: E501 + + :param status: The status of this OrderResponse. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def gas_mode(self): + """Gets the gas_mode of this OrderResponse. # noqa: E501 + + Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter # noqa: E501 + + :return: The gas_mode of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._gas_mode + + @gas_mode.setter + def gas_mode(self, gas_mode): + """Sets the gas_mode of this OrderResponse. + + Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter # noqa: E501 + + :param gas_mode: The gas_mode of this OrderResponse. # noqa: E501 + :type: str + """ + + self._gas_mode = gas_mode + + @property + def chain(self): + """Gets the chain of this OrderResponse. # noqa: E501 + + Blockchain # noqa: E501 + + :return: The chain of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this OrderResponse. + + Blockchain # noqa: E501 + + :param chain: The chain of this OrderResponse. # noqa: E501 + :type: str + """ + + self._chain = chain + + @property + def gas_fee(self): + """Gets the gas_fee of this OrderResponse. # noqa: E501 + + Gas Fee (USDT-based) # noqa: E501 + + :return: The gas_fee of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._gas_fee + + @gas_fee.setter + def gas_fee(self, gas_fee): + """Sets the gas_fee of this OrderResponse. + + Gas Fee (USDT-based) # noqa: E501 + + :param gas_fee: The gas_fee of this OrderResponse. # noqa: E501 + :type: str + """ + + self._gas_fee = gas_fee + + @property + def transaction_fee(self): + """Gets the transaction_fee of this OrderResponse. # noqa: E501 + + Trading Fee (USDT-based) # noqa: E501 + + :return: The transaction_fee of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._transaction_fee + + @transaction_fee.setter + def transaction_fee(self, transaction_fee): + """Sets the transaction_fee of this OrderResponse. + + Trading Fee (USDT-based) # noqa: E501 + + :param transaction_fee: The transaction_fee of this OrderResponse. # noqa: E501 + :type: str + """ + + self._transaction_fee = transaction_fee + + @property + def failed_reason(self): + """Gets the failed_reason of this OrderResponse. # noqa: E501 + + Failure reason (if applicable) # noqa: E501 + + :return: The failed_reason of this OrderResponse. # noqa: E501 + :rtype: str + """ + return self._failed_reason + + @failed_reason.setter + def failed_reason(self, failed_reason): + """Sets the failed_reason of this OrderResponse. + + Failure reason (if applicable) # noqa: E501 + + :param failed_reason: The failed_reason of this OrderResponse. # noqa: E501 + :type: str + """ + + self._failed_reason = failed_reason + + @property + def create_time(self): + """Gets the create_time of this OrderResponse. # noqa: E501 + + Creation timestamp # noqa: E501 + + :return: The create_time of this OrderResponse. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this OrderResponse. + + Creation timestamp # noqa: E501 + + :param create_time: The create_time of this OrderResponse. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrderResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OrderResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_action_response.py b/gate_api/models/otc_action_response.py new file mode 100644 index 00000000..490f2e70 --- /dev/null +++ b/gate_api/models/otc_action_response.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcActionResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, int, Configuration) -> None + """OtcActionResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this OtcActionResponse. # noqa: E501 + + + :return: The code of this OtcActionResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this OtcActionResponse. + + + :param code: The code of this OtcActionResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this OtcActionResponse. # noqa: E501 + + + :return: The message of this OtcActionResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OtcActionResponse. + + + :param message: The message of this OtcActionResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def timestamp(self): + """Gets the timestamp of this OtcActionResponse. # noqa: E501 + + + :return: The timestamp of this OtcActionResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OtcActionResponse. + + + :param timestamp: The timestamp of this OtcActionResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcActionResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcActionResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_create_multipart_request.py b/gate_api/models/otc_bank_create_multipart_request.py new file mode 100644 index 00000000..33a80bd7 --- /dev/null +++ b/gate_api/models/otc_bank_create_multipart_request.py @@ -0,0 +1,364 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankCreateMultipartRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'bank_account_name': 'str', + 'bank_name': 'str', + 'bank_country': 'str', + 'bank_address': 'str', + 'iban': 'str', + 'swift': 'str', + 'remittance_line_number': 'str', + 'agent_bank_name': 'str', + 'agent_bank_swift': 'str', + 'documentation_file': 'str' + } + + attribute_map = { + 'bank_account_name': 'bank_account_name', + 'bank_name': 'bank_name', + 'bank_country': 'bank_country', + 'bank_address': 'bank_address', + 'iban': 'iban', + 'swift': 'swift', + 'remittance_line_number': 'remittance_line_number', + 'agent_bank_name': 'agent_bank_name', + 'agent_bank_swift': 'agent_bank_swift', + 'documentation_file': 'documentation_file' + } + + def __init__(self, bank_account_name=None, bank_name=None, bank_country=None, bank_address=None, iban=None, swift=None, remittance_line_number=None, agent_bank_name=None, agent_bank_swift=None, documentation_file=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """OtcBankCreateMultipartRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._bank_account_name = None + self._bank_name = None + self._bank_country = None + self._bank_address = None + self._iban = None + self._swift = None + self._remittance_line_number = None + self._agent_bank_name = None + self._agent_bank_swift = None + self._documentation_file = None + self.discriminator = None + + self.bank_account_name = bank_account_name + self.bank_name = bank_name + self.bank_country = bank_country + self.bank_address = bank_address + self.iban = iban + self.swift = swift + if remittance_line_number is not None: + self.remittance_line_number = remittance_line_number + if agent_bank_name is not None: + self.agent_bank_name = agent_bank_name + if agent_bank_swift is not None: + self.agent_bank_swift = agent_bank_swift + self.documentation_file = documentation_file + + @property + def bank_account_name(self): + """Gets the bank_account_name of this OtcBankCreateMultipartRequest. # noqa: E501 + + + :return: The bank_account_name of this OtcBankCreateMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._bank_account_name + + @bank_account_name.setter + def bank_account_name(self, bank_account_name): + """Sets the bank_account_name of this OtcBankCreateMultipartRequest. + + + :param bank_account_name: The bank_account_name of this OtcBankCreateMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and bank_account_name is None: # noqa: E501 + raise ValueError("Invalid value for `bank_account_name`, must not be `None`") # noqa: E501 + + self._bank_account_name = bank_account_name + + @property + def bank_name(self): + """Gets the bank_name of this OtcBankCreateMultipartRequest. # noqa: E501 + + + :return: The bank_name of this OtcBankCreateMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._bank_name + + @bank_name.setter + def bank_name(self, bank_name): + """Sets the bank_name of this OtcBankCreateMultipartRequest. + + + :param bank_name: The bank_name of this OtcBankCreateMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and bank_name is None: # noqa: E501 + raise ValueError("Invalid value for `bank_name`, must not be `None`") # noqa: E501 + + self._bank_name = bank_name + + @property + def bank_country(self): + """Gets the bank_country of this OtcBankCreateMultipartRequest. # noqa: E501 + + + :return: The bank_country of this OtcBankCreateMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._bank_country + + @bank_country.setter + def bank_country(self, bank_country): + """Sets the bank_country of this OtcBankCreateMultipartRequest. + + + :param bank_country: The bank_country of this OtcBankCreateMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and bank_country is None: # noqa: E501 + raise ValueError("Invalid value for `bank_country`, must not be `None`") # noqa: E501 + + self._bank_country = bank_country + + @property + def bank_address(self): + """Gets the bank_address of this OtcBankCreateMultipartRequest. # noqa: E501 + + + :return: The bank_address of this OtcBankCreateMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._bank_address + + @bank_address.setter + def bank_address(self, bank_address): + """Sets the bank_address of this OtcBankCreateMultipartRequest. + + + :param bank_address: The bank_address of this OtcBankCreateMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and bank_address is None: # noqa: E501 + raise ValueError("Invalid value for `bank_address`, must not be `None`") # noqa: E501 + + self._bank_address = bank_address + + @property + def iban(self): + """Gets the iban of this OtcBankCreateMultipartRequest. # noqa: E501 + + + :return: The iban of this OtcBankCreateMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._iban + + @iban.setter + def iban(self, iban): + """Sets the iban of this OtcBankCreateMultipartRequest. + + + :param iban: The iban of this OtcBankCreateMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and iban is None: # noqa: E501 + raise ValueError("Invalid value for `iban`, must not be `None`") # noqa: E501 + + self._iban = iban + + @property + def swift(self): + """Gets the swift of this OtcBankCreateMultipartRequest. # noqa: E501 + + + :return: The swift of this OtcBankCreateMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._swift + + @swift.setter + def swift(self, swift): + """Sets the swift of this OtcBankCreateMultipartRequest. + + + :param swift: The swift of this OtcBankCreateMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and swift is None: # noqa: E501 + raise ValueError("Invalid value for `swift`, must not be `None`") # noqa: E501 + + self._swift = swift + + @property + def remittance_line_number(self): + """Gets the remittance_line_number of this OtcBankCreateMultipartRequest. # noqa: E501 + + + :return: The remittance_line_number of this OtcBankCreateMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._remittance_line_number + + @remittance_line_number.setter + def remittance_line_number(self, remittance_line_number): + """Sets the remittance_line_number of this OtcBankCreateMultipartRequest. + + + :param remittance_line_number: The remittance_line_number of this OtcBankCreateMultipartRequest. # noqa: E501 + :type: str + """ + + self._remittance_line_number = remittance_line_number + + @property + def agent_bank_name(self): + """Gets the agent_bank_name of this OtcBankCreateMultipartRequest. # noqa: E501 + + + :return: The agent_bank_name of this OtcBankCreateMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._agent_bank_name + + @agent_bank_name.setter + def agent_bank_name(self, agent_bank_name): + """Sets the agent_bank_name of this OtcBankCreateMultipartRequest. + + + :param agent_bank_name: The agent_bank_name of this OtcBankCreateMultipartRequest. # noqa: E501 + :type: str + """ + + self._agent_bank_name = agent_bank_name + + @property + def agent_bank_swift(self): + """Gets the agent_bank_swift of this OtcBankCreateMultipartRequest. # noqa: E501 + + + :return: The agent_bank_swift of this OtcBankCreateMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._agent_bank_swift + + @agent_bank_swift.setter + def agent_bank_swift(self, agent_bank_swift): + """Sets the agent_bank_swift of this OtcBankCreateMultipartRequest. + + + :param agent_bank_swift: The agent_bank_swift of this OtcBankCreateMultipartRequest. # noqa: E501 + :type: str + """ + + self._agent_bank_swift = agent_bank_swift + + @property + def documentation_file(self): + """Gets the documentation_file of this OtcBankCreateMultipartRequest. # noqa: E501 + + Account opening proof file content (multipart file field, binary/Base64; jpg/jpeg/png/pdf, etc.; maximum 10 MB per file, subject to the live environment) # noqa: E501 + + :return: The documentation_file of this OtcBankCreateMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._documentation_file + + @documentation_file.setter + def documentation_file(self, documentation_file): + """Sets the documentation_file of this OtcBankCreateMultipartRequest. + + Account opening proof file content (multipart file field, binary/Base64; jpg/jpeg/png/pdf, etc.; maximum 10 MB per file, subject to the live environment) # noqa: E501 + + :param documentation_file: The documentation_file of this OtcBankCreateMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and documentation_file is None: # noqa: E501 + raise ValueError("Invalid value for `documentation_file`, must not be `None`") # noqa: E501 + + self._documentation_file = documentation_file + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankCreateMultipartRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankCreateMultipartRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_create_response.py b/gate_api/models/otc_bank_create_response.py new file mode 100644 index 00000000..16482959 --- /dev/null +++ b/gate_api/models/otc_bank_create_response.py @@ -0,0 +1,202 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankCreateResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'OtcBankCreateResponseData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, OtcBankCreateResponseData, int, Configuration) -> None + """OtcBankCreateResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this OtcBankCreateResponse. # noqa: E501 + + + :return: The code of this OtcBankCreateResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this OtcBankCreateResponse. + + + :param code: The code of this OtcBankCreateResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this OtcBankCreateResponse. # noqa: E501 + + + :return: The message of this OtcBankCreateResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OtcBankCreateResponse. + + + :param message: The message of this OtcBankCreateResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this OtcBankCreateResponse. # noqa: E501 + + + :return: The data of this OtcBankCreateResponse. # noqa: E501 + :rtype: OtcBankCreateResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OtcBankCreateResponse. + + + :param data: The data of this OtcBankCreateResponse. # noqa: E501 + :type: OtcBankCreateResponseData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this OtcBankCreateResponse. # noqa: E501 + + + :return: The timestamp of this OtcBankCreateResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OtcBankCreateResponse. + + + :param timestamp: The timestamp of this OtcBankCreateResponse. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankCreateResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankCreateResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_create_response_data.py b/gate_api/models/otc_bank_create_response_data.py new file mode 100644 index 00000000..1d2a38bf --- /dev/null +++ b/gate_api/models/otc_bank_create_response_data.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankCreateResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'bank_id': 'int', + 'status': 'int' + } + + attribute_map = { + 'bank_id': 'bank_id', + 'status': 'status' + } + + def __init__(self, bank_id=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, Configuration) -> None + """OtcBankCreateResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._bank_id = None + self._status = None + self.discriminator = None + + self.bank_id = bank_id + self.status = status + + @property + def bank_id(self): + """Gets the bank_id of this OtcBankCreateResponseData. # noqa: E501 + + Bank card primary key in otc_rds. # noqa: E501 + + :return: The bank_id of this OtcBankCreateResponseData. # noqa: E501 + :rtype: int + """ + return self._bank_id + + @bank_id.setter + def bank_id(self, bank_id): + """Sets the bank_id of this OtcBankCreateResponseData. + + Bank card primary key in otc_rds. # noqa: E501 + + :param bank_id: The bank_id of this OtcBankCreateResponseData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and bank_id is None: # noqa: E501 + raise ValueError("Invalid value for `bank_id`, must not be `None`") # noqa: E501 + + self._bank_id = bank_id + + @property + def status(self): + """Gets the status of this OtcBankCreateResponseData. # noqa: E501 + + Review status (e.g., pending review). # noqa: E501 + + :return: The status of this OtcBankCreateResponseData. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OtcBankCreateResponseData. + + Review status (e.g., pending review). # noqa: E501 + + :param status: The status of this OtcBankCreateResponseData. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankCreateResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankCreateResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_enterprise_supplement_multipart_request.py b/gate_api/models/otc_bank_enterprise_supplement_multipart_request.py new file mode 100644 index 00000000..5b962cec --- /dev/null +++ b/gate_api/models/otc_bank_enterprise_supplement_multipart_request.py @@ -0,0 +1,320 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankEnterpriseSupplementMultipartRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'uid': 'str', + 'bank_id': 'str', + 'certificate': 'str', + 'share_holders': 'str', + 'passport': 'str', + 'share_holding_structure': 'str', + 'funds_statement': 'str', + 'additional': 'str' + } + + attribute_map = { + 'uid': 'uid', + 'bank_id': 'bank_id', + 'certificate': 'certificate', + 'share_holders': 'share_holders', + 'passport': 'passport', + 'share_holding_structure': 'share_holding_structure', + 'funds_statement': 'funds_statement', + 'additional': 'additional' + } + + def __init__(self, uid=None, bank_id=None, certificate=None, share_holders=None, passport=None, share_holding_structure=None, funds_statement=None, additional=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, Configuration) -> None + """OtcBankEnterpriseSupplementMultipartRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._uid = None + self._bank_id = None + self._certificate = None + self._share_holders = None + self._passport = None + self._share_holding_structure = None + self._funds_statement = None + self._additional = None + self.discriminator = None + + if uid is not None: + self.uid = uid + self.bank_id = bank_id + self.certificate = certificate + self.share_holders = share_holders + self.passport = passport + self.share_holding_structure = share_holding_structure + if funds_statement is not None: + self.funds_statement = funds_statement + if additional is not None: + self.additional = additional + + @property + def uid(self): + """Gets the uid of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + + + :return: The uid of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this OtcBankEnterpriseSupplementMultipartRequest. + + + :param uid: The uid of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :type: str + """ + + self._uid = uid + + @property + def bank_id(self): + """Gets the bank_id of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + + + :return: The bank_id of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._bank_id + + @bank_id.setter + def bank_id(self, bank_id): + """Sets the bank_id of this OtcBankEnterpriseSupplementMultipartRequest. + + + :param bank_id: The bank_id of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and bank_id is None: # noqa: E501 + raise ValueError("Invalid value for `bank_id`, must not be `None`") # noqa: E501 + + self._bank_id = bank_id + + @property + def certificate(self): + """Gets the certificate of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + + Business license / registration certificate file content (multipart file field, binary/Base64) # noqa: E501 + + :return: The certificate of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._certificate + + @certificate.setter + def certificate(self, certificate): + """Sets the certificate of this OtcBankEnterpriseSupplementMultipartRequest. + + Business license / registration certificate file content (multipart file field, binary/Base64) # noqa: E501 + + :param certificate: The certificate of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and certificate is None: # noqa: E501 + raise ValueError("Invalid value for `certificate`, must not be `None`") # noqa: E501 + + self._certificate = certificate + + @property + def share_holders(self): + """Gets the share_holders of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + + Register of shareholders file content (multipart file field, binary/Base64) # noqa: E501 + + :return: The share_holders of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._share_holders + + @share_holders.setter + def share_holders(self, share_holders): + """Sets the share_holders of this OtcBankEnterpriseSupplementMultipartRequest. + + Register of shareholders file content (multipart file field, binary/Base64) # noqa: E501 + + :param share_holders: The share_holders of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and share_holders is None: # noqa: E501 + raise ValueError("Invalid value for `share_holders`, must not be `None`") # noqa: E501 + + self._share_holders = share_holders + + @property + def passport(self): + """Gets the passport of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + + Legal representative / shareholder passport file content (multipart file field, binary/Base64) # noqa: E501 + + :return: The passport of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._passport + + @passport.setter + def passport(self, passport): + """Sets the passport of this OtcBankEnterpriseSupplementMultipartRequest. + + Legal representative / shareholder passport file content (multipart file field, binary/Base64) # noqa: E501 + + :param passport: The passport of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and passport is None: # noqa: E501 + raise ValueError("Invalid value for `passport`, must not be `None`") # noqa: E501 + + self._passport = passport + + @property + def share_holding_structure(self): + """Gets the share_holding_structure of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + + Ownership structure chart file content (multipart file field, binary/Base64) # noqa: E501 + + :return: The share_holding_structure of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._share_holding_structure + + @share_holding_structure.setter + def share_holding_structure(self, share_holding_structure): + """Sets the share_holding_structure of this OtcBankEnterpriseSupplementMultipartRequest. + + Ownership structure chart file content (multipart file field, binary/Base64) # noqa: E501 + + :param share_holding_structure: The share_holding_structure of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and share_holding_structure is None: # noqa: E501 + raise ValueError("Invalid value for `share_holding_structure`, must not be `None`") # noqa: E501 + + self._share_holding_structure = share_holding_structure + + @property + def funds_statement(self): + """Gets the funds_statement of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + + Proof-of-funds file content (multipart file field, binary/Base64, optional) # noqa: E501 + + :return: The funds_statement of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._funds_statement + + @funds_statement.setter + def funds_statement(self, funds_statement): + """Sets the funds_statement of this OtcBankEnterpriseSupplementMultipartRequest. + + Proof-of-funds file content (multipart file field, binary/Base64, optional) # noqa: E501 + + :param funds_statement: The funds_statement of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :type: str + """ + + self._funds_statement = funds_statement + + @property + def additional(self): + """Gets the additional of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + + Other supplementary material file content (multipart file field, binary/Base64, optional) # noqa: E501 + + :return: The additional of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._additional + + @additional.setter + def additional(self, additional): + """Sets the additional of this OtcBankEnterpriseSupplementMultipartRequest. + + Other supplementary material file content (multipart file field, binary/Base64, optional) # noqa: E501 + + :param additional: The additional of this OtcBankEnterpriseSupplementMultipartRequest. # noqa: E501 + :type: str + """ + + self._additional = additional + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankEnterpriseSupplementMultipartRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankEnterpriseSupplementMultipartRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_id_request.py b/gate_api/models/otc_bank_id_request.py new file mode 100644 index 00000000..403dd182 --- /dev/null +++ b/gate_api/models/otc_bank_id_request.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankIdRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'bank_id': 'str' + } + + attribute_map = { + 'bank_id': 'bank_id' + } + + def __init__(self, bank_id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """OtcBankIdRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._bank_id = None + self.discriminator = None + + self.bank_id = bank_id + + @property + def bank_id(self): + """Gets the bank_id of this OtcBankIdRequest. # noqa: E501 + + Bank card ID # noqa: E501 + + :return: The bank_id of this OtcBankIdRequest. # noqa: E501 + :rtype: str + """ + return self._bank_id + + @bank_id.setter + def bank_id(self, bank_id): + """Sets the bank_id of this OtcBankIdRequest. + + Bank card ID # noqa: E501 + + :param bank_id: The bank_id of this OtcBankIdRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and bank_id is None: # noqa: E501 + raise ValueError("Invalid value for `bank_id`, must not be `None`") # noqa: E501 + + self._bank_id = bank_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankIdRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankIdRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_list_item.py b/gate_api/models/otc_bank_list_item.py new file mode 100644 index 00000000..6f86d03a --- /dev/null +++ b/gate_api/models/otc_bank_list_item.py @@ -0,0 +1,490 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankListItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'bank_account_name': 'str', + 'bank_name': 'str', + 'bank_country': 'str', + 'bank_address': 'str', + 'iban': 'str', + 'swift': 'str', + 'remittance_line_number': 'str', + 'agent_bank_name': 'str', + 'agent_bank_swift': 'str', + 'submit_time': 'str', + 'update_time': 'str', + 'status': 'str', + 'is_default': 'int' + } + + attribute_map = { + 'id': 'id', + 'bank_account_name': 'bank_account_name', + 'bank_name': 'bank_name', + 'bank_country': 'bank_country', + 'bank_address': 'bank_address', + 'iban': 'iban', + 'swift': 'swift', + 'remittance_line_number': 'remittance_line_number', + 'agent_bank_name': 'agent_bank_name', + 'agent_bank_swift': 'agent_bank_swift', + 'submit_time': 'submit_time', + 'update_time': 'update_time', + 'status': 'status', + 'is_default': 'is_default' + } + + def __init__(self, id=None, bank_account_name=None, bank_name=None, bank_country=None, bank_address=None, iban=None, swift=None, remittance_line_number=None, agent_bank_name=None, agent_bank_swift=None, submit_time=None, update_time=None, status=None, is_default=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, int, Configuration) -> None + """OtcBankListItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._bank_account_name = None + self._bank_name = None + self._bank_country = None + self._bank_address = None + self._iban = None + self._swift = None + self._remittance_line_number = None + self._agent_bank_name = None + self._agent_bank_swift = None + self._submit_time = None + self._update_time = None + self._status = None + self._is_default = None + self.discriminator = None + + self.id = id + self.bank_account_name = bank_account_name + self.bank_name = bank_name + if bank_country is not None: + self.bank_country = bank_country + if bank_address is not None: + self.bank_address = bank_address + if iban is not None: + self.iban = iban + if swift is not None: + self.swift = swift + if remittance_line_number is not None: + self.remittance_line_number = remittance_line_number + if agent_bank_name is not None: + self.agent_bank_name = agent_bank_name + if agent_bank_swift is not None: + self.agent_bank_swift = agent_bank_swift + if submit_time is not None: + self.submit_time = submit_time + if update_time is not None: + self.update_time = update_time + if status is not None: + self.status = status + if is_default is not None: + self.is_default = is_default + + @property + def id(self): + """Gets the id of this OtcBankListItem. # noqa: E501 + + Bank card ID (used when placing an order; the synonymous `bank_id` field has been consolidated into `id`) # noqa: E501 + + :return: The id of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this OtcBankListItem. + + Bank card ID (used when placing an order; the synonymous `bank_id` field has been consolidated into `id`) # noqa: E501 + + :param id: The id of this OtcBankListItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def bank_account_name(self): + """Gets the bank_account_name of this OtcBankListItem. # noqa: E501 + + Bank account name # noqa: E501 + + :return: The bank_account_name of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._bank_account_name + + @bank_account_name.setter + def bank_account_name(self, bank_account_name): + """Sets the bank_account_name of this OtcBankListItem. + + Bank account name # noqa: E501 + + :param bank_account_name: The bank_account_name of this OtcBankListItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and bank_account_name is None: # noqa: E501 + raise ValueError("Invalid value for `bank_account_name`, must not be `None`") # noqa: E501 + + self._bank_account_name = bank_account_name + + @property + def bank_name(self): + """Gets the bank_name of this OtcBankListItem. # noqa: E501 + + Bank name # noqa: E501 + + :return: The bank_name of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._bank_name + + @bank_name.setter + def bank_name(self, bank_name): + """Sets the bank_name of this OtcBankListItem. + + Bank name # noqa: E501 + + :param bank_name: The bank_name of this OtcBankListItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and bank_name is None: # noqa: E501 + raise ValueError("Invalid value for `bank_name`, must not be `None`") # noqa: E501 + + self._bank_name = bank_name + + @property + def bank_country(self): + """Gets the bank_country of this OtcBankListItem. # noqa: E501 + + Bank country # noqa: E501 + + :return: The bank_country of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._bank_country + + @bank_country.setter + def bank_country(self, bank_country): + """Sets the bank_country of this OtcBankListItem. + + Bank country # noqa: E501 + + :param bank_country: The bank_country of this OtcBankListItem. # noqa: E501 + :type: str + """ + + self._bank_country = bank_country + + @property + def bank_address(self): + """Gets the bank_address of this OtcBankListItem. # noqa: E501 + + Bank address # noqa: E501 + + :return: The bank_address of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._bank_address + + @bank_address.setter + def bank_address(self, bank_address): + """Sets the bank_address of this OtcBankListItem. + + Bank address # noqa: E501 + + :param bank_address: The bank_address of this OtcBankListItem. # noqa: E501 + :type: str + """ + + self._bank_address = bank_address + + @property + def iban(self): + """Gets the iban of this OtcBankListItem. # noqa: E501 + + IBAN number # noqa: E501 + + :return: The iban of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._iban + + @iban.setter + def iban(self, iban): + """Sets the iban of this OtcBankListItem. + + IBAN number # noqa: E501 + + :param iban: The iban of this OtcBankListItem. # noqa: E501 + :type: str + """ + + self._iban = iban + + @property + def swift(self): + """Gets the swift of this OtcBankListItem. # noqa: E501 + + SWIFT code # noqa: E501 + + :return: The swift of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._swift + + @swift.setter + def swift(self, swift): + """Sets the swift of this OtcBankListItem. + + SWIFT code # noqa: E501 + + :param swift: The swift of this OtcBankListItem. # noqa: E501 + :type: str + """ + + self._swift = swift + + @property + def remittance_line_number(self): + """Gets the remittance_line_number of this OtcBankListItem. # noqa: E501 + + Remittance routing number # noqa: E501 + + :return: The remittance_line_number of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._remittance_line_number + + @remittance_line_number.setter + def remittance_line_number(self, remittance_line_number): + """Sets the remittance_line_number of this OtcBankListItem. + + Remittance routing number # noqa: E501 + + :param remittance_line_number: The remittance_line_number of this OtcBankListItem. # noqa: E501 + :type: str + """ + + self._remittance_line_number = remittance_line_number + + @property + def agent_bank_name(self): + """Gets the agent_bank_name of this OtcBankListItem. # noqa: E501 + + Correspondent bank name # noqa: E501 + + :return: The agent_bank_name of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._agent_bank_name + + @agent_bank_name.setter + def agent_bank_name(self, agent_bank_name): + """Sets the agent_bank_name of this OtcBankListItem. + + Correspondent bank name # noqa: E501 + + :param agent_bank_name: The agent_bank_name of this OtcBankListItem. # noqa: E501 + :type: str + """ + + self._agent_bank_name = agent_bank_name + + @property + def agent_bank_swift(self): + """Gets the agent_bank_swift of this OtcBankListItem. # noqa: E501 + + Correspondent bank SWIFT code # noqa: E501 + + :return: The agent_bank_swift of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._agent_bank_swift + + @agent_bank_swift.setter + def agent_bank_swift(self, agent_bank_swift): + """Sets the agent_bank_swift of this OtcBankListItem. + + Correspondent bank SWIFT code # noqa: E501 + + :param agent_bank_swift: The agent_bank_swift of this OtcBankListItem. # noqa: E501 + :type: str + """ + + self._agent_bank_swift = agent_bank_swift + + @property + def submit_time(self): + """Gets the submit_time of this OtcBankListItem. # noqa: E501 + + Submission time # noqa: E501 + + :return: The submit_time of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._submit_time + + @submit_time.setter + def submit_time(self, submit_time): + """Sets the submit_time of this OtcBankListItem. + + Submission time # noqa: E501 + + :param submit_time: The submit_time of this OtcBankListItem. # noqa: E501 + :type: str + """ + + self._submit_time = submit_time + + @property + def update_time(self): + """Gets the update_time of this OtcBankListItem. # noqa: E501 + + Update time # noqa: E501 + + :return: The update_time of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time): + """Sets the update_time of this OtcBankListItem. + + Update time # noqa: E501 + + :param update_time: The update_time of this OtcBankListItem. # noqa: E501 + :type: str + """ + + self._update_time = update_time + + @property + def status(self): + """Gets the status of this OtcBankListItem. # noqa: E501 + + Status # noqa: E501 + + :return: The status of this OtcBankListItem. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OtcBankListItem. + + Status # noqa: E501 + + :param status: The status of this OtcBankListItem. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def is_default(self): + """Gets the is_default of this OtcBankListItem. # noqa: E501 + + Whether it is the default bank card. 1 - Yes, 0 - No # noqa: E501 + + :return: The is_default of this OtcBankListItem. # noqa: E501 + :rtype: int + """ + return self._is_default + + @is_default.setter + def is_default(self, is_default): + """Sets the is_default of this OtcBankListItem. + + Whether it is the default bank card. 1 - Yes, 0 - No # noqa: E501 + + :param is_default: The is_default of this OtcBankListItem. # noqa: E501 + :type: int + """ + + self._is_default = is_default + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankListItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankListItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_list_response.py b/gate_api/models/otc_bank_list_response.py new file mode 100644 index 00000000..c06a50f9 --- /dev/null +++ b/gate_api/models/otc_bank_list_response.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankListResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'OtcBankListResult', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, OtcBankListResult, int, Configuration) -> None + """OtcBankListResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this OtcBankListResponse. # noqa: E501 + + + :return: The code of this OtcBankListResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this OtcBankListResponse. + + + :param code: The code of this OtcBankListResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this OtcBankListResponse. # noqa: E501 + + + :return: The message of this OtcBankListResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OtcBankListResponse. + + + :param message: The message of this OtcBankListResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this OtcBankListResponse. # noqa: E501 + + + :return: The data of this OtcBankListResponse. # noqa: E501 + :rtype: OtcBankListResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OtcBankListResponse. + + + :param data: The data of this OtcBankListResponse. # noqa: E501 + :type: OtcBankListResult + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this OtcBankListResponse. # noqa: E501 + + + :return: The timestamp of this OtcBankListResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OtcBankListResponse. + + + :param timestamp: The timestamp of this OtcBankListResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankListResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankListResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_list_result.py b/gate_api/models/otc_bank_list_result.py new file mode 100644 index 00000000..d7151d7e --- /dev/null +++ b/gate_api/models/otc_bank_list_result.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankListResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'lists': 'list[OtcBankListItem]' + } + + attribute_map = { + 'lists': 'lists' + } + + def __init__(self, lists=None, local_vars_configuration=None): # noqa: E501 + # type: (list[OtcBankListItem], Configuration) -> None + """OtcBankListResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._lists = None + self.discriminator = None + + self.lists = lists + + @property + def lists(self): + """Gets the lists of this OtcBankListResult. # noqa: E501 + + Bank card list # noqa: E501 + + :return: The lists of this OtcBankListResult. # noqa: E501 + :rtype: list[OtcBankListItem] + """ + return self._lists + + @lists.setter + def lists(self, lists): + """Sets the lists of this OtcBankListResult. + + Bank card list # noqa: E501 + + :param lists: The lists of this OtcBankListResult. # noqa: E501 + :type: list[OtcBankListItem] + """ + if self.local_vars_configuration.client_side_validation and lists is None: # noqa: E501 + raise ValueError("Invalid value for `lists`, must not be `None`") # noqa: E501 + + self._lists = lists + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankListResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankListResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_personal_supplement_multipart_request.py b/gate_api/models/otc_bank_personal_supplement_multipart_request.py new file mode 100644 index 00000000..03ee5101 --- /dev/null +++ b/gate_api/models/otc_bank_personal_supplement_multipart_request.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankPersonalSupplementMultipartRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'bank_id': 'str', + 'id_document_front': 'str', + 'id_document_back': 'str', + 'address_proof': 'str' + } + + attribute_map = { + 'bank_id': 'bank_id', + 'id_document_front': 'id_document_front', + 'id_document_back': 'id_document_back', + 'address_proof': 'address_proof' + } + + def __init__(self, bank_id=None, id_document_front=None, id_document_back=None, address_proof=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """OtcBankPersonalSupplementMultipartRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._bank_id = None + self._id_document_front = None + self._id_document_back = None + self._address_proof = None + self.discriminator = None + + self.bank_id = bank_id + self.id_document_front = id_document_front + self.id_document_back = id_document_back + self.address_proof = address_proof + + @property + def bank_id(self): + """Gets the bank_id of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + + + :return: The bank_id of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._bank_id + + @bank_id.setter + def bank_id(self, bank_id): + """Sets the bank_id of this OtcBankPersonalSupplementMultipartRequest. + + + :param bank_id: The bank_id of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and bank_id is None: # noqa: E501 + raise ValueError("Invalid value for `bank_id`, must not be `None`") # noqa: E501 + + self._bank_id = bank_id + + @property + def id_document_front(self): + """Gets the id_document_front of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + + ID document front-side file content (multipart file field, binary/Base64) # noqa: E501 + + :return: The id_document_front of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._id_document_front + + @id_document_front.setter + def id_document_front(self, id_document_front): + """Sets the id_document_front of this OtcBankPersonalSupplementMultipartRequest. + + ID document front-side file content (multipart file field, binary/Base64) # noqa: E501 + + :param id_document_front: The id_document_front of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and id_document_front is None: # noqa: E501 + raise ValueError("Invalid value for `id_document_front`, must not be `None`") # noqa: E501 + + self._id_document_front = id_document_front + + @property + def id_document_back(self): + """Gets the id_document_back of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + + ID document back-side file content (multipart file field, binary/Base64) # noqa: E501 + + :return: The id_document_back of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._id_document_back + + @id_document_back.setter + def id_document_back(self, id_document_back): + """Sets the id_document_back of this OtcBankPersonalSupplementMultipartRequest. + + ID document back-side file content (multipart file field, binary/Base64) # noqa: E501 + + :param id_document_back: The id_document_back of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and id_document_back is None: # noqa: E501 + raise ValueError("Invalid value for `id_document_back`, must not be `None`") # noqa: E501 + + self._id_document_back = id_document_back + + @property + def address_proof(self): + """Gets the address_proof of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + + Proof-of-address file content (multipart file field, binary/Base64) # noqa: E501 + + :return: The address_proof of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + :rtype: str + """ + return self._address_proof + + @address_proof.setter + def address_proof(self, address_proof): + """Sets the address_proof of this OtcBankPersonalSupplementMultipartRequest. + + Proof-of-address file content (multipart file field, binary/Base64) # noqa: E501 + + :param address_proof: The address_proof of this OtcBankPersonalSupplementMultipartRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and address_proof is None: # noqa: E501 + raise ValueError("Invalid value for `address_proof`, must not be `None`") # noqa: E501 + + self._address_proof = address_proof + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankPersonalSupplementMultipartRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankPersonalSupplementMultipartRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_supplement_checklist_item.py b/gate_api/models/otc_bank_supplement_checklist_item.py new file mode 100644 index 00000000..fbc81bb8 --- /dev/null +++ b/gate_api/models/otc_bank_supplement_checklist_item.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankSupplementChecklistItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'description': 'str' + } + + attribute_map = { + 'description': 'description' + } + + def __init__(self, description=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """OtcBankSupplementChecklistItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._description = None + self.discriminator = None + + self.description = description + + @property + def description(self): + """Gets the description of this OtcBankSupplementChecklistItem. # noqa: E501 + + Supplementary document submission description # noqa: E501 + + :return: The description of this OtcBankSupplementChecklistItem. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this OtcBankSupplementChecklistItem. + + Supplementary document submission description # noqa: E501 + + :param description: The description of this OtcBankSupplementChecklistItem. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and description is None: # noqa: E501 + raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 + + self._description = description + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankSupplementChecklistItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankSupplementChecklistItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_supplement_checklist_response.py b/gate_api/models/otc_bank_supplement_checklist_response.py new file mode 100644 index 00000000..19f63505 --- /dev/null +++ b/gate_api/models/otc_bank_supplement_checklist_response.py @@ -0,0 +1,202 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankSupplementChecklistResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'OtcBankSupplementChecklistResponseData', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, OtcBankSupplementChecklistResponseData, int, Configuration) -> None + """OtcBankSupplementChecklistResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this OtcBankSupplementChecklistResponse. # noqa: E501 + + + :return: The code of this OtcBankSupplementChecklistResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this OtcBankSupplementChecklistResponse. + + + :param code: The code of this OtcBankSupplementChecklistResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this OtcBankSupplementChecklistResponse. # noqa: E501 + + + :return: The message of this OtcBankSupplementChecklistResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OtcBankSupplementChecklistResponse. + + + :param message: The message of this OtcBankSupplementChecklistResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this OtcBankSupplementChecklistResponse. # noqa: E501 + + + :return: The data of this OtcBankSupplementChecklistResponse. # noqa: E501 + :rtype: OtcBankSupplementChecklistResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OtcBankSupplementChecklistResponse. + + + :param data: The data of this OtcBankSupplementChecklistResponse. # noqa: E501 + :type: OtcBankSupplementChecklistResponseData + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this OtcBankSupplementChecklistResponse. # noqa: E501 + + + :return: The timestamp of this OtcBankSupplementChecklistResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OtcBankSupplementChecklistResponse. + + + :param timestamp: The timestamp of this OtcBankSupplementChecklistResponse. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankSupplementChecklistResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankSupplementChecklistResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_bank_supplement_checklist_response_data.py b/gate_api/models/otc_bank_supplement_checklist_response_data.py new file mode 100644 index 00000000..816af303 --- /dev/null +++ b/gate_api/models/otc_bank_supplement_checklist_response_data.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcBankSupplementChecklistResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_type': 'str', + 'items': 'list[OtcBankSupplementChecklistItem]' + } + + attribute_map = { + 'user_type': 'user_type', + 'items': 'items' + } + + def __init__(self, user_type=None, items=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[OtcBankSupplementChecklistItem], Configuration) -> None + """OtcBankSupplementChecklistResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_type = None + self._items = None + self.discriminator = None + + self.user_type = user_type + self.items = items + + @property + def user_type(self): + """Gets the user_type of this OtcBankSupplementChecklistResponseData. # noqa: E501 + + `personal` or `enterprise`, matching the supplementary document submission type; `items[].description` describes the submission requirements for each item # noqa: E501 + + :return: The user_type of this OtcBankSupplementChecklistResponseData. # noqa: E501 + :rtype: str + """ + return self._user_type + + @user_type.setter + def user_type(self, user_type): + """Sets the user_type of this OtcBankSupplementChecklistResponseData. + + `personal` or `enterprise`, matching the supplementary document submission type; `items[].description` describes the submission requirements for each item # noqa: E501 + + :param user_type: The user_type of this OtcBankSupplementChecklistResponseData. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and user_type is None: # noqa: E501 + raise ValueError("Invalid value for `user_type`, must not be `None`") # noqa: E501 + allowed_values = ["personal", "enterprise"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and user_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `user_type` ({0}), must be one of {1}" # noqa: E501 + .format(user_type, allowed_values) + ) + + self._user_type = user_type + + @property + def items(self): + """Gets the items of this OtcBankSupplementChecklistResponseData. # noqa: E501 + + + :return: The items of this OtcBankSupplementChecklistResponseData. # noqa: E501 + :rtype: list[OtcBankSupplementChecklistItem] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this OtcBankSupplementChecklistResponseData. + + + :param items: The items of this OtcBankSupplementChecklistResponseData. # noqa: E501 + :type: list[OtcBankSupplementChecklistItem] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcBankSupplementChecklistResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcBankSupplementChecklistResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_mark_order_paid_request.py b/gate_api/models/otc_mark_order_paid_request.py new file mode 100644 index 00000000..1f775519 --- /dev/null +++ b/gate_api/models/otc_mark_order_paid_request.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcMarkOrderPaidRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'client_order_id': 'str', + 'payment_receipt_file_key': 'str', + 'payment_receipt': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'client_order_id': 'client_order_id', + 'payment_receipt_file_key': 'payment_receipt_file_key', + 'payment_receipt': 'payment_receipt' + } + + def __init__(self, order_id=None, client_order_id=None, payment_receipt_file_key=None, payment_receipt=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """OtcMarkOrderPaidRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._client_order_id = None + self._payment_receipt_file_key = None + self._payment_receipt = None + self.discriminator = None + + self.order_id = order_id + if client_order_id is not None: + self.client_order_id = client_order_id + self.payment_receipt_file_key = payment_receipt_file_key + if payment_receipt is not None: + self.payment_receipt = payment_receipt + + @property + def order_id(self): + """Gets the order_id of this OtcMarkOrderPaidRequest. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this OtcMarkOrderPaidRequest. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OtcMarkOrderPaidRequest. + + Order ID # noqa: E501 + + :param order_id: The order_id of this OtcMarkOrderPaidRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 + raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 + + self._order_id = order_id + + @property + def client_order_id(self): + """Gets the client_order_id of this OtcMarkOrderPaidRequest. # noqa: E501 + + Client order ID (used by some gateway/Inner Pay paths, optional) # noqa: E501 + + :return: The client_order_id of this OtcMarkOrderPaidRequest. # noqa: E501 + :rtype: str + """ + return self._client_order_id + + @client_order_id.setter + def client_order_id(self, client_order_id): + """Sets the client_order_id of this OtcMarkOrderPaidRequest. + + Client order ID (used by some gateway/Inner Pay paths, optional) # noqa: E501 + + :param client_order_id: The client_order_id of this OtcMarkOrderPaidRequest. # noqa: E501 + :type: str + """ + + self._client_order_id = client_order_id + + @property + def payment_receipt_file_key(self): + """Gets the payment_receipt_file_key of this OtcMarkOrderPaidRequest. # noqa: E501 + + User payment receipt: **required**. Stored as a file_key. One file; jpg/jpeg/png/pdf; maximum 10 MB. # noqa: E501 + + :return: The payment_receipt_file_key of this OtcMarkOrderPaidRequest. # noqa: E501 + :rtype: str + """ + return self._payment_receipt_file_key + + @payment_receipt_file_key.setter + def payment_receipt_file_key(self, payment_receipt_file_key): + """Sets the payment_receipt_file_key of this OtcMarkOrderPaidRequest. + + User payment receipt: **required**. Stored as a file_key. One file; jpg/jpeg/png/pdf; maximum 10 MB. # noqa: E501 + + :param payment_receipt_file_key: The payment_receipt_file_key of this OtcMarkOrderPaidRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and payment_receipt_file_key is None: # noqa: E501 + raise ValueError("Invalid value for `payment_receipt_file_key`, must not be `None`") # noqa: E501 + + self._payment_receipt_file_key = payment_receipt_file_key + + @property + def payment_receipt(self): + """Gets the payment_receipt of this OtcMarkOrderPaidRequest. # noqa: E501 + + Alias compatible with `payment_receipt_file_key` (depends on the gateway's external field name) # noqa: E501 + + :return: The payment_receipt of this OtcMarkOrderPaidRequest. # noqa: E501 + :rtype: str + """ + return self._payment_receipt + + @payment_receipt.setter + def payment_receipt(self, payment_receipt): + """Sets the payment_receipt of this OtcMarkOrderPaidRequest. + + Alias compatible with `payment_receipt_file_key` (depends on the gateway's external field name) # noqa: E501 + + :param payment_receipt: The payment_receipt of this OtcMarkOrderPaidRequest. # noqa: E501 + :type: str + """ + + self._payment_receipt = payment_receipt + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcMarkOrderPaidRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcMarkOrderPaidRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_order_detail.py b/gate_api/models/otc_order_detail.py new file mode 100644 index 00000000..a15345c0 --- /dev/null +++ b/gate_api/models/otc_order_detail.py @@ -0,0 +1,889 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcOrderDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'uid': 'str', + 'type': 'str', + 'fiat_currency': 'str', + 'fiat_amount': 'str', + 'crypto_currency': 'str', + 'crypto_amount': 'str', + 'rate': 'str', + 'bank_account_name': 'str', + 'bank_name': 'str', + 'bank_country': 'str', + 'bank_address': 'str', + 'bank_account_number_iban': 'str', + 'swift_code': 'str', + 'intermediate_bank_name': 'str', + 'intermediary_bank_swift_code': 'str', + 'gate_bank_account_name': 'str', + 'gate_bank_name': 'str', + 'gate_bank_country': 'str', + 'gate_bank_address': 'str', + 'gate_bank_account_number_iban': 'str', + 'gate_swift_code': 'str', + 'gate_intermediary_bank_name': 'str', + 'gate_intermediary_bank_swift_code': 'str', + 'gate_transfer_remark': 'str', + 'gate_reference_code': 'str', + 'status': 'str', + 'create_time': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'uid': 'uid', + 'type': 'type', + 'fiat_currency': 'fiat_currency', + 'fiat_amount': 'fiat_amount', + 'crypto_currency': 'crypto_currency', + 'crypto_amount': 'crypto_amount', + 'rate': 'rate', + 'bank_account_name': 'bank_account_name', + 'bank_name': 'bank_name', + 'bank_country': 'bank_country', + 'bank_address': 'bank_address', + 'bank_account_number_iban': 'bank_account_number_iban', + 'swift_code': 'swift_code', + 'intermediate_bank_name': 'intermediate_bank_name', + 'intermediary_bank_swift_code': 'intermediary_bank_swift_code', + 'gate_bank_account_name': 'gate_bank_account_name', + 'gate_bank_name': 'gate_bank_name', + 'gate_bank_country': 'gate_bank_country', + 'gate_bank_address': 'gate_bank_address', + 'gate_bank_account_number_iban': 'gate_bank_account_number_iban', + 'gate_swift_code': 'gate_swift_code', + 'gate_intermediary_bank_name': 'gate_intermediary_bank_name', + 'gate_intermediary_bank_swift_code': 'gate_intermediary_bank_swift_code', + 'gate_transfer_remark': 'gate_transfer_remark', + 'gate_reference_code': 'gate_reference_code', + 'status': 'status', + 'create_time': 'create_time' + } + + def __init__(self, order_id=None, uid=None, type=None, fiat_currency=None, fiat_amount=None, crypto_currency=None, crypto_amount=None, rate=None, bank_account_name=None, bank_name=None, bank_country=None, bank_address=None, bank_account_number_iban=None, swift_code=None, intermediate_bank_name=None, intermediary_bank_swift_code=None, gate_bank_account_name=None, gate_bank_name=None, gate_bank_country=None, gate_bank_address=None, gate_bank_account_number_iban=None, gate_swift_code=None, gate_intermediary_bank_name=None, gate_intermediary_bank_swift_code=None, gate_transfer_remark=None, gate_reference_code=None, status=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """OtcOrderDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._uid = None + self._type = None + self._fiat_currency = None + self._fiat_amount = None + self._crypto_currency = None + self._crypto_amount = None + self._rate = None + self._bank_account_name = None + self._bank_name = None + self._bank_country = None + self._bank_address = None + self._bank_account_number_iban = None + self._swift_code = None + self._intermediate_bank_name = None + self._intermediary_bank_swift_code = None + self._gate_bank_account_name = None + self._gate_bank_name = None + self._gate_bank_country = None + self._gate_bank_address = None + self._gate_bank_account_number_iban = None + self._gate_swift_code = None + self._gate_intermediary_bank_name = None + self._gate_intermediary_bank_swift_code = None + self._gate_transfer_remark = None + self._gate_reference_code = None + self._status = None + self._create_time = None + self.discriminator = None + + self.order_id = order_id + self.uid = uid + self.type = type + self.fiat_currency = fiat_currency + self.fiat_amount = fiat_amount + self.crypto_currency = crypto_currency + self.crypto_amount = crypto_amount + self.rate = rate + if bank_account_name is not None: + self.bank_account_name = bank_account_name + if bank_name is not None: + self.bank_name = bank_name + if bank_country is not None: + self.bank_country = bank_country + if bank_address is not None: + self.bank_address = bank_address + if bank_account_number_iban is not None: + self.bank_account_number_iban = bank_account_number_iban + if swift_code is not None: + self.swift_code = swift_code + if intermediate_bank_name is not None: + self.intermediate_bank_name = intermediate_bank_name + if intermediary_bank_swift_code is not None: + self.intermediary_bank_swift_code = intermediary_bank_swift_code + if gate_bank_account_name is not None: + self.gate_bank_account_name = gate_bank_account_name + if gate_bank_name is not None: + self.gate_bank_name = gate_bank_name + if gate_bank_country is not None: + self.gate_bank_country = gate_bank_country + if gate_bank_address is not None: + self.gate_bank_address = gate_bank_address + if gate_bank_account_number_iban is not None: + self.gate_bank_account_number_iban = gate_bank_account_number_iban + if gate_swift_code is not None: + self.gate_swift_code = gate_swift_code + if gate_intermediary_bank_name is not None: + self.gate_intermediary_bank_name = gate_intermediary_bank_name + if gate_intermediary_bank_swift_code is not None: + self.gate_intermediary_bank_swift_code = gate_intermediary_bank_swift_code + if gate_transfer_remark is not None: + self.gate_transfer_remark = gate_transfer_remark + if gate_reference_code is not None: + self.gate_reference_code = gate_reference_code + self.status = status + self.create_time = create_time + + @property + def order_id(self): + """Gets the order_id of this OtcOrderDetail. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OtcOrderDetail. + + Order ID # noqa: E501 + + :param order_id: The order_id of this OtcOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 + raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 + + self._order_id = order_id + + @property + def uid(self): + """Gets the uid of this OtcOrderDetail. # noqa: E501 + + User ID # noqa: E501 + + :return: The uid of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this OtcOrderDetail. + + User ID # noqa: E501 + + :param uid: The uid of this OtcOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and uid is None: # noqa: E501 + raise ValueError("Invalid value for `uid`, must not be `None`") # noqa: E501 + + self._uid = uid + + @property + def type(self): + """Gets the type of this OtcOrderDetail. # noqa: E501 + + Order Type # noqa: E501 + + :return: The type of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OtcOrderDetail. + + Order Type # noqa: E501 + + :param type: The type of this OtcOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + @property + def fiat_currency(self): + """Gets the fiat_currency of this OtcOrderDetail. # noqa: E501 + + Fiat currency # noqa: E501 + + :return: The fiat_currency of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._fiat_currency + + @fiat_currency.setter + def fiat_currency(self, fiat_currency): + """Sets the fiat_currency of this OtcOrderDetail. + + Fiat currency # noqa: E501 + + :param fiat_currency: The fiat_currency of this OtcOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fiat_currency is None: # noqa: E501 + raise ValueError("Invalid value for `fiat_currency`, must not be `None`") # noqa: E501 + + self._fiat_currency = fiat_currency + + @property + def fiat_amount(self): + """Gets the fiat_amount of this OtcOrderDetail. # noqa: E501 + + Fiat amount # noqa: E501 + + :return: The fiat_amount of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._fiat_amount + + @fiat_amount.setter + def fiat_amount(self, fiat_amount): + """Sets the fiat_amount of this OtcOrderDetail. + + Fiat amount # noqa: E501 + + :param fiat_amount: The fiat_amount of this OtcOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fiat_amount is None: # noqa: E501 + raise ValueError("Invalid value for `fiat_amount`, must not be `None`") # noqa: E501 + + self._fiat_amount = fiat_amount + + @property + def crypto_currency(self): + """Gets the crypto_currency of this OtcOrderDetail. # noqa: E501 + + Digital currency # noqa: E501 + + :return: The crypto_currency of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._crypto_currency + + @crypto_currency.setter + def crypto_currency(self, crypto_currency): + """Sets the crypto_currency of this OtcOrderDetail. + + Digital currency # noqa: E501 + + :param crypto_currency: The crypto_currency of this OtcOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and crypto_currency is None: # noqa: E501 + raise ValueError("Invalid value for `crypto_currency`, must not be `None`") # noqa: E501 + + self._crypto_currency = crypto_currency + + @property + def crypto_amount(self): + """Gets the crypto_amount of this OtcOrderDetail. # noqa: E501 + + Cryptocurrency amount # noqa: E501 + + :return: The crypto_amount of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._crypto_amount + + @crypto_amount.setter + def crypto_amount(self, crypto_amount): + """Sets the crypto_amount of this OtcOrderDetail. + + Cryptocurrency amount # noqa: E501 + + :param crypto_amount: The crypto_amount of this OtcOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and crypto_amount is None: # noqa: E501 + raise ValueError("Invalid value for `crypto_amount`, must not be `None`") # noqa: E501 + + self._crypto_amount = crypto_amount + + @property + def rate(self): + """Gets the rate of this OtcOrderDetail. # noqa: E501 + + Exchange rate # noqa: E501 + + :return: The rate of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this OtcOrderDetail. + + Exchange rate # noqa: E501 + + :param rate: The rate of this OtcOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and rate is None: # noqa: E501 + raise ValueError("Invalid value for `rate`, must not be `None`") # noqa: E501 + + self._rate = rate + + @property + def bank_account_name(self): + """Gets the bank_account_name of this OtcOrderDetail. # noqa: E501 + + User payment/receiving name # noqa: E501 + + :return: The bank_account_name of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._bank_account_name + + @bank_account_name.setter + def bank_account_name(self, bank_account_name): + """Sets the bank_account_name of this OtcOrderDetail. + + User payment/receiving name # noqa: E501 + + :param bank_account_name: The bank_account_name of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._bank_account_name = bank_account_name + + @property + def bank_name(self): + """Gets the bank_name of this OtcOrderDetail. # noqa: E501 + + User payment/receiving bank name # noqa: E501 + + :return: The bank_name of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._bank_name + + @bank_name.setter + def bank_name(self, bank_name): + """Sets the bank_name of this OtcOrderDetail. + + User payment/receiving bank name # noqa: E501 + + :param bank_name: The bank_name of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._bank_name = bank_name + + @property + def bank_country(self): + """Gets the bank_country of this OtcOrderDetail. # noqa: E501 + + User payment/receiving bank country # noqa: E501 + + :return: The bank_country of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._bank_country + + @bank_country.setter + def bank_country(self, bank_country): + """Sets the bank_country of this OtcOrderDetail. + + User payment/receiving bank country # noqa: E501 + + :param bank_country: The bank_country of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._bank_country = bank_country + + @property + def bank_address(self): + """Gets the bank_address of this OtcOrderDetail. # noqa: E501 + + User payment/receiving bank address # noqa: E501 + + :return: The bank_address of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._bank_address + + @bank_address.setter + def bank_address(self, bank_address): + """Sets the bank_address of this OtcOrderDetail. + + User payment/receiving bank address # noqa: E501 + + :param bank_address: The bank_address of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._bank_address = bank_address + + @property + def bank_account_number_iban(self): + """Gets the bank_account_number_iban of this OtcOrderDetail. # noqa: E501 + + User payment/receiving bank account number/IBAN # noqa: E501 + + :return: The bank_account_number_iban of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._bank_account_number_iban + + @bank_account_number_iban.setter + def bank_account_number_iban(self, bank_account_number_iban): + """Sets the bank_account_number_iban of this OtcOrderDetail. + + User payment/receiving bank account number/IBAN # noqa: E501 + + :param bank_account_number_iban: The bank_account_number_iban of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._bank_account_number_iban = bank_account_number_iban + + @property + def swift_code(self): + """Gets the swift_code of this OtcOrderDetail. # noqa: E501 + + User payment/receiving bank SWIFT code # noqa: E501 + + :return: The swift_code of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._swift_code + + @swift_code.setter + def swift_code(self, swift_code): + """Sets the swift_code of this OtcOrderDetail. + + User payment/receiving bank SWIFT code # noqa: E501 + + :param swift_code: The swift_code of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._swift_code = swift_code + + @property + def intermediate_bank_name(self): + """Gets the intermediate_bank_name of this OtcOrderDetail. # noqa: E501 + + User payment/receiving intermediary bank name # noqa: E501 + + :return: The intermediate_bank_name of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._intermediate_bank_name + + @intermediate_bank_name.setter + def intermediate_bank_name(self, intermediate_bank_name): + """Sets the intermediate_bank_name of this OtcOrderDetail. + + User payment/receiving intermediary bank name # noqa: E501 + + :param intermediate_bank_name: The intermediate_bank_name of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._intermediate_bank_name = intermediate_bank_name + + @property + def intermediary_bank_swift_code(self): + """Gets the intermediary_bank_swift_code of this OtcOrderDetail. # noqa: E501 + + User payment/receiving intermediary bank SWIFT code # noqa: E501 + + :return: The intermediary_bank_swift_code of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._intermediary_bank_swift_code + + @intermediary_bank_swift_code.setter + def intermediary_bank_swift_code(self, intermediary_bank_swift_code): + """Sets the intermediary_bank_swift_code of this OtcOrderDetail. + + User payment/receiving intermediary bank SWIFT code # noqa: E501 + + :param intermediary_bank_swift_code: The intermediary_bank_swift_code of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._intermediary_bank_swift_code = intermediary_bank_swift_code + + @property + def gate_bank_account_name(self): + """Gets the gate_bank_account_name of this OtcOrderDetail. # noqa: E501 + + Gate beneficiary name, shown for BUY only # noqa: E501 + + :return: The gate_bank_account_name of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._gate_bank_account_name + + @gate_bank_account_name.setter + def gate_bank_account_name(self, gate_bank_account_name): + """Sets the gate_bank_account_name of this OtcOrderDetail. + + Gate beneficiary name, shown for BUY only # noqa: E501 + + :param gate_bank_account_name: The gate_bank_account_name of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._gate_bank_account_name = gate_bank_account_name + + @property + def gate_bank_name(self): + """Gets the gate_bank_name of this OtcOrderDetail. # noqa: E501 + + Gate beneficiary bank name, shown for BUY only # noqa: E501 + + :return: The gate_bank_name of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._gate_bank_name + + @gate_bank_name.setter + def gate_bank_name(self, gate_bank_name): + """Sets the gate_bank_name of this OtcOrderDetail. + + Gate beneficiary bank name, shown for BUY only # noqa: E501 + + :param gate_bank_name: The gate_bank_name of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._gate_bank_name = gate_bank_name + + @property + def gate_bank_country(self): + """Gets the gate_bank_country of this OtcOrderDetail. # noqa: E501 + + Gate beneficiary bank country, shown for BUY only # noqa: E501 + + :return: The gate_bank_country of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._gate_bank_country + + @gate_bank_country.setter + def gate_bank_country(self, gate_bank_country): + """Sets the gate_bank_country of this OtcOrderDetail. + + Gate beneficiary bank country, shown for BUY only # noqa: E501 + + :param gate_bank_country: The gate_bank_country of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._gate_bank_country = gate_bank_country + + @property + def gate_bank_address(self): + """Gets the gate_bank_address of this OtcOrderDetail. # noqa: E501 + + Gate beneficiary bank address, shown for BUY only # noqa: E501 + + :return: The gate_bank_address of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._gate_bank_address + + @gate_bank_address.setter + def gate_bank_address(self, gate_bank_address): + """Sets the gate_bank_address of this OtcOrderDetail. + + Gate beneficiary bank address, shown for BUY only # noqa: E501 + + :param gate_bank_address: The gate_bank_address of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._gate_bank_address = gate_bank_address + + @property + def gate_bank_account_number_iban(self): + """Gets the gate_bank_account_number_iban of this OtcOrderDetail. # noqa: E501 + + Gate beneficiary bank account number/IBAN, shown for BUY only # noqa: E501 + + :return: The gate_bank_account_number_iban of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._gate_bank_account_number_iban + + @gate_bank_account_number_iban.setter + def gate_bank_account_number_iban(self, gate_bank_account_number_iban): + """Sets the gate_bank_account_number_iban of this OtcOrderDetail. + + Gate beneficiary bank account number/IBAN, shown for BUY only # noqa: E501 + + :param gate_bank_account_number_iban: The gate_bank_account_number_iban of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._gate_bank_account_number_iban = gate_bank_account_number_iban + + @property + def gate_swift_code(self): + """Gets the gate_swift_code of this OtcOrderDetail. # noqa: E501 + + Gate beneficiary bank SWIFT code, shown for BUY only # noqa: E501 + + :return: The gate_swift_code of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._gate_swift_code + + @gate_swift_code.setter + def gate_swift_code(self, gate_swift_code): + """Sets the gate_swift_code of this OtcOrderDetail. + + Gate beneficiary bank SWIFT code, shown for BUY only # noqa: E501 + + :param gate_swift_code: The gate_swift_code of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._gate_swift_code = gate_swift_code + + @property + def gate_intermediary_bank_name(self): + """Gets the gate_intermediary_bank_name of this OtcOrderDetail. # noqa: E501 + + Gate beneficiary intermediary bank name, shown for BUY only # noqa: E501 + + :return: The gate_intermediary_bank_name of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._gate_intermediary_bank_name + + @gate_intermediary_bank_name.setter + def gate_intermediary_bank_name(self, gate_intermediary_bank_name): + """Sets the gate_intermediary_bank_name of this OtcOrderDetail. + + Gate beneficiary intermediary bank name, shown for BUY only # noqa: E501 + + :param gate_intermediary_bank_name: The gate_intermediary_bank_name of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._gate_intermediary_bank_name = gate_intermediary_bank_name + + @property + def gate_intermediary_bank_swift_code(self): + """Gets the gate_intermediary_bank_swift_code of this OtcOrderDetail. # noqa: E501 + + Gate beneficiary intermediary bank SWIFT code, shown for BUY only # noqa: E501 + + :return: The gate_intermediary_bank_swift_code of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._gate_intermediary_bank_swift_code + + @gate_intermediary_bank_swift_code.setter + def gate_intermediary_bank_swift_code(self, gate_intermediary_bank_swift_code): + """Sets the gate_intermediary_bank_swift_code of this OtcOrderDetail. + + Gate beneficiary intermediary bank SWIFT code, shown for BUY only # noqa: E501 + + :param gate_intermediary_bank_swift_code: The gate_intermediary_bank_swift_code of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._gate_intermediary_bank_swift_code = gate_intermediary_bank_swift_code + + @property + def gate_transfer_remark(self): + """Gets the gate_transfer_remark of this OtcOrderDetail. # noqa: E501 + + Transfer remark (mutually exclusive with `gate_reference_code`; empty when a BUY deposit order has a reference code), shown for BUY only # noqa: E501 + + :return: The gate_transfer_remark of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._gate_transfer_remark + + @gate_transfer_remark.setter + def gate_transfer_remark(self, gate_transfer_remark): + """Sets the gate_transfer_remark of this OtcOrderDetail. + + Transfer remark (mutually exclusive with `gate_reference_code`; empty when a BUY deposit order has a reference code), shown for BUY only # noqa: E501 + + :param gate_transfer_remark: The gate_transfer_remark of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._gate_transfer_remark = gate_transfer_remark + + @property + def gate_reference_code(self): + """Gets the gate_reference_code of this OtcOrderDetail. # noqa: E501 + + Be sure to include the reference code when making the transfer so that your order can be processed promptly. (Mutually exclusive with `gate_transfer_remark`.) # noqa: E501 + + :return: The gate_reference_code of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._gate_reference_code + + @gate_reference_code.setter + def gate_reference_code(self, gate_reference_code): + """Sets the gate_reference_code of this OtcOrderDetail. + + Be sure to include the reference code when making the transfer so that your order can be processed promptly. (Mutually exclusive with `gate_transfer_remark`.) # noqa: E501 + + :param gate_reference_code: The gate_reference_code of this OtcOrderDetail. # noqa: E501 + :type: str + """ + + self._gate_reference_code = gate_reference_code + + @property + def status(self): + """Gets the status of this OtcOrderDetail. # noqa: E501 + + Status # noqa: E501 + + :return: The status of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OtcOrderDetail. + + Status # noqa: E501 + + :param status: The status of this OtcOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def create_time(self): + """Gets the create_time of this OtcOrderDetail. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this OtcOrderDetail. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this OtcOrderDetail. + + Created time # noqa: E501 + + :param create_time: The create_time of this OtcOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and create_time is None: # noqa: E501 + raise ValueError("Invalid value for `create_time`, must not be `None`") # noqa: E501 + + self._create_time = create_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcOrderDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcOrderDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_order_detail_response.py b/gate_api/models/otc_order_detail_response.py new file mode 100644 index 00000000..d847e5f2 --- /dev/null +++ b/gate_api/models/otc_order_detail_response.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcOrderDetailResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'message': 'str', + 'code': 'int', + 'data': 'OtcOrderDetail' + } + + attribute_map = { + 'message': 'message', + 'code': 'code', + 'data': 'data' + } + + def __init__(self, message=None, code=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, OtcOrderDetail, Configuration) -> None + """OtcOrderDetailResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._message = None + self._code = None + self._data = None + self.discriminator = None + + self.message = message + self.code = code + self.data = data + + @property + def message(self): + """Gets the message of this OtcOrderDetailResponse. # noqa: E501 + + + :return: The message of this OtcOrderDetailResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OtcOrderDetailResponse. + + + :param message: The message of this OtcOrderDetailResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def code(self): + """Gets the code of this OtcOrderDetailResponse. # noqa: E501 + + + :return: The code of this OtcOrderDetailResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this OtcOrderDetailResponse. + + + :param code: The code of this OtcOrderDetailResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def data(self): + """Gets the data of this OtcOrderDetailResponse. # noqa: E501 + + + :return: The data of this OtcOrderDetailResponse. # noqa: E501 + :rtype: OtcOrderDetail + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OtcOrderDetailResponse. + + + :param data: The data of this OtcOrderDetailResponse. # noqa: E501 + :type: OtcOrderDetail + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcOrderDetailResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcOrderDetailResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_order_list_crypto_currency_info.py b/gate_api/models/otc_order_list_crypto_currency_info.py new file mode 100644 index 00000000..761db3b1 --- /dev/null +++ b/gate_api/models/otc_order_list_crypto_currency_info.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcOrderListCryptoCurrencyInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str', + 'icon': 'str' + } + + attribute_map = { + 'name': 'name', + 'icon': 'icon' + } + + def __init__(self, name=None, icon=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """OtcOrderListCryptoCurrencyInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._name = None + self._icon = None + self.discriminator = None + + self.name = name + self.icon = icon + + @property + def name(self): + """Gets the name of this OtcOrderListCryptoCurrencyInfo. # noqa: E501 + + + :return: The name of this OtcOrderListCryptoCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OtcOrderListCryptoCurrencyInfo. + + + :param name: The name of this OtcOrderListCryptoCurrencyInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def icon(self): + """Gets the icon of this OtcOrderListCryptoCurrencyInfo. # noqa: E501 + + + :return: The icon of this OtcOrderListCryptoCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._icon + + @icon.setter + def icon(self, icon): + """Sets the icon of this OtcOrderListCryptoCurrencyInfo. + + + :param icon: The icon of this OtcOrderListCryptoCurrencyInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and icon is None: # noqa: E501 + raise ValueError("Invalid value for `icon`, must not be `None`") # noqa: E501 + + self._icon = icon + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcOrderListCryptoCurrencyInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcOrderListCryptoCurrencyInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_order_list_fiat_currency_info.py b/gate_api/models/otc_order_list_fiat_currency_info.py new file mode 100644 index 00000000..c387482f --- /dev/null +++ b/gate_api/models/otc_order_list_fiat_currency_info.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcOrderListFiatCurrencyInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str', + 'icon': 'str' + } + + attribute_map = { + 'name': 'name', + 'icon': 'icon' + } + + def __init__(self, name=None, icon=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """OtcOrderListFiatCurrencyInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._name = None + self._icon = None + self.discriminator = None + + self.name = name + self.icon = icon + + @property + def name(self): + """Gets the name of this OtcOrderListFiatCurrencyInfo. # noqa: E501 + + Name # noqa: E501 + + :return: The name of this OtcOrderListFiatCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OtcOrderListFiatCurrencyInfo. + + Name # noqa: E501 + + :param name: The name of this OtcOrderListFiatCurrencyInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def icon(self): + """Gets the icon of this OtcOrderListFiatCurrencyInfo. # noqa: E501 + + Image # noqa: E501 + + :return: The icon of this OtcOrderListFiatCurrencyInfo. # noqa: E501 + :rtype: str + """ + return self._icon + + @icon.setter + def icon(self, icon): + """Sets the icon of this OtcOrderListFiatCurrencyInfo. + + Image # noqa: E501 + + :param icon: The icon of this OtcOrderListFiatCurrencyInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and icon is None: # noqa: E501 + raise ValueError("Invalid value for `icon`, must not be `None`") # noqa: E501 + + self._icon = icon + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcOrderListFiatCurrencyInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcOrderListFiatCurrencyInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_order_list_item.py b/gate_api/models/otc_order_list_item.py new file mode 100644 index 00000000..565c1132 --- /dev/null +++ b/gate_api/models/otc_order_list_item.py @@ -0,0 +1,483 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcOrderListItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'time': 'str', + 'timestamp': 'int', + 'order_id': 'str', + 'trade_no': 'str', + 'type': 'str', + 'status': 'str', + 'fiat_currency': 'str', + 'fiat_currency_info': 'OtcOrderListFiatCurrencyInfo', + 'fiat_amount': 'str', + 'crypto_currency': 'str', + 'crypto_currency_info': 'OtcOrderListCryptoCurrencyInfo', + 'crypto_amount': 'str', + 'rate': 'str', + 'promotion_code': 'str' + } + + attribute_map = { + 'time': 'time', + 'timestamp': 'timestamp', + 'order_id': 'order_id', + 'trade_no': 'trade_no', + 'type': 'type', + 'status': 'status', + 'fiat_currency': 'fiat_currency', + 'fiat_currency_info': 'fiat_currency_info', + 'fiat_amount': 'fiat_amount', + 'crypto_currency': 'crypto_currency', + 'crypto_currency_info': 'crypto_currency_info', + 'crypto_amount': 'crypto_amount', + 'rate': 'rate', + 'promotion_code': 'promotion_code' + } + + def __init__(self, time=None, timestamp=None, order_id=None, trade_no=None, type=None, status=None, fiat_currency=None, fiat_currency_info=None, fiat_amount=None, crypto_currency=None, crypto_currency_info=None, crypto_amount=None, rate=None, promotion_code=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, str, str, str, str, str, OtcOrderListFiatCurrencyInfo, str, str, OtcOrderListCryptoCurrencyInfo, str, str, str, Configuration) -> None + """OtcOrderListItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._time = None + self._timestamp = None + self._order_id = None + self._trade_no = None + self._type = None + self._status = None + self._fiat_currency = None + self._fiat_currency_info = None + self._fiat_amount = None + self._crypto_currency = None + self._crypto_currency_info = None + self._crypto_amount = None + self._rate = None + self._promotion_code = None + self.discriminator = None + + if time is not None: + self.time = time + if timestamp is not None: + self.timestamp = timestamp + if order_id is not None: + self.order_id = order_id + if trade_no is not None: + self.trade_no = trade_no + if type is not None: + self.type = type + if status is not None: + self.status = status + if fiat_currency is not None: + self.fiat_currency = fiat_currency + if fiat_currency_info is not None: + self.fiat_currency_info = fiat_currency_info + if fiat_amount is not None: + self.fiat_amount = fiat_amount + if crypto_currency is not None: + self.crypto_currency = crypto_currency + if crypto_currency_info is not None: + self.crypto_currency_info = crypto_currency_info + if crypto_amount is not None: + self.crypto_amount = crypto_amount + if rate is not None: + self.rate = rate + if promotion_code is not None: + self.promotion_code = promotion_code + + @property + def time(self): + """Gets the time of this OtcOrderListItem. # noqa: E501 + + Current time # noqa: E501 + + :return: The time of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this OtcOrderListItem. + + Current time # noqa: E501 + + :param time: The time of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._time = time + + @property + def timestamp(self): + """Gets the timestamp of this OtcOrderListItem. # noqa: E501 + + Current timestamp # noqa: E501 + + :return: The timestamp of this OtcOrderListItem. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OtcOrderListItem. + + Current timestamp # noqa: E501 + + :param timestamp: The timestamp of this OtcOrderListItem. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def order_id(self): + """Gets the order_id of this OtcOrderListItem. # noqa: E501 + + orderId # noqa: E501 + + :return: The order_id of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this OtcOrderListItem. + + orderId # noqa: E501 + + :param order_id: The order_id of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def trade_no(self): + """Gets the trade_no of this OtcOrderListItem. # noqa: E501 + + Trade number # noqa: E501 + + :return: The trade_no of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._trade_no + + @trade_no.setter + def trade_no(self, trade_no): + """Sets the trade_no of this OtcOrderListItem. + + Trade number # noqa: E501 + + :param trade_no: The trade_no of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._trade_no = trade_no + + @property + def type(self): + """Gets the type of this OtcOrderListItem. # noqa: E501 + + BUY deposit / SELL withdrawal # noqa: E501 + + :return: The type of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OtcOrderListItem. + + BUY deposit / SELL withdrawal # noqa: E501 + + :param type: The type of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def status(self): + """Gets the status of this OtcOrderListItem. # noqa: E501 + + Order status # noqa: E501 + + :return: The status of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OtcOrderListItem. + + Order status # noqa: E501 + + :param status: The status of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def fiat_currency(self): + """Gets the fiat_currency of this OtcOrderListItem. # noqa: E501 + + Fiat currency # noqa: E501 + + :return: The fiat_currency of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._fiat_currency + + @fiat_currency.setter + def fiat_currency(self, fiat_currency): + """Sets the fiat_currency of this OtcOrderListItem. + + Fiat currency # noqa: E501 + + :param fiat_currency: The fiat_currency of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._fiat_currency = fiat_currency + + @property + def fiat_currency_info(self): + """Gets the fiat_currency_info of this OtcOrderListItem. # noqa: E501 + + + :return: The fiat_currency_info of this OtcOrderListItem. # noqa: E501 + :rtype: OtcOrderListFiatCurrencyInfo + """ + return self._fiat_currency_info + + @fiat_currency_info.setter + def fiat_currency_info(self, fiat_currency_info): + """Sets the fiat_currency_info of this OtcOrderListItem. + + + :param fiat_currency_info: The fiat_currency_info of this OtcOrderListItem. # noqa: E501 + :type: OtcOrderListFiatCurrencyInfo + """ + + self._fiat_currency_info = fiat_currency_info + + @property + def fiat_amount(self): + """Gets the fiat_amount of this OtcOrderListItem. # noqa: E501 + + Fiat amount # noqa: E501 + + :return: The fiat_amount of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._fiat_amount + + @fiat_amount.setter + def fiat_amount(self, fiat_amount): + """Sets the fiat_amount of this OtcOrderListItem. + + Fiat amount # noqa: E501 + + :param fiat_amount: The fiat_amount of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._fiat_amount = fiat_amount + + @property + def crypto_currency(self): + """Gets the crypto_currency of this OtcOrderListItem. # noqa: E501 + + Digital currency # noqa: E501 + + :return: The crypto_currency of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._crypto_currency + + @crypto_currency.setter + def crypto_currency(self, crypto_currency): + """Sets the crypto_currency of this OtcOrderListItem. + + Digital currency # noqa: E501 + + :param crypto_currency: The crypto_currency of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._crypto_currency = crypto_currency + + @property + def crypto_currency_info(self): + """Gets the crypto_currency_info of this OtcOrderListItem. # noqa: E501 + + + :return: The crypto_currency_info of this OtcOrderListItem. # noqa: E501 + :rtype: OtcOrderListCryptoCurrencyInfo + """ + return self._crypto_currency_info + + @crypto_currency_info.setter + def crypto_currency_info(self, crypto_currency_info): + """Sets the crypto_currency_info of this OtcOrderListItem. + + + :param crypto_currency_info: The crypto_currency_info of this OtcOrderListItem. # noqa: E501 + :type: OtcOrderListCryptoCurrencyInfo + """ + + self._crypto_currency_info = crypto_currency_info + + @property + def crypto_amount(self): + """Gets the crypto_amount of this OtcOrderListItem. # noqa: E501 + + Cryptocurrency amount # noqa: E501 + + :return: The crypto_amount of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._crypto_amount + + @crypto_amount.setter + def crypto_amount(self, crypto_amount): + """Sets the crypto_amount of this OtcOrderListItem. + + Cryptocurrency amount # noqa: E501 + + :param crypto_amount: The crypto_amount of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._crypto_amount = crypto_amount + + @property + def rate(self): + """Gets the rate of this OtcOrderListItem. # noqa: E501 + + Exchange rate # noqa: E501 + + :return: The rate of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this OtcOrderListItem. + + Exchange rate # noqa: E501 + + :param rate: The rate of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._rate = rate + + @property + def promotion_code(self): + """Gets the promotion_code of this OtcOrderListItem. # noqa: E501 + + Promotion code # noqa: E501 + + :return: The promotion_code of this OtcOrderListItem. # noqa: E501 + :rtype: str + """ + return self._promotion_code + + @promotion_code.setter + def promotion_code(self, promotion_code): + """Sets the promotion_code of this OtcOrderListItem. + + Promotion code # noqa: E501 + + :param promotion_code: The promotion_code of this OtcOrderListItem. # noqa: E501 + :type: str + """ + + self._promotion_code = promotion_code + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcOrderListItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcOrderListItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_order_list_response.py b/gate_api/models/otc_order_list_response.py new file mode 100644 index 00000000..83adc072 --- /dev/null +++ b/gate_api/models/otc_order_list_response.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcOrderListResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'OtcOrderListResult' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data' + } + + def __init__(self, code=None, message=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, OtcOrderListResult, Configuration) -> None + """OtcOrderListResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + + @property + def code(self): + """Gets the code of this OtcOrderListResponse. # noqa: E501 + + + :return: The code of this OtcOrderListResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this OtcOrderListResponse. + + + :param code: The code of this OtcOrderListResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this OtcOrderListResponse. # noqa: E501 + + + :return: The message of this OtcOrderListResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OtcOrderListResponse. + + + :param message: The message of this OtcOrderListResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this OtcOrderListResponse. # noqa: E501 + + + :return: The data of this OtcOrderListResponse. # noqa: E501 + :rtype: OtcOrderListResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OtcOrderListResponse. + + + :param data: The data of this OtcOrderListResponse. # noqa: E501 + :type: OtcOrderListResult + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcOrderListResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcOrderListResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_order_list_result.py b/gate_api/models/otc_order_list_result.py new file mode 100644 index 00000000..9789216b --- /dev/null +++ b/gate_api/models/otc_order_list_result.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcOrderListResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'pn': 'int', + 'ps': 'int', + 'total_pn': 'int', + 'count': 'int', + 'list': 'list[OtcOrderListItem]' + } + + attribute_map = { + 'pn': 'pn', + 'ps': 'ps', + 'total_pn': 'total_pn', + 'count': 'count', + 'list': 'list' + } + + def __init__(self, pn=None, ps=None, total_pn=None, count=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, int, list[OtcOrderListItem], Configuration) -> None + """OtcOrderListResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._pn = None + self._ps = None + self._total_pn = None + self._count = None + self._list = None + self.discriminator = None + + self.pn = pn + self.ps = ps + self.total_pn = total_pn + self.count = count + self.list = list + + @property + def pn(self): + """Gets the pn of this OtcOrderListResult. # noqa: E501 + + + :return: The pn of this OtcOrderListResult. # noqa: E501 + :rtype: int + """ + return self._pn + + @pn.setter + def pn(self, pn): + """Sets the pn of this OtcOrderListResult. + + + :param pn: The pn of this OtcOrderListResult. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and pn is None: # noqa: E501 + raise ValueError("Invalid value for `pn`, must not be `None`") # noqa: E501 + + self._pn = pn + + @property + def ps(self): + """Gets the ps of this OtcOrderListResult. # noqa: E501 + + + :return: The ps of this OtcOrderListResult. # noqa: E501 + :rtype: int + """ + return self._ps + + @ps.setter + def ps(self, ps): + """Sets the ps of this OtcOrderListResult. + + + :param ps: The ps of this OtcOrderListResult. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and ps is None: # noqa: E501 + raise ValueError("Invalid value for `ps`, must not be `None`") # noqa: E501 + + self._ps = ps + + @property + def total_pn(self): + """Gets the total_pn of this OtcOrderListResult. # noqa: E501 + + + :return: The total_pn of this OtcOrderListResult. # noqa: E501 + :rtype: int + """ + return self._total_pn + + @total_pn.setter + def total_pn(self, total_pn): + """Sets the total_pn of this OtcOrderListResult. + + + :param total_pn: The total_pn of this OtcOrderListResult. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total_pn is None: # noqa: E501 + raise ValueError("Invalid value for `total_pn`, must not be `None`") # noqa: E501 + + self._total_pn = total_pn + + @property + def count(self): + """Gets the count of this OtcOrderListResult. # noqa: E501 + + + :return: The count of this OtcOrderListResult. # noqa: E501 + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this OtcOrderListResult. + + + :param count: The count of this OtcOrderListResult. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and count is None: # noqa: E501 + raise ValueError("Invalid value for `count`, must not be `None`") # noqa: E501 + + self._count = count + + @property + def list(self): + """Gets the list of this OtcOrderListResult. # noqa: E501 + + + :return: The list of this OtcOrderListResult. # noqa: E501 + :rtype: list[OtcOrderListItem] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this OtcOrderListResult. + + + :param list: The list of this OtcOrderListResult. # noqa: E501 + :type: list[OtcOrderListItem] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcOrderListResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcOrderListResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_order_request.py b/gate_api/models/otc_order_request.py new file mode 100644 index 00000000..26cd914a --- /dev/null +++ b/gate_api/models/otc_order_request.py @@ -0,0 +1,355 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'side': 'str', + 'crypto_currency': 'str', + 'fiat_currency': 'str', + 'crypto_amount': 'str', + 'fiat_amount': 'str', + 'promotion_code': 'str', + 'quote_token': 'str', + 'bank_id': 'str' + } + + attribute_map = { + 'type': 'type', + 'side': 'side', + 'crypto_currency': 'crypto_currency', + 'fiat_currency': 'fiat_currency', + 'crypto_amount': 'crypto_amount', + 'fiat_amount': 'fiat_amount', + 'promotion_code': 'promotion_code', + 'quote_token': 'quote_token', + 'bank_id': 'bank_id' + } + + def __init__(self, type=None, side=None, crypto_currency=None, fiat_currency=None, crypto_amount=None, fiat_amount=None, promotion_code=None, quote_token=None, bank_id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, Configuration) -> None + """OtcOrderRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._type = None + self._side = None + self._crypto_currency = None + self._fiat_currency = None + self._crypto_amount = None + self._fiat_amount = None + self._promotion_code = None + self._quote_token = None + self._bank_id = None + self.discriminator = None + + self.type = type + self.side = side + self.crypto_currency = crypto_currency + self.fiat_currency = fiat_currency + self.crypto_amount = crypto_amount + self.fiat_amount = fiat_amount + if promotion_code is not None: + self.promotion_code = promotion_code + self.quote_token = quote_token + self.bank_id = bank_id + + @property + def type(self): + """Gets the type of this OtcOrderRequest. # noqa: E501 + + BUY for on-ramp, SELL for off-ramp # noqa: E501 + + :return: The type of this OtcOrderRequest. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OtcOrderRequest. + + BUY for on-ramp, SELL for off-ramp # noqa: E501 + + :param type: The type of this OtcOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + @property + def side(self): + """Gets the side of this OtcOrderRequest. # noqa: E501 + + The side returned by the quote endpoint (used for order validation). For backward compatibility, `FIAT`/`CRYPTO` or `PAY`/`GET` are accepted; new integrations should use the value returned by the quote response. # noqa: E501 + + :return: The side of this OtcOrderRequest. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OtcOrderRequest. + + The side returned by the quote endpoint (used for order validation). For backward compatibility, `FIAT`/`CRYPTO` or `PAY`/`GET` are accepted; new integrations should use the value returned by the quote response. # noqa: E501 + + :param side: The side of this OtcOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def crypto_currency(self): + """Gets the crypto_currency of this OtcOrderRequest. # noqa: E501 + + Cryptocurrency (supported currencies can be queried from the OTC web fiat quote page) # noqa: E501 + + :return: The crypto_currency of this OtcOrderRequest. # noqa: E501 + :rtype: str + """ + return self._crypto_currency + + @crypto_currency.setter + def crypto_currency(self, crypto_currency): + """Sets the crypto_currency of this OtcOrderRequest. + + Cryptocurrency (supported currencies can be queried from the OTC web fiat quote page) # noqa: E501 + + :param crypto_currency: The crypto_currency of this OtcOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and crypto_currency is None: # noqa: E501 + raise ValueError("Invalid value for `crypto_currency`, must not be `None`") # noqa: E501 + + self._crypto_currency = crypto_currency + + @property + def fiat_currency(self): + """Gets the fiat_currency of this OtcOrderRequest. # noqa: E501 + + Fiat currency (supported currencies can be queried from the OTC web fiat quote page) # noqa: E501 + + :return: The fiat_currency of this OtcOrderRequest. # noqa: E501 + :rtype: str + """ + return self._fiat_currency + + @fiat_currency.setter + def fiat_currency(self, fiat_currency): + """Sets the fiat_currency of this OtcOrderRequest. + + Fiat currency (supported currencies can be queried from the OTC web fiat quote page) # noqa: E501 + + :param fiat_currency: The fiat_currency of this OtcOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fiat_currency is None: # noqa: E501 + raise ValueError("Invalid value for `fiat_currency`, must not be `None`") # noqa: E501 + + self._fiat_currency = fiat_currency + + @property + def crypto_amount(self): + """Gets the crypto_amount of this OtcOrderRequest. # noqa: E501 + + Amount of cryptocurrency # noqa: E501 + + :return: The crypto_amount of this OtcOrderRequest. # noqa: E501 + :rtype: str + """ + return self._crypto_amount + + @crypto_amount.setter + def crypto_amount(self, crypto_amount): + """Sets the crypto_amount of this OtcOrderRequest. + + Amount of cryptocurrency # noqa: E501 + + :param crypto_amount: The crypto_amount of this OtcOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and crypto_amount is None: # noqa: E501 + raise ValueError("Invalid value for `crypto_amount`, must not be `None`") # noqa: E501 + + self._crypto_amount = crypto_amount + + @property + def fiat_amount(self): + """Gets the fiat_amount of this OtcOrderRequest. # noqa: E501 + + Fiat amount # noqa: E501 + + :return: The fiat_amount of this OtcOrderRequest. # noqa: E501 + :rtype: str + """ + return self._fiat_amount + + @fiat_amount.setter + def fiat_amount(self, fiat_amount): + """Sets the fiat_amount of this OtcOrderRequest. + + Fiat amount # noqa: E501 + + :param fiat_amount: The fiat_amount of this OtcOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and fiat_amount is None: # noqa: E501 + raise ValueError("Invalid value for `fiat_amount`, must not be `None`") # noqa: E501 + + self._fiat_amount = fiat_amount + + @property + def promotion_code(self): + """Gets the promotion_code of this OtcOrderRequest. # noqa: E501 + + Promotion code # noqa: E501 + + :return: The promotion_code of this OtcOrderRequest. # noqa: E501 + :rtype: str + """ + return self._promotion_code + + @promotion_code.setter + def promotion_code(self, promotion_code): + """Sets the promotion_code of this OtcOrderRequest. + + Promotion code # noqa: E501 + + :param promotion_code: The promotion_code of this OtcOrderRequest. # noqa: E501 + :type: str + """ + + self._promotion_code = promotion_code + + @property + def quote_token(self): + """Gets the quote_token of this OtcOrderRequest. # noqa: E501 + + Parameter returned by the quote API # noqa: E501 + + :return: The quote_token of this OtcOrderRequest. # noqa: E501 + :rtype: str + """ + return self._quote_token + + @quote_token.setter + def quote_token(self, quote_token): + """Sets the quote_token of this OtcOrderRequest. + + Parameter returned by the quote API # noqa: E501 + + :param quote_token: The quote_token of this OtcOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and quote_token is None: # noqa: E501 + raise ValueError("Invalid value for `quote_token`, must not be `None`") # noqa: E501 + + self._quote_token = quote_token + + @property + def bank_id(self): + """Gets the bank_id of this OtcOrderRequest. # noqa: E501 + + Bank card ID used to place the order. Select one from the list returned by `GET /otc/bank/list`; the default card has `is_default=1`. # noqa: E501 + + :return: The bank_id of this OtcOrderRequest. # noqa: E501 + :rtype: str + """ + return self._bank_id + + @bank_id.setter + def bank_id(self, bank_id): + """Sets the bank_id of this OtcOrderRequest. + + Bank card ID used to place the order. Select one from the list returned by `GET /otc/bank/list`; the default card has `is_default=1`. # noqa: E501 + + :param bank_id: The bank_id of this OtcOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and bank_id is None: # noqa: E501 + raise ValueError("Invalid value for `bank_id`, must not be `None`") # noqa: E501 + + self._bank_id = bank_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_quote_request.py b/gate_api/models/otc_quote_request.py new file mode 100644 index 00000000..b403bd91 --- /dev/null +++ b/gate_api/models/otc_quote_request.py @@ -0,0 +1,294 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcQuoteRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'side': 'str', + 'pay_coin': 'str', + 'get_coin': 'str', + 'pay_amount': 'str', + 'get_amount': 'str', + 'create_quote_token': 'str', + 'promotion_code': 'str' + } + + attribute_map = { + 'side': 'side', + 'pay_coin': 'pay_coin', + 'get_coin': 'get_coin', + 'pay_amount': 'pay_amount', + 'get_amount': 'get_amount', + 'create_quote_token': 'create_quote_token', + 'promotion_code': 'promotion_code' + } + + def __init__(self, side=None, pay_coin=None, get_coin=None, pay_amount=None, get_amount=None, create_quote_token=None, promotion_code=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, Configuration) -> None + """OtcQuoteRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._side = None + self._pay_coin = None + self._get_coin = None + self._pay_amount = None + self._get_amount = None + self._create_quote_token = None + self._promotion_code = None + self.discriminator = None + + self.side = side + self.pay_coin = pay_coin + self.get_coin = get_coin + if pay_amount is not None: + self.pay_amount = pay_amount + if get_amount is not None: + self.get_amount = get_amount + if create_quote_token is not None: + self.create_quote_token = create_quote_token + if promotion_code is not None: + self.promotion_code = promotion_code + + @property + def side(self): + """Gets the side of this OtcQuoteRequest. # noqa: E501 + + PAY: specify the payment amount (`pay_amount` is required); GET: specify the receive amount (`get_amount` is required). # noqa: E501 + + :return: The side of this OtcQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OtcQuoteRequest. + + PAY: specify the payment amount (`pay_amount` is required); GET: specify the receive amount (`get_amount` is required). # noqa: E501 + + :param side: The side of this OtcQuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def pay_coin(self): + """Gets the pay_coin of this OtcQuoteRequest. # noqa: E501 + + Payment currency. Supported currencies are available on the OTC web quote page. # noqa: E501 + + :return: The pay_coin of this OtcQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._pay_coin + + @pay_coin.setter + def pay_coin(self, pay_coin): + """Sets the pay_coin of this OtcQuoteRequest. + + Payment currency. Supported currencies are available on the OTC web quote page. # noqa: E501 + + :param pay_coin: The pay_coin of this OtcQuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and pay_coin is None: # noqa: E501 + raise ValueError("Invalid value for `pay_coin`, must not be `None`") # noqa: E501 + + self._pay_coin = pay_coin + + @property + def get_coin(self): + """Gets the get_coin of this OtcQuoteRequest. # noqa: E501 + + Receive currency. Supported currencies are available on the OTC web quote page. # noqa: E501 + + :return: The get_coin of this OtcQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._get_coin + + @get_coin.setter + def get_coin(self, get_coin): + """Sets the get_coin of this OtcQuoteRequest. + + Receive currency. Supported currencies are available on the OTC web quote page. # noqa: E501 + + :param get_coin: The get_coin of this OtcQuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and get_coin is None: # noqa: E501 + raise ValueError("Invalid value for `get_coin`, must not be `None`") # noqa: E501 + + self._get_coin = get_coin + + @property + def pay_amount(self): + """Gets the pay_amount of this OtcQuoteRequest. # noqa: E501 + + User payment currency amount # noqa: E501 + + :return: The pay_amount of this OtcQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._pay_amount + + @pay_amount.setter + def pay_amount(self, pay_amount): + """Sets the pay_amount of this OtcQuoteRequest. + + User payment currency amount # noqa: E501 + + :param pay_amount: The pay_amount of this OtcQuoteRequest. # noqa: E501 + :type: str + """ + + self._pay_amount = pay_amount + + @property + def get_amount(self): + """Gets the get_amount of this OtcQuoteRequest. # noqa: E501 + + Amount of currency received by the user # noqa: E501 + + :return: The get_amount of this OtcQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._get_amount + + @get_amount.setter + def get_amount(self, get_amount): + """Sets the get_amount of this OtcQuoteRequest. + + Amount of currency received by the user # noqa: E501 + + :param get_amount: The get_amount of this OtcQuoteRequest. # noqa: E501 + :type: str + """ + + self._get_amount = get_amount + + @property + def create_quote_token(self): + """Gets the create_quote_token of this OtcQuoteRequest. # noqa: E501 + + Create quote token: 0: quote preview only; 1: generate quote token for order placement. # noqa: E501 + + :return: The create_quote_token of this OtcQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._create_quote_token + + @create_quote_token.setter + def create_quote_token(self, create_quote_token): + """Sets the create_quote_token of this OtcQuoteRequest. + + Create quote token: 0: quote preview only; 1: generate quote token for order placement. # noqa: E501 + + :param create_quote_token: The create_quote_token of this OtcQuoteRequest. # noqa: E501 + :type: str + """ + + self._create_quote_token = create_quote_token + + @property + def promotion_code(self): + """Gets the promotion_code of this OtcQuoteRequest. # noqa: E501 + + Promotion code # noqa: E501 + + :return: The promotion_code of this OtcQuoteRequest. # noqa: E501 + :rtype: str + """ + return self._promotion_code + + @promotion_code.setter + def promotion_code(self, promotion_code): + """Sets the promotion_code of this OtcQuoteRequest. + + Promotion code # noqa: E501 + + :param promotion_code: The promotion_code of this OtcQuoteRequest. # noqa: E501 + :type: str + """ + + self._promotion_code = promotion_code + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcQuoteRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcQuoteRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_quote_response.py b/gate_api/models/otc_quote_response.py new file mode 100644 index 00000000..8048fd22 --- /dev/null +++ b/gate_api/models/otc_quote_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcQuoteResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'OtcQuoteResult', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, OtcQuoteResult, int, Configuration) -> None + """OtcQuoteResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this OtcQuoteResponse. # noqa: E501 + + + :return: The code of this OtcQuoteResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this OtcQuoteResponse. + + + :param code: The code of this OtcQuoteResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this OtcQuoteResponse. # noqa: E501 + + + :return: The message of this OtcQuoteResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OtcQuoteResponse. + + + :param message: The message of this OtcQuoteResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this OtcQuoteResponse. # noqa: E501 + + + :return: The data of this OtcQuoteResponse. # noqa: E501 + :rtype: OtcQuoteResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OtcQuoteResponse. + + + :param data: The data of this OtcQuoteResponse. # noqa: E501 + :type: OtcQuoteResult + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this OtcQuoteResponse. # noqa: E501 + + Server Unix timestamp in seconds # noqa: E501 + + :return: The timestamp of this OtcQuoteResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OtcQuoteResponse. + + Server Unix timestamp in seconds # noqa: E501 + + :param timestamp: The timestamp of this OtcQuoteResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcQuoteResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcQuoteResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_quote_result.py b/gate_api/models/otc_quote_result.py new file mode 100644 index 00000000..b396910b --- /dev/null +++ b/gate_api/models/otc_quote_result.py @@ -0,0 +1,498 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcQuoteResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'pay_coin': 'str', + 'get_coin': 'str', + 'pay_amount': 'str', + 'get_amount': 'str', + 'rate': 'str', + 'rate_reci': 'str', + 'promotion_code': 'str', + 'side': 'str', + 'order_type': 'str', + 'quote_token': 'str', + 'validity_period': 'str', + 'refresh_limit': 'int', + 'refresh_limit_msg': 'str' + } + + attribute_map = { + 'type': 'type', + 'pay_coin': 'pay_coin', + 'get_coin': 'get_coin', + 'pay_amount': 'pay_amount', + 'get_amount': 'get_amount', + 'rate': 'rate', + 'rate_reci': 'rate_reci', + 'promotion_code': 'promotion_code', + 'side': 'side', + 'order_type': 'order_type', + 'quote_token': 'quote_token', + 'validity_period': 'validity_period', + 'refresh_limit': 'refresh_limit', + 'refresh_limit_msg': 'refresh_limit_msg' + } + + def __init__(self, type=None, pay_coin=None, get_coin=None, pay_amount=None, get_amount=None, rate=None, rate_reci=None, promotion_code=None, side=None, order_type=None, quote_token=None, validity_period=None, refresh_limit=None, refresh_limit_msg=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, int, str, Configuration) -> None + """OtcQuoteResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._type = None + self._pay_coin = None + self._get_coin = None + self._pay_amount = None + self._get_amount = None + self._rate = None + self._rate_reci = None + self._promotion_code = None + self._side = None + self._order_type = None + self._quote_token = None + self._validity_period = None + self._refresh_limit = None + self._refresh_limit_msg = None + self.discriminator = None + + self.type = type + self.pay_coin = pay_coin + self.get_coin = get_coin + self.pay_amount = pay_amount + self.get_amount = get_amount + self.rate = rate + self.rate_reci = rate_reci + self.promotion_code = promotion_code + self.side = side + self.order_type = order_type + self.quote_token = quote_token + if validity_period is not None: + self.validity_period = validity_period + if refresh_limit is not None: + self.refresh_limit = refresh_limit + if refresh_limit_msg is not None: + self.refresh_limit_msg = refresh_limit_msg + + @property + def type(self): + """Gets the type of this OtcQuoteResult. # noqa: E501 + + BUY (on-ramp) or SELL (off-ramp) # noqa: E501 + + :return: The type of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OtcQuoteResult. + + BUY (on-ramp) or SELL (off-ramp) # noqa: E501 + + :param type: The type of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + @property + def pay_coin(self): + """Gets the pay_coin of this OtcQuoteResult. # noqa: E501 + + Payment currency # noqa: E501 + + :return: The pay_coin of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._pay_coin + + @pay_coin.setter + def pay_coin(self, pay_coin): + """Sets the pay_coin of this OtcQuoteResult. + + Payment currency # noqa: E501 + + :param pay_coin: The pay_coin of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and pay_coin is None: # noqa: E501 + raise ValueError("Invalid value for `pay_coin`, must not be `None`") # noqa: E501 + + self._pay_coin = pay_coin + + @property + def get_coin(self): + """Gets the get_coin of this OtcQuoteResult. # noqa: E501 + + Currency # noqa: E501 + + :return: The get_coin of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._get_coin + + @get_coin.setter + def get_coin(self, get_coin): + """Sets the get_coin of this OtcQuoteResult. + + Currency # noqa: E501 + + :param get_coin: The get_coin of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and get_coin is None: # noqa: E501 + raise ValueError("Invalid value for `get_coin`, must not be `None`") # noqa: E501 + + self._get_coin = get_coin + + @property + def pay_amount(self): + """Gets the pay_amount of this OtcQuoteResult. # noqa: E501 + + Payment amount # noqa: E501 + + :return: The pay_amount of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._pay_amount + + @pay_amount.setter + def pay_amount(self, pay_amount): + """Sets the pay_amount of this OtcQuoteResult. + + Payment amount # noqa: E501 + + :param pay_amount: The pay_amount of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and pay_amount is None: # noqa: E501 + raise ValueError("Invalid value for `pay_amount`, must not be `None`") # noqa: E501 + + self._pay_amount = pay_amount + + @property + def get_amount(self): + """Gets the get_amount of this OtcQuoteResult. # noqa: E501 + + Redemption Amount # noqa: E501 + + :return: The get_amount of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._get_amount + + @get_amount.setter + def get_amount(self, get_amount): + """Sets the get_amount of this OtcQuoteResult. + + Redemption Amount # noqa: E501 + + :param get_amount: The get_amount of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and get_amount is None: # noqa: E501 + raise ValueError("Invalid value for `get_amount`, must not be `None`") # noqa: E501 + + self._get_amount = get_amount + + @property + def rate(self): + """Gets the rate of this OtcQuoteResult. # noqa: E501 + + Exchange rate # noqa: E501 + + :return: The rate of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this OtcQuoteResult. + + Exchange rate # noqa: E501 + + :param rate: The rate of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and rate is None: # noqa: E501 + raise ValueError("Invalid value for `rate`, must not be `None`") # noqa: E501 + + self._rate = rate + + @property + def rate_reci(self): + """Gets the rate_reci of this OtcQuoteResult. # noqa: E501 + + Reciprocal of the exchange rate # noqa: E501 + + :return: The rate_reci of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._rate_reci + + @rate_reci.setter + def rate_reci(self, rate_reci): + """Sets the rate_reci of this OtcQuoteResult. + + Reciprocal of the exchange rate # noqa: E501 + + :param rate_reci: The rate_reci of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and rate_reci is None: # noqa: E501 + raise ValueError("Invalid value for `rate_reci`, must not be `None`") # noqa: E501 + + self._rate_reci = rate_reci + + @property + def promotion_code(self): + """Gets the promotion_code of this OtcQuoteResult. # noqa: E501 + + Promotion code # noqa: E501 + + :return: The promotion_code of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._promotion_code + + @promotion_code.setter + def promotion_code(self, promotion_code): + """Sets the promotion_code of this OtcQuoteResult. + + Promotion code # noqa: E501 + + :param promotion_code: The promotion_code of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and promotion_code is None: # noqa: E501 + raise ValueError("Invalid value for `promotion_code`, must not be `None`") # noqa: E501 + + self._promotion_code = promotion_code + + @property + def side(self): + """Gets the side of this OtcQuoteResult. # noqa: E501 + + Quote method # noqa: E501 + + :return: The side of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OtcQuoteResult. + + Quote method # noqa: E501 + + :param side: The side of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def order_type(self): + """Gets the order_type of this OtcQuoteResult. # noqa: E501 + + Order type: FIAT (fiat) / STABLE (stablecoin) # noqa: E501 + + :return: The order_type of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._order_type + + @order_type.setter + def order_type(self, order_type): + """Sets the order_type of this OtcQuoteResult. + + Order type: FIAT (fiat) / STABLE (stablecoin) # noqa: E501 + + :param order_type: The order_type of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and order_type is None: # noqa: E501 + raise ValueError("Invalid value for `order_type`, must not be `None`") # noqa: E501 + + self._order_type = order_type + + @property + def quote_token(self): + """Gets the quote_token of this OtcQuoteResult. # noqa: E501 + + Quote token required when placing an order # noqa: E501 + + :return: The quote_token of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._quote_token + + @quote_token.setter + def quote_token(self, quote_token): + """Sets the quote_token of this OtcQuoteResult. + + Quote token required when placing an order # noqa: E501 + + :param quote_token: The quote_token of this OtcQuoteResult. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and quote_token is None: # noqa: E501 + raise ValueError("Invalid value for `quote_token`, must not be `None`") # noqa: E501 + + self._quote_token = quote_token + + @property + def validity_period(self): + """Gets the validity_period of this OtcQuoteResult. # noqa: E501 + + Quote validity period (seconds) # noqa: E501 + + :return: The validity_period of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._validity_period + + @validity_period.setter + def validity_period(self, validity_period): + """Sets the validity_period of this OtcQuoteResult. + + Quote validity period (seconds) # noqa: E501 + + :param validity_period: The validity_period of this OtcQuoteResult. # noqa: E501 + :type: str + """ + + self._validity_period = validity_period + + @property + def refresh_limit(self): + """Gets the refresh_limit of this OtcQuoteResult. # noqa: E501 + + Quote refresh limit # noqa: E501 + + :return: The refresh_limit of this OtcQuoteResult. # noqa: E501 + :rtype: int + """ + return self._refresh_limit + + @refresh_limit.setter + def refresh_limit(self, refresh_limit): + """Sets the refresh_limit of this OtcQuoteResult. + + Quote refresh limit # noqa: E501 + + :param refresh_limit: The refresh_limit of this OtcQuoteResult. # noqa: E501 + :type: int + """ + + self._refresh_limit = refresh_limit + + @property + def refresh_limit_msg(self): + """Gets the refresh_limit_msg of this OtcQuoteResult. # noqa: E501 + + Quote refresh limit message # noqa: E501 + + :return: The refresh_limit_msg of this OtcQuoteResult. # noqa: E501 + :rtype: str + """ + return self._refresh_limit_msg + + @refresh_limit_msg.setter + def refresh_limit_msg(self, refresh_limit_msg): + """Sets the refresh_limit_msg of this OtcQuoteResult. + + Quote refresh limit message # noqa: E501 + + :param refresh_limit_msg: The refresh_limit_msg of this OtcQuoteResult. # noqa: E501 + :type: str + """ + + self._refresh_limit_msg = refresh_limit_msg + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcQuoteResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcQuoteResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_stable_coin_order_create_response.py b/gate_api/models/otc_stable_coin_order_create_response.py new file mode 100644 index 00000000..7444894d --- /dev/null +++ b/gate_api/models/otc_stable_coin_order_create_response.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcStableCoinOrderCreateResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, int, Configuration) -> None + """OtcStableCoinOrderCreateResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this OtcStableCoinOrderCreateResponse. # noqa: E501 + + Business code; 0 indicates success # noqa: E501 + + :return: The code of this OtcStableCoinOrderCreateResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this OtcStableCoinOrderCreateResponse. + + Business code; 0 indicates success # noqa: E501 + + :param code: The code of this OtcStableCoinOrderCreateResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this OtcStableCoinOrderCreateResponse. # noqa: E501 + + Message # noqa: E501 + + :return: The message of this OtcStableCoinOrderCreateResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OtcStableCoinOrderCreateResponse. + + Message # noqa: E501 + + :param message: The message of this OtcStableCoinOrderCreateResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def timestamp(self): + """Gets the timestamp of this OtcStableCoinOrderCreateResponse. # noqa: E501 + + Server Unix timestamp in seconds # noqa: E501 + + :return: The timestamp of this OtcStableCoinOrderCreateResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this OtcStableCoinOrderCreateResponse. + + Server Unix timestamp in seconds # noqa: E501 + + :param timestamp: The timestamp of this OtcStableCoinOrderCreateResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcStableCoinOrderCreateResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcStableCoinOrderCreateResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_stable_coin_order_list_item.py b/gate_api/models/otc_stable_coin_order_list_item.py new file mode 100644 index 00000000..8dc2e99e --- /dev/null +++ b/gate_api/models/otc_stable_coin_order_list_item.py @@ -0,0 +1,459 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcStableCoinOrderListItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'trade_no': 'str', + 'pay_coin': 'str', + 'pay_icon': 'str', + 'pay_amount': 'str', + 'get_coin': 'str', + 'get_icon': 'str', + 'get_amount': 'str', + 'rate': 'str', + 'rate_reci': 'str', + 'status': 'str', + 'create_timest': 'int', + 'create_time': 'str' + } + + attribute_map = { + 'id': 'id', + 'trade_no': 'trade_no', + 'pay_coin': 'pay_coin', + 'pay_icon': 'pay_icon', + 'pay_amount': 'pay_amount', + 'get_coin': 'get_coin', + 'get_icon': 'get_icon', + 'get_amount': 'get_amount', + 'rate': 'rate', + 'rate_reci': 'rate_reci', + 'status': 'status', + 'create_timest': 'create_timest', + 'create_time': 'create_time' + } + + def __init__(self, id=None, trade_no=None, pay_coin=None, pay_icon=None, pay_amount=None, get_coin=None, get_icon=None, get_amount=None, rate=None, rate_reci=None, status=None, create_timest=None, create_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, str, str, str, str, str, int, str, Configuration) -> None + """OtcStableCoinOrderListItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._trade_no = None + self._pay_coin = None + self._pay_icon = None + self._pay_amount = None + self._get_coin = None + self._get_icon = None + self._get_amount = None + self._rate = None + self._rate_reci = None + self._status = None + self._create_timest = None + self._create_time = None + self.discriminator = None + + if id is not None: + self.id = id + if trade_no is not None: + self.trade_no = trade_no + if pay_coin is not None: + self.pay_coin = pay_coin + if pay_icon is not None: + self.pay_icon = pay_icon + if pay_amount is not None: + self.pay_amount = pay_amount + if get_coin is not None: + self.get_coin = get_coin + if get_icon is not None: + self.get_icon = get_icon + if get_amount is not None: + self.get_amount = get_amount + if rate is not None: + self.rate = rate + if rate_reci is not None: + self.rate_reci = rate_reci + if status is not None: + self.status = status + if create_timest is not None: + self.create_timest = create_timest + if create_time is not None: + self.create_time = create_time + + @property + def id(self): + """Gets the id of this OtcStableCoinOrderListItem. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this OtcStableCoinOrderListItem. + + Order ID # noqa: E501 + + :param id: The id of this OtcStableCoinOrderListItem. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def trade_no(self): + """Gets the trade_no of this OtcStableCoinOrderListItem. # noqa: E501 + + Transaction reference number # noqa: E501 + + :return: The trade_no of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._trade_no + + @trade_no.setter + def trade_no(self, trade_no): + """Sets the trade_no of this OtcStableCoinOrderListItem. + + Transaction reference number # noqa: E501 + + :param trade_no: The trade_no of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._trade_no = trade_no + + @property + def pay_coin(self): + """Gets the pay_coin of this OtcStableCoinOrderListItem. # noqa: E501 + + Payment currency # noqa: E501 + + :return: The pay_coin of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._pay_coin + + @pay_coin.setter + def pay_coin(self, pay_coin): + """Sets the pay_coin of this OtcStableCoinOrderListItem. + + Payment currency # noqa: E501 + + :param pay_coin: The pay_coin of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._pay_coin = pay_coin + + @property + def pay_icon(self): + """Gets the pay_icon of this OtcStableCoinOrderListItem. # noqa: E501 + + Payment currency icon # noqa: E501 + + :return: The pay_icon of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._pay_icon + + @pay_icon.setter + def pay_icon(self, pay_icon): + """Sets the pay_icon of this OtcStableCoinOrderListItem. + + Payment currency icon # noqa: E501 + + :param pay_icon: The pay_icon of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._pay_icon = pay_icon + + @property + def pay_amount(self): + """Gets the pay_amount of this OtcStableCoinOrderListItem. # noqa: E501 + + Payment amount # noqa: E501 + + :return: The pay_amount of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._pay_amount + + @pay_amount.setter + def pay_amount(self, pay_amount): + """Sets the pay_amount of this OtcStableCoinOrderListItem. + + Payment amount # noqa: E501 + + :param pay_amount: The pay_amount of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._pay_amount = pay_amount + + @property + def get_coin(self): + """Gets the get_coin of this OtcStableCoinOrderListItem. # noqa: E501 + + Received currency # noqa: E501 + + :return: The get_coin of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._get_coin + + @get_coin.setter + def get_coin(self, get_coin): + """Sets the get_coin of this OtcStableCoinOrderListItem. + + Received currency # noqa: E501 + + :param get_coin: The get_coin of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._get_coin = get_coin + + @property + def get_icon(self): + """Gets the get_icon of this OtcStableCoinOrderListItem. # noqa: E501 + + Received currency icon # noqa: E501 + + :return: The get_icon of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._get_icon + + @get_icon.setter + def get_icon(self, get_icon): + """Sets the get_icon of this OtcStableCoinOrderListItem. + + Received currency icon # noqa: E501 + + :param get_icon: The get_icon of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._get_icon = get_icon + + @property + def get_amount(self): + """Gets the get_amount of this OtcStableCoinOrderListItem. # noqa: E501 + + Received amount # noqa: E501 + + :return: The get_amount of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._get_amount + + @get_amount.setter + def get_amount(self, get_amount): + """Sets the get_amount of this OtcStableCoinOrderListItem. + + Received amount # noqa: E501 + + :param get_amount: The get_amount of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._get_amount = get_amount + + @property + def rate(self): + """Gets the rate of this OtcStableCoinOrderListItem. # noqa: E501 + + Exchange rate # noqa: E501 + + :return: The rate of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this OtcStableCoinOrderListItem. + + Exchange rate # noqa: E501 + + :param rate: The rate of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._rate = rate + + @property + def rate_reci(self): + """Gets the rate_reci of this OtcStableCoinOrderListItem. # noqa: E501 + + Reciprocal of the exchange rate # noqa: E501 + + :return: The rate_reci of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._rate_reci + + @rate_reci.setter + def rate_reci(self, rate_reci): + """Sets the rate_reci of this OtcStableCoinOrderListItem. + + Reciprocal of the exchange rate # noqa: E501 + + :param rate_reci: The rate_reci of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._rate_reci = rate_reci + + @property + def status(self): + """Gets the status of this OtcStableCoinOrderListItem. # noqa: E501 + + PROCESSING: in progress / DONE: completed / FAILED: failed # noqa: E501 + + :return: The status of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OtcStableCoinOrderListItem. + + PROCESSING: in progress / DONE: completed / FAILED: failed # noqa: E501 + + :param status: The status of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def create_timest(self): + """Gets the create_timest of this OtcStableCoinOrderListItem. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_timest of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: int + """ + return self._create_timest + + @create_timest.setter + def create_timest(self, create_timest): + """Sets the create_timest of this OtcStableCoinOrderListItem. + + Created time # noqa: E501 + + :param create_timest: The create_timest of this OtcStableCoinOrderListItem. # noqa: E501 + :type: int + """ + + self._create_timest = create_timest + + @property + def create_time(self): + """Gets the create_time of this OtcStableCoinOrderListItem. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this OtcStableCoinOrderListItem. # noqa: E501 + :rtype: str + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this OtcStableCoinOrderListItem. + + Created time # noqa: E501 + + :param create_time: The create_time of this OtcStableCoinOrderListItem. # noqa: E501 + :type: str + """ + + self._create_time = create_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcStableCoinOrderListItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcStableCoinOrderListItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_stable_coin_order_list_response.py b/gate_api/models/otc_stable_coin_order_list_response.py new file mode 100644 index 00000000..afeceee9 --- /dev/null +++ b/gate_api/models/otc_stable_coin_order_list_response.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcStableCoinOrderListResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'OtcStableCoinOrderListResult' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data' + } + + def __init__(self, code=None, message=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, OtcStableCoinOrderListResult, Configuration) -> None + """OtcStableCoinOrderListResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + + @property + def code(self): + """Gets the code of this OtcStableCoinOrderListResponse. # noqa: E501 + + + :return: The code of this OtcStableCoinOrderListResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this OtcStableCoinOrderListResponse. + + + :param code: The code of this OtcStableCoinOrderListResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this OtcStableCoinOrderListResponse. # noqa: E501 + + + :return: The message of this OtcStableCoinOrderListResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OtcStableCoinOrderListResponse. + + + :param message: The message of this OtcStableCoinOrderListResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this OtcStableCoinOrderListResponse. # noqa: E501 + + + :return: The data of this OtcStableCoinOrderListResponse. # noqa: E501 + :rtype: OtcStableCoinOrderListResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this OtcStableCoinOrderListResponse. + + + :param data: The data of this OtcStableCoinOrderListResponse. # noqa: E501 + :type: OtcStableCoinOrderListResult + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcStableCoinOrderListResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcStableCoinOrderListResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_stable_coin_order_list_result.py b/gate_api/models/otc_stable_coin_order_list_result.py new file mode 100644 index 00000000..7f57ef4c --- /dev/null +++ b/gate_api/models/otc_stable_coin_order_list_result.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcStableCoinOrderListResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'total': 'int', + 'page_size': 'int', + 'page_number': 'int', + 'total_page': 'int', + 'list': 'list[OtcStableCoinOrderListItem]' + } + + attribute_map = { + 'total': 'total', + 'page_size': 'page_size', + 'page_number': 'page_number', + 'total_page': 'total_page', + 'list': 'list' + } + + def __init__(self, total=None, page_size=None, page_number=None, total_page=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, int, list[OtcStableCoinOrderListItem], Configuration) -> None + """OtcStableCoinOrderListResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._page_size = None + self._page_number = None + self._total_page = None + self._list = None + self.discriminator = None + + self.total = total + self.page_size = page_size + self.page_number = page_number + self.total_page = total_page + self.list = list + + @property + def total(self): + """Gets the total of this OtcStableCoinOrderListResult. # noqa: E501 + + + :return: The total of this OtcStableCoinOrderListResult. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this OtcStableCoinOrderListResult. + + + :param total: The total of this OtcStableCoinOrderListResult. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total is None: # noqa: E501 + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + @property + def page_size(self): + """Gets the page_size of this OtcStableCoinOrderListResult. # noqa: E501 + + + :return: The page_size of this OtcStableCoinOrderListResult. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this OtcStableCoinOrderListResult. + + + :param page_size: The page_size of this OtcStableCoinOrderListResult. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page_size is None: # noqa: E501 + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def page_number(self): + """Gets the page_number of this OtcStableCoinOrderListResult. # noqa: E501 + + + :return: The page_number of this OtcStableCoinOrderListResult. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this OtcStableCoinOrderListResult. + + + :param page_number: The page_number of this OtcStableCoinOrderListResult. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and page_number is None: # noqa: E501 + raise ValueError("Invalid value for `page_number`, must not be `None`") # noqa: E501 + + self._page_number = page_number + + @property + def total_page(self): + """Gets the total_page of this OtcStableCoinOrderListResult. # noqa: E501 + + + :return: The total_page of this OtcStableCoinOrderListResult. # noqa: E501 + :rtype: int + """ + return self._total_page + + @total_page.setter + def total_page(self, total_page): + """Sets the total_page of this OtcStableCoinOrderListResult. + + + :param total_page: The total_page of this OtcStableCoinOrderListResult. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and total_page is None: # noqa: E501 + raise ValueError("Invalid value for `total_page`, must not be `None`") # noqa: E501 + + self._total_page = total_page + + @property + def list(self): + """Gets the list of this OtcStableCoinOrderListResult. # noqa: E501 + + + :return: The list of this OtcStableCoinOrderListResult. # noqa: E501 + :rtype: list[OtcStableCoinOrderListItem] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this OtcStableCoinOrderListResult. + + + :param list: The list of this OtcStableCoinOrderListResult. # noqa: E501 + :type: list[OtcStableCoinOrderListItem] + """ + if self.local_vars_configuration.client_side_validation and list is None: # noqa: E501 + raise ValueError("Invalid value for `list`, must not be `None`") # noqa: E501 + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcStableCoinOrderListResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcStableCoinOrderListResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/otc_stable_coin_order_request.py b/gate_api/models/otc_stable_coin_order_request.py new file mode 100644 index 00000000..b8a51abb --- /dev/null +++ b/gate_api/models/otc_stable_coin_order_request.py @@ -0,0 +1,297 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtcStableCoinOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'pay_coin': 'str', + 'get_coin': 'str', + 'pay_amount': 'str', + 'get_amount': 'str', + 'side': 'str', + 'promotion_code': 'str', + 'quote_token': 'str' + } + + attribute_map = { + 'pay_coin': 'pay_coin', + 'get_coin': 'get_coin', + 'pay_amount': 'pay_amount', + 'get_amount': 'get_amount', + 'side': 'side', + 'promotion_code': 'promotion_code', + 'quote_token': 'quote_token' + } + + def __init__(self, pay_coin=None, get_coin=None, pay_amount=None, get_amount=None, side=None, promotion_code=None, quote_token=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, Configuration) -> None + """OtcStableCoinOrderRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._pay_coin = None + self._get_coin = None + self._pay_amount = None + self._get_amount = None + self._side = None + self._promotion_code = None + self._quote_token = None + self.discriminator = None + + self.pay_coin = pay_coin + self.get_coin = get_coin + self.pay_amount = pay_amount + self.get_amount = get_amount + self.side = side + if promotion_code is not None: + self.promotion_code = promotion_code + self.quote_token = quote_token + + @property + def pay_coin(self): + """Gets the pay_coin of this OtcStableCoinOrderRequest. # noqa: E501 + + Currency paid by the user. Supported currencies can be queried from the OTC web stablecoin quote page. # noqa: E501 + + :return: The pay_coin of this OtcStableCoinOrderRequest. # noqa: E501 + :rtype: str + """ + return self._pay_coin + + @pay_coin.setter + def pay_coin(self, pay_coin): + """Sets the pay_coin of this OtcStableCoinOrderRequest. + + Currency paid by the user. Supported currencies can be queried from the OTC web stablecoin quote page. # noqa: E501 + + :param pay_coin: The pay_coin of this OtcStableCoinOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and pay_coin is None: # noqa: E501 + raise ValueError("Invalid value for `pay_coin`, must not be `None`") # noqa: E501 + + self._pay_coin = pay_coin + + @property + def get_coin(self): + """Gets the get_coin of this OtcStableCoinOrderRequest. # noqa: E501 + + Currency to be received by the user. Supported currencies can be queried from the OTC web stablecoin quote page. # noqa: E501 + + :return: The get_coin of this OtcStableCoinOrderRequest. # noqa: E501 + :rtype: str + """ + return self._get_coin + + @get_coin.setter + def get_coin(self, get_coin): + """Sets the get_coin of this OtcStableCoinOrderRequest. + + Currency to be received by the user. Supported currencies can be queried from the OTC web stablecoin quote page. # noqa: E501 + + :param get_coin: The get_coin of this OtcStableCoinOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and get_coin is None: # noqa: E501 + raise ValueError("Invalid value for `get_coin`, must not be `None`") # noqa: E501 + + self._get_coin = get_coin + + @property + def pay_amount(self): + """Gets the pay_amount of this OtcStableCoinOrderRequest. # noqa: E501 + + User payment currency amount # noqa: E501 + + :return: The pay_amount of this OtcStableCoinOrderRequest. # noqa: E501 + :rtype: str + """ + return self._pay_amount + + @pay_amount.setter + def pay_amount(self, pay_amount): + """Sets the pay_amount of this OtcStableCoinOrderRequest. + + User payment currency amount # noqa: E501 + + :param pay_amount: The pay_amount of this OtcStableCoinOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and pay_amount is None: # noqa: E501 + raise ValueError("Invalid value for `pay_amount`, must not be `None`") # noqa: E501 + + self._pay_amount = pay_amount + + @property + def get_amount(self): + """Gets the get_amount of this OtcStableCoinOrderRequest. # noqa: E501 + + Amount of currency received by the user # noqa: E501 + + :return: The get_amount of this OtcStableCoinOrderRequest. # noqa: E501 + :rtype: str + """ + return self._get_amount + + @get_amount.setter + def get_amount(self, get_amount): + """Sets the get_amount of this OtcStableCoinOrderRequest. + + Amount of currency received by the user # noqa: E501 + + :param get_amount: The get_amount of this OtcStableCoinOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and get_amount is None: # noqa: E501 + raise ValueError("Invalid value for `get_amount`, must not be `None`") # noqa: E501 + + self._get_amount = get_amount + + @property + def side(self): + """Gets the side of this OtcStableCoinOrderRequest. # noqa: E501 + + The side returned by the quote endpoint (used for order validation). For backward compatibility, `PAY`/`GET` are accepted; new integrations should use the value returned by the quote response. # noqa: E501 + + :return: The side of this OtcStableCoinOrderRequest. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this OtcStableCoinOrderRequest. + + The side returned by the quote endpoint (used for order validation). For backward compatibility, `PAY`/`GET` are accepted; new integrations should use the value returned by the quote response. # noqa: E501 + + :param side: The side of this OtcStableCoinOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def promotion_code(self): + """Gets the promotion_code of this OtcStableCoinOrderRequest. # noqa: E501 + + Promotion code (optional) # noqa: E501 + + :return: The promotion_code of this OtcStableCoinOrderRequest. # noqa: E501 + :rtype: str + """ + return self._promotion_code + + @promotion_code.setter + def promotion_code(self, promotion_code): + """Sets the promotion_code of this OtcStableCoinOrderRequest. + + Promotion code (optional) # noqa: E501 + + :param promotion_code: The promotion_code of this OtcStableCoinOrderRequest. # noqa: E501 + :type: str + """ + + self._promotion_code = promotion_code + + @property + def quote_token(self): + """Gets the quote_token of this OtcStableCoinOrderRequest. # noqa: E501 + + Parameter returned by the quote API # noqa: E501 + + :return: The quote_token of this OtcStableCoinOrderRequest. # noqa: E501 + :rtype: str + """ + return self._quote_token + + @quote_token.setter + def quote_token(self, quote_token): + """Sets the quote_token of this OtcStableCoinOrderRequest. + + Parameter returned by the quote API # noqa: E501 + + :param quote_token: The quote_token of this OtcStableCoinOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and quote_token is None: # noqa: E501 + raise ValueError("Invalid value for `quote_token`, must not be `None`") # noqa: E501 + + self._quote_token = quote_token + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtcStableCoinOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtcStableCoinOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/other_contact.py b/gate_api/models/other_contact.py new file mode 100644 index 00000000..77940f51 --- /dev/null +++ b/gate_api/models/other_contact.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class OtherContact(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'int', + 'value': 'str' + } + + attribute_map = { + 'type': 'type', + 'value': 'value' + } + + def __init__(self, type=None, value=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """OtherContact - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._type = None + self._value = None + self.discriminator = None + + if type is not None: + self.type = type + if value is not None: + self.value = value + + @property + def type(self): + """Gets the type of this OtherContact. # noqa: E501 + + Contact type # noqa: E501 + + :return: The type of this OtherContact. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OtherContact. + + Contact type # noqa: E501 + + :param type: The type of this OtherContact. # noqa: E501 + :type: int + """ + + self._type = type + + @property + def value(self): + """Gets the value of this OtherContact. # noqa: E501 + + Contact value # noqa: E501 + + :return: The value of this OtherContact. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this OtherContact. + + Contact value # noqa: E501 + + :param value: The value of this OtherContact. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OtherContact): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, OtherContact): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_ad_detail.py b/gate_api/models/p2p_ad_detail.py new file mode 100644 index 00000000..32da439c --- /dev/null +++ b/gate_api/models/p2p_ad_detail.py @@ -0,0 +1,1283 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pAdDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'rate': 'str', + 'type': 'str', + 'amount': 'str', + 'min_amount': 'str', + 'max_amount': 'str', + 'fiat_min_amount': 'str', + 'fiat_max_amount': 'str', + 'limit_basis': 'int', + 'limit_basis_text': 'str', + 'total': 'str', + 'pay_ali': 'int', + 'pay_bank': 'int', + 'pay_paypal': 'int', + 'pay_wechat': 'int', + 'pay_type_num': 'str', + 'pay_type_json': 'str', + 'locked_amount': 'str', + 'orderid': 'int', + 'timestamp': 'int', + 'currency_type': 'str', + 'want_type': 'str', + 'hide_rate': 'str', + 'trade_tips': 'str', + 'auto_reply': 'str', + 'rate_ref_id': 'int', + 'rate_offset': 'float', + 'status': 'str', + 'rate_fixed': 'int', + 'float_trend': 'int', + 'expire_min': 'int', + 'tier_limit': 'int', + 'reg_time_limit': 'int', + 'advertisers_limit': 'int', + 'polymarket_limit': 'int', + 'min_completed_limit': 'int', + 'max_completed_limit': 'int', + 'user_orders_limit': 'int', + 'completed_rate_limit': 'float', + 'limit_country_cn': 'str', + 'limit_country_en': 'str', + 'is_hedge': 'int', + 'hide_payment': 'int' + } + + attribute_map = { + 'rate': 'rate', + 'type': 'type', + 'amount': 'amount', + 'min_amount': 'min_amount', + 'max_amount': 'max_amount', + 'fiat_min_amount': 'fiat_min_amount', + 'fiat_max_amount': 'fiat_max_amount', + 'limit_basis': 'limit_basis', + 'limit_basis_text': 'limit_basis_text', + 'total': 'total', + 'pay_ali': 'pay_ali', + 'pay_bank': 'pay_bank', + 'pay_paypal': 'pay_paypal', + 'pay_wechat': 'pay_wechat', + 'pay_type_num': 'pay_type_num', + 'pay_type_json': 'pay_type_json', + 'locked_amount': 'locked_amount', + 'orderid': 'orderid', + 'timestamp': 'timestamp', + 'currency_type': 'currency_type', + 'want_type': 'want_type', + 'hide_rate': 'hide_rate', + 'trade_tips': 'trade_tips', + 'auto_reply': 'auto_reply', + 'rate_ref_id': 'rate_ref_id', + 'rate_offset': 'rate_offset', + 'status': 'status', + 'rate_fixed': 'rate_fixed', + 'float_trend': 'float_trend', + 'expire_min': 'expire_min', + 'tier_limit': 'tier_limit', + 'reg_time_limit': 'reg_time_limit', + 'advertisers_limit': 'advertisers_limit', + 'polymarket_limit': 'polymarket_limit', + 'min_completed_limit': 'min_completed_limit', + 'max_completed_limit': 'max_completed_limit', + 'user_orders_limit': 'user_orders_limit', + 'completed_rate_limit': 'completed_rate_limit', + 'limit_country_cn': 'limit_country_cn', + 'limit_country_en': 'limit_country_en', + 'is_hedge': 'is_hedge', + 'hide_payment': 'hide_payment' + } + + def __init__(self, rate=None, type=None, amount=None, min_amount=None, max_amount=None, fiat_min_amount=None, fiat_max_amount=None, limit_basis=None, limit_basis_text=None, total=None, pay_ali=None, pay_bank=None, pay_paypal=None, pay_wechat=None, pay_type_num=None, pay_type_json=None, locked_amount=None, orderid=None, timestamp=None, currency_type=None, want_type=None, hide_rate=None, trade_tips=None, auto_reply=None, rate_ref_id=None, rate_offset=None, status=None, rate_fixed=None, float_trend=None, expire_min=None, tier_limit=None, reg_time_limit=None, advertisers_limit=None, polymarket_limit=None, min_completed_limit=None, max_completed_limit=None, user_orders_limit=None, completed_rate_limit=None, limit_country_cn=None, limit_country_en=None, is_hedge=None, hide_payment=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, int, str, str, int, int, int, int, str, str, str, int, int, str, str, str, str, str, int, float, str, int, int, int, int, int, int, int, int, int, int, float, str, str, int, int, Configuration) -> None + """P2pAdDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._rate = None + self._type = None + self._amount = None + self._min_amount = None + self._max_amount = None + self._fiat_min_amount = None + self._fiat_max_amount = None + self._limit_basis = None + self._limit_basis_text = None + self._total = None + self._pay_ali = None + self._pay_bank = None + self._pay_paypal = None + self._pay_wechat = None + self._pay_type_num = None + self._pay_type_json = None + self._locked_amount = None + self._orderid = None + self._timestamp = None + self._currency_type = None + self._want_type = None + self._hide_rate = None + self._trade_tips = None + self._auto_reply = None + self._rate_ref_id = None + self._rate_offset = None + self._status = None + self._rate_fixed = None + self._float_trend = None + self._expire_min = None + self._tier_limit = None + self._reg_time_limit = None + self._advertisers_limit = None + self._polymarket_limit = None + self._min_completed_limit = None + self._max_completed_limit = None + self._user_orders_limit = None + self._completed_rate_limit = None + self._limit_country_cn = None + self._limit_country_en = None + self._is_hedge = None + self._hide_payment = None + self.discriminator = None + + if rate is not None: + self.rate = rate + if type is not None: + self.type = type + if amount is not None: + self.amount = amount + if min_amount is not None: + self.min_amount = min_amount + if max_amount is not None: + self.max_amount = max_amount + if fiat_min_amount is not None: + self.fiat_min_amount = fiat_min_amount + if fiat_max_amount is not None: + self.fiat_max_amount = fiat_max_amount + if limit_basis is not None: + self.limit_basis = limit_basis + if limit_basis_text is not None: + self.limit_basis_text = limit_basis_text + if total is not None: + self.total = total + if pay_ali is not None: + self.pay_ali = pay_ali + if pay_bank is not None: + self.pay_bank = pay_bank + if pay_paypal is not None: + self.pay_paypal = pay_paypal + if pay_wechat is not None: + self.pay_wechat = pay_wechat + if pay_type_num is not None: + self.pay_type_num = pay_type_num + if pay_type_json is not None: + self.pay_type_json = pay_type_json + if locked_amount is not None: + self.locked_amount = locked_amount + if orderid is not None: + self.orderid = orderid + if timestamp is not None: + self.timestamp = timestamp + if currency_type is not None: + self.currency_type = currency_type + if want_type is not None: + self.want_type = want_type + if hide_rate is not None: + self.hide_rate = hide_rate + if trade_tips is not None: + self.trade_tips = trade_tips + if auto_reply is not None: + self.auto_reply = auto_reply + if rate_ref_id is not None: + self.rate_ref_id = rate_ref_id + if rate_offset is not None: + self.rate_offset = rate_offset + if status is not None: + self.status = status + if rate_fixed is not None: + self.rate_fixed = rate_fixed + if float_trend is not None: + self.float_trend = float_trend + if expire_min is not None: + self.expire_min = expire_min + if tier_limit is not None: + self.tier_limit = tier_limit + if reg_time_limit is not None: + self.reg_time_limit = reg_time_limit + if advertisers_limit is not None: + self.advertisers_limit = advertisers_limit + if polymarket_limit is not None: + self.polymarket_limit = polymarket_limit + if min_completed_limit is not None: + self.min_completed_limit = min_completed_limit + if max_completed_limit is not None: + self.max_completed_limit = max_completed_limit + if user_orders_limit is not None: + self.user_orders_limit = user_orders_limit + if completed_rate_limit is not None: + self.completed_rate_limit = completed_rate_limit + if limit_country_cn is not None: + self.limit_country_cn = limit_country_cn + if limit_country_en is not None: + self.limit_country_en = limit_country_en + if is_hedge is not None: + self.is_hedge = is_hedge + if hide_payment is not None: + self.hide_payment = hide_payment + + @property + def rate(self): + """Gets the rate of this P2pAdDetail. # noqa: E501 + + Advertisement price. # noqa: E501 + + :return: The rate of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this P2pAdDetail. + + Advertisement price. # noqa: E501 + + :param rate: The rate of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._rate = rate + + @property + def type(self): + """Gets the type of this P2pAdDetail. # noqa: E501 + + Ad side: `buy` buy-crypto ad; `sell` sell-crypto ad. # noqa: E501 + + :return: The type of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this P2pAdDetail. + + Ad side: `buy` buy-crypto ad; `sell` sell-crypto ad. # noqa: E501 + + :param type: The type of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def amount(self): + """Gets the amount of this P2pAdDetail. # noqa: E501 + + Remaining crypto amount on the ad. # noqa: E501 + + :return: The amount of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this P2pAdDetail. + + Remaining crypto amount on the ad. # noqa: E501 + + :param amount: The amount of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def min_amount(self): + """Gets the min_amount of this P2pAdDetail. # noqa: E501 + + Minimum quantity per order, denominated by currency_type # noqa: E501 + + :return: The min_amount of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._min_amount + + @min_amount.setter + def min_amount(self, min_amount): + """Sets the min_amount of this P2pAdDetail. + + Minimum quantity per order, denominated by currency_type # noqa: E501 + + :param min_amount: The min_amount of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._min_amount = min_amount + + @property + def max_amount(self): + """Gets the max_amount of this P2pAdDetail. # noqa: E501 + + Maximum quantity per order, denominated by currency_type # noqa: E501 + + :return: The max_amount of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._max_amount + + @max_amount.setter + def max_amount(self, max_amount): + """Sets the max_amount of this P2pAdDetail. + + Maximum quantity per order, denominated by currency_type # noqa: E501 + + :param max_amount: The max_amount of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._max_amount = max_amount + + @property + def fiat_min_amount(self): + """Gets the fiat_min_amount of this P2pAdDetail. # noqa: E501 + + Minimum trade amount in `want_type`. # noqa: E501 + + :return: The fiat_min_amount of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._fiat_min_amount + + @fiat_min_amount.setter + def fiat_min_amount(self, fiat_min_amount): + """Sets the fiat_min_amount of this P2pAdDetail. + + Minimum trade amount in `want_type`. # noqa: E501 + + :param fiat_min_amount: The fiat_min_amount of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._fiat_min_amount = fiat_min_amount + + @property + def fiat_max_amount(self): + """Gets the fiat_max_amount of this P2pAdDetail. # noqa: E501 + + Maximum trade amount priced in `want_type`. # noqa: E501 + + :return: The fiat_max_amount of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._fiat_max_amount + + @fiat_max_amount.setter + def fiat_max_amount(self, fiat_max_amount): + """Sets the fiat_max_amount of this P2pAdDetail. + + Maximum trade amount priced in `want_type`. # noqa: E501 + + :param fiat_max_amount: The fiat_max_amount of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._fiat_max_amount = fiat_max_amount + + @property + def limit_basis(self): + """Gets the limit_basis of this P2pAdDetail. # noqa: E501 + + Trading limit unit. 0: crypto quantity, 1: fiat amount # noqa: E501 + + :return: The limit_basis of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._limit_basis + + @limit_basis.setter + def limit_basis(self, limit_basis): + """Sets the limit_basis of this P2pAdDetail. + + Trading limit unit. 0: crypto quantity, 1: fiat amount # noqa: E501 + + :param limit_basis: The limit_basis of this P2pAdDetail. # noqa: E501 + :type: int + """ + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and limit_basis not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `limit_basis` ({0}), must be one of {1}" # noqa: E501 + .format(limit_basis, allowed_values) + ) + + self._limit_basis = limit_basis + + @property + def limit_basis_text(self): + """Gets the limit_basis_text of this P2pAdDetail. # noqa: E501 + + Trading limit unit label. crypto: crypto quantity, fiat: fiat amount # noqa: E501 + + :return: The limit_basis_text of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._limit_basis_text + + @limit_basis_text.setter + def limit_basis_text(self, limit_basis_text): + """Sets the limit_basis_text of this P2pAdDetail. + + Trading limit unit label. crypto: crypto quantity, fiat: fiat amount # noqa: E501 + + :param limit_basis_text: The limit_basis_text of this P2pAdDetail. # noqa: E501 + :type: str + """ + allowed_values = ["crypto", "fiat"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and limit_basis_text not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `limit_basis_text` ({0}), must be one of {1}" # noqa: E501 + .format(limit_basis_text, allowed_values) + ) + + self._limit_basis_text = limit_basis_text + + @property + def total(self): + """Gets the total of this P2pAdDetail. # noqa: E501 + + Fiat amount # noqa: E501 + + :return: The total of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this P2pAdDetail. + + Fiat amount # noqa: E501 + + :param total: The total of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._total = total + + @property + def pay_ali(self): + """Gets the pay_ali of this P2pAdDetail. # noqa: E501 + + Whether Alipay is supported. `1`: yes; `0`: no. # noqa: E501 + + :return: The pay_ali of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._pay_ali + + @pay_ali.setter + def pay_ali(self, pay_ali): + """Sets the pay_ali of this P2pAdDetail. + + Whether Alipay is supported. `1`: yes; `0`: no. # noqa: E501 + + :param pay_ali: The pay_ali of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._pay_ali = pay_ali + + @property + def pay_bank(self): + """Gets the pay_bank of this P2pAdDetail. # noqa: E501 + + Whether bank transfer is supported. `1`: yes; `0`: no. # noqa: E501 + + :return: The pay_bank of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._pay_bank + + @pay_bank.setter + def pay_bank(self, pay_bank): + """Sets the pay_bank of this P2pAdDetail. + + Whether bank transfer is supported. `1`: yes; `0`: no. # noqa: E501 + + :param pay_bank: The pay_bank of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._pay_bank = pay_bank + + @property + def pay_paypal(self): + """Gets the pay_paypal of this P2pAdDetail. # noqa: E501 + + Whether PayPal is supported. `1`: yes; `0`: no. # noqa: E501 + + :return: The pay_paypal of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._pay_paypal + + @pay_paypal.setter + def pay_paypal(self, pay_paypal): + """Sets the pay_paypal of this P2pAdDetail. + + Whether PayPal is supported. `1`: yes; `0`: no. # noqa: E501 + + :param pay_paypal: The pay_paypal of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._pay_paypal = pay_paypal + + @property + def pay_wechat(self): + """Gets the pay_wechat of this P2pAdDetail. # noqa: E501 + + Whether WeChat Pay is supported. `1`: yes; `0`: no. # noqa: E501 + + :return: The pay_wechat of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._pay_wechat + + @pay_wechat.setter + def pay_wechat(self, pay_wechat): + """Sets the pay_wechat of this P2pAdDetail. + + Whether WeChat Pay is supported. `1`: yes; `0`: no. # noqa: E501 + + :param pay_wechat: The pay_wechat of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._pay_wechat = pay_wechat + + @property + def pay_type_num(self): + """Gets the pay_type_num of this P2pAdDetail. # noqa: E501 + + Payment method ID list # noqa: E501 + + :return: The pay_type_num of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._pay_type_num + + @pay_type_num.setter + def pay_type_num(self, pay_type_num): + """Sets the pay_type_num of this P2pAdDetail. + + Payment method ID list # noqa: E501 + + :param pay_type_num: The pay_type_num of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._pay_type_num = pay_type_num + + @property + def pay_type_json(self): + """Gets the pay_type_json of this P2pAdDetail. # noqa: E501 + + JSON map of payment type -> payment method ID. # noqa: E501 + + :return: The pay_type_json of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._pay_type_json + + @pay_type_json.setter + def pay_type_json(self, pay_type_json): + """Sets the pay_type_json of this P2pAdDetail. + + JSON map of payment type -> payment method ID. # noqa: E501 + + :param pay_type_json: The pay_type_json of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._pay_type_json = pay_type_json + + @property + def locked_amount(self): + """Gets the locked_amount of this P2pAdDetail. # noqa: E501 + + Locked amount # noqa: E501 + + :return: The locked_amount of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._locked_amount + + @locked_amount.setter + def locked_amount(self, locked_amount): + """Sets the locked_amount of this P2pAdDetail. + + Locked amount # noqa: E501 + + :param locked_amount: The locked_amount of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._locked_amount = locked_amount + + @property + def orderid(self): + """Gets the orderid of this P2pAdDetail. # noqa: E501 + + Order ID # noqa: E501 + + :return: The orderid of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._orderid + + @orderid.setter + def orderid(self, orderid): + """Sets the orderid of this P2pAdDetail. + + Order ID # noqa: E501 + + :param orderid: The orderid of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._orderid = orderid + + @property + def timestamp(self): + """Gets the timestamp of this P2pAdDetail. # noqa: E501 + + Created time # noqa: E501 + + :return: The timestamp of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pAdDetail. + + Created time # noqa: E501 + + :param timestamp: The timestamp of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def currency_type(self): + """Gets the currency_type of this P2pAdDetail. # noqa: E501 + + Cryptocurrency symbol. # noqa: E501 + + :return: The currency_type of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._currency_type + + @currency_type.setter + def currency_type(self, currency_type): + """Sets the currency_type of this P2pAdDetail. + + Cryptocurrency symbol. # noqa: E501 + + :param currency_type: The currency_type of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._currency_type = currency_type + + @property + def want_type(self): + """Gets the want_type of this P2pAdDetail. # noqa: E501 + + Fiat type # noqa: E501 + + :return: The want_type of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._want_type + + @want_type.setter + def want_type(self, want_type): + """Sets the want_type of this P2pAdDetail. + + Fiat type # noqa: E501 + + :param want_type: The want_type of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._want_type = want_type + + @property + def hide_rate(self): + """Gets the hide_rate of this P2pAdDetail. # noqa: E501 + + Hidden price # noqa: E501 + + :return: The hide_rate of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._hide_rate + + @hide_rate.setter + def hide_rate(self, hide_rate): + """Sets the hide_rate of this P2pAdDetail. + + Hidden price # noqa: E501 + + :param hide_rate: The hide_rate of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._hide_rate = hide_rate + + @property + def trade_tips(self): + """Gets the trade_tips of this P2pAdDetail. # noqa: E501 + + Trading terms # noqa: E501 + + :return: The trade_tips of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._trade_tips + + @trade_tips.setter + def trade_tips(self, trade_tips): + """Sets the trade_tips of this P2pAdDetail. + + Trading terms # noqa: E501 + + :param trade_tips: The trade_tips of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._trade_tips = trade_tips + + @property + def auto_reply(self): + """Gets the auto_reply of this P2pAdDetail. # noqa: E501 + + Auto reply # noqa: E501 + + :return: The auto_reply of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._auto_reply + + @auto_reply.setter + def auto_reply(self, auto_reply): + """Sets the auto_reply of this P2pAdDetail. + + Auto reply # noqa: E501 + + :param auto_reply: The auto_reply of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._auto_reply = auto_reply + + @property + def rate_ref_id(self): + """Gets the rate_ref_id of this P2pAdDetail. # noqa: E501 + + Floating reference: `1` platform; `2` Gate; `3` spot; `<= 0` means fixed price. # noqa: E501 + + :return: The rate_ref_id of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._rate_ref_id + + @rate_ref_id.setter + def rate_ref_id(self, rate_ref_id): + """Sets the rate_ref_id of this P2pAdDetail. + + Floating reference: `1` platform; `2` Gate; `3` spot; `<= 0` means fixed price. # noqa: E501 + + :param rate_ref_id: The rate_ref_id of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._rate_ref_id = rate_ref_id + + @property + def rate_offset(self): + """Gets the rate_offset of this P2pAdDetail. # noqa: E501 + + Floating ratio (absolute value) # noqa: E501 + + :return: The rate_offset of this P2pAdDetail. # noqa: E501 + :rtype: float + """ + return self._rate_offset + + @rate_offset.setter + def rate_offset(self, rate_offset): + """Sets the rate_offset of this P2pAdDetail. + + Floating ratio (absolute value) # noqa: E501 + + :param rate_offset: The rate_offset of this P2pAdDetail. # noqa: E501 + :type: float + """ + + self._rate_offset = rate_offset + + @property + def status(self): + """Gets the status of this P2pAdDetail. # noqa: E501 + + Ad status: `OPEN` listed; `OFFLIN` delisted; `CLOSED` closed; `CANCEL` canceled. # noqa: E501 + + :return: The status of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this P2pAdDetail. + + Ad status: `OPEN` listed; `OFFLIN` delisted; `CLOSED` closed; `CANCEL` canceled. # noqa: E501 + + :param status: The status of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def rate_fixed(self): + """Gets the rate_fixed of this P2pAdDetail. # noqa: E501 + + Price type: `0` floating; `1` fixed. # noqa: E501 + + :return: The rate_fixed of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._rate_fixed + + @rate_fixed.setter + def rate_fixed(self, rate_fixed): + """Sets the rate_fixed of this P2pAdDetail. + + Price type: `0` floating; `1` fixed. # noqa: E501 + + :param rate_fixed: The rate_fixed of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._rate_fixed = rate_fixed + + @property + def float_trend(self): + """Gets the float_trend of this P2pAdDetail. # noqa: E501 + + Floating direction: `0` markup; `1` markdown. # noqa: E501 + + :return: The float_trend of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._float_trend + + @float_trend.setter + def float_trend(self, float_trend): + """Sets the float_trend of this P2pAdDetail. + + Floating direction: `0` markup; `1` markdown. # noqa: E501 + + :param float_trend: The float_trend of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._float_trend = float_trend + + @property + def expire_min(self): + """Gets the expire_min of this P2pAdDetail. # noqa: E501 + + Timeout (minutes) # noqa: E501 + + :return: The expire_min of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._expire_min + + @expire_min.setter + def expire_min(self, expire_min): + """Sets the expire_min of this P2pAdDetail. + + Timeout (minutes) # noqa: E501 + + :param expire_min: The expire_min of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._expire_min = expire_min + + @property + def tier_limit(self): + """Gets the tier_limit of this P2pAdDetail. # noqa: E501 + + Tier limit # noqa: E501 + + :return: The tier_limit of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._tier_limit + + @tier_limit.setter + def tier_limit(self, tier_limit): + """Sets the tier_limit of this P2pAdDetail. + + Tier limit # noqa: E501 + + :param tier_limit: The tier_limit of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._tier_limit = tier_limit + + @property + def reg_time_limit(self): + """Gets the reg_time_limit of this P2pAdDetail. # noqa: E501 + + Registration time limit # noqa: E501 + + :return: The reg_time_limit of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._reg_time_limit + + @reg_time_limit.setter + def reg_time_limit(self, reg_time_limit): + """Sets the reg_time_limit of this P2pAdDetail. + + Registration time limit # noqa: E501 + + :param reg_time_limit: The reg_time_limit of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._reg_time_limit = reg_time_limit + + @property + def advertisers_limit(self): + """Gets the advertisers_limit of this P2pAdDetail. # noqa: E501 + + Whether trading with the advertiser is restricted. `0`: no; `1`: yes. # noqa: E501 + + :return: The advertisers_limit of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._advertisers_limit + + @advertisers_limit.setter + def advertisers_limit(self, advertisers_limit): + """Sets the advertisers_limit of this P2pAdDetail. + + Whether trading with the advertiser is restricted. `0`: no; `1`: yes. # noqa: E501 + + :param advertisers_limit: The advertisers_limit of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._advertisers_limit = advertisers_limit + + @property + def polymarket_limit(self): + """Gets the polymarket_limit of this P2pAdDetail. # noqa: E501 + + Whether to restrict trading with Polymarket users. 0: no restriction, 1: restricted # noqa: E501 + + :return: The polymarket_limit of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._polymarket_limit + + @polymarket_limit.setter + def polymarket_limit(self, polymarket_limit): + """Sets the polymarket_limit of this P2pAdDetail. + + Whether to restrict trading with Polymarket users. 0: no restriction, 1: restricted # noqa: E501 + + :param polymarket_limit: The polymarket_limit of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._polymarket_limit = polymarket_limit + + @property + def min_completed_limit(self): + """Gets the min_completed_limit of this P2pAdDetail. # noqa: E501 + + Minimum limit of completed orders # noqa: E501 + + :return: The min_completed_limit of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._min_completed_limit + + @min_completed_limit.setter + def min_completed_limit(self, min_completed_limit): + """Sets the min_completed_limit of this P2pAdDetail. + + Minimum limit of completed orders # noqa: E501 + + :param min_completed_limit: The min_completed_limit of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._min_completed_limit = min_completed_limit + + @property + def max_completed_limit(self): + """Gets the max_completed_limit of this P2pAdDetail. # noqa: E501 + + Maximum limit of completed orders # noqa: E501 + + :return: The max_completed_limit of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._max_completed_limit + + @max_completed_limit.setter + def max_completed_limit(self, max_completed_limit): + """Sets the max_completed_limit of this P2pAdDetail. + + Maximum limit of completed orders # noqa: E501 + + :param max_completed_limit: The max_completed_limit of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._max_completed_limit = max_completed_limit + + @property + def user_orders_limit(self): + """Gets the user_orders_limit of this P2pAdDetail. # noqa: E501 + + Order count limit # noqa: E501 + + :return: The user_orders_limit of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._user_orders_limit + + @user_orders_limit.setter + def user_orders_limit(self, user_orders_limit): + """Sets the user_orders_limit of this P2pAdDetail. + + Order count limit # noqa: E501 + + :param user_orders_limit: The user_orders_limit of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._user_orders_limit = user_orders_limit + + @property + def completed_rate_limit(self): + """Gets the completed_rate_limit of this P2pAdDetail. # noqa: E501 + + 30-day completion rate limit # noqa: E501 + + :return: The completed_rate_limit of this P2pAdDetail. # noqa: E501 + :rtype: float + """ + return self._completed_rate_limit + + @completed_rate_limit.setter + def completed_rate_limit(self, completed_rate_limit): + """Sets the completed_rate_limit of this P2pAdDetail. + + 30-day completion rate limit # noqa: E501 + + :param completed_rate_limit: The completed_rate_limit of this P2pAdDetail. # noqa: E501 + :type: float + """ + + self._completed_rate_limit = completed_rate_limit + + @property + def limit_country_cn(self): + """Gets the limit_country_cn of this P2pAdDetail. # noqa: E501 + + Restricted nationality (Chinese) # noqa: E501 + + :return: The limit_country_cn of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._limit_country_cn + + @limit_country_cn.setter + def limit_country_cn(self, limit_country_cn): + """Sets the limit_country_cn of this P2pAdDetail. + + Restricted nationality (Chinese) # noqa: E501 + + :param limit_country_cn: The limit_country_cn of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._limit_country_cn = limit_country_cn + + @property + def limit_country_en(self): + """Gets the limit_country_en of this P2pAdDetail. # noqa: E501 + + Restricted nationality (English) # noqa: E501 + + :return: The limit_country_en of this P2pAdDetail. # noqa: E501 + :rtype: str + """ + return self._limit_country_en + + @limit_country_en.setter + def limit_country_en(self, limit_country_en): + """Sets the limit_country_en of this P2pAdDetail. + + Restricted nationality (English) # noqa: E501 + + :param limit_country_en: The limit_country_en of this P2pAdDetail. # noqa: E501 + :type: str + """ + + self._limit_country_en = limit_country_en + + @property + def is_hedge(self): + """Gets the is_hedge of this P2pAdDetail. # noqa: E501 + + Whether auto-delegation is enabled. `1`: yes; `0`: no. # noqa: E501 + + :return: The is_hedge of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._is_hedge + + @is_hedge.setter + def is_hedge(self, is_hedge): + """Sets the is_hedge of this P2pAdDetail. + + Whether auto-delegation is enabled. `1`: yes; `0`: no. # noqa: E501 + + :param is_hedge: The is_hedge of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._is_hedge = is_hedge + + @property + def hide_payment(self): + """Gets the hide_payment of this P2pAdDetail. # noqa: E501 + + Whether payment methods are hidden. `1`: hidden; `0`: visible. # noqa: E501 + + :return: The hide_payment of this P2pAdDetail. # noqa: E501 + :rtype: int + """ + return self._hide_payment + + @hide_payment.setter + def hide_payment(self, hide_payment): + """Sets the hide_payment of this P2pAdDetail. + + Whether payment methods are hidden. `1`: hidden; `0`: visible. # noqa: E501 + + :param hide_payment: The hide_payment of this P2pAdDetail. # noqa: E501 + :type: int + """ + + self._hide_payment = hide_payment + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pAdDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pAdDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_ad_detail_response.py b/gate_api/models/p2p_ad_detail_response.py new file mode 100644 index 00000000..ac37f9a9 --- /dev/null +++ b/gate_api/models/p2p_ad_detail_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pAdDetailResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pAdDetail', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pAdDetail, str, Configuration) -> None + """P2pAdDetailResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pAdDetailResponse. # noqa: E501 + + + :return: The timestamp of this P2pAdDetailResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pAdDetailResponse. + + + :param timestamp: The timestamp of this P2pAdDetailResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pAdDetailResponse. # noqa: E501 + + + :return: The method of this P2pAdDetailResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pAdDetailResponse. + + + :param method: The method of this P2pAdDetailResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pAdDetailResponse. # noqa: E501 + + + :return: The code of this P2pAdDetailResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pAdDetailResponse. + + + :param code: The code of this P2pAdDetailResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pAdDetailResponse. # noqa: E501 + + + :return: The message of this P2pAdDetailResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pAdDetailResponse. + + + :param message: The message of this P2pAdDetailResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pAdDetailResponse. # noqa: E501 + + + :return: The data of this P2pAdDetailResponse. # noqa: E501 + :rtype: P2pAdDetail + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pAdDetailResponse. + + + :param data: The data of this P2pAdDetailResponse. # noqa: E501 + :type: P2pAdDetail + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pAdDetailResponse. # noqa: E501 + + + :return: The version of this P2pAdDetailResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pAdDetailResponse. + + + :param version: The version of this P2pAdDetailResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pAdDetailResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pAdDetailResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_ads_list_item.py b/gate_api/models/p2p_ads_list_item.py new file mode 100644 index 00000000..6ac1b1f0 --- /dev/null +++ b/gate_api/models/p2p_ads_list_item.py @@ -0,0 +1,499 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pAdsListItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'index': 'int', + 'asset': 'str', + 'fiat_unit': 'str', + 'adv_no': 'int', + 'price': 'str', + 'surplus_amount': 'str', + 'max_single_trans_amount': 'str', + 'min_single_trans_amount': 'str', + 'fiat_min_amount': 'str', + 'fiat_max_amount': 'str', + 'limit_basis': 'int', + 'limit_basis_text': 'str', + 'trade_methods': 'list[P2pAdsListTradeMethod]', + 'nick_name': 'str' + } + + attribute_map = { + 'index': 'index', + 'asset': 'asset', + 'fiat_unit': 'fiat_unit', + 'adv_no': 'adv_no', + 'price': 'price', + 'surplus_amount': 'surplus_amount', + 'max_single_trans_amount': 'max_single_trans_amount', + 'min_single_trans_amount': 'min_single_trans_amount', + 'fiat_min_amount': 'fiat_min_amount', + 'fiat_max_amount': 'fiat_max_amount', + 'limit_basis': 'limit_basis', + 'limit_basis_text': 'limit_basis_text', + 'trade_methods': 'trade_methods', + 'nick_name': 'nick_name' + } + + def __init__(self, index=None, asset=None, fiat_unit=None, adv_no=None, price=None, surplus_amount=None, max_single_trans_amount=None, min_single_trans_amount=None, fiat_min_amount=None, fiat_max_amount=None, limit_basis=None, limit_basis_text=None, trade_methods=None, nick_name=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, int, str, str, str, str, str, str, int, str, list[P2pAdsListTradeMethod], str, Configuration) -> None + """P2pAdsListItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._index = None + self._asset = None + self._fiat_unit = None + self._adv_no = None + self._price = None + self._surplus_amount = None + self._max_single_trans_amount = None + self._min_single_trans_amount = None + self._fiat_min_amount = None + self._fiat_max_amount = None + self._limit_basis = None + self._limit_basis_text = None + self._trade_methods = None + self._nick_name = None + self.discriminator = None + + if index is not None: + self.index = index + if asset is not None: + self.asset = asset + if fiat_unit is not None: + self.fiat_unit = fiat_unit + if adv_no is not None: + self.adv_no = adv_no + if price is not None: + self.price = price + if surplus_amount is not None: + self.surplus_amount = surplus_amount + if max_single_trans_amount is not None: + self.max_single_trans_amount = max_single_trans_amount + if min_single_trans_amount is not None: + self.min_single_trans_amount = min_single_trans_amount + if fiat_min_amount is not None: + self.fiat_min_amount = fiat_min_amount + if fiat_max_amount is not None: + self.fiat_max_amount = fiat_max_amount + if limit_basis is not None: + self.limit_basis = limit_basis + if limit_basis_text is not None: + self.limit_basis_text = limit_basis_text + if trade_methods is not None: + self.trade_methods = trade_methods + if nick_name is not None: + self.nick_name = nick_name + + @property + def index(self): + """Gets the index of this P2pAdsListItem. # noqa: E501 + + Serial number # noqa: E501 + + :return: The index of this P2pAdsListItem. # noqa: E501 + :rtype: int + """ + return self._index + + @index.setter + def index(self, index): + """Sets the index of this P2pAdsListItem. + + Serial number # noqa: E501 + + :param index: The index of this P2pAdsListItem. # noqa: E501 + :type: int + """ + + self._index = index + + @property + def asset(self): + """Gets the asset of this P2pAdsListItem. # noqa: E501 + + Cryptocurrency # noqa: E501 + + :return: The asset of this P2pAdsListItem. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this P2pAdsListItem. + + Cryptocurrency # noqa: E501 + + :param asset: The asset of this P2pAdsListItem. # noqa: E501 + :type: str + """ + + self._asset = asset + + @property + def fiat_unit(self): + """Gets the fiat_unit of this P2pAdsListItem. # noqa: E501 + + Fiat currency # noqa: E501 + + :return: The fiat_unit of this P2pAdsListItem. # noqa: E501 + :rtype: str + """ + return self._fiat_unit + + @fiat_unit.setter + def fiat_unit(self, fiat_unit): + """Sets the fiat_unit of this P2pAdsListItem. + + Fiat currency # noqa: E501 + + :param fiat_unit: The fiat_unit of this P2pAdsListItem. # noqa: E501 + :type: str + """ + + self._fiat_unit = fiat_unit + + @property + def adv_no(self): + """Gets the adv_no of this P2pAdsListItem. # noqa: E501 + + Ad ID # noqa: E501 + + :return: The adv_no of this P2pAdsListItem. # noqa: E501 + :rtype: int + """ + return self._adv_no + + @adv_no.setter + def adv_no(self, adv_no): + """Sets the adv_no of this P2pAdsListItem. + + Ad ID # noqa: E501 + + :param adv_no: The adv_no of this P2pAdsListItem. # noqa: E501 + :type: int + """ + + self._adv_no = adv_no + + @property + def price(self): + """Gets the price of this P2pAdsListItem. # noqa: E501 + + Price # noqa: E501 + + :return: The price of this P2pAdsListItem. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this P2pAdsListItem. + + Price # noqa: E501 + + :param price: The price of this P2pAdsListItem. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def surplus_amount(self): + """Gets the surplus_amount of this P2pAdsListItem. # noqa: E501 + + Remaining tradable crypto quantity # noqa: E501 + + :return: The surplus_amount of this P2pAdsListItem. # noqa: E501 + :rtype: str + """ + return self._surplus_amount + + @surplus_amount.setter + def surplus_amount(self, surplus_amount): + """Sets the surplus_amount of this P2pAdsListItem. + + Remaining tradable crypto quantity # noqa: E501 + + :param surplus_amount: The surplus_amount of this P2pAdsListItem. # noqa: E501 + :type: str + """ + + self._surplus_amount = surplus_amount + + @property + def max_single_trans_amount(self): + """Gets the max_single_trans_amount of this P2pAdsListItem. # noqa: E501 + + Maximum crypto size per trade. # noqa: E501 + + :return: The max_single_trans_amount of this P2pAdsListItem. # noqa: E501 + :rtype: str + """ + return self._max_single_trans_amount + + @max_single_trans_amount.setter + def max_single_trans_amount(self, max_single_trans_amount): + """Sets the max_single_trans_amount of this P2pAdsListItem. + + Maximum crypto size per trade. # noqa: E501 + + :param max_single_trans_amount: The max_single_trans_amount of this P2pAdsListItem. # noqa: E501 + :type: str + """ + + self._max_single_trans_amount = max_single_trans_amount + + @property + def min_single_trans_amount(self): + """Gets the min_single_trans_amount of this P2pAdsListItem. # noqa: E501 + + Minimum crypto size per trade. # noqa: E501 + + :return: The min_single_trans_amount of this P2pAdsListItem. # noqa: E501 + :rtype: str + """ + return self._min_single_trans_amount + + @min_single_trans_amount.setter + def min_single_trans_amount(self, min_single_trans_amount): + """Sets the min_single_trans_amount of this P2pAdsListItem. + + Minimum crypto size per trade. # noqa: E501 + + :param min_single_trans_amount: The min_single_trans_amount of this P2pAdsListItem. # noqa: E501 + :type: str + """ + + self._min_single_trans_amount = min_single_trans_amount + + @property + def fiat_min_amount(self): + """Gets the fiat_min_amount of this P2pAdsListItem. # noqa: E501 + + Minimum fiat amount per order # noqa: E501 + + :return: The fiat_min_amount of this P2pAdsListItem. # noqa: E501 + :rtype: str + """ + return self._fiat_min_amount + + @fiat_min_amount.setter + def fiat_min_amount(self, fiat_min_amount): + """Sets the fiat_min_amount of this P2pAdsListItem. + + Minimum fiat amount per order # noqa: E501 + + :param fiat_min_amount: The fiat_min_amount of this P2pAdsListItem. # noqa: E501 + :type: str + """ + + self._fiat_min_amount = fiat_min_amount + + @property + def fiat_max_amount(self): + """Gets the fiat_max_amount of this P2pAdsListItem. # noqa: E501 + + Maximum fiat amount per order # noqa: E501 + + :return: The fiat_max_amount of this P2pAdsListItem. # noqa: E501 + :rtype: str + """ + return self._fiat_max_amount + + @fiat_max_amount.setter + def fiat_max_amount(self, fiat_max_amount): + """Sets the fiat_max_amount of this P2pAdsListItem. + + Maximum fiat amount per order # noqa: E501 + + :param fiat_max_amount: The fiat_max_amount of this P2pAdsListItem. # noqa: E501 + :type: str + """ + + self._fiat_max_amount = fiat_max_amount + + @property + def limit_basis(self): + """Gets the limit_basis of this P2pAdsListItem. # noqa: E501 + + Trading limit unit. 0: crypto quantity, 1: fiat amount # noqa: E501 + + :return: The limit_basis of this P2pAdsListItem. # noqa: E501 + :rtype: int + """ + return self._limit_basis + + @limit_basis.setter + def limit_basis(self, limit_basis): + """Sets the limit_basis of this P2pAdsListItem. + + Trading limit unit. 0: crypto quantity, 1: fiat amount # noqa: E501 + + :param limit_basis: The limit_basis of this P2pAdsListItem. # noqa: E501 + :type: int + """ + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and limit_basis not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `limit_basis` ({0}), must be one of {1}" # noqa: E501 + .format(limit_basis, allowed_values) + ) + + self._limit_basis = limit_basis + + @property + def limit_basis_text(self): + """Gets the limit_basis_text of this P2pAdsListItem. # noqa: E501 + + Trading limit unit label. crypto: crypto quantity, fiat: fiat amount # noqa: E501 + + :return: The limit_basis_text of this P2pAdsListItem. # noqa: E501 + :rtype: str + """ + return self._limit_basis_text + + @limit_basis_text.setter + def limit_basis_text(self, limit_basis_text): + """Sets the limit_basis_text of this P2pAdsListItem. + + Trading limit unit label. crypto: crypto quantity, fiat: fiat amount # noqa: E501 + + :param limit_basis_text: The limit_basis_text of this P2pAdsListItem. # noqa: E501 + :type: str + """ + allowed_values = ["crypto", "fiat"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and limit_basis_text not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `limit_basis_text` ({0}), must be one of {1}" # noqa: E501 + .format(limit_basis_text, allowed_values) + ) + + self._limit_basis_text = limit_basis_text + + @property + def trade_methods(self): + """Gets the trade_methods of this P2pAdsListItem. # noqa: E501 + + Supported payment methods list # noqa: E501 + + :return: The trade_methods of this P2pAdsListItem. # noqa: E501 + :rtype: list[P2pAdsListTradeMethod] + """ + return self._trade_methods + + @trade_methods.setter + def trade_methods(self, trade_methods): + """Sets the trade_methods of this P2pAdsListItem. + + Supported payment methods list # noqa: E501 + + :param trade_methods: The trade_methods of this P2pAdsListItem. # noqa: E501 + :type: list[P2pAdsListTradeMethod] + """ + + self._trade_methods = trade_methods + + @property + def nick_name(self): + """Gets the nick_name of this P2pAdsListItem. # noqa: E501 + + Advertiser Nickname # noqa: E501 + + :return: The nick_name of this P2pAdsListItem. # noqa: E501 + :rtype: str + """ + return self._nick_name + + @nick_name.setter + def nick_name(self, nick_name): + """Sets the nick_name of this P2pAdsListItem. + + Advertiser Nickname # noqa: E501 + + :param nick_name: The nick_name of this P2pAdsListItem. # noqa: E501 + :type: str + """ + + self._nick_name = nick_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pAdsListItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pAdsListItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_ads_list_response.py b/gate_api/models/p2p_ads_list_response.py new file mode 100644 index 00000000..b5c86e33 --- /dev/null +++ b/gate_api/models/p2p_ads_list_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pAdsListResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'list[P2pAdsListItem]', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, list[P2pAdsListItem], str, Configuration) -> None + """P2pAdsListResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pAdsListResponse. # noqa: E501 + + + :return: The timestamp of this P2pAdsListResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pAdsListResponse. + + + :param timestamp: The timestamp of this P2pAdsListResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pAdsListResponse. # noqa: E501 + + + :return: The method of this P2pAdsListResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pAdsListResponse. + + + :param method: The method of this P2pAdsListResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pAdsListResponse. # noqa: E501 + + + :return: The code of this P2pAdsListResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pAdsListResponse. + + + :param code: The code of this P2pAdsListResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pAdsListResponse. # noqa: E501 + + + :return: The message of this P2pAdsListResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pAdsListResponse. + + + :param message: The message of this P2pAdsListResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pAdsListResponse. # noqa: E501 + + + :return: The data of this P2pAdsListResponse. # noqa: E501 + :rtype: list[P2pAdsListItem] + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pAdsListResponse. + + + :param data: The data of this P2pAdsListResponse. # noqa: E501 + :type: list[P2pAdsListItem] + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pAdsListResponse. # noqa: E501 + + + :return: The version of this P2pAdsListResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pAdsListResponse. + + + :param version: The version of this P2pAdsListResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pAdsListResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pAdsListResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_ads_list_trade_method.py b/gate_api/models/p2p_ads_list_trade_method.py new file mode 100644 index 00000000..2a8883e6 --- /dev/null +++ b/gate_api/models/p2p_ads_list_trade_method.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pAdsListTradeMethod(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'icon_url_color': 'str', + 'identifier': 'str', + 'pay_id': 'str', + 'pay_type': 'str', + 'trade_method_name': 'str' + } + + attribute_map = { + 'icon_url_color': 'icon_url_color', + 'identifier': 'identifier', + 'pay_id': 'pay_id', + 'pay_type': 'pay_type', + 'trade_method_name': 'trade_method_name' + } + + def __init__(self, icon_url_color=None, identifier=None, pay_id=None, pay_type=None, trade_method_name=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """P2pAdsListTradeMethod - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._icon_url_color = None + self._identifier = None + self._pay_id = None + self._pay_type = None + self._trade_method_name = None + self.discriminator = None + + if icon_url_color is not None: + self.icon_url_color = icon_url_color + if identifier is not None: + self.identifier = identifier + if pay_id is not None: + self.pay_id = pay_id + if pay_type is not None: + self.pay_type = pay_type + if trade_method_name is not None: + self.trade_method_name = trade_method_name + + @property + def icon_url_color(self): + """Gets the icon_url_color of this P2pAdsListTradeMethod. # noqa: E501 + + Payment method color icon URL # noqa: E501 + + :return: The icon_url_color of this P2pAdsListTradeMethod. # noqa: E501 + :rtype: str + """ + return self._icon_url_color + + @icon_url_color.setter + def icon_url_color(self, icon_url_color): + """Sets the icon_url_color of this P2pAdsListTradeMethod. + + Payment method color icon URL # noqa: E501 + + :param icon_url_color: The icon_url_color of this P2pAdsListTradeMethod. # noqa: E501 + :type: str + """ + + self._icon_url_color = icon_url_color + + @property + def identifier(self): + """Gets the identifier of this P2pAdsListTradeMethod. # noqa: E501 + + Payment method identifier # noqa: E501 + + :return: The identifier of this P2pAdsListTradeMethod. # noqa: E501 + :rtype: str + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this P2pAdsListTradeMethod. + + Payment method identifier # noqa: E501 + + :param identifier: The identifier of this P2pAdsListTradeMethod. # noqa: E501 + :type: str + """ + + self._identifier = identifier + + @property + def pay_id(self): + """Gets the pay_id of this P2pAdsListTradeMethod. # noqa: E501 + + Payment method ID # noqa: E501 + + :return: The pay_id of this P2pAdsListTradeMethod. # noqa: E501 + :rtype: str + """ + return self._pay_id + + @pay_id.setter + def pay_id(self, pay_id): + """Sets the pay_id of this P2pAdsListTradeMethod. + + Payment method ID # noqa: E501 + + :param pay_id: The pay_id of this P2pAdsListTradeMethod. # noqa: E501 + :type: str + """ + + self._pay_id = pay_id + + @property + def pay_type(self): + """Gets the pay_type of this P2pAdsListTradeMethod. # noqa: E501 + + Payment method type # noqa: E501 + + :return: The pay_type of this P2pAdsListTradeMethod. # noqa: E501 + :rtype: str + """ + return self._pay_type + + @pay_type.setter + def pay_type(self, pay_type): + """Sets the pay_type of this P2pAdsListTradeMethod. + + Payment method type # noqa: E501 + + :param pay_type: The pay_type of this P2pAdsListTradeMethod. # noqa: E501 + :type: str + """ + + self._pay_type = pay_type + + @property + def trade_method_name(self): + """Gets the trade_method_name of this P2pAdsListTradeMethod. # noqa: E501 + + Payment method name # noqa: E501 + + :return: The trade_method_name of this P2pAdsListTradeMethod. # noqa: E501 + :rtype: str + """ + return self._trade_method_name + + @trade_method_name.setter + def trade_method_name(self, trade_method_name): + """Sets the trade_method_name of this P2pAdsListTradeMethod. + + Payment method name # noqa: E501 + + :param trade_method_name: The trade_method_name of this P2pAdsListTradeMethod. # noqa: E501 + :type: str + """ + + self._trade_method_name = trade_method_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pAdsListTradeMethod): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pAdsListTradeMethod): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_ads_update_status_response.py b/gate_api/models/p2p_ads_update_status_response.py new file mode 100644 index 00000000..b9ef3f35 --- /dev/null +++ b/gate_api/models/p2p_ads_update_status_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pAdsUpdateStatusResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pAdsUpdateStatusResult', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pAdsUpdateStatusResult, str, Configuration) -> None + """P2pAdsUpdateStatusResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pAdsUpdateStatusResponse. # noqa: E501 + + + :return: The timestamp of this P2pAdsUpdateStatusResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pAdsUpdateStatusResponse. + + + :param timestamp: The timestamp of this P2pAdsUpdateStatusResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pAdsUpdateStatusResponse. # noqa: E501 + + + :return: The method of this P2pAdsUpdateStatusResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pAdsUpdateStatusResponse. + + + :param method: The method of this P2pAdsUpdateStatusResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pAdsUpdateStatusResponse. # noqa: E501 + + + :return: The code of this P2pAdsUpdateStatusResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pAdsUpdateStatusResponse. + + + :param code: The code of this P2pAdsUpdateStatusResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pAdsUpdateStatusResponse. # noqa: E501 + + + :return: The message of this P2pAdsUpdateStatusResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pAdsUpdateStatusResponse. + + + :param message: The message of this P2pAdsUpdateStatusResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pAdsUpdateStatusResponse. # noqa: E501 + + + :return: The data of this P2pAdsUpdateStatusResponse. # noqa: E501 + :rtype: P2pAdsUpdateStatusResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pAdsUpdateStatusResponse. + + + :param data: The data of this P2pAdsUpdateStatusResponse. # noqa: E501 + :type: P2pAdsUpdateStatusResult + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pAdsUpdateStatusResponse. # noqa: E501 + + + :return: The version of this P2pAdsUpdateStatusResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pAdsUpdateStatusResponse. + + + :param version: The version of this P2pAdsUpdateStatusResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pAdsUpdateStatusResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pAdsUpdateStatusResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_ads_update_status_result.py b/gate_api/models/p2p_ads_update_status_result.py new file mode 100644 index 00000000..e515240c --- /dev/null +++ b/gate_api/models/p2p_ads_update_status_result.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pAdsUpdateStatusResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'status': 'int' + } + + attribute_map = { + 'status': 'status' + } + + def __init__(self, status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """P2pAdsUpdateStatusResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._status = None + self.discriminator = None + + if status is not None: + self.status = status + + @property + def status(self): + """Gets the status of this P2pAdsUpdateStatusResult. # noqa: E501 + + Ad status after update: `1` listed; `3` delisted; `4` closed. # noqa: E501 + + :return: The status of this P2pAdsUpdateStatusResult. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this P2pAdsUpdateStatusResult. + + Ad status after update: `1` listed; `3` delisted; `4` closed. # noqa: E501 + + :param status: The status of this P2pAdsUpdateStatusResult. # noqa: E501 + :type: int + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pAdsUpdateStatusResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pAdsUpdateStatusResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_chat_list_response.py b/gate_api/models/p2p_chat_list_response.py new file mode 100644 index 00000000..ffabf7a0 --- /dev/null +++ b/gate_api/models/p2p_chat_list_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pChatListResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pChatListResult', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pChatListResult, str, Configuration) -> None + """P2pChatListResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pChatListResponse. # noqa: E501 + + + :return: The timestamp of this P2pChatListResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pChatListResponse. + + + :param timestamp: The timestamp of this P2pChatListResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pChatListResponse. # noqa: E501 + + + :return: The method of this P2pChatListResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pChatListResponse. + + + :param method: The method of this P2pChatListResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pChatListResponse. # noqa: E501 + + + :return: The code of this P2pChatListResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pChatListResponse. + + + :param code: The code of this P2pChatListResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pChatListResponse. # noqa: E501 + + + :return: The message of this P2pChatListResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pChatListResponse. + + + :param message: The message of this P2pChatListResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pChatListResponse. # noqa: E501 + + + :return: The data of this P2pChatListResponse. # noqa: E501 + :rtype: P2pChatListResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pChatListResponse. + + + :param data: The data of this P2pChatListResponse. # noqa: E501 + :type: P2pChatListResult + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pChatListResponse. # noqa: E501 + + + :return: The version of this P2pChatListResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pChatListResponse. + + + :param version: The version of this P2pChatListResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pChatListResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pChatListResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_chat_list_result.py b/gate_api/models/p2p_chat_list_result.py new file mode 100644 index 00000000..541fa5a0 --- /dev/null +++ b/gate_api/models/p2p_chat_list_result.py @@ -0,0 +1,263 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pChatListResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'messages': 'list[P2pChatMessage]', + 'memo': 'str', + 'has_history': 'bool', + 'txid': 'int', + 'srvtm': 'int', + 'order_status': 'str' + } + + attribute_map = { + 'messages': 'messages', + 'memo': 'memo', + 'has_history': 'has_history', + 'txid': 'txid', + 'srvtm': 'SRVTM', + 'order_status': 'order_status' + } + + def __init__(self, messages=None, memo=None, has_history=None, txid=None, srvtm=None, order_status=None, local_vars_configuration=None): # noqa: E501 + # type: (list[P2pChatMessage], str, bool, int, int, str, Configuration) -> None + """P2pChatListResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._messages = None + self._memo = None + self._has_history = None + self._txid = None + self._srvtm = None + self._order_status = None + self.discriminator = None + + if messages is not None: + self.messages = messages + if memo is not None: + self.memo = memo + if has_history is not None: + self.has_history = has_history + if txid is not None: + self.txid = txid + if srvtm is not None: + self.srvtm = srvtm + if order_status is not None: + self.order_status = order_status + + @property + def messages(self): + """Gets the messages of this P2pChatListResult. # noqa: E501 + + Message List # noqa: E501 + + :return: The messages of this P2pChatListResult. # noqa: E501 + :rtype: list[P2pChatMessage] + """ + return self._messages + + @messages.setter + def messages(self, messages): + """Sets the messages of this P2pChatListResult. + + Message List # noqa: E501 + + :param messages: The messages of this P2pChatListResult. # noqa: E501 + :type: list[P2pChatMessage] + """ + + self._messages = messages + + @property + def memo(self): + """Gets the memo of this P2pChatListResult. # noqa: E501 + + Payment tip (displayed on homepage only) # noqa: E501 + + :return: The memo of this P2pChatListResult. # noqa: E501 + :rtype: str + """ + return self._memo + + @memo.setter + def memo(self, memo): + """Sets the memo of this P2pChatListResult. + + Payment tip (displayed on homepage only) # noqa: E501 + + :param memo: The memo of this P2pChatListResult. # noqa: E501 + :type: str + """ + + self._memo = memo + + @property + def has_history(self): + """Gets the has_history of this P2pChatListResult. # noqa: E501 + + Whether historical records exist # noqa: E501 + + :return: The has_history of this P2pChatListResult. # noqa: E501 + :rtype: bool + """ + return self._has_history + + @has_history.setter + def has_history(self, has_history): + """Sets the has_history of this P2pChatListResult. + + Whether historical records exist # noqa: E501 + + :param has_history: The has_history of this P2pChatListResult. # noqa: E501 + :type: bool + """ + + self._has_history = has_history + + @property + def txid(self): + """Gets the txid of this P2pChatListResult. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this P2pChatListResult. # noqa: E501 + :rtype: int + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this P2pChatListResult. + + Order ID # noqa: E501 + + :param txid: The txid of this P2pChatListResult. # noqa: E501 + :type: int + """ + + self._txid = txid + + @property + def srvtm(self): + """Gets the srvtm of this P2pChatListResult. # noqa: E501 + + Timestamp of the latest message. # noqa: E501 + + :return: The srvtm of this P2pChatListResult. # noqa: E501 + :rtype: int + """ + return self._srvtm + + @srvtm.setter + def srvtm(self, srvtm): + """Sets the srvtm of this P2pChatListResult. + + Timestamp of the latest message. # noqa: E501 + + :param srvtm: The srvtm of this P2pChatListResult. # noqa: E501 + :type: int + """ + + self._srvtm = srvtm + + @property + def order_status(self): + """Gets the order_status of this P2pChatListResult. # noqa: E501 + + Raw order status in DB; typical values: `OPEN`, `PAID`, `LOCKED`, `ACCEPT`, `BCLOSED`, `CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`. # noqa: E501 + + :return: The order_status of this P2pChatListResult. # noqa: E501 + :rtype: str + """ + return self._order_status + + @order_status.setter + def order_status(self, order_status): + """Sets the order_status of this P2pChatListResult. + + Raw order status in DB; typical values: `OPEN`, `PAID`, `LOCKED`, `ACCEPT`, `BCLOSED`, `CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`. # noqa: E501 + + :param order_status: The order_status of this P2pChatListResult. # noqa: E501 + :type: str + """ + + self._order_status = order_status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pChatListResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pChatListResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_chat_message.py b/gate_api/models/p2p_chat_message.py new file mode 100644 index 00000000..9d854878 --- /dev/null +++ b/gate_api/models/p2p_chat_message.py @@ -0,0 +1,463 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pChatMessage(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'is_sell': 'int', + 'msg_type': 'int', + 'msg': 'str', + 'username': 'str', + 'timest': 'int', + 'msg_obj': 'P2pChatMessagePayload', + 'uid': 'str', + 'type': 'int', + 'pic': 'str', + 'file_key': 'str', + 'file_type': 'str', + 'risk_type': 'int', + 'toast_msg': 'str' + } + + attribute_map = { + 'is_sell': 'is_sell', + 'msg_type': 'msg_type', + 'msg': 'msg', + 'username': 'username', + 'timest': 'timest', + 'msg_obj': 'msg_obj', + 'uid': 'uid', + 'type': 'type', + 'pic': 'pic', + 'file_key': 'file_key', + 'file_type': 'file_type', + 'risk_type': 'risk_type', + 'toast_msg': 'toast_msg' + } + + def __init__(self, is_sell=None, msg_type=None, msg=None, username=None, timest=None, msg_obj=None, uid=None, type=None, pic=None, file_key=None, file_type=None, risk_type=None, toast_msg=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, int, P2pChatMessagePayload, str, int, str, str, str, int, str, Configuration) -> None + """P2pChatMessage - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._is_sell = None + self._msg_type = None + self._msg = None + self._username = None + self._timest = None + self._msg_obj = None + self._uid = None + self._type = None + self._pic = None + self._file_key = None + self._file_type = None + self._risk_type = None + self._toast_msg = None + self.discriminator = None + + if is_sell is not None: + self.is_sell = is_sell + if msg_type is not None: + self.msg_type = msg_type + if msg is not None: + self.msg = msg + if username is not None: + self.username = username + if timest is not None: + self.timest = timest + if msg_obj is not None: + self.msg_obj = msg_obj + if uid is not None: + self.uid = uid + if type is not None: + self.type = type + if pic is not None: + self.pic = pic + if file_key is not None: + self.file_key = file_key + if file_type is not None: + self.file_type = file_type + if risk_type is not None: + self.risk_type = risk_type + if toast_msg is not None: + self.toast_msg = toast_msg + + @property + def is_sell(self): + """Gets the is_sell of this P2pChatMessage. # noqa: E501 + + Whether the current user is the seller. `1`: yes; `0`: no. # noqa: E501 + + :return: The is_sell of this P2pChatMessage. # noqa: E501 + :rtype: int + """ + return self._is_sell + + @is_sell.setter + def is_sell(self, is_sell): + """Sets the is_sell of this P2pChatMessage. + + Whether the current user is the seller. `1`: yes; `0`: no. # noqa: E501 + + :param is_sell: The is_sell of this P2pChatMessage. # noqa: E501 + :type: int + """ + + self._is_sell = is_sell + + @property + def msg_type(self): + """Gets the msg_type of this P2pChatMessage. # noqa: E501 + + Message type: `0` text; `1` file; `2` template; `3` order-share; `4` payment-share; `5` status update. # noqa: E501 + + :return: The msg_type of this P2pChatMessage. # noqa: E501 + :rtype: int + """ + return self._msg_type + + @msg_type.setter + def msg_type(self, msg_type): + """Sets the msg_type of this P2pChatMessage. + + Message type: `0` text; `1` file; `2` template; `3` order-share; `4` payment-share; `5` status update. # noqa: E501 + + :param msg_type: The msg_type of this P2pChatMessage. # noqa: E501 + :type: int + """ + + self._msg_type = msg_type + + @property + def msg(self): + """Gets the msg of this P2pChatMessage. # noqa: E501 + + Message content; for file messages, usually URL or file key. # noqa: E501 + + :return: The msg of this P2pChatMessage. # noqa: E501 + :rtype: str + """ + return self._msg + + @msg.setter + def msg(self, msg): + """Sets the msg of this P2pChatMessage. + + Message content; for file messages, usually URL or file key. # noqa: E501 + + :param msg: The msg of this P2pChatMessage. # noqa: E501 + :type: str + """ + + self._msg = msg + + @property + def username(self): + """Gets the username of this P2pChatMessage. # noqa: E501 + + Message sender username # noqa: E501 + + :return: The username of this P2pChatMessage. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this P2pChatMessage. + + Message sender username # noqa: E501 + + :param username: The username of this P2pChatMessage. # noqa: E501 + :type: str + """ + + self._username = username + + @property + def timest(self): + """Gets the timest of this P2pChatMessage. # noqa: E501 + + Message timestamp # noqa: E501 + + :return: The timest of this P2pChatMessage. # noqa: E501 + :rtype: int + """ + return self._timest + + @timest.setter + def timest(self, timest): + """Sets the timest of this P2pChatMessage. + + Message timestamp # noqa: E501 + + :param timest: The timest of this P2pChatMessage. # noqa: E501 + :type: int + """ + + self._timest = timest + + @property + def msg_obj(self): + """Gets the msg_obj of this P2pChatMessage. # noqa: E501 + + + :return: The msg_obj of this P2pChatMessage. # noqa: E501 + :rtype: P2pChatMessagePayload + """ + return self._msg_obj + + @msg_obj.setter + def msg_obj(self, msg_obj): + """Sets the msg_obj of this P2pChatMessage. + + + :param msg_obj: The msg_obj of this P2pChatMessage. # noqa: E501 + :type: P2pChatMessagePayload + """ + + self._msg_obj = msg_obj + + @property + def uid(self): + """Gets the uid of this P2pChatMessage. # noqa: E501 + + Sender's crypto UID; system messages may use `System` or an empty string. # noqa: E501 + + :return: The uid of this P2pChatMessage. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this P2pChatMessage. + + Sender's crypto UID; system messages may use `System` or an empty string. # noqa: E501 + + :param uid: The uid of this P2pChatMessage. # noqa: E501 + :type: str + """ + + self._uid = uid + + @property + def type(self): + """Gets the type of this P2pChatMessage. # noqa: E501 + + Display type: `1` file message; `2` system message. # noqa: E501 + + :return: The type of this P2pChatMessage. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this P2pChatMessage. + + Display type: `1` file message; `2` system message. # noqa: E501 + + :param type: The type of this P2pChatMessage. # noqa: E501 + :type: int + """ + + self._type = type + + @property + def pic(self): + """Gets the pic of this P2pChatMessage. # noqa: E501 + + File link # noqa: E501 + + :return: The pic of this P2pChatMessage. # noqa: E501 + :rtype: str + """ + return self._pic + + @pic.setter + def pic(self, pic): + """Sets the pic of this P2pChatMessage. + + File link # noqa: E501 + + :param pic: The pic of this P2pChatMessage. # noqa: E501 + :type: str + """ + + self._pic = pic + + @property + def file_key(self): + """Gets the file_key of this P2pChatMessage. # noqa: E501 + + File key # noqa: E501 + + :return: The file_key of this P2pChatMessage. # noqa: E501 + :rtype: str + """ + return self._file_key + + @file_key.setter + def file_key(self, file_key): + """Sets the file_key of this P2pChatMessage. + + File key # noqa: E501 + + :param file_key: The file_key of this P2pChatMessage. # noqa: E501 + :type: str + """ + + self._file_key = file_key + + @property + def file_type(self): + """Gets the file_type of this P2pChatMessage. # noqa: E501 + + File type: `image` for images, `video` for videos. # noqa: E501 + + :return: The file_type of this P2pChatMessage. # noqa: E501 + :rtype: str + """ + return self._file_type + + @file_type.setter + def file_type(self, file_type): + """Sets the file_type of this P2pChatMessage. + + File type: `image` for images, `video` for videos. # noqa: E501 + + :param file_type: The file_type of this P2pChatMessage. # noqa: E501 + :type: str + """ + + self._file_type = file_type + + @property + def risk_type(self): + """Gets the risk_type of this P2pChatMessage. # noqa: E501 + + Risk control display type. 1: off-platform traffic diversion risk; returned when a text message hits risk control # noqa: E501 + + :return: The risk_type of this P2pChatMessage. # noqa: E501 + :rtype: int + """ + return self._risk_type + + @risk_type.setter + def risk_type(self, risk_type): + """Sets the risk_type of this P2pChatMessage. + + Risk control display type. 1: off-platform traffic diversion risk; returned when a text message hits risk control # noqa: E501 + + :param risk_type: The risk_type of this P2pChatMessage. # noqa: E501 + :type: int + """ + allowed_values = [1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and risk_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `risk_type` ({0}), must be one of {1}" # noqa: E501 + .format(risk_type, allowed_values) + ) + + self._risk_type = risk_type + + @property + def toast_msg(self): + """Gets the toast_msg of this P2pChatMessage. # noqa: E501 + + Risk control prompt message; returned only when risk_type=1 # noqa: E501 + + :return: The toast_msg of this P2pChatMessage. # noqa: E501 + :rtype: str + """ + return self._toast_msg + + @toast_msg.setter + def toast_msg(self, toast_msg): + """Sets the toast_msg of this P2pChatMessage. + + Risk control prompt message; returned only when risk_type=1 # noqa: E501 + + :param toast_msg: The toast_msg of this P2pChatMessage. # noqa: E501 + :type: str + """ + + self._toast_msg = toast_msg + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pChatMessage): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pChatMessage): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_chat_message_payload.py b/gate_api/models/p2p_chat_message_payload.py new file mode 100644 index 00000000..1b31e9b9 --- /dev/null +++ b/gate_api/models/p2p_chat_message_payload.py @@ -0,0 +1,683 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pChatMessagePayload(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'status': 'str', + 'text': 'str', + 'payment_voucher': 'list[str]', + 'reason_id': 'int', + 'toast_id': 'int', + 'reason_memo': 'str', + 'cancel_time': 'int', + 'seller_confirm': 'int', + 'id': 'str', + 'account_des': 'str', + 'pay_type': 'str', + 'file': 'str', + 'file_key': 'str', + 'account': 'str', + 'memo': 'str', + 'code': 'str', + 'memo_ext': 'str', + 'trade_tips': 'str', + 'real_name': 'str', + 'is_delete': 'int', + 'pay_name': 'str' + } + + attribute_map = { + 'status': 'status', + 'text': 'text', + 'payment_voucher': 'payment_voucher', + 'reason_id': 'reason_id', + 'toast_id': 'toast_id', + 'reason_memo': 'reason_memo', + 'cancel_time': 'cancel_time', + 'seller_confirm': 'seller_confirm', + 'id': 'id', + 'account_des': 'account_des', + 'pay_type': 'pay_type', + 'file': 'file', + 'file_key': 'file_key', + 'account': 'account', + 'memo': 'memo', + 'code': 'code', + 'memo_ext': 'memo_ext', + 'trade_tips': 'trade_tips', + 'real_name': 'real_name', + 'is_delete': 'is_delete', + 'pay_name': 'pay_name' + } + + def __init__(self, status=None, text=None, payment_voucher=None, reason_id=None, toast_id=None, reason_memo=None, cancel_time=None, seller_confirm=None, id=None, account_des=None, pay_type=None, file=None, file_key=None, account=None, memo=None, code=None, memo_ext=None, trade_tips=None, real_name=None, is_delete=None, pay_name=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, list[str], int, int, str, int, int, str, str, str, str, str, str, str, str, str, str, str, int, str, Configuration) -> None + """P2pChatMessagePayload - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._status = None + self._text = None + self._payment_voucher = None + self._reason_id = None + self._toast_id = None + self._reason_memo = None + self._cancel_time = None + self._seller_confirm = None + self._id = None + self._account_des = None + self._pay_type = None + self._file = None + self._file_key = None + self._account = None + self._memo = None + self._code = None + self._memo_ext = None + self._trade_tips = None + self._real_name = None + self._is_delete = None + self._pay_name = None + self.discriminator = None + + if status is not None: + self.status = status + if text is not None: + self.text = text + if payment_voucher is not None: + self.payment_voucher = payment_voucher + if reason_id is not None: + self.reason_id = reason_id + if toast_id is not None: + self.toast_id = toast_id + if reason_memo is not None: + self.reason_memo = reason_memo + if cancel_time is not None: + self.cancel_time = cancel_time + if seller_confirm is not None: + self.seller_confirm = seller_confirm + if id is not None: + self.id = id + if account_des is not None: + self.account_des = account_des + if pay_type is not None: + self.pay_type = pay_type + if file is not None: + self.file = file + if file_key is not None: + self.file_key = file_key + if account is not None: + self.account = account + if memo is not None: + self.memo = memo + if code is not None: + self.code = code + if memo_ext is not None: + self.memo_ext = memo_ext + if trade_tips is not None: + self.trade_tips = trade_tips + if real_name is not None: + self.real_name = real_name + if is_delete is not None: + self.is_delete = is_delete + if pay_name is not None: + self.pay_name = pay_name + + @property + def status(self): + """Gets the status of this P2pChatMessagePayload. # noqa: E501 + + Order status when sending a message. Typical values: `OPEN`, `PAID`, `LOCKED`, `ACCEPT`, `BCLOSED`, `CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`. # noqa: E501 + + :return: The status of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this P2pChatMessagePayload. + + Order status when sending a message. Typical values: `OPEN`, `PAID`, `LOCKED`, `ACCEPT`, `BCLOSED`, `CANCEL`, `BECANCEL`, `SCLOSED`, `SCANCEL`. # noqa: E501 + + :param status: The status of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def text(self): + """Gets the text of this P2pChatMessagePayload. # noqa: E501 + + Message content # noqa: E501 + + :return: The text of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this P2pChatMessagePayload. + + Message content # noqa: E501 + + :param text: The text of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def payment_voucher(self): + """Gets the payment_voucher of this P2pChatMessagePayload. # noqa: E501 + + Payment voucher # noqa: E501 + + :return: The payment_voucher of this P2pChatMessagePayload. # noqa: E501 + :rtype: list[str] + """ + return self._payment_voucher + + @payment_voucher.setter + def payment_voucher(self, payment_voucher): + """Sets the payment_voucher of this P2pChatMessagePayload. + + Payment voucher # noqa: E501 + + :param payment_voucher: The payment_voucher of this P2pChatMessagePayload. # noqa: E501 + :type: list[str] + """ + + self._payment_voucher = payment_voucher + + @property + def reason_id(self): + """Gets the reason_id of this P2pChatMessagePayload. # noqa: E501 + + Cancel reason ID. `1` no longer want to buy; `2` cannot reach seller; `3` will not pay; `4` seller account not real; `5` payout account issue; `6` price mismatch; `7` mutually agreed cancel; `8` poor communication; `9` other; `10` seller cannot release with refund; `11` terms not met; `12` seller payout risk-controlled. # noqa: E501 + + :return: The reason_id of this P2pChatMessagePayload. # noqa: E501 + :rtype: int + """ + return self._reason_id + + @reason_id.setter + def reason_id(self, reason_id): + """Sets the reason_id of this P2pChatMessagePayload. + + Cancel reason ID. `1` no longer want to buy; `2` cannot reach seller; `3` will not pay; `4` seller account not real; `5` payout account issue; `6` price mismatch; `7` mutually agreed cancel; `8` poor communication; `9` other; `10` seller cannot release with refund; `11` terms not met; `12` seller payout risk-controlled. # noqa: E501 + + :param reason_id: The reason_id of this P2pChatMessagePayload. # noqa: E501 + :type: int + """ + + self._reason_id = reason_id + + @property + def toast_id(self): + """Gets the toast_id of this P2pChatMessagePayload. # noqa: E501 + + Cancellation reason popup # noqa: E501 + + :return: The toast_id of this P2pChatMessagePayload. # noqa: E501 + :rtype: int + """ + return self._toast_id + + @toast_id.setter + def toast_id(self, toast_id): + """Sets the toast_id of this P2pChatMessagePayload. + + Cancellation reason popup # noqa: E501 + + :param toast_id: The toast_id of this P2pChatMessagePayload. # noqa: E501 + :type: int + """ + + self._toast_id = toast_id + + @property + def reason_memo(self): + """Gets the reason_memo of this P2pChatMessagePayload. # noqa: E501 + + Cancel reason description. # noqa: E501 + + :return: The reason_memo of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._reason_memo + + @reason_memo.setter + def reason_memo(self, reason_memo): + """Sets the reason_memo of this P2pChatMessagePayload. + + Cancel reason description. # noqa: E501 + + :param reason_memo: The reason_memo of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._reason_memo = reason_memo + + @property + def cancel_time(self): + """Gets the cancel_time of this P2pChatMessagePayload. # noqa: E501 + + Cancellation time # noqa: E501 + + :return: The cancel_time of this P2pChatMessagePayload. # noqa: E501 + :rtype: int + """ + return self._cancel_time + + @cancel_time.setter + def cancel_time(self, cancel_time): + """Sets the cancel_time of this P2pChatMessagePayload. + + Cancellation time # noqa: E501 + + :param cancel_time: The cancel_time of this P2pChatMessagePayload. # noqa: E501 + :type: int + """ + + self._cancel_time = cancel_time + + @property + def seller_confirm(self): + """Gets the seller_confirm of this P2pChatMessagePayload. # noqa: E501 + + Seller confirmation of cancel reason: `0` pending; `1` confirmed; `2` rejected. # noqa: E501 + + :return: The seller_confirm of this P2pChatMessagePayload. # noqa: E501 + :rtype: int + """ + return self._seller_confirm + + @seller_confirm.setter + def seller_confirm(self, seller_confirm): + """Sets the seller_confirm of this P2pChatMessagePayload. + + Seller confirmation of cancel reason: `0` pending; `1` confirmed; `2` rejected. # noqa: E501 + + :param seller_confirm: The seller_confirm of this P2pChatMessagePayload. # noqa: E501 + :type: int + """ + + self._seller_confirm = seller_confirm + + @property + def id(self): + """Gets the id of this P2pChatMessagePayload. # noqa: E501 + + Payment method information ID # noqa: E501 + + :return: The id of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this P2pChatMessagePayload. + + Payment method information ID # noqa: E501 + + :param id: The id of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def account_des(self): + """Gets the account_des of this P2pChatMessagePayload. # noqa: E501 + + Payment method description # noqa: E501 + + :return: The account_des of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._account_des + + @account_des.setter + def account_des(self, account_des): + """Sets the account_des of this P2pChatMessagePayload. + + Payment method description # noqa: E501 + + :param account_des: The account_des of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._account_des = account_des + + @property + def pay_type(self): + """Gets the pay_type of this P2pChatMessagePayload. # noqa: E501 + + Payment method type # noqa: E501 + + :return: The pay_type of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._pay_type + + @pay_type.setter + def pay_type(self, pay_type): + """Sets the pay_type of this P2pChatMessagePayload. + + Payment method type # noqa: E501 + + :param pay_type: The pay_type of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._pay_type = pay_type + + @property + def file(self): + """Gets the file of this P2pChatMessagePayload. # noqa: E501 + + Payment method file link # noqa: E501 + + :return: The file of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this P2pChatMessagePayload. + + Payment method file link # noqa: E501 + + :param file: The file of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._file = file + + @property + def file_key(self): + """Gets the file_key of this P2pChatMessagePayload. # noqa: E501 + + Payment method file key # noqa: E501 + + :return: The file_key of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._file_key + + @file_key.setter + def file_key(self, file_key): + """Sets the file_key of this P2pChatMessagePayload. + + Payment method file key # noqa: E501 + + :param file_key: The file_key of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._file_key = file_key + + @property + def account(self): + """Gets the account of this P2pChatMessagePayload. # noqa: E501 + + Payment account or masked payment account. # noqa: E501 + + :return: The account of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._account + + @account.setter + def account(self, account): + """Sets the account of this P2pChatMessagePayload. + + Payment account or masked payment account. # noqa: E501 + + :param account: The account of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._account = account + + @property + def memo(self): + """Gets the memo of this P2pChatMessagePayload. # noqa: E501 + + Payment method note # noqa: E501 + + :return: The memo of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._memo + + @memo.setter + def memo(self, memo): + """Sets the memo of this P2pChatMessagePayload. + + Payment method note # noqa: E501 + + :param memo: The memo of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._memo = memo + + @property + def code(self): + """Gets the code of this P2pChatMessagePayload. # noqa: E501 + + Payment method code # noqa: E501 + + :return: The code of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pChatMessagePayload. + + Payment method code # noqa: E501 + + :param code: The code of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._code = code + + @property + def memo_ext(self): + """Gets the memo_ext of this P2pChatMessagePayload. # noqa: E501 + + Payment method additional note # noqa: E501 + + :return: The memo_ext of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._memo_ext + + @memo_ext.setter + def memo_ext(self, memo_ext): + """Sets the memo_ext of this P2pChatMessagePayload. + + Payment method additional note # noqa: E501 + + :param memo_ext: The memo_ext of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._memo_ext = memo_ext + + @property + def trade_tips(self): + """Gets the trade_tips of this P2pChatMessagePayload. # noqa: E501 + + Payment method tip # noqa: E501 + + :return: The trade_tips of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._trade_tips + + @trade_tips.setter + def trade_tips(self, trade_tips): + """Sets the trade_tips of this P2pChatMessagePayload. + + Payment method tip # noqa: E501 + + :param trade_tips: The trade_tips of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._trade_tips = trade_tips + + @property + def real_name(self): + """Gets the real_name of this P2pChatMessagePayload. # noqa: E501 + + Payment method username # noqa: E501 + + :return: The real_name of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._real_name + + @real_name.setter + def real_name(self, real_name): + """Sets the real_name of this P2pChatMessagePayload. + + Payment method username # noqa: E501 + + :param real_name: The real_name of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._real_name = real_name + + @property + def is_delete(self): + """Gets the is_delete of this P2pChatMessagePayload. # noqa: E501 + + Whether the payment method was deleted. `1`: deleted; `0`: not deleted. # noqa: E501 + + :return: The is_delete of this P2pChatMessagePayload. # noqa: E501 + :rtype: int + """ + return self._is_delete + + @is_delete.setter + def is_delete(self, is_delete): + """Sets the is_delete of this P2pChatMessagePayload. + + Whether the payment method was deleted. `1`: deleted; `0`: not deleted. # noqa: E501 + + :param is_delete: The is_delete of this P2pChatMessagePayload. # noqa: E501 + :type: int + """ + + self._is_delete = is_delete + + @property + def pay_name(self): + """Gets the pay_name of this P2pChatMessagePayload. # noqa: E501 + + Payment method full name # noqa: E501 + + :return: The pay_name of this P2pChatMessagePayload. # noqa: E501 + :rtype: str + """ + return self._pay_name + + @pay_name.setter + def pay_name(self, pay_name): + """Sets the pay_name of this P2pChatMessagePayload. + + Payment method full name # noqa: E501 + + :param pay_name: The pay_name of this P2pChatMessagePayload. # noqa: E501 + :type: str + """ + + self._pay_name = pay_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pChatMessagePayload): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pChatMessagePayload): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_counterparty_user_info.py b/gate_api/models/p2p_counterparty_user_info.py new file mode 100644 index 00000000..3bc68d7e --- /dev/null +++ b/gate_api/models/p2p_counterparty_user_info.py @@ -0,0 +1,627 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pCounterpartyUserInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_timest': 'str', + 'email_verified': 'str', + 'verified': 'str', + 'has_phone': 'str', + 'user_name': 'str', + 'user_note': 'str', + 'complete_transactions': 'str', + 'paid_transactions': 'str', + 'accepted_transactions': 'str', + 'transactions_used_time': 'str', + 'cancelled_used_time_month': 'str', + 'complete_transactions_month': 'str', + 'complete_rate_month': 'float', + 'is_follow': 'int', + 'have_traded': 'int', + 'biz_uid': 'str', + 'registration_days': 'int', + 'first_trade_days': 'int', + 'trade_versatile': 'bool' + } + + attribute_map = { + 'user_timest': 'user_timest', + 'email_verified': 'email_verified', + 'verified': 'verified', + 'has_phone': 'has_phone', + 'user_name': 'user_name', + 'user_note': 'user_note', + 'complete_transactions': 'complete_transactions', + 'paid_transactions': 'paid_transactions', + 'accepted_transactions': 'accepted_transactions', + 'transactions_used_time': 'transactions_used_time', + 'cancelled_used_time_month': 'cancelled_used_time_month', + 'complete_transactions_month': 'complete_transactions_month', + 'complete_rate_month': 'complete_rate_month', + 'is_follow': 'is_follow', + 'have_traded': 'have_traded', + 'biz_uid': 'biz_uid', + 'registration_days': 'registration_days', + 'first_trade_days': 'first_trade_days', + 'trade_versatile': 'trade_versatile' + } + + def __init__(self, user_timest=None, email_verified=None, verified=None, has_phone=None, user_name=None, user_note=None, complete_transactions=None, paid_transactions=None, accepted_transactions=None, transactions_used_time=None, cancelled_used_time_month=None, complete_transactions_month=None, complete_rate_month=None, is_follow=None, have_traded=None, biz_uid=None, registration_days=None, first_trade_days=None, trade_versatile=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, float, int, int, str, int, int, bool, Configuration) -> None + """P2pCounterpartyUserInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_timest = None + self._email_verified = None + self._verified = None + self._has_phone = None + self._user_name = None + self._user_note = None + self._complete_transactions = None + self._paid_transactions = None + self._accepted_transactions = None + self._transactions_used_time = None + self._cancelled_used_time_month = None + self._complete_transactions_month = None + self._complete_rate_month = None + self._is_follow = None + self._have_traded = None + self._biz_uid = None + self._registration_days = None + self._first_trade_days = None + self._trade_versatile = None + self.discriminator = None + + if user_timest is not None: + self.user_timest = user_timest + if email_verified is not None: + self.email_verified = email_verified + if verified is not None: + self.verified = verified + if has_phone is not None: + self.has_phone = has_phone + if user_name is not None: + self.user_name = user_name + if user_note is not None: + self.user_note = user_note + if complete_transactions is not None: + self.complete_transactions = complete_transactions + if paid_transactions is not None: + self.paid_transactions = paid_transactions + if accepted_transactions is not None: + self.accepted_transactions = accepted_transactions + if transactions_used_time is not None: + self.transactions_used_time = transactions_used_time + if cancelled_used_time_month is not None: + self.cancelled_used_time_month = cancelled_used_time_month + if complete_transactions_month is not None: + self.complete_transactions_month = complete_transactions_month + if complete_rate_month is not None: + self.complete_rate_month = complete_rate_month + if is_follow is not None: + self.is_follow = is_follow + if have_traded is not None: + self.have_traded = have_traded + if biz_uid is not None: + self.biz_uid = biz_uid + if registration_days is not None: + self.registration_days = registration_days + if first_trade_days is not None: + self.first_trade_days = first_trade_days + if trade_versatile is not None: + self.trade_versatile = trade_versatile + + @property + def user_timest(self): + """Gets the user_timest of this P2pCounterpartyUserInfo. # noqa: E501 + + User registration time (formatted string) # noqa: E501 + + :return: The user_timest of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._user_timest + + @user_timest.setter + def user_timest(self, user_timest): + """Sets the user_timest of this P2pCounterpartyUserInfo. + + User registration time (formatted string) # noqa: E501 + + :param user_timest: The user_timest of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._user_timest = user_timest + + @property + def email_verified(self): + """Gets the email_verified of this P2pCounterpartyUserInfo. # noqa: E501 + + Whether email is verified. `1`: yes; `0`: no. # noqa: E501 + + :return: The email_verified of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this P2pCounterpartyUserInfo. + + Whether email is verified. `1`: yes; `0`: no. # noqa: E501 + + :param email_verified: The email_verified of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._email_verified = email_verified + + @property + def verified(self): + """Gets the verified of this P2pCounterpartyUserInfo. # noqa: E501 + + Whether KYC is completed. `1`: yes; `0`: no. # noqa: E501 + + :return: The verified of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._verified + + @verified.setter + def verified(self, verified): + """Sets the verified of this P2pCounterpartyUserInfo. + + Whether KYC is completed. `1`: yes; `0`: no. # noqa: E501 + + :param verified: The verified of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._verified = verified + + @property + def has_phone(self): + """Gets the has_phone of this P2pCounterpartyUserInfo. # noqa: E501 + + Whether a phone number is bound. `1`: yes; `0`: no. # noqa: E501 + + :return: The has_phone of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._has_phone + + @has_phone.setter + def has_phone(self, has_phone): + """Sets the has_phone of this P2pCounterpartyUserInfo. + + Whether a phone number is bound. `1`: yes; `0`: no. # noqa: E501 + + :param has_phone: The has_phone of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._has_phone = has_phone + + @property + def user_name(self): + """Gets the user_name of this P2pCounterpartyUserInfo. # noqa: E501 + + Username # noqa: E501 + + :return: The user_name of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._user_name + + @user_name.setter + def user_name(self, user_name): + """Sets the user_name of this P2pCounterpartyUserInfo. + + Username # noqa: E501 + + :param user_name: The user_name of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._user_name = user_name + + @property + def user_note(self): + """Gets the user_note of this P2pCounterpartyUserInfo. # noqa: E501 + + User note information # noqa: E501 + + :return: The user_note of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._user_note + + @user_note.setter + def user_note(self, user_note): + """Sets the user_note of this P2pCounterpartyUserInfo. + + User note information # noqa: E501 + + :param user_note: The user_note of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._user_note = user_note + + @property + def complete_transactions(self): + """Gets the complete_transactions of this P2pCounterpartyUserInfo. # noqa: E501 + + Total completed orders # noqa: E501 + + :return: The complete_transactions of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._complete_transactions + + @complete_transactions.setter + def complete_transactions(self, complete_transactions): + """Sets the complete_transactions of this P2pCounterpartyUserInfo. + + Total completed orders # noqa: E501 + + :param complete_transactions: The complete_transactions of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._complete_transactions = complete_transactions + + @property + def paid_transactions(self): + """Gets the paid_transactions of this P2pCounterpartyUserInfo. # noqa: E501 + + Number of completed buy orders # noqa: E501 + + :return: The paid_transactions of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._paid_transactions + + @paid_transactions.setter + def paid_transactions(self, paid_transactions): + """Sets the paid_transactions of this P2pCounterpartyUserInfo. + + Number of completed buy orders # noqa: E501 + + :param paid_transactions: The paid_transactions of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._paid_transactions = paid_transactions + + @property + def accepted_transactions(self): + """Gets the accepted_transactions of this P2pCounterpartyUserInfo. # noqa: E501 + + Number of completed sell orders # noqa: E501 + + :return: The accepted_transactions of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._accepted_transactions + + @accepted_transactions.setter + def accepted_transactions(self, accepted_transactions): + """Sets the accepted_transactions of this P2pCounterpartyUserInfo. + + Number of completed sell orders # noqa: E501 + + :param accepted_transactions: The accepted_transactions of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._accepted_transactions = accepted_transactions + + @property + def transactions_used_time(self): + """Gets the transactions_used_time of this P2pCounterpartyUserInfo. # noqa: E501 + + Average time to confirm receipt # noqa: E501 + + :return: The transactions_used_time of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._transactions_used_time + + @transactions_used_time.setter + def transactions_used_time(self, transactions_used_time): + """Sets the transactions_used_time of this P2pCounterpartyUserInfo. + + Average time to confirm receipt # noqa: E501 + + :param transactions_used_time: The transactions_used_time of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._transactions_used_time = transactions_used_time + + @property + def cancelled_used_time_month(self): + """Gets the cancelled_used_time_month of this P2pCounterpartyUserInfo. # noqa: E501 + + Cancellation time in last 30 days # noqa: E501 + + :return: The cancelled_used_time_month of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._cancelled_used_time_month + + @cancelled_used_time_month.setter + def cancelled_used_time_month(self, cancelled_used_time_month): + """Sets the cancelled_used_time_month of this P2pCounterpartyUserInfo. + + Cancellation time in last 30 days # noqa: E501 + + :param cancelled_used_time_month: The cancelled_used_time_month of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._cancelled_used_time_month = cancelled_used_time_month + + @property + def complete_transactions_month(self): + """Gets the complete_transactions_month of this P2pCounterpartyUserInfo. # noqa: E501 + + Number of completed orders in last 30 days # noqa: E501 + + :return: The complete_transactions_month of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._complete_transactions_month + + @complete_transactions_month.setter + def complete_transactions_month(self, complete_transactions_month): + """Sets the complete_transactions_month of this P2pCounterpartyUserInfo. + + Number of completed orders in last 30 days # noqa: E501 + + :param complete_transactions_month: The complete_transactions_month of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._complete_transactions_month = complete_transactions_month + + @property + def complete_rate_month(self): + """Gets the complete_rate_month of this P2pCounterpartyUserInfo. # noqa: E501 + + Completion rate in last 30 days # noqa: E501 + + :return: The complete_rate_month of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: float + """ + return self._complete_rate_month + + @complete_rate_month.setter + def complete_rate_month(self, complete_rate_month): + """Sets the complete_rate_month of this P2pCounterpartyUserInfo. + + Completion rate in last 30 days # noqa: E501 + + :param complete_rate_month: The complete_rate_month of this P2pCounterpartyUserInfo. # noqa: E501 + :type: float + """ + + self._complete_rate_month = complete_rate_month + + @property + def is_follow(self): + """Gets the is_follow of this P2pCounterpartyUserInfo. # noqa: E501 + + Whether you follow this user. `1`: yes; `0`: no. # noqa: E501 + + :return: The is_follow of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: int + """ + return self._is_follow + + @is_follow.setter + def is_follow(self, is_follow): + """Sets the is_follow of this P2pCounterpartyUserInfo. + + Whether you follow this user. `1`: yes; `0`: no. # noqa: E501 + + :param is_follow: The is_follow of this P2pCounterpartyUserInfo. # noqa: E501 + :type: int + """ + + self._is_follow = is_follow + + @property + def have_traded(self): + """Gets the have_traded of this P2pCounterpartyUserInfo. # noqa: E501 + + Whether you have traded with this user before. `1`: yes; `0`: no. # noqa: E501 + + :return: The have_traded of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: int + """ + return self._have_traded + + @have_traded.setter + def have_traded(self, have_traded): + """Sets the have_traded of this P2pCounterpartyUserInfo. + + Whether you have traded with this user before. `1`: yes; `0`: no. # noqa: E501 + + :param have_traded: The have_traded of this P2pCounterpartyUserInfo. # noqa: E501 + :type: int + """ + + self._have_traded = have_traded + + @property + def biz_uid(self): + """Gets the biz_uid of this P2pCounterpartyUserInfo. # noqa: E501 + + Encrypted UID # noqa: E501 + + :return: The biz_uid of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: str + """ + return self._biz_uid + + @biz_uid.setter + def biz_uid(self, biz_uid): + """Sets the biz_uid of this P2pCounterpartyUserInfo. + + Encrypted UID # noqa: E501 + + :param biz_uid: The biz_uid of this P2pCounterpartyUserInfo. # noqa: E501 + :type: str + """ + + self._biz_uid = biz_uid + + @property + def registration_days(self): + """Gets the registration_days of this P2pCounterpartyUserInfo. # noqa: E501 + + Registration days # noqa: E501 + + :return: The registration_days of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: int + """ + return self._registration_days + + @registration_days.setter + def registration_days(self, registration_days): + """Sets the registration_days of this P2pCounterpartyUserInfo. + + Registration days # noqa: E501 + + :param registration_days: The registration_days of this P2pCounterpartyUserInfo. # noqa: E501 + :type: int + """ + + self._registration_days = registration_days + + @property + def first_trade_days(self): + """Gets the first_trade_days of this P2pCounterpartyUserInfo. # noqa: E501 + + Days since first trade # noqa: E501 + + :return: The first_trade_days of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: int + """ + return self._first_trade_days + + @first_trade_days.setter + def first_trade_days(self, first_trade_days): + """Sets the first_trade_days of this P2pCounterpartyUserInfo. + + Days since first trade # noqa: E501 + + :param first_trade_days: The first_trade_days of this P2pCounterpartyUserInfo. # noqa: E501 + :type: int + """ + + self._first_trade_days = first_trade_days + + @property + def trade_versatile(self): + """Gets the trade_versatile of this P2pCounterpartyUserInfo. # noqa: E501 + + Single user or composite user # noqa: E501 + + :return: The trade_versatile of this P2pCounterpartyUserInfo. # noqa: E501 + :rtype: bool + """ + return self._trade_versatile + + @trade_versatile.setter + def trade_versatile(self, trade_versatile): + """Sets the trade_versatile of this P2pCounterpartyUserInfo. + + Single user or composite user # noqa: E501 + + :param trade_versatile: The trade_versatile of this P2pCounterpartyUserInfo. # noqa: E501 + :type: bool + """ + + self._trade_versatile = trade_versatile + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pCounterpartyUserInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pCounterpartyUserInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_counterparty_user_info_response.py b/gate_api/models/p2p_counterparty_user_info_response.py new file mode 100644 index 00000000..43f23ea2 --- /dev/null +++ b/gate_api/models/p2p_counterparty_user_info_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pCounterpartyUserInfoResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pCounterpartyUserInfo', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pCounterpartyUserInfo, str, Configuration) -> None + """P2pCounterpartyUserInfoResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pCounterpartyUserInfoResponse. # noqa: E501 + + + :return: The timestamp of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pCounterpartyUserInfoResponse. + + + :param timestamp: The timestamp of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pCounterpartyUserInfoResponse. # noqa: E501 + + + :return: The method of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pCounterpartyUserInfoResponse. + + + :param method: The method of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pCounterpartyUserInfoResponse. # noqa: E501 + + + :return: The code of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pCounterpartyUserInfoResponse. + + + :param code: The code of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pCounterpartyUserInfoResponse. # noqa: E501 + + + :return: The message of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pCounterpartyUserInfoResponse. + + + :param message: The message of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pCounterpartyUserInfoResponse. # noqa: E501 + + + :return: The data of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :rtype: P2pCounterpartyUserInfo + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pCounterpartyUserInfoResponse. + + + :param data: The data of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :type: P2pCounterpartyUserInfo + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pCounterpartyUserInfoResponse. # noqa: E501 + + + :return: The version of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pCounterpartyUserInfoResponse. + + + :param version: The version of this P2pCounterpartyUserInfoResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pCounterpartyUserInfoResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pCounterpartyUserInfoResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_merchant_books_place_biz_push_order_response.py b/gate_api/models/p2p_merchant_books_place_biz_push_order_response.py new file mode 100644 index 00000000..ef4e3aa4 --- /dev/null +++ b/gate_api/models/p2p_merchant_books_place_biz_push_order_response.py @@ -0,0 +1,261 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMerchantBooksPlaceBizPushOrderResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pMerchantBooksPlaceBizPushOrderResponseData', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pMerchantBooksPlaceBizPushOrderResponseData, str, Configuration) -> None + """P2pMerchantBooksPlaceBizPushOrderResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + + Response timestamp. # noqa: E501 + + :return: The timestamp of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pMerchantBooksPlaceBizPushOrderResponse. + + Response timestamp. # noqa: E501 + + :param timestamp: The timestamp of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + + Placeholder for request method. # noqa: E501 + + :return: The method of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pMerchantBooksPlaceBizPushOrderResponse. + + Placeholder for request method. # noqa: E501 + + :param method: The method of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + + Response code. 0 means success; 70305102 means the advertisement trade terms or auto reply hit off-platform traffic diversion risk control # noqa: E501 + + :return: The code of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pMerchantBooksPlaceBizPushOrderResponse. + + Response code. 0 means success; 70305102 means the advertisement trade terms or auto reply hit off-platform traffic diversion risk control # noqa: E501 + + :param code: The code of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pMerchantBooksPlaceBizPushOrderResponse. + + Response message # noqa: E501 + + :param message: The message of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + + + :return: The data of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :rtype: P2pMerchantBooksPlaceBizPushOrderResponseData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pMerchantBooksPlaceBizPushOrderResponse. + + + :param data: The data of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :type: P2pMerchantBooksPlaceBizPushOrderResponseData + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + + API version. # noqa: E501 + + :return: The version of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pMerchantBooksPlaceBizPushOrderResponse. + + API version. # noqa: E501 + + :param version: The version of this P2pMerchantBooksPlaceBizPushOrderResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMerchantBooksPlaceBizPushOrderResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMerchantBooksPlaceBizPushOrderResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_merchant_books_place_biz_push_order_response_data.py b/gate_api/models/p2p_merchant_books_place_biz_push_order_response_data.py new file mode 100644 index 00000000..a0e64baf --- /dev/null +++ b/gate_api/models/p2p_merchant_books_place_biz_push_order_response_data.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMerchantBooksPlaceBizPushOrderResponseData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'risk_code': 'int', + 'risk_event': 'P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent' + } + + attribute_map = { + 'risk_code': 'risk_code', + 'risk_event': 'risk_event' + } + + def __init__(self, risk_code=None, risk_event=None, local_vars_configuration=None): # noqa: E501 + # type: (int, P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent, Configuration) -> None + """P2pMerchantBooksPlaceBizPushOrderResponseData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._risk_code = None + self._risk_event = None + self.discriminator = None + + if risk_code is not None: + self.risk_code = risk_code + if risk_event is not None: + self.risk_event = risk_event + + @property + def risk_code(self): + """Gets the risk_code of this P2pMerchantBooksPlaceBizPushOrderResponseData. # noqa: E501 + + Risk control sub-code; 0 for advertisement content traffic diversion risk control # noqa: E501 + + :return: The risk_code of this P2pMerchantBooksPlaceBizPushOrderResponseData. # noqa: E501 + :rtype: int + """ + return self._risk_code + + @risk_code.setter + def risk_code(self, risk_code): + """Sets the risk_code of this P2pMerchantBooksPlaceBizPushOrderResponseData. + + Risk control sub-code; 0 for advertisement content traffic diversion risk control # noqa: E501 + + :param risk_code: The risk_code of this P2pMerchantBooksPlaceBizPushOrderResponseData. # noqa: E501 + :type: int + """ + + self._risk_code = risk_code + + @property + def risk_event(self): + """Gets the risk_event of this P2pMerchantBooksPlaceBizPushOrderResponseData. # noqa: E501 + + + :return: The risk_event of this P2pMerchantBooksPlaceBizPushOrderResponseData. # noqa: E501 + :rtype: P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent + """ + return self._risk_event + + @risk_event.setter + def risk_event(self, risk_event): + """Sets the risk_event of this P2pMerchantBooksPlaceBizPushOrderResponseData. + + + :param risk_event: The risk_event of this P2pMerchantBooksPlaceBizPushOrderResponseData. # noqa: E501 + :type: P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent + """ + + self._risk_event = risk_event + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMerchantBooksPlaceBizPushOrderResponseData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMerchantBooksPlaceBizPushOrderResponseData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_merchant_books_place_biz_push_order_response_data_risk_event.py b/gate_api/models/p2p_merchant_books_place_biz_push_order_response_data_risk_event.py new file mode 100644 index 00000000..084499d5 --- /dev/null +++ b/gate_api/models/p2p_merchant_books_place_biz_push_order_response_data_risk_event.py @@ -0,0 +1,303 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'title': 'str', + 'msg': 'str', + 'action': 'list[P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction]', + 'content_risk_type': 'str', + 'trade_tips': 'str', + 'auto_reply': 'str' + } + + attribute_map = { + 'type': 'type', + 'title': 'title', + 'msg': 'msg', + 'action': 'action', + 'content_risk_type': 'content_risk_type', + 'trade_tips': 'trade_tips', + 'auto_reply': 'auto_reply' + } + + def __init__(self, type=None, title=None, msg=None, action=None, content_risk_type=None, trade_tips=None, auto_reply=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, list[P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction], str, str, str, Configuration) -> None + """P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._type = None + self._title = None + self._msg = None + self._action = None + self._content_risk_type = None + self._trade_tips = None + self._auto_reply = None + self.discriminator = None + + if type is not None: + self.type = type + if title is not None: + self.title = title + if msg is not None: + self.msg = msg + if action is not None: + self.action = action + if content_risk_type is not None: + self.content_risk_type = content_risk_type + if trade_tips is not None: + self.trade_tips = trade_tips + if auto_reply is not None: + self.auto_reply = auto_reply + + @property + def type(self): + """Gets the type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + + Prompt display type # noqa: E501 + + :return: The type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. + + Prompt display type # noqa: E501 + + :param type: The type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :type: str + """ + allowed_values = ["modal"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def title(self): + """Gets the title of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + + Risk control prompt title # noqa: E501 + + :return: The title of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. + + Risk control prompt title # noqa: E501 + + :param title: The title of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :type: str + """ + + self._title = title + + @property + def msg(self): + """Gets the msg of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + + Risk control prompt message generated based on the field that hit risk control # noqa: E501 + + :return: The msg of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :rtype: str + """ + return self._msg + + @msg.setter + def msg(self, msg): + """Sets the msg of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. + + Risk control prompt message generated based on the field that hit risk control # noqa: E501 + + :param msg: The msg of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :type: str + """ + + self._msg = msg + + @property + def action(self): + """Gets the action of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + + Available actions; advertisement content risk control only returns the close action # noqa: E501 + + :return: The action of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :rtype: list[P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction] + """ + return self._action + + @action.setter + def action(self, action): + """Sets the action of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. + + Available actions; advertisement content risk control only returns the close action # noqa: E501 + + :param action: The action of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :type: list[P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction] + """ + + self._action = action + + @property + def content_risk_type(self): + """Gets the content_risk_type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + + Advertisement content field that hit risk control # noqa: E501 + + :return: The content_risk_type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :rtype: str + """ + return self._content_risk_type + + @content_risk_type.setter + def content_risk_type(self, content_risk_type): + """Sets the content_risk_type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. + + Advertisement content field that hit risk control # noqa: E501 + + :param content_risk_type: The content_risk_type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :type: str + """ + allowed_values = ["trade_tips", "auto_reply", "trade_tips_auto_reply"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and content_risk_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `content_risk_type` ({0}), must be one of {1}" # noqa: E501 + .format(content_risk_type, allowed_values) + ) + + self._content_risk_type = content_risk_type + + @property + def trade_tips(self): + """Gets the trade_tips of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + + Prompt message returned when the trade terms hit risk control # noqa: E501 + + :return: The trade_tips of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :rtype: str + """ + return self._trade_tips + + @trade_tips.setter + def trade_tips(self, trade_tips): + """Sets the trade_tips of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. + + Prompt message returned when the trade terms hit risk control # noqa: E501 + + :param trade_tips: The trade_tips of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :type: str + """ + + self._trade_tips = trade_tips + + @property + def auto_reply(self): + """Gets the auto_reply of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + + Prompt message returned when the auto reply hits risk control # noqa: E501 + + :return: The auto_reply of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :rtype: str + """ + return self._auto_reply + + @auto_reply.setter + def auto_reply(self, auto_reply): + """Sets the auto_reply of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. + + Prompt message returned when the auto reply hits risk control # noqa: E501 + + :param auto_reply: The auto_reply of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent. # noqa: E501 + :type: str + """ + + self._auto_reply = auto_reply + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEvent): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_merchant_books_place_biz_push_order_response_data_risk_event_action.py b/gate_api/models/p2p_merchant_books_place_biz_push_order_response_data_risk_event_action.py new file mode 100644 index 00000000..b2aaf271 --- /dev/null +++ b/gate_api/models/p2p_merchant_books_place_biz_push_order_response_data_risk_event_action.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'action_type': 'str', + 'title': 'str', + 'mainly': 'int', + 'action_data': 'object' + } + + attribute_map = { + 'action_type': 'action_type', + 'title': 'title', + 'mainly': 'mainly', + 'action_data': 'action_data' + } + + def __init__(self, action_type=None, title=None, mainly=None, action_data=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, object, Configuration) -> None + """P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._action_type = None + self._title = None + self._mainly = None + self._action_data = None + self.discriminator = None + + if action_type is not None: + self.action_type = action_type + if title is not None: + self.title = title + if mainly is not None: + self.mainly = mainly + if action_data is not None: + self.action_data = action_data + + @property + def action_type(self): + """Gets the action_type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + + Action type # noqa: E501 + + :return: The action_type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + :rtype: str + """ + return self._action_type + + @action_type.setter + def action_type(self, action_type): + """Sets the action_type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. + + Action type # noqa: E501 + + :param action_type: The action_type of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + :type: str + """ + allowed_values = ["close"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and action_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `action_type` ({0}), must be one of {1}" # noqa: E501 + .format(action_type, allowed_values) + ) + + self._action_type = action_type + + @property + def title(self): + """Gets the title of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + + Action button text # noqa: E501 + + :return: The title of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. + + Action button text # noqa: E501 + + :param title: The title of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + :type: str + """ + + self._title = title + + @property + def mainly(self): + """Gets the mainly of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + + Whether it is the primary action. 0: no # noqa: E501 + + :return: The mainly of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + :rtype: int + """ + return self._mainly + + @mainly.setter + def mainly(self, mainly): + """Sets the mainly of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. + + Whether it is the primary action. 0: no # noqa: E501 + + :param mainly: The mainly of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + :type: int + """ + allowed_values = [0] # noqa: E501 + if self.local_vars_configuration.client_side_validation and mainly not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `mainly` ({0}), must be one of {1}" # noqa: E501 + .format(mainly, allowed_values) + ) + + self._mainly = mainly + + @property + def action_data(self): + """Gets the action_data of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + + Additional data of the action; empty object for the close action # noqa: E501 + + :return: The action_data of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + :rtype: object + """ + return self._action_data + + @action_data.setter + def action_data(self, action_data): + """Sets the action_data of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. + + Additional data of the action; empty object for the close action # noqa: E501 + + :param action_data: The action_data of this P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction. # noqa: E501 + :type: object + """ + + self._action_data = action_data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMerchantBooksPlaceBizPushOrderResponseDataRiskEventAction): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_merchant_market_info.py b/gate_api/models/p2p_merchant_market_info.py new file mode 100644 index 00000000..64056353 --- /dev/null +++ b/gate_api/models/p2p_merchant_market_info.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMerchantMarketInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'market': 'str' + } + + attribute_map = { + 'type': 'type', + 'market': 'market' + } + + def __init__(self, type=None, market=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """P2pMerchantMarketInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._type = None + self._market = None + self.discriminator = None + + if type is not None: + self.type = type + if market is not None: + self.market = market + + @property + def type(self): + """Gets the type of this P2pMerchantMarketInfo. # noqa: E501 + + + :return: The type of this P2pMerchantMarketInfo. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this P2pMerchantMarketInfo. + + + :param type: The type of this P2pMerchantMarketInfo. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def market(self): + """Gets the market of this P2pMerchantMarketInfo. # noqa: E501 + + + :return: The market of this P2pMerchantMarketInfo. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this P2pMerchantMarketInfo. + + + :param market: The market of this P2pMerchantMarketInfo. # noqa: E501 + :type: str + """ + + self._market = market + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMerchantMarketInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMerchantMarketInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_merchant_user_info.py b/gate_api/models/p2p_merchant_user_info.py new file mode 100644 index 00000000..05f87c5c --- /dev/null +++ b/gate_api/models/p2p_merchant_user_info.py @@ -0,0 +1,960 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMerchantUserInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'is_self': 'bool', + 'user_timest': 'str', + 'counterparties_num': 'int', + 'email_verified': 'str', + 'verified': 'str', + 'has_phone': 'str', + 'user_name': 'str', + 'user_note': 'str', + 'complete_transactions': 'str', + 'paid_transactions': 'str', + 'accepted_transactions': 'str', + 'transactions_used_time': 'str', + 'cancelled_used_time_month': 'str', + 'complete_transactions_month': 'str', + 'complete_rate_month': 'float', + 'orders_buy_rate_month': 'float', + 'is_black': 'int', + 'is_follow': 'int', + 'have_traded': 'int', + 'biz_uid': 'str', + 'blue_vip': 'int', + 'work_status': 'int', + 'registration_days': 'int', + 'first_trade_days': 'int', + 'need_replenish': 'int', + 'merchant_info': 'P2pMerchantMarketInfo', + 'online_status': 'int', + 'work_hours': 'object', + 'transactions_month': 'float', + 'transactions_all': 'float', + 'trade_versatile': 'bool' + } + + attribute_map = { + 'is_self': 'is_self', + 'user_timest': 'user_timest', + 'counterparties_num': 'counterparties_num', + 'email_verified': 'email_verified', + 'verified': 'verified', + 'has_phone': 'has_phone', + 'user_name': 'user_name', + 'user_note': 'user_note', + 'complete_transactions': 'complete_transactions', + 'paid_transactions': 'paid_transactions', + 'accepted_transactions': 'accepted_transactions', + 'transactions_used_time': 'transactions_used_time', + 'cancelled_used_time_month': 'cancelled_used_time_month', + 'complete_transactions_month': 'complete_transactions_month', + 'complete_rate_month': 'complete_rate_month', + 'orders_buy_rate_month': 'orders_buy_rate_month', + 'is_black': 'is_black', + 'is_follow': 'is_follow', + 'have_traded': 'have_traded', + 'biz_uid': 'biz_uid', + 'blue_vip': 'blue_vip', + 'work_status': 'work_status', + 'registration_days': 'registration_days', + 'first_trade_days': 'first_trade_days', + 'need_replenish': 'need_replenish', + 'merchant_info': 'merchant_info', + 'online_status': 'online_status', + 'work_hours': 'work_hours', + 'transactions_month': 'transactions_month', + 'transactions_all': 'transactions_all', + 'trade_versatile': 'trade_versatile' + } + + def __init__(self, is_self=None, user_timest=None, counterparties_num=None, email_verified=None, verified=None, has_phone=None, user_name=None, user_note=None, complete_transactions=None, paid_transactions=None, accepted_transactions=None, transactions_used_time=None, cancelled_used_time_month=None, complete_transactions_month=None, complete_rate_month=None, orders_buy_rate_month=None, is_black=None, is_follow=None, have_traded=None, biz_uid=None, blue_vip=None, work_status=None, registration_days=None, first_trade_days=None, need_replenish=None, merchant_info=None, online_status=None, work_hours=None, transactions_month=None, transactions_all=None, trade_versatile=None, local_vars_configuration=None): # noqa: E501 + # type: (bool, str, int, str, str, str, str, str, str, str, str, str, str, str, float, float, int, int, int, str, int, int, int, int, int, P2pMerchantMarketInfo, int, object, float, float, bool, Configuration) -> None + """P2pMerchantUserInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._is_self = None + self._user_timest = None + self._counterparties_num = None + self._email_verified = None + self._verified = None + self._has_phone = None + self._user_name = None + self._user_note = None + self._complete_transactions = None + self._paid_transactions = None + self._accepted_transactions = None + self._transactions_used_time = None + self._cancelled_used_time_month = None + self._complete_transactions_month = None + self._complete_rate_month = None + self._orders_buy_rate_month = None + self._is_black = None + self._is_follow = None + self._have_traded = None + self._biz_uid = None + self._blue_vip = None + self._work_status = None + self._registration_days = None + self._first_trade_days = None + self._need_replenish = None + self._merchant_info = None + self._online_status = None + self._work_hours = None + self._transactions_month = None + self._transactions_all = None + self._trade_versatile = None + self.discriminator = None + + if is_self is not None: + self.is_self = is_self + if user_timest is not None: + self.user_timest = user_timest + if counterparties_num is not None: + self.counterparties_num = counterparties_num + if email_verified is not None: + self.email_verified = email_verified + if verified is not None: + self.verified = verified + if has_phone is not None: + self.has_phone = has_phone + if user_name is not None: + self.user_name = user_name + if user_note is not None: + self.user_note = user_note + if complete_transactions is not None: + self.complete_transactions = complete_transactions + if paid_transactions is not None: + self.paid_transactions = paid_transactions + if accepted_transactions is not None: + self.accepted_transactions = accepted_transactions + if transactions_used_time is not None: + self.transactions_used_time = transactions_used_time + if cancelled_used_time_month is not None: + self.cancelled_used_time_month = cancelled_used_time_month + if complete_transactions_month is not None: + self.complete_transactions_month = complete_transactions_month + if complete_rate_month is not None: + self.complete_rate_month = complete_rate_month + if orders_buy_rate_month is not None: + self.orders_buy_rate_month = orders_buy_rate_month + if is_black is not None: + self.is_black = is_black + if is_follow is not None: + self.is_follow = is_follow + if have_traded is not None: + self.have_traded = have_traded + if biz_uid is not None: + self.biz_uid = biz_uid + if blue_vip is not None: + self.blue_vip = blue_vip + if work_status is not None: + self.work_status = work_status + if registration_days is not None: + self.registration_days = registration_days + if first_trade_days is not None: + self.first_trade_days = first_trade_days + if need_replenish is not None: + self.need_replenish = need_replenish + if merchant_info is not None: + self.merchant_info = merchant_info + if online_status is not None: + self.online_status = online_status + self.work_hours = work_hours + if transactions_month is not None: + self.transactions_month = transactions_month + if transactions_all is not None: + self.transactions_all = transactions_all + if trade_versatile is not None: + self.trade_versatile = trade_versatile + + @property + def is_self(self): + """Gets the is_self of this P2pMerchantUserInfo. # noqa: E501 + + Whether self # noqa: E501 + + :return: The is_self of this P2pMerchantUserInfo. # noqa: E501 + :rtype: bool + """ + return self._is_self + + @is_self.setter + def is_self(self, is_self): + """Sets the is_self of this P2pMerchantUserInfo. + + Whether self # noqa: E501 + + :param is_self: The is_self of this P2pMerchantUserInfo. # noqa: E501 + :type: bool + """ + + self._is_self = is_self + + @property + def user_timest(self): + """Gets the user_timest of this P2pMerchantUserInfo. # noqa: E501 + + User registration time (formatted string) # noqa: E501 + + :return: The user_timest of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._user_timest + + @user_timest.setter + def user_timest(self, user_timest): + """Sets the user_timest of this P2pMerchantUserInfo. + + User registration time (formatted string) # noqa: E501 + + :param user_timest: The user_timest of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._user_timest = user_timest + + @property + def counterparties_num(self): + """Gets the counterparties_num of this P2pMerchantUserInfo. # noqa: E501 + + Number of counterparties # noqa: E501 + + :return: The counterparties_num of this P2pMerchantUserInfo. # noqa: E501 + :rtype: int + """ + return self._counterparties_num + + @counterparties_num.setter + def counterparties_num(self, counterparties_num): + """Sets the counterparties_num of this P2pMerchantUserInfo. + + Number of counterparties # noqa: E501 + + :param counterparties_num: The counterparties_num of this P2pMerchantUserInfo. # noqa: E501 + :type: int + """ + + self._counterparties_num = counterparties_num + + @property + def email_verified(self): + """Gets the email_verified of this P2pMerchantUserInfo. # noqa: E501 + + Whether email is verified. `1`: yes; `0`: no. # noqa: E501 + + :return: The email_verified of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this P2pMerchantUserInfo. + + Whether email is verified. `1`: yes; `0`: no. # noqa: E501 + + :param email_verified: The email_verified of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._email_verified = email_verified + + @property + def verified(self): + """Gets the verified of this P2pMerchantUserInfo. # noqa: E501 + + Whether KYC is completed. `1`: yes; `0`: no. # noqa: E501 + + :return: The verified of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._verified + + @verified.setter + def verified(self, verified): + """Sets the verified of this P2pMerchantUserInfo. + + Whether KYC is completed. `1`: yes; `0`: no. # noqa: E501 + + :param verified: The verified of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._verified = verified + + @property + def has_phone(self): + """Gets the has_phone of this P2pMerchantUserInfo. # noqa: E501 + + Whether a phone number is bound. `1`: yes; `0`: no. # noqa: E501 + + :return: The has_phone of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._has_phone + + @has_phone.setter + def has_phone(self, has_phone): + """Sets the has_phone of this P2pMerchantUserInfo. + + Whether a phone number is bound. `1`: yes; `0`: no. # noqa: E501 + + :param has_phone: The has_phone of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._has_phone = has_phone + + @property + def user_name(self): + """Gets the user_name of this P2pMerchantUserInfo. # noqa: E501 + + Username # noqa: E501 + + :return: The user_name of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._user_name + + @user_name.setter + def user_name(self, user_name): + """Sets the user_name of this P2pMerchantUserInfo. + + Username # noqa: E501 + + :param user_name: The user_name of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._user_name = user_name + + @property + def user_note(self): + """Gets the user_note of this P2pMerchantUserInfo. # noqa: E501 + + User note information # noqa: E501 + + :return: The user_note of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._user_note + + @user_note.setter + def user_note(self, user_note): + """Sets the user_note of this P2pMerchantUserInfo. + + User note information # noqa: E501 + + :param user_note: The user_note of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._user_note = user_note + + @property + def complete_transactions(self): + """Gets the complete_transactions of this P2pMerchantUserInfo. # noqa: E501 + + Total completed orders # noqa: E501 + + :return: The complete_transactions of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._complete_transactions + + @complete_transactions.setter + def complete_transactions(self, complete_transactions): + """Sets the complete_transactions of this P2pMerchantUserInfo. + + Total completed orders # noqa: E501 + + :param complete_transactions: The complete_transactions of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._complete_transactions = complete_transactions + + @property + def paid_transactions(self): + """Gets the paid_transactions of this P2pMerchantUserInfo. # noqa: E501 + + Number of completed buy orders # noqa: E501 + + :return: The paid_transactions of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._paid_transactions + + @paid_transactions.setter + def paid_transactions(self, paid_transactions): + """Sets the paid_transactions of this P2pMerchantUserInfo. + + Number of completed buy orders # noqa: E501 + + :param paid_transactions: The paid_transactions of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._paid_transactions = paid_transactions + + @property + def accepted_transactions(self): + """Gets the accepted_transactions of this P2pMerchantUserInfo. # noqa: E501 + + Number of completed sell orders # noqa: E501 + + :return: The accepted_transactions of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._accepted_transactions + + @accepted_transactions.setter + def accepted_transactions(self, accepted_transactions): + """Sets the accepted_transactions of this P2pMerchantUserInfo. + + Number of completed sell orders # noqa: E501 + + :param accepted_transactions: The accepted_transactions of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._accepted_transactions = accepted_transactions + + @property + def transactions_used_time(self): + """Gets the transactions_used_time of this P2pMerchantUserInfo. # noqa: E501 + + Average time to confirm receipt # noqa: E501 + + :return: The transactions_used_time of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._transactions_used_time + + @transactions_used_time.setter + def transactions_used_time(self, transactions_used_time): + """Sets the transactions_used_time of this P2pMerchantUserInfo. + + Average time to confirm receipt # noqa: E501 + + :param transactions_used_time: The transactions_used_time of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._transactions_used_time = transactions_used_time + + @property + def cancelled_used_time_month(self): + """Gets the cancelled_used_time_month of this P2pMerchantUserInfo. # noqa: E501 + + Cancellation time in last 30 days # noqa: E501 + + :return: The cancelled_used_time_month of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._cancelled_used_time_month + + @cancelled_used_time_month.setter + def cancelled_used_time_month(self, cancelled_used_time_month): + """Sets the cancelled_used_time_month of this P2pMerchantUserInfo. + + Cancellation time in last 30 days # noqa: E501 + + :param cancelled_used_time_month: The cancelled_used_time_month of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._cancelled_used_time_month = cancelled_used_time_month + + @property + def complete_transactions_month(self): + """Gets the complete_transactions_month of this P2pMerchantUserInfo. # noqa: E501 + + Number of completed orders in last 30 days # noqa: E501 + + :return: The complete_transactions_month of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._complete_transactions_month + + @complete_transactions_month.setter + def complete_transactions_month(self, complete_transactions_month): + """Sets the complete_transactions_month of this P2pMerchantUserInfo. + + Number of completed orders in last 30 days # noqa: E501 + + :param complete_transactions_month: The complete_transactions_month of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._complete_transactions_month = complete_transactions_month + + @property + def complete_rate_month(self): + """Gets the complete_rate_month of this P2pMerchantUserInfo. # noqa: E501 + + Completion rate in last 30 days # noqa: E501 + + :return: The complete_rate_month of this P2pMerchantUserInfo. # noqa: E501 + :rtype: float + """ + return self._complete_rate_month + + @complete_rate_month.setter + def complete_rate_month(self, complete_rate_month): + """Sets the complete_rate_month of this P2pMerchantUserInfo. + + Completion rate in last 30 days # noqa: E501 + + :param complete_rate_month: The complete_rate_month of this P2pMerchantUserInfo. # noqa: E501 + :type: float + """ + + self._complete_rate_month = complete_rate_month + + @property + def orders_buy_rate_month(self): + """Gets the orders_buy_rate_month of this P2pMerchantUserInfo. # noqa: E501 + + Buy order ratio in last 30 days # noqa: E501 + + :return: The orders_buy_rate_month of this P2pMerchantUserInfo. # noqa: E501 + :rtype: float + """ + return self._orders_buy_rate_month + + @orders_buy_rate_month.setter + def orders_buy_rate_month(self, orders_buy_rate_month): + """Sets the orders_buy_rate_month of this P2pMerchantUserInfo. + + Buy order ratio in last 30 days # noqa: E501 + + :param orders_buy_rate_month: The orders_buy_rate_month of this P2pMerchantUserInfo. # noqa: E501 + :type: float + """ + + self._orders_buy_rate_month = orders_buy_rate_month + + @property + def is_black(self): + """Gets the is_black of this P2pMerchantUserInfo. # noqa: E501 + + Whether the user is blocked. `1`: yes; `0`: no. # noqa: E501 + + :return: The is_black of this P2pMerchantUserInfo. # noqa: E501 + :rtype: int + """ + return self._is_black + + @is_black.setter + def is_black(self, is_black): + """Sets the is_black of this P2pMerchantUserInfo. + + Whether the user is blocked. `1`: yes; `0`: no. # noqa: E501 + + :param is_black: The is_black of this P2pMerchantUserInfo. # noqa: E501 + :type: int + """ + + self._is_black = is_black + + @property + def is_follow(self): + """Gets the is_follow of this P2pMerchantUserInfo. # noqa: E501 + + Whether you follow this user. `1`: yes; `0`: no. # noqa: E501 + + :return: The is_follow of this P2pMerchantUserInfo. # noqa: E501 + :rtype: int + """ + return self._is_follow + + @is_follow.setter + def is_follow(self, is_follow): + """Sets the is_follow of this P2pMerchantUserInfo. + + Whether you follow this user. `1`: yes; `0`: no. # noqa: E501 + + :param is_follow: The is_follow of this P2pMerchantUserInfo. # noqa: E501 + :type: int + """ + + self._is_follow = is_follow + + @property + def have_traded(self): + """Gets the have_traded of this P2pMerchantUserInfo. # noqa: E501 + + Whether you have traded with this user before. `1`: yes; `0`: no. # noqa: E501 + + :return: The have_traded of this P2pMerchantUserInfo. # noqa: E501 + :rtype: int + """ + return self._have_traded + + @have_traded.setter + def have_traded(self, have_traded): + """Sets the have_traded of this P2pMerchantUserInfo. + + Whether you have traded with this user before. `1`: yes; `0`: no. # noqa: E501 + + :param have_traded: The have_traded of this P2pMerchantUserInfo. # noqa: E501 + :type: int + """ + + self._have_traded = have_traded + + @property + def biz_uid(self): + """Gets the biz_uid of this P2pMerchantUserInfo. # noqa: E501 + + Encrypted UID # noqa: E501 + + :return: The biz_uid of this P2pMerchantUserInfo. # noqa: E501 + :rtype: str + """ + return self._biz_uid + + @biz_uid.setter + def biz_uid(self, biz_uid): + """Sets the biz_uid of this P2pMerchantUserInfo. + + Encrypted UID # noqa: E501 + + :param biz_uid: The biz_uid of this P2pMerchantUserInfo. # noqa: E501 + :type: str + """ + + self._biz_uid = biz_uid + + @property + def blue_vip(self): + """Gets the blue_vip of this P2pMerchantUserInfo. # noqa: E501 + + Blue V Crown Shield # noqa: E501 + + :return: The blue_vip of this P2pMerchantUserInfo. # noqa: E501 + :rtype: int + """ + return self._blue_vip + + @blue_vip.setter + def blue_vip(self, blue_vip): + """Sets the blue_vip of this P2pMerchantUserInfo. + + Blue V Crown Shield # noqa: E501 + + :param blue_vip: The blue_vip of this P2pMerchantUserInfo. # noqa: E501 + :type: int + """ + + self._blue_vip = blue_vip + + @property + def work_status(self): + """Gets the work_status of this P2pMerchantUserInfo. # noqa: E501 + + Merchant work status # noqa: E501 + + :return: The work_status of this P2pMerchantUserInfo. # noqa: E501 + :rtype: int + """ + return self._work_status + + @work_status.setter + def work_status(self, work_status): + """Sets the work_status of this P2pMerchantUserInfo. + + Merchant work status # noqa: E501 + + :param work_status: The work_status of this P2pMerchantUserInfo. # noqa: E501 + :type: int + """ + + self._work_status = work_status + + @property + def registration_days(self): + """Gets the registration_days of this P2pMerchantUserInfo. # noqa: E501 + + Registration days # noqa: E501 + + :return: The registration_days of this P2pMerchantUserInfo. # noqa: E501 + :rtype: int + """ + return self._registration_days + + @registration_days.setter + def registration_days(self, registration_days): + """Sets the registration_days of this P2pMerchantUserInfo. + + Registration days # noqa: E501 + + :param registration_days: The registration_days of this P2pMerchantUserInfo. # noqa: E501 + :type: int + """ + + self._registration_days = registration_days + + @property + def first_trade_days(self): + """Gets the first_trade_days of this P2pMerchantUserInfo. # noqa: E501 + + Days since first trade # noqa: E501 + + :return: The first_trade_days of this P2pMerchantUserInfo. # noqa: E501 + :rtype: int + """ + return self._first_trade_days + + @first_trade_days.setter + def first_trade_days(self, first_trade_days): + """Sets the first_trade_days of this P2pMerchantUserInfo. + + Days since first trade # noqa: E501 + + :param first_trade_days: The first_trade_days of this P2pMerchantUserInfo. # noqa: E501 + :type: int + """ + + self._first_trade_days = first_trade_days + + @property + def need_replenish(self): + """Gets the need_replenish of this P2pMerchantUserInfo. # noqa: E501 + + Whether additional margin is required. `1`: yes; `0`: no. # noqa: E501 + + :return: The need_replenish of this P2pMerchantUserInfo. # noqa: E501 + :rtype: int + """ + return self._need_replenish + + @need_replenish.setter + def need_replenish(self, need_replenish): + """Sets the need_replenish of this P2pMerchantUserInfo. + + Whether additional margin is required. `1`: yes; `0`: no. # noqa: E501 + + :param need_replenish: The need_replenish of this P2pMerchantUserInfo. # noqa: E501 + :type: int + """ + + self._need_replenish = need_replenish + + @property + def merchant_info(self): + """Gets the merchant_info of this P2pMerchantUserInfo. # noqa: E501 + + + :return: The merchant_info of this P2pMerchantUserInfo. # noqa: E501 + :rtype: P2pMerchantMarketInfo + """ + return self._merchant_info + + @merchant_info.setter + def merchant_info(self, merchant_info): + """Sets the merchant_info of this P2pMerchantUserInfo. + + + :param merchant_info: The merchant_info of this P2pMerchantUserInfo. # noqa: E501 + :type: P2pMerchantMarketInfo + """ + + self._merchant_info = merchant_info + + @property + def online_status(self): + """Gets the online_status of this P2pMerchantUserInfo. # noqa: E501 + + Merchant online status: `1` online; `0` offline. # noqa: E501 + + :return: The online_status of this P2pMerchantUserInfo. # noqa: E501 + :rtype: int + """ + return self._online_status + + @online_status.setter + def online_status(self, online_status): + """Sets the online_status of this P2pMerchantUserInfo. + + Merchant online status: `1` online; `0` offline. # noqa: E501 + + :param online_status: The online_status of this P2pMerchantUserInfo. # noqa: E501 + :type: int + """ + + self._online_status = online_status + + @property + def work_hours(self): + """Gets the work_hours of this P2pMerchantUserInfo. # noqa: E501 + + Merchant online status details # noqa: E501 + + :return: The work_hours of this P2pMerchantUserInfo. # noqa: E501 + :rtype: object + """ + return self._work_hours + + @work_hours.setter + def work_hours(self, work_hours): + """Sets the work_hours of this P2pMerchantUserInfo. + + Merchant online status details # noqa: E501 + + :param work_hours: The work_hours of this P2pMerchantUserInfo. # noqa: E501 + :type: object + """ + + self._work_hours = work_hours + + @property + def transactions_month(self): + """Gets the transactions_month of this P2pMerchantUserInfo. # noqa: E501 + + 30-day transaction volume # noqa: E501 + + :return: The transactions_month of this P2pMerchantUserInfo. # noqa: E501 + :rtype: float + """ + return self._transactions_month + + @transactions_month.setter + def transactions_month(self, transactions_month): + """Sets the transactions_month of this P2pMerchantUserInfo. + + 30-day transaction volume # noqa: E501 + + :param transactions_month: The transactions_month of this P2pMerchantUserInfo. # noqa: E501 + :type: float + """ + + self._transactions_month = transactions_month + + @property + def transactions_all(self): + """Gets the transactions_all of this P2pMerchantUserInfo. # noqa: E501 + + Total transaction volume # noqa: E501 + + :return: The transactions_all of this P2pMerchantUserInfo. # noqa: E501 + :rtype: float + """ + return self._transactions_all + + @transactions_all.setter + def transactions_all(self, transactions_all): + """Sets the transactions_all of this P2pMerchantUserInfo. + + Total transaction volume # noqa: E501 + + :param transactions_all: The transactions_all of this P2pMerchantUserInfo. # noqa: E501 + :type: float + """ + + self._transactions_all = transactions_all + + @property + def trade_versatile(self): + """Gets the trade_versatile of this P2pMerchantUserInfo. # noqa: E501 + + Single user or composite user # noqa: E501 + + :return: The trade_versatile of this P2pMerchantUserInfo. # noqa: E501 + :rtype: bool + """ + return self._trade_versatile + + @trade_versatile.setter + def trade_versatile(self, trade_versatile): + """Sets the trade_versatile of this P2pMerchantUserInfo. + + Single user or composite user # noqa: E501 + + :param trade_versatile: The trade_versatile of this P2pMerchantUserInfo. # noqa: E501 + :type: bool + """ + + self._trade_versatile = trade_versatile + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMerchantUserInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMerchantUserInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_merchant_user_info_response.py b/gate_api/models/p2p_merchant_user_info_response.py new file mode 100644 index 00000000..11c6ab54 --- /dev/null +++ b/gate_api/models/p2p_merchant_user_info_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMerchantUserInfoResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pMerchantUserInfo', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pMerchantUserInfo, str, Configuration) -> None + """P2pMerchantUserInfoResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pMerchantUserInfoResponse. # noqa: E501 + + + :return: The timestamp of this P2pMerchantUserInfoResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pMerchantUserInfoResponse. + + + :param timestamp: The timestamp of this P2pMerchantUserInfoResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pMerchantUserInfoResponse. # noqa: E501 + + + :return: The method of this P2pMerchantUserInfoResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pMerchantUserInfoResponse. + + + :param method: The method of this P2pMerchantUserInfoResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pMerchantUserInfoResponse. # noqa: E501 + + + :return: The code of this P2pMerchantUserInfoResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pMerchantUserInfoResponse. + + + :param code: The code of this P2pMerchantUserInfoResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pMerchantUserInfoResponse. # noqa: E501 + + + :return: The message of this P2pMerchantUserInfoResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pMerchantUserInfoResponse. + + + :param message: The message of this P2pMerchantUserInfoResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pMerchantUserInfoResponse. # noqa: E501 + + + :return: The data of this P2pMerchantUserInfoResponse. # noqa: E501 + :rtype: P2pMerchantUserInfo + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pMerchantUserInfoResponse. + + + :param data: The data of this P2pMerchantUserInfoResponse. # noqa: E501 + :type: P2pMerchantUserInfo + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pMerchantUserInfoResponse. # noqa: E501 + + + :return: The version of this P2pMerchantUserInfoResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pMerchantUserInfoResponse. + + + :param version: The version of this P2pMerchantUserInfoResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMerchantUserInfoResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMerchantUserInfoResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_merchant_work_hours.py b/gate_api/models/p2p_merchant_work_hours.py new file mode 100644 index 00000000..12cca1a6 --- /dev/null +++ b/gate_api/models/p2p_merchant_work_hours.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMerchantWorkHours(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'work_status': 'int' + } + + attribute_map = { + 'work_status': 'work_status' + } + + def __init__(self, work_status=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """P2pMerchantWorkHours - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._work_status = None + self.discriminator = None + + if work_status is not None: + self.work_status = work_status + + @property + def work_status(self): + """Gets the work_status of this P2pMerchantWorkHours. # noqa: E501 + + Merchant's current working status. 0: normal resting, 1: normal working, 2: custom resting, 3: custom working # noqa: E501 + + :return: The work_status of this P2pMerchantWorkHours. # noqa: E501 + :rtype: int + """ + return self._work_status + + @work_status.setter + def work_status(self, work_status): + """Sets the work_status of this P2pMerchantWorkHours. + + Merchant's current working status. 0: normal resting, 1: normal working, 2: custom resting, 3: custom working # noqa: E501 + + :param work_status: The work_status of this P2pMerchantWorkHours. # noqa: E501 + :type: int + """ + allowed_values = [0, 1, 2, 3] # noqa: E501 + if self.local_vars_configuration.client_side_validation and work_status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `work_status` ({0}), must be one of {1}" # noqa: E501 + .format(work_status, allowed_values) + ) + + self._work_status = work_status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMerchantWorkHours): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMerchantWorkHours): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_merchant_work_hours_response.py b/gate_api/models/p2p_merchant_work_hours_response.py new file mode 100644 index 00000000..5d7ca894 --- /dev/null +++ b/gate_api/models/p2p_merchant_work_hours_response.py @@ -0,0 +1,261 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMerchantWorkHoursResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pMerchantWorkHours', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pMerchantWorkHours, str, Configuration) -> None + """P2pMerchantWorkHoursResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pMerchantWorkHoursResponse. # noqa: E501 + + Response timestamp. # noqa: E501 + + :return: The timestamp of this P2pMerchantWorkHoursResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pMerchantWorkHoursResponse. + + Response timestamp. # noqa: E501 + + :param timestamp: The timestamp of this P2pMerchantWorkHoursResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pMerchantWorkHoursResponse. # noqa: E501 + + Placeholder for request method. # noqa: E501 + + :return: The method of this P2pMerchantWorkHoursResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pMerchantWorkHoursResponse. + + Placeholder for request method. # noqa: E501 + + :param method: The method of this P2pMerchantWorkHoursResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pMerchantWorkHoursResponse. # noqa: E501 + + Response code, 0 means success # noqa: E501 + + :return: The code of this P2pMerchantWorkHoursResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pMerchantWorkHoursResponse. + + Response code, 0 means success # noqa: E501 + + :param code: The code of this P2pMerchantWorkHoursResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pMerchantWorkHoursResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this P2pMerchantWorkHoursResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pMerchantWorkHoursResponse. + + Response message # noqa: E501 + + :param message: The message of this P2pMerchantWorkHoursResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pMerchantWorkHoursResponse. # noqa: E501 + + + :return: The data of this P2pMerchantWorkHoursResponse. # noqa: E501 + :rtype: P2pMerchantWorkHours + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pMerchantWorkHoursResponse. + + + :param data: The data of this P2pMerchantWorkHoursResponse. # noqa: E501 + :type: P2pMerchantWorkHours + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pMerchantWorkHoursResponse. # noqa: E501 + + API version. # noqa: E501 + + :return: The version of this P2pMerchantWorkHoursResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pMerchantWorkHoursResponse. + + API version. # noqa: E501 + + :param version: The version of this P2pMerchantWorkHoursResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMerchantWorkHoursResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMerchantWorkHoursResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_my_ad.py b/gate_api/models/p2p_my_ad.py new file mode 100644 index 00000000..d1ba71e0 --- /dev/null +++ b/gate_api/models/p2p_my_ad.py @@ -0,0 +1,1187 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMyAd(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type': 'str', + 'rate': 'str', + 'original_rate': 'str', + 'amount': 'str', + 'total': 'str', + 'limit_total': 'str', + 'limit_fiat': 'str', + 'min_amount': 'str', + 'max_amount': 'str', + 'pay_type_num': 'str', + 'pay_type_json': 'str', + 'expire_min': 'str', + 'tier_limit': 'str', + 'advertisers_limit': 'int', + 'reg_time_limit': 'int', + 'verified_limit': 'int', + 'min_completed_limit': 'int', + 'max_completed_limit': 'int', + 'user_country_limit': 'int', + 'completed_rate_limit': 'float', + 'user_orders_limit': 'int', + 'hide_payment': 'str', + 'currency_type': 'str', + 'want_type': 'str', + 'trade_tips': 'str', + 'new_hand': 'int', + 'id': 'str', + 'status': 'str', + 'locked_amount': 'str', + 'hide_rate': 'str', + 'is_out_time': 'int', + 'rate_ref_id': 'int', + 'rate_offset': 'str', + 'rate_fixed': 'int', + 'float_trend': 'int', + 'in_dispute': 'int', + 'auto_reply': 'str', + 'timestamp': 'int', + 'is_hedge': 'int' + } + + attribute_map = { + 'type': 'type', + 'rate': 'rate', + 'original_rate': 'original_rate', + 'amount': 'amount', + 'total': 'total', + 'limit_total': 'limit_total', + 'limit_fiat': 'limit_fiat', + 'min_amount': 'min_amount', + 'max_amount': 'max_amount', + 'pay_type_num': 'pay_type_num', + 'pay_type_json': 'pay_type_json', + 'expire_min': 'expire_min', + 'tier_limit': 'tier_limit', + 'advertisers_limit': 'advertisers_limit', + 'reg_time_limit': 'reg_time_limit', + 'verified_limit': 'verified_limit', + 'min_completed_limit': 'min_completed_limit', + 'max_completed_limit': 'max_completed_limit', + 'user_country_limit': 'user_country_limit', + 'completed_rate_limit': 'completed_rate_limit', + 'user_orders_limit': 'user_orders_limit', + 'hide_payment': 'hide_payment', + 'currency_type': 'currencyType', + 'want_type': 'want_type', + 'trade_tips': 'trade_tips', + 'new_hand': 'new_hand', + 'id': 'id', + 'status': 'status', + 'locked_amount': 'locked_amount', + 'hide_rate': 'hide_rate', + 'is_out_time': 'is_out_time', + 'rate_ref_id': 'rate_ref_id', + 'rate_offset': 'rate_offset', + 'rate_fixed': 'rate_fixed', + 'float_trend': 'float_trend', + 'in_dispute': 'in_dispute', + 'auto_reply': 'auto_reply', + 'timestamp': 'timestamp', + 'is_hedge': 'is_hedge' + } + + def __init__(self, type=None, rate=None, original_rate=None, amount=None, total=None, limit_total=None, limit_fiat=None, min_amount=None, max_amount=None, pay_type_num=None, pay_type_json=None, expire_min=None, tier_limit=None, advertisers_limit=None, reg_time_limit=None, verified_limit=None, min_completed_limit=None, max_completed_limit=None, user_country_limit=None, completed_rate_limit=None, user_orders_limit=None, hide_payment=None, currency_type=None, want_type=None, trade_tips=None, new_hand=None, id=None, status=None, locked_amount=None, hide_rate=None, is_out_time=None, rate_ref_id=None, rate_offset=None, rate_fixed=None, float_trend=None, in_dispute=None, auto_reply=None, timestamp=None, is_hedge=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, int, int, int, int, int, int, float, int, str, str, str, str, int, str, str, str, str, int, int, str, int, int, int, str, int, int, Configuration) -> None + """P2pMyAd - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._type = None + self._rate = None + self._original_rate = None + self._amount = None + self._total = None + self._limit_total = None + self._limit_fiat = None + self._min_amount = None + self._max_amount = None + self._pay_type_num = None + self._pay_type_json = None + self._expire_min = None + self._tier_limit = None + self._advertisers_limit = None + self._reg_time_limit = None + self._verified_limit = None + self._min_completed_limit = None + self._max_completed_limit = None + self._user_country_limit = None + self._completed_rate_limit = None + self._user_orders_limit = None + self._hide_payment = None + self._currency_type = None + self._want_type = None + self._trade_tips = None + self._new_hand = None + self._id = None + self._status = None + self._locked_amount = None + self._hide_rate = None + self._is_out_time = None + self._rate_ref_id = None + self._rate_offset = None + self._rate_fixed = None + self._float_trend = None + self._in_dispute = None + self._auto_reply = None + self._timestamp = None + self._is_hedge = None + self.discriminator = None + + if type is not None: + self.type = type + if rate is not None: + self.rate = rate + if original_rate is not None: + self.original_rate = original_rate + if amount is not None: + self.amount = amount + if total is not None: + self.total = total + if limit_total is not None: + self.limit_total = limit_total + if limit_fiat is not None: + self.limit_fiat = limit_fiat + if min_amount is not None: + self.min_amount = min_amount + if max_amount is not None: + self.max_amount = max_amount + if pay_type_num is not None: + self.pay_type_num = pay_type_num + if pay_type_json is not None: + self.pay_type_json = pay_type_json + if expire_min is not None: + self.expire_min = expire_min + if tier_limit is not None: + self.tier_limit = tier_limit + if advertisers_limit is not None: + self.advertisers_limit = advertisers_limit + if reg_time_limit is not None: + self.reg_time_limit = reg_time_limit + if verified_limit is not None: + self.verified_limit = verified_limit + if min_completed_limit is not None: + self.min_completed_limit = min_completed_limit + if max_completed_limit is not None: + self.max_completed_limit = max_completed_limit + if user_country_limit is not None: + self.user_country_limit = user_country_limit + if completed_rate_limit is not None: + self.completed_rate_limit = completed_rate_limit + if user_orders_limit is not None: + self.user_orders_limit = user_orders_limit + if hide_payment is not None: + self.hide_payment = hide_payment + if currency_type is not None: + self.currency_type = currency_type + if want_type is not None: + self.want_type = want_type + if trade_tips is not None: + self.trade_tips = trade_tips + if new_hand is not None: + self.new_hand = new_hand + if id is not None: + self.id = id + if status is not None: + self.status = status + if locked_amount is not None: + self.locked_amount = locked_amount + if hide_rate is not None: + self.hide_rate = hide_rate + if is_out_time is not None: + self.is_out_time = is_out_time + if rate_ref_id is not None: + self.rate_ref_id = rate_ref_id + if rate_offset is not None: + self.rate_offset = rate_offset + if rate_fixed is not None: + self.rate_fixed = rate_fixed + if float_trend is not None: + self.float_trend = float_trend + if in_dispute is not None: + self.in_dispute = in_dispute + if auto_reply is not None: + self.auto_reply = auto_reply + if timestamp is not None: + self.timestamp = timestamp + if is_hedge is not None: + self.is_hedge = is_hedge + + @property + def type(self): + """Gets the type of this P2pMyAd. # noqa: E501 + + Ad side: `buy` buy-crypto ad; `sell` sell-crypto ad. # noqa: E501 + + :return: The type of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this P2pMyAd. + + Ad side: `buy` buy-crypto ad; `sell` sell-crypto ad. # noqa: E501 + + :param type: The type of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def rate(self): + """Gets the rate of this P2pMyAd. # noqa: E501 + + Price # noqa: E501 + + :return: The rate of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this P2pMyAd. + + Price # noqa: E501 + + :param rate: The rate of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._rate = rate + + @property + def original_rate(self): + """Gets the original_rate of this P2pMyAd. # noqa: E501 + + Original price # noqa: E501 + + :return: The original_rate of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._original_rate + + @original_rate.setter + def original_rate(self, original_rate): + """Sets the original_rate of this P2pMyAd. + + Original price # noqa: E501 + + :param original_rate: The original_rate of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._original_rate = original_rate + + @property + def amount(self): + """Gets the amount of this P2pMyAd. # noqa: E501 + + Remaining crypto amount on the ad. # noqa: E501 + + :return: The amount of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this P2pMyAd. + + Remaining crypto amount on the ad. # noqa: E501 + + :param amount: The amount of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def total(self): + """Gets the total of this P2pMyAd. # noqa: E501 + + Remaining fiat amount of ad # noqa: E501 + + :return: The total of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this P2pMyAd. + + Remaining fiat amount of ad # noqa: E501 + + :param total: The total of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._total = total + + @property + def limit_total(self): + """Gets the limit_total of this P2pMyAd. # noqa: E501 + + Single order limit range (cryptocurrency) # noqa: E501 + + :return: The limit_total of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._limit_total + + @limit_total.setter + def limit_total(self, limit_total): + """Sets the limit_total of this P2pMyAd. + + Single order limit range (cryptocurrency) # noqa: E501 + + :param limit_total: The limit_total of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._limit_total = limit_total + + @property + def limit_fiat(self): + """Gets the limit_fiat of this P2pMyAd. # noqa: E501 + + Single order limit range (fiat) # noqa: E501 + + :return: The limit_fiat of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._limit_fiat + + @limit_fiat.setter + def limit_fiat(self, limit_fiat): + """Sets the limit_fiat of this P2pMyAd. + + Single order limit range (fiat) # noqa: E501 + + :param limit_fiat: The limit_fiat of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._limit_fiat = limit_fiat + + @property + def min_amount(self): + """Gets the min_amount of this P2pMyAd. # noqa: E501 + + Minimum quantity per order # noqa: E501 + + :return: The min_amount of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._min_amount + + @min_amount.setter + def min_amount(self, min_amount): + """Sets the min_amount of this P2pMyAd. + + Minimum quantity per order # noqa: E501 + + :param min_amount: The min_amount of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._min_amount = min_amount + + @property + def max_amount(self): + """Gets the max_amount of this P2pMyAd. # noqa: E501 + + Maximum quantity per order # noqa: E501 + + :return: The max_amount of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._max_amount + + @max_amount.setter + def max_amount(self, max_amount): + """Sets the max_amount of this P2pMyAd. + + Maximum quantity per order # noqa: E501 + + :param max_amount: The max_amount of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._max_amount = max_amount + + @property + def pay_type_num(self): + """Gets the pay_type_num of this P2pMyAd. # noqa: E501 + + Payment method ID list # noqa: E501 + + :return: The pay_type_num of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._pay_type_num + + @pay_type_num.setter + def pay_type_num(self, pay_type_num): + """Sets the pay_type_num of this P2pMyAd. + + Payment method ID list # noqa: E501 + + :param pay_type_num: The pay_type_num of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._pay_type_num = pay_type_num + + @property + def pay_type_json(self): + """Gets the pay_type_json of this P2pMyAd. # noqa: E501 + + JSON map of payment type -> payment method ID. # noqa: E501 + + :return: The pay_type_json of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._pay_type_json + + @pay_type_json.setter + def pay_type_json(self, pay_type_json): + """Sets the pay_type_json of this P2pMyAd. + + JSON map of payment type -> payment method ID. # noqa: E501 + + :param pay_type_json: The pay_type_json of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._pay_type_json = pay_type_json + + @property + def expire_min(self): + """Gets the expire_min of this P2pMyAd. # noqa: E501 + + Ad expiration time (minutes) # noqa: E501 + + :return: The expire_min of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._expire_min + + @expire_min.setter + def expire_min(self, expire_min): + """Sets the expire_min of this P2pMyAd. + + Ad expiration time (minutes) # noqa: E501 + + :param expire_min: The expire_min of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._expire_min = expire_min + + @property + def tier_limit(self): + """Gets the tier_limit of this P2pMyAd. # noqa: E501 + + VIP limit # noqa: E501 + + :return: The tier_limit of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._tier_limit + + @tier_limit.setter + def tier_limit(self, tier_limit): + """Sets the tier_limit of this P2pMyAd. + + VIP limit # noqa: E501 + + :param tier_limit: The tier_limit of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._tier_limit = tier_limit + + @property + def advertisers_limit(self): + """Gets the advertisers_limit of this P2pMyAd. # noqa: E501 + + Whether trading with the advertiser is restricted. `0`: no; `1`: yes. # noqa: E501 + + :return: The advertisers_limit of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._advertisers_limit + + @advertisers_limit.setter + def advertisers_limit(self, advertisers_limit): + """Sets the advertisers_limit of this P2pMyAd. + + Whether trading with the advertiser is restricted. `0`: no; `1`: yes. # noqa: E501 + + :param advertisers_limit: The advertisers_limit of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._advertisers_limit = advertisers_limit + + @property + def reg_time_limit(self): + """Gets the reg_time_limit of this P2pMyAd. # noqa: E501 + + Registration time limit # noqa: E501 + + :return: The reg_time_limit of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._reg_time_limit + + @reg_time_limit.setter + def reg_time_limit(self, reg_time_limit): + """Sets the reg_time_limit of this P2pMyAd. + + Registration time limit # noqa: E501 + + :param reg_time_limit: The reg_time_limit of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._reg_time_limit = reg_time_limit + + @property + def verified_limit(self): + """Gets the verified_limit of this P2pMyAd. # noqa: E501 + + KYC level limit # noqa: E501 + + :return: The verified_limit of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._verified_limit + + @verified_limit.setter + def verified_limit(self, verified_limit): + """Sets the verified_limit of this P2pMyAd. + + KYC level limit # noqa: E501 + + :param verified_limit: The verified_limit of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._verified_limit = verified_limit + + @property + def min_completed_limit(self): + """Gets the min_completed_limit of this P2pMyAd. # noqa: E501 + + Minimum limit of completed orders by counterparty # noqa: E501 + + :return: The min_completed_limit of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._min_completed_limit + + @min_completed_limit.setter + def min_completed_limit(self, min_completed_limit): + """Sets the min_completed_limit of this P2pMyAd. + + Minimum limit of completed orders by counterparty # noqa: E501 + + :param min_completed_limit: The min_completed_limit of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._min_completed_limit = min_completed_limit + + @property + def max_completed_limit(self): + """Gets the max_completed_limit of this P2pMyAd. # noqa: E501 + + Maximum limit of completed orders by counterparty # noqa: E501 + + :return: The max_completed_limit of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._max_completed_limit + + @max_completed_limit.setter + def max_completed_limit(self, max_completed_limit): + """Sets the max_completed_limit of this P2pMyAd. + + Maximum limit of completed orders by counterparty # noqa: E501 + + :param max_completed_limit: The max_completed_limit of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._max_completed_limit = max_completed_limit + + @property + def user_country_limit(self): + """Gets the user_country_limit of this P2pMyAd. # noqa: E501 + + KYC nationality restriction # noqa: E501 + + :return: The user_country_limit of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._user_country_limit + + @user_country_limit.setter + def user_country_limit(self, user_country_limit): + """Sets the user_country_limit of this P2pMyAd. + + KYC nationality restriction # noqa: E501 + + :param user_country_limit: The user_country_limit of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._user_country_limit = user_country_limit + + @property + def completed_rate_limit(self): + """Gets the completed_rate_limit of this P2pMyAd. # noqa: E501 + + 30-day completion rate limit # noqa: E501 + + :return: The completed_rate_limit of this P2pMyAd. # noqa: E501 + :rtype: float + """ + return self._completed_rate_limit + + @completed_rate_limit.setter + def completed_rate_limit(self, completed_rate_limit): + """Sets the completed_rate_limit of this P2pMyAd. + + 30-day completion rate limit # noqa: E501 + + :param completed_rate_limit: The completed_rate_limit of this P2pMyAd. # noqa: E501 + :type: float + """ + + self._completed_rate_limit = completed_rate_limit + + @property + def user_orders_limit(self): + """Gets the user_orders_limit of this P2pMyAd. # noqa: E501 + + Maximum order limit for counterparty # noqa: E501 + + :return: The user_orders_limit of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._user_orders_limit + + @user_orders_limit.setter + def user_orders_limit(self, user_orders_limit): + """Sets the user_orders_limit of this P2pMyAd. + + Maximum order limit for counterparty # noqa: E501 + + :param user_orders_limit: The user_orders_limit of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._user_orders_limit = user_orders_limit + + @property + def hide_payment(self): + """Gets the hide_payment of this P2pMyAd. # noqa: E501 + + Whether payment methods are hidden. `1`: hidden; `0`: visible. # noqa: E501 + + :return: The hide_payment of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._hide_payment + + @hide_payment.setter + def hide_payment(self, hide_payment): + """Sets the hide_payment of this P2pMyAd. + + Whether payment methods are hidden. `1`: hidden; `0`: visible. # noqa: E501 + + :param hide_payment: The hide_payment of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._hide_payment = hide_payment + + @property + def currency_type(self): + """Gets the currency_type of this P2pMyAd. # noqa: E501 + + Cryptocurrency symbol. # noqa: E501 + + :return: The currency_type of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._currency_type + + @currency_type.setter + def currency_type(self, currency_type): + """Sets the currency_type of this P2pMyAd. + + Cryptocurrency symbol. # noqa: E501 + + :param currency_type: The currency_type of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._currency_type = currency_type + + @property + def want_type(self): + """Gets the want_type of this P2pMyAd. # noqa: E501 + + Fiat currency # noqa: E501 + + :return: The want_type of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._want_type + + @want_type.setter + def want_type(self, want_type): + """Sets the want_type of this P2pMyAd. + + Fiat currency # noqa: E501 + + :param want_type: The want_type of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._want_type = want_type + + @property + def trade_tips(self): + """Gets the trade_tips of this P2pMyAd. # noqa: E501 + + Trading terms # noqa: E501 + + :return: The trade_tips of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._trade_tips + + @trade_tips.setter + def trade_tips(self, trade_tips): + """Sets the trade_tips of this P2pMyAd. + + Trading terms # noqa: E501 + + :param trade_tips: The trade_tips of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._trade_tips = trade_tips + + @property + def new_hand(self): + """Gets the new_hand of this P2pMyAd. # noqa: E501 + + Special ad type. `0` normal; `1` newcomer guide; `2` newcomer discount; `3` featured promo; `4` KOL ad; `5` coupon ad. # noqa: E501 + + :return: The new_hand of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._new_hand + + @new_hand.setter + def new_hand(self, new_hand): + """Sets the new_hand of this P2pMyAd. + + Special ad type. `0` normal; `1` newcomer guide; `2` newcomer discount; `3` featured promo; `4` KOL ad; `5` coupon ad. # noqa: E501 + + :param new_hand: The new_hand of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._new_hand = new_hand + + @property + def id(self): + """Gets the id of this P2pMyAd. # noqa: E501 + + Advertisement ID. # noqa: E501 + + :return: The id of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this P2pMyAd. + + Advertisement ID. # noqa: E501 + + :param id: The id of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def status(self): + """Gets the status of this P2pMyAd. # noqa: E501 + + Ad status: `OPEN` listed; `OFFLIN` delisted; `CLOSED` closed; `CANCEL` canceled. # noqa: E501 + + :return: The status of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this P2pMyAd. + + Ad status: `OPEN` listed; `OFFLIN` delisted; `CLOSED` closed; `CANCEL` canceled. # noqa: E501 + + :param status: The status of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def locked_amount(self): + """Gets the locked_amount of this P2pMyAd. # noqa: E501 + + Ad frozen amount # noqa: E501 + + :return: The locked_amount of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._locked_amount + + @locked_amount.setter + def locked_amount(self, locked_amount): + """Sets the locked_amount of this P2pMyAd. + + Ad frozen amount # noqa: E501 + + :param locked_amount: The locked_amount of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._locked_amount = locked_amount + + @property + def hide_rate(self): + """Gets the hide_rate of this P2pMyAd. # noqa: E501 + + Hidden price # noqa: E501 + + :return: The hide_rate of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._hide_rate + + @hide_rate.setter + def hide_rate(self, hide_rate): + """Sets the hide_rate of this P2pMyAd. + + Hidden price # noqa: E501 + + :param hide_rate: The hide_rate of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._hide_rate = hide_rate + + @property + def is_out_time(self): + """Gets the is_out_time of this P2pMyAd. # noqa: E501 + + Whether the ad timed out. `1`: timed out; `0`: not yet. # noqa: E501 + + :return: The is_out_time of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._is_out_time + + @is_out_time.setter + def is_out_time(self, is_out_time): + """Sets the is_out_time of this P2pMyAd. + + Whether the ad timed out. `1`: timed out; `0`: not yet. # noqa: E501 + + :param is_out_time: The is_out_time of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._is_out_time = is_out_time + + @property + def rate_ref_id(self): + """Gets the rate_ref_id of this P2pMyAd. # noqa: E501 + + Floating reference: `1` platform; `2` Gate; `3` spot; `<= 0` means fixed price. # noqa: E501 + + :return: The rate_ref_id of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._rate_ref_id + + @rate_ref_id.setter + def rate_ref_id(self, rate_ref_id): + """Sets the rate_ref_id of this P2pMyAd. + + Floating reference: `1` platform; `2` Gate; `3` spot; `<= 0` means fixed price. # noqa: E501 + + :param rate_ref_id: The rate_ref_id of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._rate_ref_id = rate_ref_id + + @property + def rate_offset(self): + """Gets the rate_offset of this P2pMyAd. # noqa: E501 + + Floating ratio # noqa: E501 + + :return: The rate_offset of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._rate_offset + + @rate_offset.setter + def rate_offset(self, rate_offset): + """Sets the rate_offset of this P2pMyAd. + + Floating ratio # noqa: E501 + + :param rate_offset: The rate_offset of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._rate_offset = rate_offset + + @property + def rate_fixed(self): + """Gets the rate_fixed of this P2pMyAd. # noqa: E501 + + Price type: `0` floating; `1` fixed. # noqa: E501 + + :return: The rate_fixed of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._rate_fixed + + @rate_fixed.setter + def rate_fixed(self, rate_fixed): + """Sets the rate_fixed of this P2pMyAd. + + Price type: `0` floating; `1` fixed. # noqa: E501 + + :param rate_fixed: The rate_fixed of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._rate_fixed = rate_fixed + + @property + def float_trend(self): + """Gets the float_trend of this P2pMyAd. # noqa: E501 + + Floating direction: `0` markup; `1` markdown. # noqa: E501 + + :return: The float_trend of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._float_trend + + @float_trend.setter + def float_trend(self, float_trend): + """Sets the float_trend of this P2pMyAd. + + Floating direction: `0` markup; `1` markdown. # noqa: E501 + + :param float_trend: The float_trend of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._float_trend = float_trend + + @property + def in_dispute(self): + """Gets the in_dispute of this P2pMyAd. # noqa: E501 + + Whether the ad had a disputed trade. `1`: yes; `0`: no. # noqa: E501 + + :return: The in_dispute of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._in_dispute + + @in_dispute.setter + def in_dispute(self, in_dispute): + """Sets the in_dispute of this P2pMyAd. + + Whether the ad had a disputed trade. `1`: yes; `0`: no. # noqa: E501 + + :param in_dispute: The in_dispute of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._in_dispute = in_dispute + + @property + def auto_reply(self): + """Gets the auto_reply of this P2pMyAd. # noqa: E501 + + Auto reply data # noqa: E501 + + :return: The auto_reply of this P2pMyAd. # noqa: E501 + :rtype: str + """ + return self._auto_reply + + @auto_reply.setter + def auto_reply(self, auto_reply): + """Sets the auto_reply of this P2pMyAd. + + Auto reply data # noqa: E501 + + :param auto_reply: The auto_reply of this P2pMyAd. # noqa: E501 + :type: str + """ + + self._auto_reply = auto_reply + + @property + def timestamp(self): + """Gets the timestamp of this P2pMyAd. # noqa: E501 + + Ad creation time # noqa: E501 + + :return: The timestamp of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pMyAd. + + Ad creation time # noqa: E501 + + :param timestamp: The timestamp of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def is_hedge(self): + """Gets the is_hedge of this P2pMyAd. # noqa: E501 + + Whether auto-delegation is enabled. `1`: yes; `0`: no. # noqa: E501 + + :return: The is_hedge of this P2pMyAd. # noqa: E501 + :rtype: int + """ + return self._is_hedge + + @is_hedge.setter + def is_hedge(self, is_hedge): + """Sets the is_hedge of this P2pMyAd. + + Whether auto-delegation is enabled. `1`: yes; `0`: no. # noqa: E501 + + :param is_hedge: The is_hedge of this P2pMyAd. # noqa: E501 + :type: int + """ + + self._is_hedge = is_hedge + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMyAd): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMyAd): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_my_ads_list_response.py b/gate_api/models/p2p_my_ads_list_response.py new file mode 100644 index 00000000..592f4c0f --- /dev/null +++ b/gate_api/models/p2p_my_ads_list_response.py @@ -0,0 +1,253 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMyAdsListResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pMyAdsListResult', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pMyAdsListResult, str, Configuration) -> None + """P2pMyAdsListResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pMyAdsListResponse. # noqa: E501 + + + :return: The timestamp of this P2pMyAdsListResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pMyAdsListResponse. + + + :param timestamp: The timestamp of this P2pMyAdsListResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pMyAdsListResponse. # noqa: E501 + + + :return: The method of this P2pMyAdsListResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pMyAdsListResponse. + + + :param method: The method of this P2pMyAdsListResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pMyAdsListResponse. # noqa: E501 + + + :return: The code of this P2pMyAdsListResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pMyAdsListResponse. + + + :param code: The code of this P2pMyAdsListResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pMyAdsListResponse. # noqa: E501 + + + :return: The message of this P2pMyAdsListResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pMyAdsListResponse. + + + :param message: The message of this P2pMyAdsListResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pMyAdsListResponse. # noqa: E501 + + + :return: The data of this P2pMyAdsListResponse. # noqa: E501 + :rtype: P2pMyAdsListResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pMyAdsListResponse. + + + :param data: The data of this P2pMyAdsListResponse. # noqa: E501 + :type: P2pMyAdsListResult + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pMyAdsListResponse. # noqa: E501 + + Version number # noqa: E501 + + :return: The version of this P2pMyAdsListResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pMyAdsListResponse. + + Version number # noqa: E501 + + :param version: The version of this P2pMyAdsListResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMyAdsListResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMyAdsListResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_my_ads_list_result.py b/gate_api/models/p2p_my_ads_list_result.py new file mode 100644 index 00000000..6bfe4658 --- /dev/null +++ b/gate_api/models/p2p_my_ads_list_result.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pMyAdsListResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'lists': 'list[P2pMyAd]' + } + + attribute_map = { + 'lists': 'lists' + } + + def __init__(self, lists=None, local_vars_configuration=None): # noqa: E501 + # type: (list[P2pMyAd], Configuration) -> None + """P2pMyAdsListResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._lists = None + self.discriminator = None + + if lists is not None: + self.lists = lists + + @property + def lists(self): + """Gets the lists of this P2pMyAdsListResult. # noqa: E501 + + + :return: The lists of this P2pMyAdsListResult. # noqa: E501 + :rtype: list[P2pMyAd] + """ + return self._lists + + @lists.setter + def lists(self, lists): + """Sets the lists of this P2pMyAdsListResult. + + + :param lists: The lists of this P2pMyAdsListResult. # noqa: E501 + :type: list[P2pMyAd] + """ + + self._lists = lists + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pMyAdsListResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pMyAdsListResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_payment_method_account.py b/gate_api/models/p2p_payment_method_account.py new file mode 100644 index 00000000..f3a15e07 --- /dev/null +++ b/gate_api/models/p2p_payment_method_account.py @@ -0,0 +1,711 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pPaymentMethodAccount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'uid': 'int', + 'bankid': 'str', + 'nickname': 'int', + 'bankname': 'str', + 'bankbranch': 'str', + 'bankcity': 'str', + 'bankprov': 'str', + 'bankaddr': 'str', + 'bankdesc': 'str', + 'hold_uid': 'int', + 'hold_username': 'str', + 'real_name': 'str', + 'id': 'str', + 'account_des': 'str', + 'pay_type': 'str', + 'file': 'str', + 'file_key': 'str', + 'account': 'str', + 'memo': 'str', + 'code': 'str', + 'memo_ext': 'str', + 'trade_tips': 'str' + } + + attribute_map = { + 'uid': 'uid', + 'bankid': 'bankid', + 'nickname': 'nickname', + 'bankname': 'bankname', + 'bankbranch': 'bankbranch', + 'bankcity': 'bankcity', + 'bankprov': 'bankprov', + 'bankaddr': 'bankaddr', + 'bankdesc': 'bankdesc', + 'hold_uid': 'hold_uid', + 'hold_username': 'hold_username', + 'real_name': 'real_name', + 'id': 'id', + 'account_des': 'account_des', + 'pay_type': 'pay_type', + 'file': 'file', + 'file_key': 'file_key', + 'account': 'account', + 'memo': 'memo', + 'code': 'code', + 'memo_ext': 'memo_ext', + 'trade_tips': 'trade_tips' + } + + def __init__(self, uid=None, bankid=None, nickname=None, bankname=None, bankbranch=None, bankcity=None, bankprov=None, bankaddr=None, bankdesc=None, hold_uid=None, hold_username=None, real_name=None, id=None, account_des=None, pay_type=None, file=None, file_key=None, account=None, memo=None, code=None, memo_ext=None, trade_tips=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, int, str, str, str, str, str, str, int, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """P2pPaymentMethodAccount - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._uid = None + self._bankid = None + self._nickname = None + self._bankname = None + self._bankbranch = None + self._bankcity = None + self._bankprov = None + self._bankaddr = None + self._bankdesc = None + self._hold_uid = None + self._hold_username = None + self._real_name = None + self._id = None + self._account_des = None + self._pay_type = None + self._file = None + self._file_key = None + self._account = None + self._memo = None + self._code = None + self._memo_ext = None + self._trade_tips = None + self.discriminator = None + + if uid is not None: + self.uid = uid + if bankid is not None: + self.bankid = bankid + if nickname is not None: + self.nickname = nickname + if bankname is not None: + self.bankname = bankname + if bankbranch is not None: + self.bankbranch = bankbranch + if bankcity is not None: + self.bankcity = bankcity + if bankprov is not None: + self.bankprov = bankprov + if bankaddr is not None: + self.bankaddr = bankaddr + if bankdesc is not None: + self.bankdesc = bankdesc + if hold_uid is not None: + self.hold_uid = hold_uid + if hold_username is not None: + self.hold_username = hold_username + if real_name is not None: + self.real_name = real_name + if id is not None: + self.id = id + if account_des is not None: + self.account_des = account_des + if pay_type is not None: + self.pay_type = pay_type + if file is not None: + self.file = file + if file_key is not None: + self.file_key = file_key + if account is not None: + self.account = account + if memo is not None: + self.memo = memo + if code is not None: + self.code = code + if memo_ext is not None: + self.memo_ext = memo_ext + if trade_tips is not None: + self.trade_tips = trade_tips + + @property + def uid(self): + """Gets the uid of this P2pPaymentMethodAccount. # noqa: E501 + + useruID # noqa: E501 + + :return: The uid of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: int + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this P2pPaymentMethodAccount. + + useruID # noqa: E501 + + :param uid: The uid of this P2pPaymentMethodAccount. # noqa: E501 + :type: int + """ + + self._uid = uid + + @property + def bankid(self): + """Gets the bankid of this P2pPaymentMethodAccount. # noqa: E501 + + User's currently bound payment method (primary key ID) # noqa: E501 + + :return: The bankid of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._bankid + + @bankid.setter + def bankid(self, bankid): + """Sets the bankid of this P2pPaymentMethodAccount. + + User's currently bound payment method (primary key ID) # noqa: E501 + + :param bankid: The bankid of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._bankid = bankid + + @property + def nickname(self): + """Gets the nickname of this P2pPaymentMethodAccount. # noqa: E501 + + Cardholder UID # noqa: E501 + + :return: The nickname of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: int + """ + return self._nickname + + @nickname.setter + def nickname(self, nickname): + """Sets the nickname of this P2pPaymentMethodAccount. + + Cardholder UID # noqa: E501 + + :param nickname: The nickname of this P2pPaymentMethodAccount. # noqa: E501 + :type: int + """ + + self._nickname = nickname + + @property + def bankname(self): + """Gets the bankname of this P2pPaymentMethodAccount. # noqa: E501 + + Bank name # noqa: E501 + + :return: The bankname of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._bankname + + @bankname.setter + def bankname(self, bankname): + """Sets the bankname of this P2pPaymentMethodAccount. + + Bank name # noqa: E501 + + :param bankname: The bankname of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._bankname = bankname + + @property + def bankbranch(self): + """Gets the bankbranch of this P2pPaymentMethodAccount. # noqa: E501 + + Bank branch name # noqa: E501 + + :return: The bankbranch of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._bankbranch + + @bankbranch.setter + def bankbranch(self, bankbranch): + """Sets the bankbranch of this P2pPaymentMethodAccount. + + Bank branch name # noqa: E501 + + :param bankbranch: The bankbranch of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._bankbranch = bankbranch + + @property + def bankcity(self): + """Gets the bankcity of this P2pPaymentMethodAccount. # noqa: E501 + + Bank city # noqa: E501 + + :return: The bankcity of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._bankcity + + @bankcity.setter + def bankcity(self, bankcity): + """Sets the bankcity of this P2pPaymentMethodAccount. + + Bank city # noqa: E501 + + :param bankcity: The bankcity of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._bankcity = bankcity + + @property + def bankprov(self): + """Gets the bankprov of this P2pPaymentMethodAccount. # noqa: E501 + + Bank province # noqa: E501 + + :return: The bankprov of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._bankprov + + @bankprov.setter + def bankprov(self, bankprov): + """Sets the bankprov of this P2pPaymentMethodAccount. + + Bank province # noqa: E501 + + :param bankprov: The bankprov of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._bankprov = bankprov + + @property + def bankaddr(self): + """Gets the bankaddr of this P2pPaymentMethodAccount. # noqa: E501 + + Bank card number or masked card number. # noqa: E501 + + :return: The bankaddr of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._bankaddr + + @bankaddr.setter + def bankaddr(self, bankaddr): + """Sets the bankaddr of this P2pPaymentMethodAccount. + + Bank card number or masked card number. # noqa: E501 + + :param bankaddr: The bankaddr of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._bankaddr = bankaddr + + @property + def bankdesc(self): + """Gets the bankdesc of this P2pPaymentMethodAccount. # noqa: E501 + + Bank note # noqa: E501 + + :return: The bankdesc of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._bankdesc + + @bankdesc.setter + def bankdesc(self, bankdesc): + """Sets the bankdesc of this P2pPaymentMethodAccount. + + Bank note # noqa: E501 + + :param bankdesc: The bankdesc of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._bankdesc = bankdesc + + @property + def hold_uid(self): + """Gets the hold_uid of this P2pPaymentMethodAccount. # noqa: E501 + + Cardholder UID # noqa: E501 + + :return: The hold_uid of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: int + """ + return self._hold_uid + + @hold_uid.setter + def hold_uid(self, hold_uid): + """Sets the hold_uid of this P2pPaymentMethodAccount. + + Cardholder UID # noqa: E501 + + :param hold_uid: The hold_uid of this P2pPaymentMethodAccount. # noqa: E501 + :type: int + """ + + self._hold_uid = hold_uid + + @property + def hold_username(self): + """Gets the hold_username of this P2pPaymentMethodAccount. # noqa: E501 + + Cardholder name # noqa: E501 + + :return: The hold_username of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._hold_username + + @hold_username.setter + def hold_username(self, hold_username): + """Sets the hold_username of this P2pPaymentMethodAccount. + + Cardholder name # noqa: E501 + + :param hold_username: The hold_username of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._hold_username = hold_username + + @property + def real_name(self): + """Gets the real_name of this P2pPaymentMethodAccount. # noqa: E501 + + User verified display name. # noqa: E501 + + :return: The real_name of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._real_name + + @real_name.setter + def real_name(self, real_name): + """Sets the real_name of this P2pPaymentMethodAccount. + + User verified display name. # noqa: E501 + + :param real_name: The real_name of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._real_name = real_name + + @property + def id(self): + """Gets the id of this P2pPaymentMethodAccount. # noqa: E501 + + User's currently bound payment method (primary key ID) # noqa: E501 + + :return: The id of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this P2pPaymentMethodAccount. + + User's currently bound payment method (primary key ID) # noqa: E501 + + :param id: The id of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def account_des(self): + """Gets the account_des of this P2pPaymentMethodAccount. # noqa: E501 + + Payment method description # noqa: E501 + + :return: The account_des of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._account_des + + @account_des.setter + def account_des(self, account_des): + """Sets the account_des of this P2pPaymentMethodAccount. + + Payment method description # noqa: E501 + + :param account_des: The account_des of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._account_des = account_des + + @property + def pay_type(self): + """Gets the pay_type of this P2pPaymentMethodAccount. # noqa: E501 + + Payment method type # noqa: E501 + + :return: The pay_type of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._pay_type + + @pay_type.setter + def pay_type(self, pay_type): + """Sets the pay_type of this P2pPaymentMethodAccount. + + Payment method type # noqa: E501 + + :param pay_type: The pay_type of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._pay_type = pay_type + + @property + def file(self): + """Gets the file of this P2pPaymentMethodAccount. # noqa: E501 + + Payment method file link # noqa: E501 + + :return: The file of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this P2pPaymentMethodAccount. + + Payment method file link # noqa: E501 + + :param file: The file of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._file = file + + @property + def file_key(self): + """Gets the file_key of this P2pPaymentMethodAccount. # noqa: E501 + + Payment method file key # noqa: E501 + + :return: The file_key of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._file_key + + @file_key.setter + def file_key(self, file_key): + """Sets the file_key of this P2pPaymentMethodAccount. + + Payment method file key # noqa: E501 + + :param file_key: The file_key of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._file_key = file_key + + @property + def account(self): + """Gets the account of this P2pPaymentMethodAccount. # noqa: E501 + + Payment account or masked payment account. # noqa: E501 + + :return: The account of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._account + + @account.setter + def account(self, account): + """Sets the account of this P2pPaymentMethodAccount. + + Payment account or masked payment account. # noqa: E501 + + :param account: The account of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._account = account + + @property + def memo(self): + """Gets the memo of this P2pPaymentMethodAccount. # noqa: E501 + + Payment method note # noqa: E501 + + :return: The memo of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._memo + + @memo.setter + def memo(self, memo): + """Sets the memo of this P2pPaymentMethodAccount. + + Payment method note # noqa: E501 + + :param memo: The memo of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._memo = memo + + @property + def code(self): + """Gets the code of this P2pPaymentMethodAccount. # noqa: E501 + + Payment method code # noqa: E501 + + :return: The code of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pPaymentMethodAccount. + + Payment method code # noqa: E501 + + :param code: The code of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._code = code + + @property + def memo_ext(self): + """Gets the memo_ext of this P2pPaymentMethodAccount. # noqa: E501 + + Payment method additional note # noqa: E501 + + :return: The memo_ext of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._memo_ext + + @memo_ext.setter + def memo_ext(self, memo_ext): + """Sets the memo_ext of this P2pPaymentMethodAccount. + + Payment method additional note # noqa: E501 + + :param memo_ext: The memo_ext of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._memo_ext = memo_ext + + @property + def trade_tips(self): + """Gets the trade_tips of this P2pPaymentMethodAccount. # noqa: E501 + + Payment method transaction information # noqa: E501 + + :return: The trade_tips of this P2pPaymentMethodAccount. # noqa: E501 + :rtype: str + """ + return self._trade_tips + + @trade_tips.setter + def trade_tips(self, trade_tips): + """Sets the trade_tips of this P2pPaymentMethodAccount. + + Payment method transaction information # noqa: E501 + + :param trade_tips: The trade_tips of this P2pPaymentMethodAccount. # noqa: E501 + :type: str + """ + + self._trade_tips = trade_tips + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pPaymentMethodAccount): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pPaymentMethodAccount): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_payment_method_group.py b/gate_api/models/p2p_payment_method_group.py new file mode 100644 index 00000000..104186e8 --- /dev/null +++ b/gate_api/models/p2p_payment_method_group.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pPaymentMethodGroup(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'pay_type': 'str', + 'pay_name': 'str', + 'ids': 'list[int]', + 'list': 'list[P2pPaymentMethodAccount]' + } + + attribute_map = { + 'pay_type': 'pay_type', + 'pay_name': 'pay_name', + 'ids': 'ids', + 'list': 'list' + } + + def __init__(self, pay_type=None, pay_name=None, ids=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, list[int], list[P2pPaymentMethodAccount], Configuration) -> None + """P2pPaymentMethodGroup - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._pay_type = None + self._pay_name = None + self._ids = None + self._list = None + self.discriminator = None + + if pay_type is not None: + self.pay_type = pay_type + if pay_name is not None: + self.pay_name = pay_name + if ids is not None: + self.ids = ids + if list is not None: + self.list = list + + @property + def pay_type(self): + """Gets the pay_type of this P2pPaymentMethodGroup. # noqa: E501 + + Payment method type # noqa: E501 + + :return: The pay_type of this P2pPaymentMethodGroup. # noqa: E501 + :rtype: str + """ + return self._pay_type + + @pay_type.setter + def pay_type(self, pay_type): + """Sets the pay_type of this P2pPaymentMethodGroup. + + Payment method type # noqa: E501 + + :param pay_type: The pay_type of this P2pPaymentMethodGroup. # noqa: E501 + :type: str + """ + + self._pay_type = pay_type + + @property + def pay_name(self): + """Gets the pay_name of this P2pPaymentMethodGroup. # noqa: E501 + + Payment method name # noqa: E501 + + :return: The pay_name of this P2pPaymentMethodGroup. # noqa: E501 + :rtype: str + """ + return self._pay_name + + @pay_name.setter + def pay_name(self, pay_name): + """Sets the pay_name of this P2pPaymentMethodGroup. + + Payment method name # noqa: E501 + + :param pay_name: The pay_name of this P2pPaymentMethodGroup. # noqa: E501 + :type: str + """ + + self._pay_name = pay_name + + @property + def ids(self): + """Gets the ids of this P2pPaymentMethodGroup. # noqa: E501 + + User's currently bound payment method (primary key ID) # noqa: E501 + + :return: The ids of this P2pPaymentMethodGroup. # noqa: E501 + :rtype: list[int] + """ + return self._ids + + @ids.setter + def ids(self, ids): + """Sets the ids of this P2pPaymentMethodGroup. + + User's currently bound payment method (primary key ID) # noqa: E501 + + :param ids: The ids of this P2pPaymentMethodGroup. # noqa: E501 + :type: list[int] + """ + + self._ids = ids + + @property + def list(self): + """Gets the list of this P2pPaymentMethodGroup. # noqa: E501 + + + :return: The list of this P2pPaymentMethodGroup. # noqa: E501 + :rtype: list[P2pPaymentMethodAccount] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this P2pPaymentMethodGroup. + + + :param list: The list of this P2pPaymentMethodGroup. # noqa: E501 + :type: list[P2pPaymentMethodAccount] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pPaymentMethodGroup): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pPaymentMethodGroup): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_payment_methods_response.py b/gate_api/models/p2p_payment_methods_response.py new file mode 100644 index 00000000..71b3e8ef --- /dev/null +++ b/gate_api/models/p2p_payment_methods_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pPaymentMethodsResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'list[P2pPaymentMethodGroup]', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, list[P2pPaymentMethodGroup], str, Configuration) -> None + """P2pPaymentMethodsResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pPaymentMethodsResponse. # noqa: E501 + + + :return: The timestamp of this P2pPaymentMethodsResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pPaymentMethodsResponse. + + + :param timestamp: The timestamp of this P2pPaymentMethodsResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pPaymentMethodsResponse. # noqa: E501 + + + :return: The method of this P2pPaymentMethodsResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pPaymentMethodsResponse. + + + :param method: The method of this P2pPaymentMethodsResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pPaymentMethodsResponse. # noqa: E501 + + + :return: The code of this P2pPaymentMethodsResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pPaymentMethodsResponse. + + + :param code: The code of this P2pPaymentMethodsResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pPaymentMethodsResponse. # noqa: E501 + + + :return: The message of this P2pPaymentMethodsResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pPaymentMethodsResponse. + + + :param message: The message of this P2pPaymentMethodsResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pPaymentMethodsResponse. # noqa: E501 + + + :return: The data of this P2pPaymentMethodsResponse. # noqa: E501 + :rtype: list[P2pPaymentMethodGroup] + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pPaymentMethodsResponse. + + + :param data: The data of this P2pPaymentMethodsResponse. # noqa: E501 + :type: list[P2pPaymentMethodGroup] + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pPaymentMethodsResponse. # noqa: E501 + + + :return: The version of this P2pPaymentMethodsResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pPaymentMethodsResponse. + + + :param version: The version of this P2pPaymentMethodsResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pPaymentMethodsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pPaymentMethodsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_send_chat_message_response.py b/gate_api/models/p2p_send_chat_message_response.py new file mode 100644 index 00000000..4f3e8f89 --- /dev/null +++ b/gate_api/models/p2p_send_chat_message_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pSendChatMessageResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pSendChatMessageResult', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pSendChatMessageResult, str, Configuration) -> None + """P2pSendChatMessageResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pSendChatMessageResponse. # noqa: E501 + + + :return: The timestamp of this P2pSendChatMessageResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pSendChatMessageResponse. + + + :param timestamp: The timestamp of this P2pSendChatMessageResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pSendChatMessageResponse. # noqa: E501 + + + :return: The method of this P2pSendChatMessageResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pSendChatMessageResponse. + + + :param method: The method of this P2pSendChatMessageResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pSendChatMessageResponse. # noqa: E501 + + + :return: The code of this P2pSendChatMessageResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pSendChatMessageResponse. + + + :param code: The code of this P2pSendChatMessageResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pSendChatMessageResponse. # noqa: E501 + + + :return: The message of this P2pSendChatMessageResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pSendChatMessageResponse. + + + :param message: The message of this P2pSendChatMessageResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pSendChatMessageResponse. # noqa: E501 + + + :return: The data of this P2pSendChatMessageResponse. # noqa: E501 + :rtype: P2pSendChatMessageResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pSendChatMessageResponse. + + + :param data: The data of this P2pSendChatMessageResponse. # noqa: E501 + :type: P2pSendChatMessageResult + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pSendChatMessageResponse. # noqa: E501 + + + :return: The version of this P2pSendChatMessageResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pSendChatMessageResponse. + + + :param version: The version of this P2pSendChatMessageResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pSendChatMessageResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pSendChatMessageResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_send_chat_message_result.py b/gate_api/models/p2p_send_chat_message_result.py new file mode 100644 index 00000000..d67875f2 --- /dev/null +++ b/gate_api/models/p2p_send_chat_message_result.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pSendChatMessageResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'srvtm': 'int', + 'txid': 'int', + 'conversation_id': 'str', + 'msg_type': 'int', + 'risk_type': 'int', + 'toast_msg': 'str' + } + + attribute_map = { + 'srvtm': 'SRVTM', + 'txid': 'txid', + 'conversation_id': 'conversation_id', + 'msg_type': 'msg_type', + 'risk_type': 'risk_type', + 'toast_msg': 'toast_msg' + } + + def __init__(self, srvtm=None, txid=None, conversation_id=None, msg_type=None, risk_type=None, toast_msg=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, int, int, str, Configuration) -> None + """P2pSendChatMessageResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._srvtm = None + self._txid = None + self._conversation_id = None + self._msg_type = None + self._risk_type = None + self._toast_msg = None + self.discriminator = None + + if srvtm is not None: + self.srvtm = srvtm + if txid is not None: + self.txid = txid + if conversation_id is not None: + self.conversation_id = conversation_id + if msg_type is not None: + self.msg_type = msg_type + if risk_type is not None: + self.risk_type = risk_type + if toast_msg is not None: + self.toast_msg = toast_msg + + @property + def srvtm(self): + """Gets the srvtm of this P2pSendChatMessageResult. # noqa: E501 + + Timestamp when message was successfully sent (current timestamp) # noqa: E501 + + :return: The srvtm of this P2pSendChatMessageResult. # noqa: E501 + :rtype: int + """ + return self._srvtm + + @srvtm.setter + def srvtm(self, srvtm): + """Sets the srvtm of this P2pSendChatMessageResult. + + Timestamp when message was successfully sent (current timestamp) # noqa: E501 + + :param srvtm: The srvtm of this P2pSendChatMessageResult. # noqa: E501 + :type: int + """ + + self._srvtm = srvtm + + @property + def txid(self): + """Gets the txid of this P2pSendChatMessageResult. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this P2pSendChatMessageResult. # noqa: E501 + :rtype: int + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this P2pSendChatMessageResult. + + Order ID # noqa: E501 + + :param txid: The txid of this P2pSendChatMessageResult. # noqa: E501 + :type: int + """ + + self._txid = txid + + @property + def conversation_id(self): + """Gets the conversation_id of this P2pSendChatMessageResult. # noqa: E501 + + Chat ID, formatted as both parties' UIDs concatenated in ascending order # noqa: E501 + + :return: The conversation_id of this P2pSendChatMessageResult. # noqa: E501 + :rtype: str + """ + return self._conversation_id + + @conversation_id.setter + def conversation_id(self, conversation_id): + """Sets the conversation_id of this P2pSendChatMessageResult. + + Chat ID, formatted as both parties' UIDs concatenated in ascending order # noqa: E501 + + :param conversation_id: The conversation_id of this P2pSendChatMessageResult. # noqa: E501 + :type: str + """ + + self._conversation_id = conversation_id + + @property + def msg_type(self): + """Gets the msg_type of this P2pSendChatMessageResult. # noqa: E501 + + Message content type when risk control is hit. 0: text # noqa: E501 + + :return: The msg_type of this P2pSendChatMessageResult. # noqa: E501 + :rtype: int + """ + return self._msg_type + + @msg_type.setter + def msg_type(self, msg_type): + """Sets the msg_type of this P2pSendChatMessageResult. + + Message content type when risk control is hit. 0: text # noqa: E501 + + :param msg_type: The msg_type of this P2pSendChatMessageResult. # noqa: E501 + :type: int + """ + allowed_values = [0] # noqa: E501 + if self.local_vars_configuration.client_side_validation and msg_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `msg_type` ({0}), must be one of {1}" # noqa: E501 + .format(msg_type, allowed_values) + ) + + self._msg_type = msg_type + + @property + def risk_type(self): + """Gets the risk_type of this P2pSendChatMessageResult. # noqa: E501 + + Risk control display type. 1: off-platform traffic diversion risk; returned only when risk control is hit # noqa: E501 + + :return: The risk_type of this P2pSendChatMessageResult. # noqa: E501 + :rtype: int + """ + return self._risk_type + + @risk_type.setter + def risk_type(self, risk_type): + """Sets the risk_type of this P2pSendChatMessageResult. + + Risk control display type. 1: off-platform traffic diversion risk; returned only when risk control is hit # noqa: E501 + + :param risk_type: The risk_type of this P2pSendChatMessageResult. # noqa: E501 + :type: int + """ + allowed_values = [1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and risk_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `risk_type` ({0}), must be one of {1}" # noqa: E501 + .format(risk_type, allowed_values) + ) + + self._risk_type = risk_type + + @property + def toast_msg(self): + """Gets the toast_msg of this P2pSendChatMessageResult. # noqa: E501 + + Risk control prompt message; returned only when risk_type=1 # noqa: E501 + + :return: The toast_msg of this P2pSendChatMessageResult. # noqa: E501 + :rtype: str + """ + return self._toast_msg + + @toast_msg.setter + def toast_msg(self, toast_msg): + """Sets the toast_msg of this P2pSendChatMessageResult. + + Risk control prompt message; returned only when risk_type=1 # noqa: E501 + + :param toast_msg: The toast_msg of this P2pSendChatMessageResult. # noqa: E501 + :type: str + """ + + self._toast_msg = toast_msg + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pSendChatMessageResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pSendChatMessageResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_transaction_action_response.py b/gate_api/models/p2p_transaction_action_response.py new file mode 100644 index 00000000..ef545166 --- /dev/null +++ b/gate_api/models/p2p_transaction_action_response.py @@ -0,0 +1,263 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pTransactionActionResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'object', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, object, str, Configuration) -> None + """P2pTransactionActionResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pTransactionActionResponse. # noqa: E501 + + Response timestamp. # noqa: E501 + + :return: The timestamp of this P2pTransactionActionResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pTransactionActionResponse. + + Response timestamp. # noqa: E501 + + :param timestamp: The timestamp of this P2pTransactionActionResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pTransactionActionResponse. # noqa: E501 + + Placeholder for request method. # noqa: E501 + + :return: The method of this P2pTransactionActionResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pTransactionActionResponse. + + Placeholder for request method. # noqa: E501 + + :param method: The method of this P2pTransactionActionResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pTransactionActionResponse. # noqa: E501 + + Response code, 0 means success # noqa: E501 + + :return: The code of this P2pTransactionActionResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pTransactionActionResponse. + + Response code, 0 means success # noqa: E501 + + :param code: The code of this P2pTransactionActionResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pTransactionActionResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this P2pTransactionActionResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pTransactionActionResponse. + + Response message # noqa: E501 + + :param message: The message of this P2pTransactionActionResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pTransactionActionResponse. # noqa: E501 + + Empty object on success. # noqa: E501 + + :return: The data of this P2pTransactionActionResponse. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pTransactionActionResponse. + + Empty object on success. # noqa: E501 + + :param data: The data of this P2pTransactionActionResponse. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pTransactionActionResponse. # noqa: E501 + + API version. # noqa: E501 + + :return: The version of this P2pTransactionActionResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pTransactionActionResponse. + + API version. # noqa: E501 + + :param version: The version of this P2pTransactionActionResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pTransactionActionResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pTransactionActionResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_transaction_convert_info.py b/gate_api/models/p2p_transaction_convert_info.py new file mode 100644 index 00000000..1c4a95fd --- /dev/null +++ b/gate_api/models/p2p_transaction_convert_info.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pTransactionConvertInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'convert_type': 'str', + 'convert_status': 'str', + 'pre_rate': 'str', + 'rate': 'str', + 'pre_fiat_rate': 'str', + 'fiat_rate': 'str', + 'amount': 'str', + 'convert_amount': 'str', + 'slippage': 'str', + 'status': 'str' + } + + attribute_map = { + 'convert_type': 'convert_type', + 'convert_status': 'convert_status', + 'pre_rate': 'pre_rate', + 'rate': 'rate', + 'pre_fiat_rate': 'pre_fiat_rate', + 'fiat_rate': 'fiat_rate', + 'amount': 'amount', + 'convert_amount': 'convert_amount', + 'slippage': 'slippage', + 'status': 'status' + } + + def __init__(self, convert_type=None, convert_status=None, pre_rate=None, rate=None, pre_fiat_rate=None, fiat_rate=None, amount=None, convert_amount=None, slippage=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """P2pTransactionConvertInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._convert_type = None + self._convert_status = None + self._pre_rate = None + self._rate = None + self._pre_fiat_rate = None + self._fiat_rate = None + self._amount = None + self._convert_amount = None + self._slippage = None + self._status = None + self.discriminator = None + + if convert_type is not None: + self.convert_type = convert_type + if convert_status is not None: + self.convert_status = convert_status + if pre_rate is not None: + self.pre_rate = pre_rate + if rate is not None: + self.rate = rate + if pre_fiat_rate is not None: + self.pre_fiat_rate = pre_fiat_rate + if fiat_rate is not None: + self.fiat_rate = fiat_rate + if amount is not None: + self.amount = amount + if convert_amount is not None: + self.convert_amount = convert_amount + if slippage is not None: + self.slippage = slippage + if status is not None: + self.status = status + + @property + def convert_type(self): + """Gets the convert_type of this P2pTransactionConvertInfo. # noqa: E501 + + Flash swap target currency # noqa: E501 + + :return: The convert_type of this P2pTransactionConvertInfo. # noqa: E501 + :rtype: str + """ + return self._convert_type + + @convert_type.setter + def convert_type(self, convert_type): + """Sets the convert_type of this P2pTransactionConvertInfo. + + Flash swap target currency # noqa: E501 + + :param convert_type: The convert_type of this P2pTransactionConvertInfo. # noqa: E501 + :type: str + """ + + self._convert_type = convert_type + + @property + def convert_status(self): + """Gets the convert_status of this P2pTransactionConvertInfo. # noqa: E501 + + Flash swap order status # noqa: E501 + + :return: The convert_status of this P2pTransactionConvertInfo. # noqa: E501 + :rtype: str + """ + return self._convert_status + + @convert_status.setter + def convert_status(self, convert_status): + """Sets the convert_status of this P2pTransactionConvertInfo. + + Flash swap order status # noqa: E501 + + :param convert_status: The convert_status of this P2pTransactionConvertInfo. # noqa: E501 + :type: str + """ + + self._convert_status = convert_status + + @property + def pre_rate(self): + """Gets the pre_rate of this P2pTransactionConvertInfo. # noqa: E501 + + Expected price when placing order # noqa: E501 + + :return: The pre_rate of this P2pTransactionConvertInfo. # noqa: E501 + :rtype: str + """ + return self._pre_rate + + @pre_rate.setter + def pre_rate(self, pre_rate): + """Sets the pre_rate of this P2pTransactionConvertInfo. + + Expected price when placing order # noqa: E501 + + :param pre_rate: The pre_rate of this P2pTransactionConvertInfo. # noqa: E501 + :type: str + """ + + self._pre_rate = pre_rate + + @property + def rate(self): + """Gets the rate of this P2pTransactionConvertInfo. # noqa: E501 + + Execution price # noqa: E501 + + :return: The rate of this P2pTransactionConvertInfo. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this P2pTransactionConvertInfo. + + Execution price # noqa: E501 + + :param rate: The rate of this P2pTransactionConvertInfo. # noqa: E501 + :type: str + """ + + self._rate = rate + + @property + def pre_fiat_rate(self): + """Gets the pre_fiat_rate of this P2pTransactionConvertInfo. # noqa: E501 + + Expected fiat price when placing order # noqa: E501 + + :return: The pre_fiat_rate of this P2pTransactionConvertInfo. # noqa: E501 + :rtype: str + """ + return self._pre_fiat_rate + + @pre_fiat_rate.setter + def pre_fiat_rate(self, pre_fiat_rate): + """Sets the pre_fiat_rate of this P2pTransactionConvertInfo. + + Expected fiat price when placing order # noqa: E501 + + :param pre_fiat_rate: The pre_fiat_rate of this P2pTransactionConvertInfo. # noqa: E501 + :type: str + """ + + self._pre_fiat_rate = pre_fiat_rate + + @property + def fiat_rate(self): + """Gets the fiat_rate of this P2pTransactionConvertInfo. # noqa: E501 + + Fiat price at execution # noqa: E501 + + :return: The fiat_rate of this P2pTransactionConvertInfo. # noqa: E501 + :rtype: str + """ + return self._fiat_rate + + @fiat_rate.setter + def fiat_rate(self, fiat_rate): + """Sets the fiat_rate of this P2pTransactionConvertInfo. + + Fiat price at execution # noqa: E501 + + :param fiat_rate: The fiat_rate of this P2pTransactionConvertInfo. # noqa: E501 + :type: str + """ + + self._fiat_rate = fiat_rate + + @property + def amount(self): + """Gets the amount of this P2pTransactionConvertInfo. # noqa: E501 + + Size # noqa: E501 + + :return: The amount of this P2pTransactionConvertInfo. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this P2pTransactionConvertInfo. + + Size # noqa: E501 + + :param amount: The amount of this P2pTransactionConvertInfo. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def convert_amount(self): + """Gets the convert_amount of this P2pTransactionConvertInfo. # noqa: E501 + + Swap Amount # noqa: E501 + + :return: The convert_amount of this P2pTransactionConvertInfo. # noqa: E501 + :rtype: str + """ + return self._convert_amount + + @convert_amount.setter + def convert_amount(self, convert_amount): + """Sets the convert_amount of this P2pTransactionConvertInfo. + + Swap Amount # noqa: E501 + + :param convert_amount: The convert_amount of this P2pTransactionConvertInfo. # noqa: E501 + :type: str + """ + + self._convert_amount = convert_amount + + @property + def slippage(self): + """Gets the slippage of this P2pTransactionConvertInfo. # noqa: E501 + + Slippage calculation: slippage = (expected price when placing order - real-time price during auto swap) / expected price when placing order # noqa: E501 + + :return: The slippage of this P2pTransactionConvertInfo. # noqa: E501 + :rtype: str + """ + return self._slippage + + @slippage.setter + def slippage(self, slippage): + """Sets the slippage of this P2pTransactionConvertInfo. + + Slippage calculation: slippage = (expected price when placing order - real-time price during auto swap) / expected price when placing order # noqa: E501 + + :param slippage: The slippage of this P2pTransactionConvertInfo. # noqa: E501 + :type: str + """ + + self._slippage = slippage + + @property + def status(self): + """Gets the status of this P2pTransactionConvertInfo. # noqa: E501 + + Flash swap order display status # noqa: E501 + + :return: The status of this P2pTransactionConvertInfo. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this P2pTransactionConvertInfo. + + Flash swap order display status # noqa: E501 + + :param status: The status of this P2pTransactionConvertInfo. # noqa: E501 + :type: str + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pTransactionConvertInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pTransactionConvertInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_transaction_detail.py b/gate_api/models/p2p_transaction_detail.py new file mode 100644 index 00000000..17f879e7 --- /dev/null +++ b/gate_api/models/p2p_transaction_detail.py @@ -0,0 +1,1439 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pTransactionDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'is_sell': 'int', + 'txid': 'int', + 'orderid': 'int', + 'timest': 'int', + 'last_pay_time': 'int', + 'remain_pay_time': 'int', + 'currency_type': 'str', + 'want_type': 'str', + 'symbol': 'str', + 'rate': 'str', + 'amount': 'str', + 'total': 'str', + 'status': 'str', + 'reason_id': 'str', + 'reason_desc': 'str', + 'cancel_time': 'str', + 'in_appeal': 'int', + 'dispute_time': 'int', + 'cancelable': 'int', + 'hide_payment': 'int', + 'trade_tips': 'str', + 'show_bank': 'str', + 'bankname': 'str', + 'bankbranch': 'str', + 'bankid': 'str', + 'bank_holder_realname': 'str', + 'show_ali': 'str', + 'aliname': 'str', + 'is_alicode': 'int', + 'show_wechat': 'str', + 'wename': 'str', + 'show_others': 'str', + 'pay_others': 'list[P2pTransactionDetailPayOthers]', + 'sel_paytype': 'str', + 'its_uid': 'str', + 'its_nickname': 'str', + 'its_realname': 'str', + 'have_traded': 'int', + 'appeal_allow_cancel': 'int', + 'appeal_verdict_has_open': 'str', + 'im_unread': 'int', + 'payment_voucher_url': 'list[str]', + 'timest_paid': 'int', + 'own_realname': 'str', + 'order_type': 'int', + 'is_show_receive': 'int', + 'show_seller_contact_info': 'bool', + 'supported_pay_types': 'list[str]' + } + + attribute_map = { + 'is_sell': 'is_sell', + 'txid': 'txid', + 'orderid': 'orderid', + 'timest': 'timest', + 'last_pay_time': 'last_pay_time', + 'remain_pay_time': 'remain_pay_time', + 'currency_type': 'currency_type', + 'want_type': 'want_type', + 'symbol': 'symbol', + 'rate': 'rate', + 'amount': 'amount', + 'total': 'total', + 'status': 'status', + 'reason_id': 'reason_id', + 'reason_desc': 'reason_desc', + 'cancel_time': 'cancel_time', + 'in_appeal': 'in_appeal', + 'dispute_time': 'dispute_time', + 'cancelable': 'cancelable', + 'hide_payment': 'hide_payment', + 'trade_tips': 'trade_tips', + 'show_bank': 'show_bank', + 'bankname': 'bankname', + 'bankbranch': 'bankbranch', + 'bankid': 'bankid', + 'bank_holder_realname': 'bank_holder_realname', + 'show_ali': 'show_ali', + 'aliname': 'aliname', + 'is_alicode': 'is_alicode', + 'show_wechat': 'show_wechat', + 'wename': 'wename', + 'show_others': 'show_others', + 'pay_others': 'pay_others', + 'sel_paytype': 'sel_paytype', + 'its_uid': 'its_uid', + 'its_nickname': 'its_nickname', + 'its_realname': 'its_realname', + 'have_traded': 'have_traded', + 'appeal_allow_cancel': 'appeal_allow_cancel', + 'appeal_verdict_has_open': 'appeal_verdict_has_open', + 'im_unread': 'im_unread', + 'payment_voucher_url': 'payment_voucher_url', + 'timest_paid': 'timest_paid', + 'own_realname': 'own_realname', + 'order_type': 'order_type', + 'is_show_receive': 'is_show_receive', + 'show_seller_contact_info': 'show_seller_contact_info', + 'supported_pay_types': 'supported_pay_types' + } + + def __init__(self, is_sell=None, txid=None, orderid=None, timest=None, last_pay_time=None, remain_pay_time=None, currency_type=None, want_type=None, symbol=None, rate=None, amount=None, total=None, status=None, reason_id=None, reason_desc=None, cancel_time=None, in_appeal=None, dispute_time=None, cancelable=None, hide_payment=None, trade_tips=None, show_bank=None, bankname=None, bankbranch=None, bankid=None, bank_holder_realname=None, show_ali=None, aliname=None, is_alicode=None, show_wechat=None, wename=None, show_others=None, pay_others=None, sel_paytype=None, its_uid=None, its_nickname=None, its_realname=None, have_traded=None, appeal_allow_cancel=None, appeal_verdict_has_open=None, im_unread=None, payment_voucher_url=None, timest_paid=None, own_realname=None, order_type=None, is_show_receive=None, show_seller_contact_info=None, supported_pay_types=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, int, int, int, str, str, str, str, str, str, str, str, str, str, int, int, int, int, str, str, str, str, str, str, str, str, int, str, str, str, list[P2pTransactionDetailPayOthers], str, str, str, str, int, int, str, int, list[str], int, str, int, int, bool, list[str], Configuration) -> None + """P2pTransactionDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._is_sell = None + self._txid = None + self._orderid = None + self._timest = None + self._last_pay_time = None + self._remain_pay_time = None + self._currency_type = None + self._want_type = None + self._symbol = None + self._rate = None + self._amount = None + self._total = None + self._status = None + self._reason_id = None + self._reason_desc = None + self._cancel_time = None + self._in_appeal = None + self._dispute_time = None + self._cancelable = None + self._hide_payment = None + self._trade_tips = None + self._show_bank = None + self._bankname = None + self._bankbranch = None + self._bankid = None + self._bank_holder_realname = None + self._show_ali = None + self._aliname = None + self._is_alicode = None + self._show_wechat = None + self._wename = None + self._show_others = None + self._pay_others = None + self._sel_paytype = None + self._its_uid = None + self._its_nickname = None + self._its_realname = None + self._have_traded = None + self._appeal_allow_cancel = None + self._appeal_verdict_has_open = None + self._im_unread = None + self._payment_voucher_url = None + self._timest_paid = None + self._own_realname = None + self._order_type = None + self._is_show_receive = None + self._show_seller_contact_info = None + self._supported_pay_types = None + self.discriminator = None + + if is_sell is not None: + self.is_sell = is_sell + if txid is not None: + self.txid = txid + if orderid is not None: + self.orderid = orderid + if timest is not None: + self.timest = timest + if last_pay_time is not None: + self.last_pay_time = last_pay_time + if remain_pay_time is not None: + self.remain_pay_time = remain_pay_time + if currency_type is not None: + self.currency_type = currency_type + if want_type is not None: + self.want_type = want_type + if symbol is not None: + self.symbol = symbol + if rate is not None: + self.rate = rate + if amount is not None: + self.amount = amount + if total is not None: + self.total = total + if status is not None: + self.status = status + if reason_id is not None: + self.reason_id = reason_id + if reason_desc is not None: + self.reason_desc = reason_desc + if cancel_time is not None: + self.cancel_time = cancel_time + if in_appeal is not None: + self.in_appeal = in_appeal + if dispute_time is not None: + self.dispute_time = dispute_time + if cancelable is not None: + self.cancelable = cancelable + if hide_payment is not None: + self.hide_payment = hide_payment + if trade_tips is not None: + self.trade_tips = trade_tips + if show_bank is not None: + self.show_bank = show_bank + if bankname is not None: + self.bankname = bankname + if bankbranch is not None: + self.bankbranch = bankbranch + if bankid is not None: + self.bankid = bankid + if bank_holder_realname is not None: + self.bank_holder_realname = bank_holder_realname + if show_ali is not None: + self.show_ali = show_ali + if aliname is not None: + self.aliname = aliname + if is_alicode is not None: + self.is_alicode = is_alicode + if show_wechat is not None: + self.show_wechat = show_wechat + if wename is not None: + self.wename = wename + if show_others is not None: + self.show_others = show_others + if pay_others is not None: + self.pay_others = pay_others + if sel_paytype is not None: + self.sel_paytype = sel_paytype + if its_uid is not None: + self.its_uid = its_uid + if its_nickname is not None: + self.its_nickname = its_nickname + if its_realname is not None: + self.its_realname = its_realname + if have_traded is not None: + self.have_traded = have_traded + if appeal_allow_cancel is not None: + self.appeal_allow_cancel = appeal_allow_cancel + if appeal_verdict_has_open is not None: + self.appeal_verdict_has_open = appeal_verdict_has_open + if im_unread is not None: + self.im_unread = im_unread + if payment_voucher_url is not None: + self.payment_voucher_url = payment_voucher_url + if timest_paid is not None: + self.timest_paid = timest_paid + if own_realname is not None: + self.own_realname = own_realname + if order_type is not None: + self.order_type = order_type + if is_show_receive is not None: + self.is_show_receive = is_show_receive + if show_seller_contact_info is not None: + self.show_seller_contact_info = show_seller_contact_info + if supported_pay_types is not None: + self.supported_pay_types = supported_pay_types + + @property + def is_sell(self): + """Gets the is_sell of this P2pTransactionDetail. # noqa: E501 + + Whether the current user is the seller. `1`: yes; `0`: no. # noqa: E501 + + :return: The is_sell of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._is_sell + + @is_sell.setter + def is_sell(self, is_sell): + """Sets the is_sell of this P2pTransactionDetail. + + Whether the current user is the seller. `1`: yes; `0`: no. # noqa: E501 + + :param is_sell: The is_sell of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._is_sell = is_sell + + @property + def txid(self): + """Gets the txid of this P2pTransactionDetail. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this P2pTransactionDetail. + + Order ID # noqa: E501 + + :param txid: The txid of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._txid = txid + + @property + def orderid(self): + """Gets the orderid of this P2pTransactionDetail. # noqa: E501 + + Order ID # noqa: E501 + + :return: The orderid of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._orderid + + @orderid.setter + def orderid(self, orderid): + """Sets the orderid of this P2pTransactionDetail. + + Order ID # noqa: E501 + + :param orderid: The orderid of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._orderid = orderid + + @property + def timest(self): + """Gets the timest of this P2pTransactionDetail. # noqa: E501 + + Order creation timestamp # noqa: E501 + + :return: The timest of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._timest + + @timest.setter + def timest(self, timest): + """Sets the timest of this P2pTransactionDetail. + + Order creation timestamp # noqa: E501 + + :param timest: The timest of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._timest = timest + + @property + def last_pay_time(self): + """Gets the last_pay_time of this P2pTransactionDetail. # noqa: E501 + + Payment deadline # noqa: E501 + + :return: The last_pay_time of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._last_pay_time + + @last_pay_time.setter + def last_pay_time(self, last_pay_time): + """Sets the last_pay_time of this P2pTransactionDetail. + + Payment deadline # noqa: E501 + + :param last_pay_time: The last_pay_time of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._last_pay_time = last_pay_time + + @property + def remain_pay_time(self): + """Gets the remain_pay_time of this P2pTransactionDetail. # noqa: E501 + + Seconds left to pay; `<= 0` means overdue. # noqa: E501 + + :return: The remain_pay_time of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._remain_pay_time + + @remain_pay_time.setter + def remain_pay_time(self, remain_pay_time): + """Sets the remain_pay_time of this P2pTransactionDetail. + + Seconds left to pay; `<= 0` means overdue. # noqa: E501 + + :param remain_pay_time: The remain_pay_time of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._remain_pay_time = remain_pay_time + + @property + def currency_type(self): + """Gets the currency_type of this P2pTransactionDetail. # noqa: E501 + + Cryptocurrency symbol. # noqa: E501 + + :return: The currency_type of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._currency_type + + @currency_type.setter + def currency_type(self, currency_type): + """Sets the currency_type of this P2pTransactionDetail. + + Cryptocurrency symbol. # noqa: E501 + + :param currency_type: The currency_type of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._currency_type = currency_type + + @property + def want_type(self): + """Gets the want_type of this P2pTransactionDetail. # noqa: E501 + + Fiat currency # noqa: E501 + + :return: The want_type of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._want_type + + @want_type.setter + def want_type(self, want_type): + """Sets the want_type of this P2pTransactionDetail. + + Fiat currency # noqa: E501 + + :param want_type: The want_type of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._want_type = want_type + + @property + def symbol(self): + """Gets the symbol of this P2pTransactionDetail. # noqa: E501 + + Fiat currency symbol # noqa: E501 + + :return: The symbol of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this P2pTransactionDetail. + + Fiat currency symbol # noqa: E501 + + :param symbol: The symbol of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def rate(self): + """Gets the rate of this P2pTransactionDetail. # noqa: E501 + + Order price in `want_type` units. # noqa: E501 + + :return: The rate of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this P2pTransactionDetail. + + Order price in `want_type` units. # noqa: E501 + + :param rate: The rate of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._rate = rate + + @property + def amount(self): + """Gets the amount of this P2pTransactionDetail. # noqa: E501 + + Order size in cryptocurrency. # noqa: E501 + + :return: The amount of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this P2pTransactionDetail. + + Order size in cryptocurrency. # noqa: E501 + + :param amount: The amount of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def total(self): + """Gets the total of this P2pTransactionDetail. # noqa: E501 + + Total fiat amount of the order. # noqa: E501 + + :return: The total of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this P2pTransactionDetail. + + Total fiat amount of the order. # noqa: E501 + + :param total: The total of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._total = total + + @property + def status(self): + """Gets the status of this P2pTransactionDetail. # noqa: E501 + + Display status: `unpay` unpaid; `hide_payment` unpaid with payment info hidden; `paid` buyer paid; `unconfirmed` awaiting seller confirmation; `locked` locked; `finished` done; `cancel` canceled; `expired` expired; `bclosed` arbitration filled; `sclosed` arbitration canceled. # noqa: E501 + + :return: The status of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this P2pTransactionDetail. + + Display status: `unpay` unpaid; `hide_payment` unpaid with payment info hidden; `paid` buyer paid; `unconfirmed` awaiting seller confirmation; `locked` locked; `finished` done; `cancel` canceled; `expired` expired; `bclosed` arbitration filled; `sclosed` arbitration canceled. # noqa: E501 + + :param status: The status of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def reason_id(self): + """Gets the reason_id of this P2pTransactionDetail. # noqa: E501 + + Cancel reason ID; empty string means none. Examples: `1` no longer want to buy; `2` cannot reach seller; `3` will not pay; `4` seller did not provide a real account; `6` price/amount mismatch; `9` other; `10` seller cannot release and refund issued; `11` terms not met; `12` seller payout account risk-controlled. # noqa: E501 + + :return: The reason_id of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._reason_id + + @reason_id.setter + def reason_id(self, reason_id): + """Sets the reason_id of this P2pTransactionDetail. + + Cancel reason ID; empty string means none. Examples: `1` no longer want to buy; `2` cannot reach seller; `3` will not pay; `4` seller did not provide a real account; `6` price/amount mismatch; `9` other; `10` seller cannot release and refund issued; `11` terms not met; `12` seller payout account risk-controlled. # noqa: E501 + + :param reason_id: The reason_id of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._reason_id = reason_id + + @property + def reason_desc(self): + """Gets the reason_desc of this P2pTransactionDetail. # noqa: E501 + + Cancel reason description. # noqa: E501 + + :return: The reason_desc of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._reason_desc + + @reason_desc.setter + def reason_desc(self, reason_desc): + """Sets the reason_desc of this P2pTransactionDetail. + + Cancel reason description. # noqa: E501 + + :param reason_desc: The reason_desc of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._reason_desc = reason_desc + + @property + def cancel_time(self): + """Gets the cancel_time of this P2pTransactionDetail. # noqa: E501 + + Cancellation time # noqa: E501 + + :return: The cancel_time of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._cancel_time + + @cancel_time.setter + def cancel_time(self, cancel_time): + """Sets the cancel_time of this P2pTransactionDetail. + + Cancellation time # noqa: E501 + + :param cancel_time: The cancel_time of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._cancel_time = cancel_time + + @property + def in_appeal(self): + """Gets the in_appeal of this P2pTransactionDetail. # noqa: E501 + + Whether a dispute is active. `1`: yes; `0`: no. # noqa: E501 + + :return: The in_appeal of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._in_appeal + + @in_appeal.setter + def in_appeal(self, in_appeal): + """Sets the in_appeal of this P2pTransactionDetail. + + Whether a dispute is active. `1`: yes; `0`: no. # noqa: E501 + + :param in_appeal: The in_appeal of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._in_appeal = in_appeal + + @property + def dispute_time(self): + """Gets the dispute_time of this P2pTransactionDetail. # noqa: E501 + + Earliest timestamp when a dispute may be opened. # noqa: E501 + + :return: The dispute_time of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._dispute_time + + @dispute_time.setter + def dispute_time(self, dispute_time): + """Sets the dispute_time of this P2pTransactionDetail. + + Earliest timestamp when a dispute may be opened. # noqa: E501 + + :param dispute_time: The dispute_time of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._dispute_time = dispute_time + + @property + def cancelable(self): + """Gets the cancelable of this P2pTransactionDetail. # noqa: E501 + + Whether cancellation is allowed. `1`: yes; `0`: no. # noqa: E501 + + :return: The cancelable of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._cancelable + + @cancelable.setter + def cancelable(self, cancelable): + """Sets the cancelable of this P2pTransactionDetail. + + Whether cancellation is allowed. `1`: yes; `0`: no. # noqa: E501 + + :param cancelable: The cancelable of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._cancelable = cancelable + + @property + def hide_payment(self): + """Gets the hide_payment of this P2pTransactionDetail. # noqa: E501 + + Whether payment methods are hidden. `1`: hidden; `0`: visible. # noqa: E501 + + :return: The hide_payment of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._hide_payment + + @hide_payment.setter + def hide_payment(self, hide_payment): + """Sets the hide_payment of this P2pTransactionDetail. + + Whether payment methods are hidden. `1`: hidden; `0`: visible. # noqa: E501 + + :param hide_payment: The hide_payment of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._hide_payment = hide_payment + + @property + def trade_tips(self): + """Gets the trade_tips of this P2pTransactionDetail. # noqa: E501 + + Trading terms # noqa: E501 + + :return: The trade_tips of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._trade_tips + + @trade_tips.setter + def trade_tips(self, trade_tips): + """Sets the trade_tips of this P2pTransactionDetail. + + Trading terms # noqa: E501 + + :param trade_tips: The trade_tips of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._trade_tips = trade_tips + + @property + def show_bank(self): + """Gets the show_bank of this P2pTransactionDetail. # noqa: E501 + + Whether to show bank transfer details. `1`: show; `0`: hide. # noqa: E501 + + :return: The show_bank of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._show_bank + + @show_bank.setter + def show_bank(self, show_bank): + """Sets the show_bank of this P2pTransactionDetail. + + Whether to show bank transfer details. `1`: show; `0`: hide. # noqa: E501 + + :param show_bank: The show_bank of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._show_bank = show_bank + + @property + def bankname(self): + """Gets the bankname of this P2pTransactionDetail. # noqa: E501 + + Bank name # noqa: E501 + + :return: The bankname of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._bankname + + @bankname.setter + def bankname(self, bankname): + """Sets the bankname of this P2pTransactionDetail. + + Bank name # noqa: E501 + + :param bankname: The bankname of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._bankname = bankname + + @property + def bankbranch(self): + """Gets the bankbranch of this P2pTransactionDetail. # noqa: E501 + + Bank branch name # noqa: E501 + + :return: The bankbranch of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._bankbranch + + @bankbranch.setter + def bankbranch(self, bankbranch): + """Sets the bankbranch of this P2pTransactionDetail. + + Bank branch name # noqa: E501 + + :param bankbranch: The bankbranch of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._bankbranch = bankbranch + + @property + def bankid(self): + """Gets the bankid of this P2pTransactionDetail. # noqa: E501 + + Bank account or masked account. # noqa: E501 + + :return: The bankid of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._bankid + + @bankid.setter + def bankid(self, bankid): + """Sets the bankid of this P2pTransactionDetail. + + Bank account or masked account. # noqa: E501 + + :param bankid: The bankid of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._bankid = bankid + + @property + def bank_holder_realname(self): + """Gets the bank_holder_realname of this P2pTransactionDetail. # noqa: E501 + + Bank cardholder name # noqa: E501 + + :return: The bank_holder_realname of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._bank_holder_realname + + @bank_holder_realname.setter + def bank_holder_realname(self, bank_holder_realname): + """Sets the bank_holder_realname of this P2pTransactionDetail. + + Bank cardholder name # noqa: E501 + + :param bank_holder_realname: The bank_holder_realname of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._bank_holder_realname = bank_holder_realname + + @property + def show_ali(self): + """Gets the show_ali of this P2pTransactionDetail. # noqa: E501 + + Whether to show Alipay details. `1`: show; `0`: hide. # noqa: E501 + + :return: The show_ali of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._show_ali + + @show_ali.setter + def show_ali(self, show_ali): + """Sets the show_ali of this P2pTransactionDetail. + + Whether to show Alipay details. `1`: show; `0`: hide. # noqa: E501 + + :param show_ali: The show_ali of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._show_ali = show_ali + + @property + def aliname(self): + """Gets the aliname of this P2pTransactionDetail. # noqa: E501 + + Alipay account name # noqa: E501 + + :return: The aliname of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._aliname + + @aliname.setter + def aliname(self, aliname): + """Sets the aliname of this P2pTransactionDetail. + + Alipay account name # noqa: E501 + + :param aliname: The aliname of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._aliname = aliname + + @property + def is_alicode(self): + """Gets the is_alicode of this P2pTransactionDetail. # noqa: E501 + + Whether an Alipay QR exists. `1`: yes; `0`: no. # noqa: E501 + + :return: The is_alicode of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._is_alicode + + @is_alicode.setter + def is_alicode(self, is_alicode): + """Sets the is_alicode of this P2pTransactionDetail. + + Whether an Alipay QR exists. `1`: yes; `0`: no. # noqa: E501 + + :param is_alicode: The is_alicode of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._is_alicode = is_alicode + + @property + def show_wechat(self): + """Gets the show_wechat of this P2pTransactionDetail. # noqa: E501 + + Whether to show WeChat details. `1`: show; `0`: hide. # noqa: E501 + + :return: The show_wechat of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._show_wechat + + @show_wechat.setter + def show_wechat(self, show_wechat): + """Sets the show_wechat of this P2pTransactionDetail. + + Whether to show WeChat details. `1`: show; `0`: hide. # noqa: E501 + + :param show_wechat: The show_wechat of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._show_wechat = show_wechat + + @property + def wename(self): + """Gets the wename of this P2pTransactionDetail. # noqa: E501 + + WeChat account name # noqa: E501 + + :return: The wename of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._wename + + @wename.setter + def wename(self, wename): + """Sets the wename of this P2pTransactionDetail. + + WeChat account name # noqa: E501 + + :param wename: The wename of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._wename = wename + + @property + def show_others(self): + """Gets the show_others of this P2pTransactionDetail. # noqa: E501 + + Whether to show other payment methods. `1`: show; `0`: hide. # noqa: E501 + + :return: The show_others of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._show_others + + @show_others.setter + def show_others(self, show_others): + """Sets the show_others of this P2pTransactionDetail. + + Whether to show other payment methods. `1`: show; `0`: hide. # noqa: E501 + + :param show_others: The show_others of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._show_others = show_others + + @property + def pay_others(self): + """Gets the pay_others of this P2pTransactionDetail. # noqa: E501 + + Other payment methods # noqa: E501 + + :return: The pay_others of this P2pTransactionDetail. # noqa: E501 + :rtype: list[P2pTransactionDetailPayOthers] + """ + return self._pay_others + + @pay_others.setter + def pay_others(self, pay_others): + """Sets the pay_others of this P2pTransactionDetail. + + Other payment methods # noqa: E501 + + :param pay_others: The pay_others of this P2pTransactionDetail. # noqa: E501 + :type: list[P2pTransactionDetailPayOthers] + """ + + self._pay_others = pay_others + + @property + def sel_paytype(self): + """Gets the sel_paytype of this P2pTransactionDetail. # noqa: E501 + + Selected payment type for this order, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. # noqa: E501 + + :return: The sel_paytype of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._sel_paytype + + @sel_paytype.setter + def sel_paytype(self, sel_paytype): + """Sets the sel_paytype of this P2pTransactionDetail. + + Selected payment type for this order, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. # noqa: E501 + + :param sel_paytype: The sel_paytype of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._sel_paytype = sel_paytype + + @property + def its_uid(self): + """Gets the its_uid of this P2pTransactionDetail. # noqa: E501 + + Counterparty crypto UID. # noqa: E501 + + :return: The its_uid of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._its_uid + + @its_uid.setter + def its_uid(self, its_uid): + """Sets the its_uid of this P2pTransactionDetail. + + Counterparty crypto UID. # noqa: E501 + + :param its_uid: The its_uid of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._its_uid = its_uid + + @property + def its_nickname(self): + """Gets the its_nickname of this P2pTransactionDetail. # noqa: E501 + + Counterparty nickname # noqa: E501 + + :return: The its_nickname of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._its_nickname + + @its_nickname.setter + def its_nickname(self, its_nickname): + """Sets the its_nickname of this P2pTransactionDetail. + + Counterparty nickname # noqa: E501 + + :param its_nickname: The its_nickname of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._its_nickname = its_nickname + + @property + def its_realname(self): + """Gets the its_realname of this P2pTransactionDetail. # noqa: E501 + + Counterparty real name or verified display name. # noqa: E501 + + :return: The its_realname of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._its_realname + + @its_realname.setter + def its_realname(self, its_realname): + """Sets the its_realname of this P2pTransactionDetail. + + Counterparty real name or verified display name. # noqa: E501 + + :param its_realname: The its_realname of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._its_realname = its_realname + + @property + def have_traded(self): + """Gets the have_traded of this P2pTransactionDetail. # noqa: E501 + + Whether you traded with the counterparty before. `1`: yes; `0`: no. # noqa: E501 + + :return: The have_traded of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._have_traded + + @have_traded.setter + def have_traded(self, have_traded): + """Sets the have_traded of this P2pTransactionDetail. + + Whether you traded with the counterparty before. `1`: yes; `0`: no. # noqa: E501 + + :param have_traded: The have_traded of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._have_traded = have_traded + + @property + def appeal_allow_cancel(self): + """Gets the appeal_allow_cancel of this P2pTransactionDetail. # noqa: E501 + + Whether the dispute can be withdrawn. `1`: allowed; `0`: not allowed. # noqa: E501 + + :return: The appeal_allow_cancel of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._appeal_allow_cancel + + @appeal_allow_cancel.setter + def appeal_allow_cancel(self, appeal_allow_cancel): + """Sets the appeal_allow_cancel of this P2pTransactionDetail. + + Whether the dispute can be withdrawn. `1`: allowed; `0`: not allowed. # noqa: E501 + + :param appeal_allow_cancel: The appeal_allow_cancel of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._appeal_allow_cancel = appeal_allow_cancel + + @property + def appeal_verdict_has_open(self): + """Gets the appeal_verdict_has_open of this P2pTransactionDetail. # noqa: E501 + + Dispute outcome or in-dispute notice text. # noqa: E501 + + :return: The appeal_verdict_has_open of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._appeal_verdict_has_open + + @appeal_verdict_has_open.setter + def appeal_verdict_has_open(self, appeal_verdict_has_open): + """Sets the appeal_verdict_has_open of this P2pTransactionDetail. + + Dispute outcome or in-dispute notice text. # noqa: E501 + + :param appeal_verdict_has_open: The appeal_verdict_has_open of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._appeal_verdict_has_open = appeal_verdict_has_open + + @property + def im_unread(self): + """Gets the im_unread of this P2pTransactionDetail. # noqa: E501 + + Unread chat message count. # noqa: E501 + + :return: The im_unread of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._im_unread + + @im_unread.setter + def im_unread(self, im_unread): + """Sets the im_unread of this P2pTransactionDetail. + + Unread chat message count. # noqa: E501 + + :param im_unread: The im_unread of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._im_unread = im_unread + + @property + def payment_voucher_url(self): + """Gets the payment_voucher_url of this P2pTransactionDetail. # noqa: E501 + + Payment voucher # noqa: E501 + + :return: The payment_voucher_url of this P2pTransactionDetail. # noqa: E501 + :rtype: list[str] + """ + return self._payment_voucher_url + + @payment_voucher_url.setter + def payment_voucher_url(self, payment_voucher_url): + """Sets the payment_voucher_url of this P2pTransactionDetail. + + Payment voucher # noqa: E501 + + :param payment_voucher_url: The payment_voucher_url of this P2pTransactionDetail. # noqa: E501 + :type: list[str] + """ + + self._payment_voucher_url = payment_voucher_url + + @property + def timest_paid(self): + """Gets the timest_paid of this P2pTransactionDetail. # noqa: E501 + + Timestamp when the buyer confirmed payment. # noqa: E501 + + :return: The timest_paid of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._timest_paid + + @timest_paid.setter + def timest_paid(self, timest_paid): + """Sets the timest_paid of this P2pTransactionDetail. + + Timestamp when the buyer confirmed payment. # noqa: E501 + + :param timest_paid: The timest_paid of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._timest_paid = timest_paid + + @property + def own_realname(self): + """Gets the own_realname of this P2pTransactionDetail. # noqa: E501 + + Current user's real name or verified display name. # noqa: E501 + + :return: The own_realname of this P2pTransactionDetail. # noqa: E501 + :rtype: str + """ + return self._own_realname + + @own_realname.setter + def own_realname(self, own_realname): + """Sets the own_realname of this P2pTransactionDetail. + + Current user's real name or verified display name. # noqa: E501 + + :param own_realname: The own_realname of this P2pTransactionDetail. # noqa: E501 + :type: str + """ + + self._own_realname = own_realname + + @property + def order_type(self): + """Gets the order_type of this P2pTransactionDetail. # noqa: E501 + + Order type: `1` standard; `2` partner; `3` flash swap; `4` Web3. # noqa: E501 + + :return: The order_type of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._order_type + + @order_type.setter + def order_type(self, order_type): + """Sets the order_type of this P2pTransactionDetail. + + Order type: `1` standard; `2` partner; `3` flash swap; `4` Web3. # noqa: E501 + + :param order_type: The order_type of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._order_type = order_type + + @property + def is_show_receive(self): + """Gets the is_show_receive of this P2pTransactionDetail. # noqa: E501 + + Whether to show confirm-receipt during dispute. `1`: show; `0`: hide. # noqa: E501 + + :return: The is_show_receive of this P2pTransactionDetail. # noqa: E501 + :rtype: int + """ + return self._is_show_receive + + @is_show_receive.setter + def is_show_receive(self, is_show_receive): + """Sets the is_show_receive of this P2pTransactionDetail. + + Whether to show confirm-receipt during dispute. `1`: show; `0`: hide. # noqa: E501 + + :param is_show_receive: The is_show_receive of this P2pTransactionDetail. # noqa: E501 + :type: int + """ + + self._is_show_receive = is_show_receive + + @property + def show_seller_contact_info(self): + """Gets the show_seller_contact_info of this P2pTransactionDetail. # noqa: E501 + + Whether to display seller contact information # noqa: E501 + + :return: The show_seller_contact_info of this P2pTransactionDetail. # noqa: E501 + :rtype: bool + """ + return self._show_seller_contact_info + + @show_seller_contact_info.setter + def show_seller_contact_info(self, show_seller_contact_info): + """Sets the show_seller_contact_info of this P2pTransactionDetail. + + Whether to display seller contact information # noqa: E501 + + :param show_seller_contact_info: The show_seller_contact_info of this P2pTransactionDetail. # noqa: E501 + :type: bool + """ + + self._show_seller_contact_info = show_seller_contact_info + + @property + def supported_pay_types(self): + """Gets the supported_pay_types of this P2pTransactionDetail. # noqa: E501 + + Supported payment method types for the order, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. # noqa: E501 + + :return: The supported_pay_types of this P2pTransactionDetail. # noqa: E501 + :rtype: list[str] + """ + return self._supported_pay_types + + @supported_pay_types.setter + def supported_pay_types(self, supported_pay_types): + """Sets the supported_pay_types of this P2pTransactionDetail. + + Supported payment method types for the order, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. # noqa: E501 + + :param supported_pay_types: The supported_pay_types of this P2pTransactionDetail. # noqa: E501 + :type: list[str] + """ + + self._supported_pay_types = supported_pay_types + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pTransactionDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pTransactionDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_transaction_detail_pay_others.py b/gate_api/models/p2p_transaction_detail_pay_others.py new file mode 100644 index 00000000..2f2cf280 --- /dev/null +++ b/gate_api/models/p2p_transaction_detail_pay_others.py @@ -0,0 +1,291 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pTransactionDetailPayOthers(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'account_des': 'str', + 'pay_type': 'str', + 'account': 'str', + 'memo': 'str', + 'trade_tips': 'str', + 'pay_name': 'str' + } + + attribute_map = { + 'id': 'id', + 'account_des': 'account_des', + 'pay_type': 'pay_type', + 'account': 'account', + 'memo': 'memo', + 'trade_tips': 'trade_tips', + 'pay_name': 'pay_name' + } + + def __init__(self, id=None, account_des=None, pay_type=None, account=None, memo=None, trade_tips=None, pay_name=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, Configuration) -> None + """P2pTransactionDetailPayOthers - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._account_des = None + self._pay_type = None + self._account = None + self._memo = None + self._trade_tips = None + self._pay_name = None + self.discriminator = None + + if id is not None: + self.id = id + if account_des is not None: + self.account_des = account_des + if pay_type is not None: + self.pay_type = pay_type + if account is not None: + self.account = account + if memo is not None: + self.memo = memo + if trade_tips is not None: + self.trade_tips = trade_tips + if pay_name is not None: + self.pay_name = pay_name + + @property + def id(self): + """Gets the id of this P2pTransactionDetailPayOthers. # noqa: E501 + + Payment method record ID. # noqa: E501 + + :return: The id of this P2pTransactionDetailPayOthers. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this P2pTransactionDetailPayOthers. + + Payment method record ID. # noqa: E501 + + :param id: The id of this P2pTransactionDetailPayOthers. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def account_des(self): + """Gets the account_des of this P2pTransactionDetailPayOthers. # noqa: E501 + + Payment method description # noqa: E501 + + :return: The account_des of this P2pTransactionDetailPayOthers. # noqa: E501 + :rtype: str + """ + return self._account_des + + @account_des.setter + def account_des(self, account_des): + """Sets the account_des of this P2pTransactionDetailPayOthers. + + Payment method description # noqa: E501 + + :param account_des: The account_des of this P2pTransactionDetailPayOthers. # noqa: E501 + :type: str + """ + + self._account_des = account_des + + @property + def pay_type(self): + """Gets the pay_type of this P2pTransactionDetailPayOthers. # noqa: E501 + + Payment method type # noqa: E501 + + :return: The pay_type of this P2pTransactionDetailPayOthers. # noqa: E501 + :rtype: str + """ + return self._pay_type + + @pay_type.setter + def pay_type(self, pay_type): + """Sets the pay_type of this P2pTransactionDetailPayOthers. + + Payment method type # noqa: E501 + + :param pay_type: The pay_type of this P2pTransactionDetailPayOthers. # noqa: E501 + :type: str + """ + + self._pay_type = pay_type + + @property + def account(self): + """Gets the account of this P2pTransactionDetailPayOthers. # noqa: E501 + + Payment account or masked account. # noqa: E501 + + :return: The account of this P2pTransactionDetailPayOthers. # noqa: E501 + :rtype: str + """ + return self._account + + @account.setter + def account(self, account): + """Sets the account of this P2pTransactionDetailPayOthers. + + Payment account or masked account. # noqa: E501 + + :param account: The account of this P2pTransactionDetailPayOthers. # noqa: E501 + :type: str + """ + + self._account = account + + @property + def memo(self): + """Gets the memo of this P2pTransactionDetailPayOthers. # noqa: E501 + + Payment note or memo. # noqa: E501 + + :return: The memo of this P2pTransactionDetailPayOthers. # noqa: E501 + :rtype: str + """ + return self._memo + + @memo.setter + def memo(self, memo): + """Sets the memo of this P2pTransactionDetailPayOthers. + + Payment note or memo. # noqa: E501 + + :param memo: The memo of this P2pTransactionDetailPayOthers. # noqa: E501 + :type: str + """ + + self._memo = memo + + @property + def trade_tips(self): + """Gets the trade_tips of this P2pTransactionDetailPayOthers. # noqa: E501 + + Payment instructions or tips. # noqa: E501 + + :return: The trade_tips of this P2pTransactionDetailPayOthers. # noqa: E501 + :rtype: str + """ + return self._trade_tips + + @trade_tips.setter + def trade_tips(self, trade_tips): + """Sets the trade_tips of this P2pTransactionDetailPayOthers. + + Payment instructions or tips. # noqa: E501 + + :param trade_tips: The trade_tips of this P2pTransactionDetailPayOthers. # noqa: E501 + :type: str + """ + + self._trade_tips = trade_tips + + @property + def pay_name(self): + """Gets the pay_name of this P2pTransactionDetailPayOthers. # noqa: E501 + + Display name of the payment method. # noqa: E501 + + :return: The pay_name of this P2pTransactionDetailPayOthers. # noqa: E501 + :rtype: str + """ + return self._pay_name + + @pay_name.setter + def pay_name(self, pay_name): + """Sets the pay_name of this P2pTransactionDetailPayOthers. + + Display name of the payment method. # noqa: E501 + + :param pay_name: The pay_name of this P2pTransactionDetailPayOthers. # noqa: E501 + :type: str + """ + + self._pay_name = pay_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pTransactionDetailPayOthers): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pTransactionDetailPayOthers): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_transaction_detail_response.py b/gate_api/models/p2p_transaction_detail_response.py new file mode 100644 index 00000000..a300d3ec --- /dev/null +++ b/gate_api/models/p2p_transaction_detail_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pTransactionDetailResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pTransactionDetail', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pTransactionDetail, str, Configuration) -> None + """P2pTransactionDetailResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pTransactionDetailResponse. # noqa: E501 + + + :return: The timestamp of this P2pTransactionDetailResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pTransactionDetailResponse. + + + :param timestamp: The timestamp of this P2pTransactionDetailResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pTransactionDetailResponse. # noqa: E501 + + + :return: The method of this P2pTransactionDetailResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pTransactionDetailResponse. + + + :param method: The method of this P2pTransactionDetailResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pTransactionDetailResponse. # noqa: E501 + + + :return: The code of this P2pTransactionDetailResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pTransactionDetailResponse. + + + :param code: The code of this P2pTransactionDetailResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pTransactionDetailResponse. # noqa: E501 + + + :return: The message of this P2pTransactionDetailResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pTransactionDetailResponse. + + + :param message: The message of this P2pTransactionDetailResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pTransactionDetailResponse. # noqa: E501 + + + :return: The data of this P2pTransactionDetailResponse. # noqa: E501 + :rtype: P2pTransactionDetail + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pTransactionDetailResponse. + + + :param data: The data of this P2pTransactionDetailResponse. # noqa: E501 + :type: P2pTransactionDetail + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pTransactionDetailResponse. # noqa: E501 + + + :return: The version of this P2pTransactionDetailResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pTransactionDetailResponse. + + + :param version: The version of this P2pTransactionDetailResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pTransactionDetailResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pTransactionDetailResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_transaction_list_item.py b/gate_api/models/p2p_transaction_list_item.py new file mode 100644 index 00000000..0c5e5255 --- /dev/null +++ b/gate_api/models/p2p_transaction_list_item.py @@ -0,0 +1,765 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pTransactionListItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'type_buy': 'int', + 'timest': 'str', + 'timest_expire': 'str', + 'timestamp': 'int', + 'rate': 'str', + 'amount': 'str', + 'total': 'str', + 'txid': 'int', + 'status': 'str', + 'its_realname': 'str', + 'its_uid': 'str', + 'its_nick': 'str', + 'seller_realname': 'str', + 'buyer_realname': 'str', + 'cancelable': 'int', + 'currency_type': 'str', + 'want_type': 'str', + 'hide_payment': 'int', + 'sel_paytype': 'str', + 'pay_others': 'list[P2pTransactionListResultPayOthers]', + 'cd_time': 'int', + 'order_type': 'int', + 'order_tag': 'list[str]', + 'convert_info': 'P2pTransactionConvertInfo' + } + + attribute_map = { + 'type_buy': 'type_buy', + 'timest': 'timest', + 'timest_expire': 'timest_expire', + 'timestamp': 'timestamp', + 'rate': 'rate', + 'amount': 'amount', + 'total': 'total', + 'txid': 'txid', + 'status': 'status', + 'its_realname': 'its_realname', + 'its_uid': 'its_uid', + 'its_nick': 'its_nick', + 'seller_realname': 'seller_realname', + 'buyer_realname': 'buyer_realname', + 'cancelable': 'cancelable', + 'currency_type': 'currency_type', + 'want_type': 'want_type', + 'hide_payment': 'hide_payment', + 'sel_paytype': 'sel_paytype', + 'pay_others': 'pay_others', + 'cd_time': 'cd_time', + 'order_type': 'order_type', + 'order_tag': 'order_tag', + 'convert_info': 'convert_info' + } + + def __init__(self, type_buy=None, timest=None, timest_expire=None, timestamp=None, rate=None, amount=None, total=None, txid=None, status=None, its_realname=None, its_uid=None, its_nick=None, seller_realname=None, buyer_realname=None, cancelable=None, currency_type=None, want_type=None, hide_payment=None, sel_paytype=None, pay_others=None, cd_time=None, order_type=None, order_tag=None, convert_info=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, int, str, str, str, int, str, str, str, str, str, str, int, str, str, int, str, list[P2pTransactionListResultPayOthers], int, int, list[str], P2pTransactionConvertInfo, Configuration) -> None + """P2pTransactionListItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._type_buy = None + self._timest = None + self._timest_expire = None + self._timestamp = None + self._rate = None + self._amount = None + self._total = None + self._txid = None + self._status = None + self._its_realname = None + self._its_uid = None + self._its_nick = None + self._seller_realname = None + self._buyer_realname = None + self._cancelable = None + self._currency_type = None + self._want_type = None + self._hide_payment = None + self._sel_paytype = None + self._pay_others = None + self._cd_time = None + self._order_type = None + self._order_tag = None + self._convert_info = None + self.discriminator = None + + if type_buy is not None: + self.type_buy = type_buy + if timest is not None: + self.timest = timest + if timest_expire is not None: + self.timest_expire = timest_expire + if timestamp is not None: + self.timestamp = timestamp + if rate is not None: + self.rate = rate + if amount is not None: + self.amount = amount + if total is not None: + self.total = total + if txid is not None: + self.txid = txid + if status is not None: + self.status = status + if its_realname is not None: + self.its_realname = its_realname + if its_uid is not None: + self.its_uid = its_uid + if its_nick is not None: + self.its_nick = its_nick + if seller_realname is not None: + self.seller_realname = seller_realname + if buyer_realname is not None: + self.buyer_realname = buyer_realname + if cancelable is not None: + self.cancelable = cancelable + if currency_type is not None: + self.currency_type = currency_type + if want_type is not None: + self.want_type = want_type + if hide_payment is not None: + self.hide_payment = hide_payment + if sel_paytype is not None: + self.sel_paytype = sel_paytype + if pay_others is not None: + self.pay_others = pay_others + if cd_time is not None: + self.cd_time = cd_time + if order_type is not None: + self.order_type = order_type + if order_tag is not None: + self.order_tag = order_tag + if convert_info is not None: + self.convert_info = convert_info + + @property + def type_buy(self): + """Gets the type_buy of this P2pTransactionListItem. # noqa: E501 + + Order side from current user's view. `1`: buy; `0`: sell. # noqa: E501 + + :return: The type_buy of this P2pTransactionListItem. # noqa: E501 + :rtype: int + """ + return self._type_buy + + @type_buy.setter + def type_buy(self, type_buy): + """Sets the type_buy of this P2pTransactionListItem. + + Order side from current user's view. `1`: buy; `0`: sell. # noqa: E501 + + :param type_buy: The type_buy of this P2pTransactionListItem. # noqa: E501 + :type: int + """ + + self._type_buy = type_buy + + @property + def timest(self): + """Gets the timest of this P2pTransactionListItem. # noqa: E501 + + Creation time of order # noqa: E501 + + :return: The timest of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._timest + + @timest.setter + def timest(self, timest): + """Sets the timest of this P2pTransactionListItem. + + Creation time of order # noqa: E501 + + :param timest: The timest of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._timest = timest + + @property + def timest_expire(self): + """Gets the timest_expire of this P2pTransactionListItem. # noqa: E501 + + Order expiration time # noqa: E501 + + :return: The timest_expire of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._timest_expire + + @timest_expire.setter + def timest_expire(self, timest_expire): + """Sets the timest_expire of this P2pTransactionListItem. + + Order expiration time # noqa: E501 + + :param timest_expire: The timest_expire of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._timest_expire = timest_expire + + @property + def timestamp(self): + """Gets the timestamp of this P2pTransactionListItem. # noqa: E501 + + Order creation timestamp # noqa: E501 + + :return: The timestamp of this P2pTransactionListItem. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pTransactionListItem. + + Order creation timestamp # noqa: E501 + + :param timestamp: The timestamp of this P2pTransactionListItem. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def rate(self): + """Gets the rate of this P2pTransactionListItem. # noqa: E501 + + Order price in fiat currency. # noqa: E501 + + :return: The rate of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._rate + + @rate.setter + def rate(self, rate): + """Sets the rate of this P2pTransactionListItem. + + Order price in fiat currency. # noqa: E501 + + :param rate: The rate of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._rate = rate + + @property + def amount(self): + """Gets the amount of this P2pTransactionListItem. # noqa: E501 + + Order size in cryptocurrency. # noqa: E501 + + :return: The amount of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this P2pTransactionListItem. + + Order size in cryptocurrency. # noqa: E501 + + :param amount: The amount of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def total(self): + """Gets the total of this P2pTransactionListItem. # noqa: E501 + + Total fiat amount of the order. # noqa: E501 + + :return: The total of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this P2pTransactionListItem. + + Total fiat amount of the order. # noqa: E501 + + :param total: The total of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._total = total + + @property + def txid(self): + """Gets the txid of this P2pTransactionListItem. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this P2pTransactionListItem. # noqa: E501 + :rtype: int + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this P2pTransactionListItem. + + Order ID # noqa: E501 + + :param txid: The txid of this P2pTransactionListItem. # noqa: E501 + :type: int + """ + + self._txid = txid + + @property + def status(self): + """Gets the status of this P2pTransactionListItem. # noqa: E501 + + Display status: `unpay` awaiting payment; `paid` buyer paid; `unconfirmed` awaiting seller confirmation; `locked` locked; `finished` completed; `cancel` canceled; `expired` expired; `bclosed` arbitration filled; `sclosed` arbitration canceled. # noqa: E501 + + :return: The status of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this P2pTransactionListItem. + + Display status: `unpay` awaiting payment; `paid` buyer paid; `unconfirmed` awaiting seller confirmation; `locked` locked; `finished` completed; `cancel` canceled; `expired` expired; `bclosed` arbitration filled; `sclosed` arbitration canceled. # noqa: E501 + + :param status: The status of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def its_realname(self): + """Gets the its_realname of this P2pTransactionListItem. # noqa: E501 + + Counterparty real name or verified display name. # noqa: E501 + + :return: The its_realname of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._its_realname + + @its_realname.setter + def its_realname(self, its_realname): + """Sets the its_realname of this P2pTransactionListItem. + + Counterparty real name or verified display name. # noqa: E501 + + :param its_realname: The its_realname of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._its_realname = its_realname + + @property + def its_uid(self): + """Gets the its_uid of this P2pTransactionListItem. # noqa: E501 + + Counterparty crypto UID. # noqa: E501 + + :return: The its_uid of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._its_uid + + @its_uid.setter + def its_uid(self, its_uid): + """Sets the its_uid of this P2pTransactionListItem. + + Counterparty crypto UID. # noqa: E501 + + :param its_uid: The its_uid of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._its_uid = its_uid + + @property + def its_nick(self): + """Gets the its_nick of this P2pTransactionListItem. # noqa: E501 + + Counterparty nickname # noqa: E501 + + :return: The its_nick of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._its_nick + + @its_nick.setter + def its_nick(self, its_nick): + """Sets the its_nick of this P2pTransactionListItem. + + Counterparty nickname # noqa: E501 + + :param its_nick: The its_nick of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._its_nick = its_nick + + @property + def seller_realname(self): + """Gets the seller_realname of this P2pTransactionListItem. # noqa: E501 + + Seller real name or verified display name. # noqa: E501 + + :return: The seller_realname of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._seller_realname + + @seller_realname.setter + def seller_realname(self, seller_realname): + """Sets the seller_realname of this P2pTransactionListItem. + + Seller real name or verified display name. # noqa: E501 + + :param seller_realname: The seller_realname of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._seller_realname = seller_realname + + @property + def buyer_realname(self): + """Gets the buyer_realname of this P2pTransactionListItem. # noqa: E501 + + Buyer real name or verified display name. # noqa: E501 + + :return: The buyer_realname of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._buyer_realname + + @buyer_realname.setter + def buyer_realname(self, buyer_realname): + """Sets the buyer_realname of this P2pTransactionListItem. + + Buyer real name or verified display name. # noqa: E501 + + :param buyer_realname: The buyer_realname of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._buyer_realname = buyer_realname + + @property + def cancelable(self): + """Gets the cancelable of this P2pTransactionListItem. # noqa: E501 + + Whether the order can be canceled. `1`: yes; `0`: no. # noqa: E501 + + :return: The cancelable of this P2pTransactionListItem. # noqa: E501 + :rtype: int + """ + return self._cancelable + + @cancelable.setter + def cancelable(self, cancelable): + """Sets the cancelable of this P2pTransactionListItem. + + Whether the order can be canceled. `1`: yes; `0`: no. # noqa: E501 + + :param cancelable: The cancelable of this P2pTransactionListItem. # noqa: E501 + :type: int + """ + + self._cancelable = cancelable + + @property + def currency_type(self): + """Gets the currency_type of this P2pTransactionListItem. # noqa: E501 + + Cryptocurrency symbol. # noqa: E501 + + :return: The currency_type of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._currency_type + + @currency_type.setter + def currency_type(self, currency_type): + """Sets the currency_type of this P2pTransactionListItem. + + Cryptocurrency symbol. # noqa: E501 + + :param currency_type: The currency_type of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._currency_type = currency_type + + @property + def want_type(self): + """Gets the want_type of this P2pTransactionListItem. # noqa: E501 + + Fiat currency # noqa: E501 + + :return: The want_type of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._want_type + + @want_type.setter + def want_type(self, want_type): + """Sets the want_type of this P2pTransactionListItem. + + Fiat currency # noqa: E501 + + :param want_type: The want_type of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._want_type = want_type + + @property + def hide_payment(self): + """Gets the hide_payment of this P2pTransactionListItem. # noqa: E501 + + Whether payment methods are hidden. `1`: hidden; `0`: visible. # noqa: E501 + + :return: The hide_payment of this P2pTransactionListItem. # noqa: E501 + :rtype: int + """ + return self._hide_payment + + @hide_payment.setter + def hide_payment(self, hide_payment): + """Sets the hide_payment of this P2pTransactionListItem. + + Whether payment methods are hidden. `1`: hidden; `0`: visible. # noqa: E501 + + :param hide_payment: The hide_payment of this P2pTransactionListItem. # noqa: E501 + :type: int + """ + + self._hide_payment = hide_payment + + @property + def sel_paytype(self): + """Gets the sel_paytype of this P2pTransactionListItem. # noqa: E501 + + Selected payment type for this order, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. # noqa: E501 + + :return: The sel_paytype of this P2pTransactionListItem. # noqa: E501 + :rtype: str + """ + return self._sel_paytype + + @sel_paytype.setter + def sel_paytype(self, sel_paytype): + """Sets the sel_paytype of this P2pTransactionListItem. + + Selected payment type for this order, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. # noqa: E501 + + :param sel_paytype: The sel_paytype of this P2pTransactionListItem. # noqa: E501 + :type: str + """ + + self._sel_paytype = sel_paytype + + @property + def pay_others(self): + """Gets the pay_others of this P2pTransactionListItem. # noqa: E501 + + Other payment method details; may appear on historical orders. # noqa: E501 + + :return: The pay_others of this P2pTransactionListItem. # noqa: E501 + :rtype: list[P2pTransactionListResultPayOthers] + """ + return self._pay_others + + @pay_others.setter + def pay_others(self, pay_others): + """Sets the pay_others of this P2pTransactionListItem. + + Other payment method details; may appear on historical orders. # noqa: E501 + + :param pay_others: The pay_others of this P2pTransactionListItem. # noqa: E501 + :type: list[P2pTransactionListResultPayOthers] + """ + + self._pay_others = pay_others + + @property + def cd_time(self): + """Gets the cd_time of this P2pTransactionListItem. # noqa: E501 + + Countdown seconds for the current order. # noqa: E501 + + :return: The cd_time of this P2pTransactionListItem. # noqa: E501 + :rtype: int + """ + return self._cd_time + + @cd_time.setter + def cd_time(self, cd_time): + """Sets the cd_time of this P2pTransactionListItem. + + Countdown seconds for the current order. # noqa: E501 + + :param cd_time: The cd_time of this P2pTransactionListItem. # noqa: E501 + :type: int + """ + + self._cd_time = cd_time + + @property + def order_type(self): + """Gets the order_type of this P2pTransactionListItem. # noqa: E501 + + Order type: `1` standard; `2` partner; `3` flash swap; `4` Web3. # noqa: E501 + + :return: The order_type of this P2pTransactionListItem. # noqa: E501 + :rtype: int + """ + return self._order_type + + @order_type.setter + def order_type(self, order_type): + """Sets the order_type of this P2pTransactionListItem. + + Order type: `1` standard; `2` partner; `3` flash swap; `4` Web3. # noqa: E501 + + :param order_type: The order_type of this P2pTransactionListItem. # noqa: E501 + :type: int + """ + + self._order_type = order_type + + @property + def order_tag(self): + """Gets the order_tag of this P2pTransactionListItem. # noqa: E501 + + Order tags # noqa: E501 + + :return: The order_tag of this P2pTransactionListItem. # noqa: E501 + :rtype: list[str] + """ + return self._order_tag + + @order_tag.setter + def order_tag(self, order_tag): + """Sets the order_tag of this P2pTransactionListItem. + + Order tags # noqa: E501 + + :param order_tag: The order_tag of this P2pTransactionListItem. # noqa: E501 + :type: list[str] + """ + + self._order_tag = order_tag + + @property + def convert_info(self): + """Gets the convert_info of this P2pTransactionListItem. # noqa: E501 + + + :return: The convert_info of this P2pTransactionListItem. # noqa: E501 + :rtype: P2pTransactionConvertInfo + """ + return self._convert_info + + @convert_info.setter + def convert_info(self, convert_info): + """Sets the convert_info of this P2pTransactionListItem. + + + :param convert_info: The convert_info of this P2pTransactionListItem. # noqa: E501 + :type: P2pTransactionConvertInfo + """ + + self._convert_info = convert_info + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pTransactionListItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pTransactionListItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_transaction_list_response.py b/gate_api/models/p2p_transaction_list_response.py new file mode 100644 index 00000000..cc72d7e5 --- /dev/null +++ b/gate_api/models/p2p_transaction_list_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pTransactionListResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pTransactionListResult', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pTransactionListResult, str, Configuration) -> None + """P2pTransactionListResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pTransactionListResponse. # noqa: E501 + + + :return: The timestamp of this P2pTransactionListResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pTransactionListResponse. + + + :param timestamp: The timestamp of this P2pTransactionListResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pTransactionListResponse. # noqa: E501 + + + :return: The method of this P2pTransactionListResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pTransactionListResponse. + + + :param method: The method of this P2pTransactionListResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pTransactionListResponse. # noqa: E501 + + + :return: The code of this P2pTransactionListResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pTransactionListResponse. + + + :param code: The code of this P2pTransactionListResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pTransactionListResponse. # noqa: E501 + + + :return: The message of this P2pTransactionListResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pTransactionListResponse. + + + :param message: The message of this P2pTransactionListResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pTransactionListResponse. # noqa: E501 + + + :return: The data of this P2pTransactionListResponse. # noqa: E501 + :rtype: P2pTransactionListResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pTransactionListResponse. + + + :param data: The data of this P2pTransactionListResponse. # noqa: E501 + :type: P2pTransactionListResult + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pTransactionListResponse. # noqa: E501 + + + :return: The version of this P2pTransactionListResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pTransactionListResponse. + + + :param version: The version of this P2pTransactionListResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pTransactionListResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pTransactionListResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_transaction_list_result.py b/gate_api/models/p2p_transaction_list_result.py new file mode 100644 index 00000000..30aa50a4 --- /dev/null +++ b/gate_api/models/p2p_transaction_list_result.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pTransactionListResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[P2pTransactionListItem]', + 'trans_time': 'list[P2pTransactionTimeMarker]', + 'count': 'int', + 'exported_num': 'int' + } + + attribute_map = { + 'list': 'list', + 'trans_time': 'trans_time', + 'count': 'count', + 'exported_num': 'exported_num' + } + + def __init__(self, list=None, trans_time=None, count=None, exported_num=None, local_vars_configuration=None): # noqa: E501 + # type: (list[P2pTransactionListItem], list[P2pTransactionTimeMarker], int, int, Configuration) -> None + """P2pTransactionListResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self._trans_time = None + self._count = None + self._exported_num = None + self.discriminator = None + + if list is not None: + self.list = list + if trans_time is not None: + self.trans_time = trans_time + if count is not None: + self.count = count + if exported_num is not None: + self.exported_num = exported_num + + @property + def list(self): + """Gets the list of this P2pTransactionListResult. # noqa: E501 + + + :return: The list of this P2pTransactionListResult. # noqa: E501 + :rtype: list[P2pTransactionListItem] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this P2pTransactionListResult. + + + :param list: The list of this P2pTransactionListResult. # noqa: E501 + :type: list[P2pTransactionListItem] + """ + + self._list = list + + @property + def trans_time(self): + """Gets the trans_time of this P2pTransactionListResult. # noqa: E501 + + Countdown time # noqa: E501 + + :return: The trans_time of this P2pTransactionListResult. # noqa: E501 + :rtype: list[P2pTransactionTimeMarker] + """ + return self._trans_time + + @trans_time.setter + def trans_time(self, trans_time): + """Sets the trans_time of this P2pTransactionListResult. + + Countdown time # noqa: E501 + + :param trans_time: The trans_time of this P2pTransactionListResult. # noqa: E501 + :type: list[P2pTransactionTimeMarker] + """ + + self._trans_time = trans_time + + @property + def count(self): + """Gets the count of this P2pTransactionListResult. # noqa: E501 + + Number of orders # noqa: E501 + + :return: The count of this P2pTransactionListResult. # noqa: E501 + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this P2pTransactionListResult. + + Number of orders # noqa: E501 + + :param count: The count of this P2pTransactionListResult. # noqa: E501 + :type: int + """ + + self._count = count + + @property + def exported_num(self): + """Gets the exported_num of this P2pTransactionListResult. # noqa: E501 + + Export count # noqa: E501 + + :return: The exported_num of this P2pTransactionListResult. # noqa: E501 + :rtype: int + """ + return self._exported_num + + @exported_num.setter + def exported_num(self, exported_num): + """Sets the exported_num of this P2pTransactionListResult. + + Export count # noqa: E501 + + :param exported_num: The exported_num of this P2pTransactionListResult. # noqa: E501 + :type: int + """ + + self._exported_num = exported_num + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pTransactionListResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pTransactionListResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_transaction_list_result_pay_others.py b/gate_api/models/p2p_transaction_list_result_pay_others.py new file mode 100644 index 00000000..b45f3900 --- /dev/null +++ b/gate_api/models/p2p_transaction_list_result_pay_others.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pTransactionListResultPayOthers(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'pay_type': 'str', + 'pay_name': 'str' + } + + attribute_map = { + 'pay_type': 'pay_type', + 'pay_name': 'pay_name' + } + + def __init__(self, pay_type=None, pay_name=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """P2pTransactionListResultPayOthers - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._pay_type = None + self._pay_name = None + self.discriminator = None + + if pay_type is not None: + self.pay_type = pay_type + if pay_name is not None: + self.pay_name = pay_name + + @property + def pay_type(self): + """Gets the pay_type of this P2pTransactionListResultPayOthers. # noqa: E501 + + Payment method type # noqa: E501 + + :return: The pay_type of this P2pTransactionListResultPayOthers. # noqa: E501 + :rtype: str + """ + return self._pay_type + + @pay_type.setter + def pay_type(self, pay_type): + """Sets the pay_type of this P2pTransactionListResultPayOthers. + + Payment method type # noqa: E501 + + :param pay_type: The pay_type of this P2pTransactionListResultPayOthers. # noqa: E501 + :type: str + """ + + self._pay_type = pay_type + + @property + def pay_name(self): + """Gets the pay_name of this P2pTransactionListResultPayOthers. # noqa: E501 + + Payment method name # noqa: E501 + + :return: The pay_name of this P2pTransactionListResultPayOthers. # noqa: E501 + :rtype: str + """ + return self._pay_name + + @pay_name.setter + def pay_name(self, pay_name): + """Sets the pay_name of this P2pTransactionListResultPayOthers. + + Payment method name # noqa: E501 + + :param pay_name: The pay_name of this P2pTransactionListResultPayOthers. # noqa: E501 + :type: str + """ + + self._pay_name = pay_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pTransactionListResultPayOthers): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pTransactionListResultPayOthers): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_transaction_time_marker.py b/gate_api/models/p2p_transaction_time_marker.py new file mode 100644 index 00000000..d2c76a64 --- /dev/null +++ b/gate_api/models/p2p_transaction_time_marker.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pTransactionTimeMarker(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'od_time': 'int' + } + + attribute_map = { + 'od_time': 'od_time' + } + + def __init__(self, od_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """P2pTransactionTimeMarker - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._od_time = None + self.discriminator = None + + if od_time is not None: + self.od_time = od_time + + @property + def od_time(self): + """Gets the od_time of this P2pTransactionTimeMarker. # noqa: E501 + + + :return: The od_time of this P2pTransactionTimeMarker. # noqa: E501 + :rtype: int + """ + return self._od_time + + @od_time.setter + def od_time(self, od_time): + """Sets the od_time of this P2pTransactionTimeMarker. + + + :param od_time: The od_time of this P2pTransactionTimeMarker. # noqa: E501 + :type: int + """ + + self._od_time = od_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pTransactionTimeMarker): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pTransactionTimeMarker): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/p2p_upload_chat_file_response.py b/gate_api/models/p2p_upload_chat_file_response.py new file mode 100644 index 00000000..cf53231b --- /dev/null +++ b/gate_api/models/p2p_upload_chat_file_response.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class P2pUploadChatFileResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'float', + 'method': 'str', + 'code': 'int', + 'message': 'str', + 'data': 'P2pUploadChatFileResult', + 'version': 'str' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'method': 'method', + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'version': 'version' + } + + def __init__(self, timestamp=None, method=None, code=None, message=None, data=None, version=None, local_vars_configuration=None): # noqa: E501 + # type: (float, str, int, str, P2pUploadChatFileResult, str, Configuration) -> None + """P2pUploadChatFileResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._method = None + self._code = None + self._message = None + self._data = None + self._version = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if method is not None: + self.method = method + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if version is not None: + self.version = version + + @property + def timestamp(self): + """Gets the timestamp of this P2pUploadChatFileResponse. # noqa: E501 + + + :return: The timestamp of this P2pUploadChatFileResponse. # noqa: E501 + :rtype: float + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this P2pUploadChatFileResponse. + + + :param timestamp: The timestamp of this P2pUploadChatFileResponse. # noqa: E501 + :type: float + """ + + self._timestamp = timestamp + + @property + def method(self): + """Gets the method of this P2pUploadChatFileResponse. # noqa: E501 + + + :return: The method of this P2pUploadChatFileResponse. # noqa: E501 + :rtype: str + """ + return self._method + + @method.setter + def method(self, method): + """Sets the method of this P2pUploadChatFileResponse. + + + :param method: The method of this P2pUploadChatFileResponse. # noqa: E501 + :type: str + """ + + self._method = method + + @property + def code(self): + """Gets the code of this P2pUploadChatFileResponse. # noqa: E501 + + + :return: The code of this P2pUploadChatFileResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this P2pUploadChatFileResponse. + + + :param code: The code of this P2pUploadChatFileResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this P2pUploadChatFileResponse. # noqa: E501 + + + :return: The message of this P2pUploadChatFileResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this P2pUploadChatFileResponse. + + + :param message: The message of this P2pUploadChatFileResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this P2pUploadChatFileResponse. # noqa: E501 + + + :return: The data of this P2pUploadChatFileResponse. # noqa: E501 + :rtype: P2pUploadChatFileResult + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this P2pUploadChatFileResponse. + + + :param data: The data of this P2pUploadChatFileResponse. # noqa: E501 + :type: P2pUploadChatFileResult + """ + + self._data = data + + @property + def version(self): + """Gets the version of this P2pUploadChatFileResponse. # noqa: E501 + + + :return: The version of this P2pUploadChatFileResponse. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this P2pUploadChatFileResponse. + + + :param version: The version of this P2pUploadChatFileResponse. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, P2pUploadChatFileResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, P2pUploadChatFileResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/find_coin.py b/gate_api/models/p2p_upload_chat_file_result.py similarity index 73% rename from gate_api/models/find_coin.py rename to gate_api/models/p2p_upload_chat_file_result.py index a73037a2..3046fb43 100644 --- a/gate_api/models/find_coin.py +++ b/gate_api/models/p2p_upload_chat_file_result.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class FindCoin(object): +class P2pUploadChatFileResult(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -33,48 +33,48 @@ class FindCoin(object): and the value is json key in definition. """ openapi_types = { - 'cointype': 'str' + 'file_key': 'str' } attribute_map = { - 'cointype': 'cointype' + 'file_key': 'file_key' } - def __init__(self, cointype=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, file_key=None, local_vars_configuration=None): # noqa: E501 # type: (str, Configuration) -> None - """FindCoin - a model defined in OpenAPI""" # noqa: E501 + """P2pUploadChatFileResult - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration - self._cointype = None + self._file_key = None self.discriminator = None - if cointype is not None: - self.cointype = cointype + if file_key is not None: + self.file_key = file_key @property - def cointype(self): - """Gets the cointype of this FindCoin. # noqa: E501 + def file_key(self): + """Gets the file_key of this P2pUploadChatFileResult. # noqa: E501 - Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. # noqa: E501 + File key # noqa: E501 - :return: The cointype of this FindCoin. # noqa: E501 + :return: The file_key of this P2pUploadChatFileResult. # noqa: E501 :rtype: str """ - return self._cointype + return self._file_key - @cointype.setter - def cointype(self, cointype): - """Sets the cointype of this FindCoin. + @file_key.setter + def file_key(self, file_key): + """Sets the file_key of this P2pUploadChatFileResult. - Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. # noqa: E501 + File key # noqa: E501 - :param cointype: The cointype of this FindCoin. # noqa: E501 + :param file_key: The file_key of this P2pUploadChatFileResult. # noqa: E501 :type: str """ - self._cointype = cointype + self._file_key = file_key def to_dict(self): """Returns the model properties as a dict""" @@ -110,14 +110,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, FindCoin): + if not isinstance(other, P2pUploadChatFileResult): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, FindCoin): + if not isinstance(other, P2pUploadChatFileResult): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/partner_application.py b/gate_api/models/partner_application.py new file mode 100644 index 00000000..b5d7651a --- /dev/null +++ b/gate_api/models/partner_application.py @@ -0,0 +1,989 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PartnerApplication(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'uid': 'int', + 'language': 'str', + 'country_id': 'int', + 'firstname': 'str', + 'lastname': 'str', + 'email': 'str', + 'join_uid': 'int', + 'join_country_id': 'int', + 'identity_comment': 'str', + 'promotion_channels': 'str', + 'contact_details': 'str', + 'know_details': 'str', + 'question_lang': 'str', + 'create_timest': 'datetime', + 'update_timest': 'datetime', + 'apply_type': 'int', + 'audit_status': 'int', + 'edit_counts': 'int', + 'proof_images': 'str', + 'proof_videos': 'str', + 'proof_url': 'str', + 'audit_reason': 'int', + 'channel_type': 'int', + 'region': 'str', + 'phone': 'str', + 'telegram': 'str', + 'other_contact': 'OtherContact', + 'proof_images_url_list': 'list[str]', + 'proof_videos_url_list': 'list[str]', + 'apply_msg': 'str', + 'jump_url': 'str' + } + + attribute_map = { + 'id': 'id', + 'uid': 'uid', + 'language': 'language', + 'country_id': 'country_id', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'email': 'email', + 'join_uid': 'join_uid', + 'join_country_id': 'join_country_id', + 'identity_comment': 'identity_comment', + 'promotion_channels': 'promotion_channels', + 'contact_details': 'contact_details', + 'know_details': 'know_details', + 'question_lang': 'question_lang', + 'create_timest': 'create_timest', + 'update_timest': 'update_timest', + 'apply_type': 'apply_type', + 'audit_status': 'audit_status', + 'edit_counts': 'edit_counts', + 'proof_images': 'proof_images', + 'proof_videos': 'proof_videos', + 'proof_url': 'proof_url', + 'audit_reason': 'audit_reason', + 'channel_type': 'channel_type', + 'region': 'region', + 'phone': 'phone', + 'telegram': 'telegram', + 'other_contact': 'other_contact', + 'proof_images_url_list': 'proof_images_url_list', + 'proof_videos_url_list': 'proof_videos_url_list', + 'apply_msg': 'apply_msg', + 'jump_url': 'jump_url' + } + + def __init__(self, id=None, uid=None, language=None, country_id=None, firstname=None, lastname=None, email=None, join_uid=None, join_country_id=None, identity_comment=None, promotion_channels=None, contact_details=None, know_details=None, question_lang=None, create_timest=None, update_timest=None, apply_type=None, audit_status=None, edit_counts=None, proof_images=None, proof_videos=None, proof_url=None, audit_reason=None, channel_type=None, region=None, phone=None, telegram=None, other_contact=None, proof_images_url_list=None, proof_videos_url_list=None, apply_msg=None, jump_url=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, int, str, str, str, int, int, str, str, str, str, str, datetime, datetime, int, int, int, str, str, str, int, int, str, str, str, OtherContact, list[str], list[str], str, str, Configuration) -> None + """PartnerApplication - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._uid = None + self._language = None + self._country_id = None + self._firstname = None + self._lastname = None + self._email = None + self._join_uid = None + self._join_country_id = None + self._identity_comment = None + self._promotion_channels = None + self._contact_details = None + self._know_details = None + self._question_lang = None + self._create_timest = None + self._update_timest = None + self._apply_type = None + self._audit_status = None + self._edit_counts = None + self._proof_images = None + self._proof_videos = None + self._proof_url = None + self._audit_reason = None + self._channel_type = None + self._region = None + self._phone = None + self._telegram = None + self._other_contact = None + self._proof_images_url_list = None + self._proof_videos_url_list = None + self._apply_msg = None + self._jump_url = None + self.discriminator = None + + if id is not None: + self.id = id + if uid is not None: + self.uid = uid + if language is not None: + self.language = language + if country_id is not None: + self.country_id = country_id + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if email is not None: + self.email = email + if join_uid is not None: + self.join_uid = join_uid + if join_country_id is not None: + self.join_country_id = join_country_id + if identity_comment is not None: + self.identity_comment = identity_comment + if promotion_channels is not None: + self.promotion_channels = promotion_channels + if contact_details is not None: + self.contact_details = contact_details + if know_details is not None: + self.know_details = know_details + if question_lang is not None: + self.question_lang = question_lang + if create_timest is not None: + self.create_timest = create_timest + if update_timest is not None: + self.update_timest = update_timest + if apply_type is not None: + self.apply_type = apply_type + if audit_status is not None: + self.audit_status = audit_status + if edit_counts is not None: + self.edit_counts = edit_counts + if proof_images is not None: + self.proof_images = proof_images + if proof_videos is not None: + self.proof_videos = proof_videos + if proof_url is not None: + self.proof_url = proof_url + if audit_reason is not None: + self.audit_reason = audit_reason + if channel_type is not None: + self.channel_type = channel_type + if region is not None: + self.region = region + if phone is not None: + self.phone = phone + if telegram is not None: + self.telegram = telegram + if other_contact is not None: + self.other_contact = other_contact + if proof_images_url_list is not None: + self.proof_images_url_list = proof_images_url_list + if proof_videos_url_list is not None: + self.proof_videos_url_list = proof_videos_url_list + if apply_msg is not None: + self.apply_msg = apply_msg + if jump_url is not None: + self.jump_url = jump_url + + @property + def id(self): + """Gets the id of this PartnerApplication. # noqa: E501 + + Application record ID # noqa: E501 + + :return: The id of this PartnerApplication. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PartnerApplication. + + Application record ID # noqa: E501 + + :param id: The id of this PartnerApplication. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def uid(self): + """Gets the uid of this PartnerApplication. # noqa: E501 + + User ID # noqa: E501 + + :return: The uid of this PartnerApplication. # noqa: E501 + :rtype: int + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this PartnerApplication. + + User ID # noqa: E501 + + :param uid: The uid of this PartnerApplication. # noqa: E501 + :type: int + """ + + self._uid = uid + + @property + def language(self): + """Gets the language of this PartnerApplication. # noqa: E501 + + Language code # noqa: E501 + + :return: The language of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this PartnerApplication. + + Language code # noqa: E501 + + :param language: The language of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._language = language + + @property + def country_id(self): + """Gets the country_id of this PartnerApplication. # noqa: E501 + + Country ID # noqa: E501 + + :return: The country_id of this PartnerApplication. # noqa: E501 + :rtype: int + """ + return self._country_id + + @country_id.setter + def country_id(self, country_id): + """Sets the country_id of this PartnerApplication. + + Country ID # noqa: E501 + + :param country_id: The country_id of this PartnerApplication. # noqa: E501 + :type: int + """ + + self._country_id = country_id + + @property + def firstname(self): + """Gets the firstname of this PartnerApplication. # noqa: E501 + + First name # noqa: E501 + + :return: The firstname of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this PartnerApplication. + + First name # noqa: E501 + + :param firstname: The firstname of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this PartnerApplication. # noqa: E501 + + Last name # noqa: E501 + + :return: The lastname of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this PartnerApplication. + + Last name # noqa: E501 + + :param lastname: The lastname of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def email(self): + """Gets the email of this PartnerApplication. # noqa: E501 + + Email address # noqa: E501 + + :return: The email of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this PartnerApplication. + + Email address # noqa: E501 + + :param email: The email of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def join_uid(self): + """Gets the join_uid of this PartnerApplication. # noqa: E501 + + Joined user ID # noqa: E501 + + :return: The join_uid of this PartnerApplication. # noqa: E501 + :rtype: int + """ + return self._join_uid + + @join_uid.setter + def join_uid(self, join_uid): + """Sets the join_uid of this PartnerApplication. + + Joined user ID # noqa: E501 + + :param join_uid: The join_uid of this PartnerApplication. # noqa: E501 + :type: int + """ + + self._join_uid = join_uid + + @property + def join_country_id(self): + """Gets the join_country_id of this PartnerApplication. # noqa: E501 + + Joined country ID # noqa: E501 + + :return: The join_country_id of this PartnerApplication. # noqa: E501 + :rtype: int + """ + return self._join_country_id + + @join_country_id.setter + def join_country_id(self, join_country_id): + """Sets the join_country_id of this PartnerApplication. + + Joined country ID # noqa: E501 + + :param join_country_id: The join_country_id of this PartnerApplication. # noqa: E501 + :type: int + """ + + self._join_country_id = join_country_id + + @property + def identity_comment(self): + """Gets the identity_comment of this PartnerApplication. # noqa: E501 + + Identity description # noqa: E501 + + :return: The identity_comment of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._identity_comment + + @identity_comment.setter + def identity_comment(self, identity_comment): + """Sets the identity_comment of this PartnerApplication. + + Identity description # noqa: E501 + + :param identity_comment: The identity_comment of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._identity_comment = identity_comment + + @property + def promotion_channels(self): + """Gets the promotion_channels of this PartnerApplication. # noqa: E501 + + Promotion channels, separated by | # noqa: E501 + + :return: The promotion_channels of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._promotion_channels + + @promotion_channels.setter + def promotion_channels(self, promotion_channels): + """Sets the promotion_channels of this PartnerApplication. + + Promotion channels, separated by | # noqa: E501 + + :param promotion_channels: The promotion_channels of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._promotion_channels = promotion_channels + + @property + def contact_details(self): + """Gets the contact_details of this PartnerApplication. # noqa: E501 + + Contact details (JSON string) # noqa: E501 + + :return: The contact_details of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._contact_details + + @contact_details.setter + def contact_details(self, contact_details): + """Sets the contact_details of this PartnerApplication. + + Contact details (JSON string) # noqa: E501 + + :param contact_details: The contact_details of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._contact_details = contact_details + + @property + def know_details(self): + """Gets the know_details of this PartnerApplication. # noqa: E501 + + Learn more # noqa: E501 + + :return: The know_details of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._know_details + + @know_details.setter + def know_details(self, know_details): + """Sets the know_details of this PartnerApplication. + + Learn more # noqa: E501 + + :param know_details: The know_details of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._know_details = know_details + + @property + def question_lang(self): + """Gets the question_lang of this PartnerApplication. # noqa: E501 + + Question language # noqa: E501 + + :return: The question_lang of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._question_lang + + @question_lang.setter + def question_lang(self, question_lang): + """Sets the question_lang of this PartnerApplication. + + Question language # noqa: E501 + + :param question_lang: The question_lang of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._question_lang = question_lang + + @property + def create_timest(self): + """Gets the create_timest of this PartnerApplication. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_timest of this PartnerApplication. # noqa: E501 + :rtype: datetime + """ + return self._create_timest + + @create_timest.setter + def create_timest(self, create_timest): + """Sets the create_timest of this PartnerApplication. + + Created time # noqa: E501 + + :param create_timest: The create_timest of this PartnerApplication. # noqa: E501 + :type: datetime + """ + + self._create_timest = create_timest + + @property + def update_timest(self): + """Gets the update_timest of this PartnerApplication. # noqa: E501 + + Update time # noqa: E501 + + :return: The update_timest of this PartnerApplication. # noqa: E501 + :rtype: datetime + """ + return self._update_timest + + @update_timest.setter + def update_timest(self, update_timest): + """Sets the update_timest of this PartnerApplication. + + Update time # noqa: E501 + + :param update_timest: The update_timest of this PartnerApplication. # noqa: E501 + :type: datetime + """ + + self._update_timest = update_timest + + @property + def apply_type(self): + """Gets the apply_type of this PartnerApplication. # noqa: E501 + + Application type # noqa: E501 + + :return: The apply_type of this PartnerApplication. # noqa: E501 + :rtype: int + """ + return self._apply_type + + @apply_type.setter + def apply_type(self, apply_type): + """Sets the apply_type of this PartnerApplication. + + Application type # noqa: E501 + + :param apply_type: The apply_type of this PartnerApplication. # noqa: E501 + :type: int + """ + + self._apply_type = apply_type + + @property + def audit_status(self): + """Gets the audit_status of this PartnerApplication. # noqa: E501 + + Review status (0 - pending, 1 - approved, 2 - rejected) # noqa: E501 + + :return: The audit_status of this PartnerApplication. # noqa: E501 + :rtype: int + """ + return self._audit_status + + @audit_status.setter + def audit_status(self, audit_status): + """Sets the audit_status of this PartnerApplication. + + Review status (0 - pending, 1 - approved, 2 - rejected) # noqa: E501 + + :param audit_status: The audit_status of this PartnerApplication. # noqa: E501 + :type: int + """ + + self._audit_status = audit_status + + @property + def edit_counts(self): + """Gets the edit_counts of this PartnerApplication. # noqa: E501 + + Edit count # noqa: E501 + + :return: The edit_counts of this PartnerApplication. # noqa: E501 + :rtype: int + """ + return self._edit_counts + + @edit_counts.setter + def edit_counts(self, edit_counts): + """Sets the edit_counts of this PartnerApplication. + + Edit count # noqa: E501 + + :param edit_counts: The edit_counts of this PartnerApplication. # noqa: E501 + :type: int + """ + + self._edit_counts = edit_counts + + @property + def proof_images(self): + """Gets the proof_images of this PartnerApplication. # noqa: E501 + + Proof image path # noqa: E501 + + :return: The proof_images of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._proof_images + + @proof_images.setter + def proof_images(self, proof_images): + """Sets the proof_images of this PartnerApplication. + + Proof image path # noqa: E501 + + :param proof_images: The proof_images of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._proof_images = proof_images + + @property + def proof_videos(self): + """Gets the proof_videos of this PartnerApplication. # noqa: E501 + + Proof video path # noqa: E501 + + :return: The proof_videos of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._proof_videos + + @proof_videos.setter + def proof_videos(self, proof_videos): + """Sets the proof_videos of this PartnerApplication. + + Proof video path # noqa: E501 + + :param proof_videos: The proof_videos of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._proof_videos = proof_videos + + @property + def proof_url(self): + """Gets the proof_url of this PartnerApplication. # noqa: E501 + + Proof link # noqa: E501 + + :return: The proof_url of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._proof_url + + @proof_url.setter + def proof_url(self, proof_url): + """Sets the proof_url of this PartnerApplication. + + Proof link # noqa: E501 + + :param proof_url: The proof_url of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._proof_url = proof_url + + @property + def audit_reason(self): + """Gets the audit_reason of this PartnerApplication. # noqa: E501 + + Review reason code # noqa: E501 + + :return: The audit_reason of this PartnerApplication. # noqa: E501 + :rtype: int + """ + return self._audit_reason + + @audit_reason.setter + def audit_reason(self, audit_reason): + """Sets the audit_reason of this PartnerApplication. + + Review reason code # noqa: E501 + + :param audit_reason: The audit_reason of this PartnerApplication. # noqa: E501 + :type: int + """ + + self._audit_reason = audit_reason + + @property + def channel_type(self): + """Gets the channel_type of this PartnerApplication. # noqa: E501 + + Channel type # noqa: E501 + + :return: The channel_type of this PartnerApplication. # noqa: E501 + :rtype: int + """ + return self._channel_type + + @channel_type.setter + def channel_type(self, channel_type): + """Sets the channel_type of this PartnerApplication. + + Channel type # noqa: E501 + + :param channel_type: The channel_type of this PartnerApplication. # noqa: E501 + :type: int + """ + + self._channel_type = channel_type + + @property + def region(self): + """Gets the region of this PartnerApplication. # noqa: E501 + + Region # noqa: E501 + + :return: The region of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._region + + @region.setter + def region(self, region): + """Sets the region of this PartnerApplication. + + Region # noqa: E501 + + :param region: The region of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._region = region + + @property + def phone(self): + """Gets the phone of this PartnerApplication. # noqa: E501 + + Phone number # noqa: E501 + + :return: The phone of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._phone + + @phone.setter + def phone(self, phone): + """Sets the phone of this PartnerApplication. + + Phone number # noqa: E501 + + :param phone: The phone of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._phone = phone + + @property + def telegram(self): + """Gets the telegram of this PartnerApplication. # noqa: E501 + + Telegram account # noqa: E501 + + :return: The telegram of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._telegram + + @telegram.setter + def telegram(self, telegram): + """Sets the telegram of this PartnerApplication. + + Telegram account # noqa: E501 + + :param telegram: The telegram of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._telegram = telegram + + @property + def other_contact(self): + """Gets the other_contact of this PartnerApplication. # noqa: E501 + + + :return: The other_contact of this PartnerApplication. # noqa: E501 + :rtype: OtherContact + """ + return self._other_contact + + @other_contact.setter + def other_contact(self, other_contact): + """Sets the other_contact of this PartnerApplication. + + + :param other_contact: The other_contact of this PartnerApplication. # noqa: E501 + :type: OtherContact + """ + + self._other_contact = other_contact + + @property + def proof_images_url_list(self): + """Gets the proof_images_url_list of this PartnerApplication. # noqa: E501 + + List of proof image URLs # noqa: E501 + + :return: The proof_images_url_list of this PartnerApplication. # noqa: E501 + :rtype: list[str] + """ + return self._proof_images_url_list + + @proof_images_url_list.setter + def proof_images_url_list(self, proof_images_url_list): + """Sets the proof_images_url_list of this PartnerApplication. + + List of proof image URLs # noqa: E501 + + :param proof_images_url_list: The proof_images_url_list of this PartnerApplication. # noqa: E501 + :type: list[str] + """ + + self._proof_images_url_list = proof_images_url_list + + @property + def proof_videos_url_list(self): + """Gets the proof_videos_url_list of this PartnerApplication. # noqa: E501 + + List of proof video URLs # noqa: E501 + + :return: The proof_videos_url_list of this PartnerApplication. # noqa: E501 + :rtype: list[str] + """ + return self._proof_videos_url_list + + @proof_videos_url_list.setter + def proof_videos_url_list(self, proof_videos_url_list): + """Sets the proof_videos_url_list of this PartnerApplication. + + List of proof video URLs # noqa: E501 + + :param proof_videos_url_list: The proof_videos_url_list of this PartnerApplication. # noqa: E501 + :type: list[str] + """ + + self._proof_videos_url_list = proof_videos_url_list + + @property + def apply_msg(self): + """Gets the apply_msg of this PartnerApplication. # noqa: E501 + + Application message # noqa: E501 + + :return: The apply_msg of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._apply_msg + + @apply_msg.setter + def apply_msg(self, apply_msg): + """Sets the apply_msg of this PartnerApplication. + + Application message # noqa: E501 + + :param apply_msg: The apply_msg of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._apply_msg = apply_msg + + @property + def jump_url(self): + """Gets the jump_url of this PartnerApplication. # noqa: E501 + + Redirect URL # noqa: E501 + + :return: The jump_url of this PartnerApplication. # noqa: E501 + :rtype: str + """ + return self._jump_url + + @jump_url.setter + def jump_url(self, jump_url): + """Sets the jump_url of this PartnerApplication. + + Redirect URL # noqa: E501 + + :param jump_url: The jump_url of this PartnerApplication. # noqa: E501 + :type: str + """ + + self._jump_url = jump_url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PartnerApplication): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PartnerApplication): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/partner_application_response.py b/gate_api/models/partner_application_response.py new file mode 100644 index 00000000..8460d362 --- /dev/null +++ b/gate_api/models/partner_application_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PartnerApplicationResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'PartnerApplication', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, PartnerApplication, int, Configuration) -> None + """PartnerApplicationResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this PartnerApplicationResponse. # noqa: E501 + + Error Code, 0 Indicates Success # noqa: E501 + + :return: The code of this PartnerApplicationResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this PartnerApplicationResponse. + + Error Code, 0 Indicates Success # noqa: E501 + + :param code: The code of this PartnerApplicationResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this PartnerApplicationResponse. # noqa: E501 + + Error message description # noqa: E501 + + :return: The message of this PartnerApplicationResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this PartnerApplicationResponse. + + Error message description # noqa: E501 + + :param message: The message of this PartnerApplicationResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this PartnerApplicationResponse. # noqa: E501 + + + :return: The data of this PartnerApplicationResponse. # noqa: E501 + :rtype: PartnerApplication + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this PartnerApplicationResponse. + + + :param data: The data of this PartnerApplicationResponse. # noqa: E501 + :type: PartnerApplication + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this PartnerApplicationResponse. # noqa: E501 + + Unix timestamp # noqa: E501 + + :return: The timestamp of this PartnerApplicationResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this PartnerApplicationResponse. + + Unix timestamp # noqa: E501 + + :param timestamp: The timestamp of this PartnerApplicationResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PartnerApplicationResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PartnerApplicationResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/partner_application_response_all_of.py b/gate_api/models/partner_application_response_all_of.py new file mode 100644 index 00000000..7d923549 --- /dev/null +++ b/gate_api/models/partner_application_response_all_of.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PartnerApplicationResponseAllOf(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'PartnerApplication' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 + # type: (PartnerApplication, Configuration) -> None + """PartnerApplicationResponseAllOf - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self.discriminator = None + + if data is not None: + self.data = data + + @property + def data(self): + """Gets the data of this PartnerApplicationResponseAllOf. # noqa: E501 + + + :return: The data of this PartnerApplicationResponseAllOf. # noqa: E501 + :rtype: PartnerApplication + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this PartnerApplicationResponseAllOf. + + + :param data: The data of this PartnerApplicationResponseAllOf. # noqa: E501 + :type: PartnerApplication + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PartnerApplicationResponseAllOf): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PartnerApplicationResponseAllOf): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/partner_data_aggregated.py b/gate_api/models/partner_data_aggregated.py new file mode 100644 index 00000000..945f1408 --- /dev/null +++ b/gate_api/models/partner_data_aggregated.py @@ -0,0 +1,349 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PartnerDataAggregated(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'rebate_amount': 'str', + 'trade_volume': 'str', + 'net_fee': 'str', + 'customer_count': 'int', + 'trading_user_count': 'str', + 'time_range_desc': 'str', + 'business_type': 'int', + 'business_type_desc': 'str' + } + + attribute_map = { + 'rebate_amount': 'rebate_amount', + 'trade_volume': 'trade_volume', + 'net_fee': 'net_fee', + 'customer_count': 'customer_count', + 'trading_user_count': 'trading_user_count', + 'time_range_desc': 'time_range_desc', + 'business_type': 'business_type', + 'business_type_desc': 'business_type_desc' + } + + def __init__(self, rebate_amount=None, trade_volume=None, net_fee=None, customer_count=None, trading_user_count=None, time_range_desc=None, business_type=None, business_type_desc=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, str, str, int, str, Configuration) -> None + """PartnerDataAggregated - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._rebate_amount = None + self._trade_volume = None + self._net_fee = None + self._customer_count = None + self._trading_user_count = None + self._time_range_desc = None + self._business_type = None + self._business_type_desc = None + self.discriminator = None + + self.rebate_amount = rebate_amount + self.trade_volume = trade_volume + self.net_fee = net_fee + self.customer_count = customer_count + self.trading_user_count = trading_user_count + self.time_range_desc = time_range_desc + self.business_type = business_type + self.business_type_desc = business_type_desc + + @property + def rebate_amount(self): + """Gets the rebate_amount of this PartnerDataAggregated. # noqa: E501 + + Rebate amount as a string for precision. Up to 6 decimal places; trailing zeros removed. # noqa: E501 + + :return: The rebate_amount of this PartnerDataAggregated. # noqa: E501 + :rtype: str + """ + return self._rebate_amount + + @rebate_amount.setter + def rebate_amount(self, rebate_amount): + """Sets the rebate_amount of this PartnerDataAggregated. + + Rebate amount as a string for precision. Up to 6 decimal places; trailing zeros removed. # noqa: E501 + + :param rebate_amount: The rebate_amount of this PartnerDataAggregated. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and rebate_amount is None: # noqa: E501 + raise ValueError("Invalid value for `rebate_amount`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + rebate_amount is not None and not re.search(r'^\d+(\.\d{1,6})?$', rebate_amount)): # noqa: E501 + raise ValueError(r"Invalid value for `rebate_amount`, must be a follow pattern or equal to `/^\d+(\.\d{1,6})?$/`") # noqa: E501 + + self._rebate_amount = rebate_amount + + @property + def trade_volume(self): + """Gets the trade_volume of this PartnerDataAggregated. # noqa: E501 + + Trading volume as a string for precision. Up to 6 decimal places; trailing zeros removed. # noqa: E501 + + :return: The trade_volume of this PartnerDataAggregated. # noqa: E501 + :rtype: str + """ + return self._trade_volume + + @trade_volume.setter + def trade_volume(self, trade_volume): + """Sets the trade_volume of this PartnerDataAggregated. + + Trading volume as a string for precision. Up to 6 decimal places; trailing zeros removed. # noqa: E501 + + :param trade_volume: The trade_volume of this PartnerDataAggregated. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and trade_volume is None: # noqa: E501 + raise ValueError("Invalid value for `trade_volume`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + trade_volume is not None and not re.search(r'^\d+(\.\d{1,6})?$', trade_volume)): # noqa: E501 + raise ValueError(r"Invalid value for `trade_volume`, must be a follow pattern or equal to `/^\d+(\.\d{1,6})?$/`") # noqa: E501 + + self._trade_volume = trade_volume + + @property + def net_fee(self): + """Gets the net_fee of this PartnerDataAggregated. # noqa: E501 + + Net fee as a string for precision. Up to 6 decimal places; trailing zeros removed. # noqa: E501 + + :return: The net_fee of this PartnerDataAggregated. # noqa: E501 + :rtype: str + """ + return self._net_fee + + @net_fee.setter + def net_fee(self, net_fee): + """Sets the net_fee of this PartnerDataAggregated. + + Net fee as a string for precision. Up to 6 decimal places; trailing zeros removed. # noqa: E501 + + :param net_fee: The net_fee of this PartnerDataAggregated. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and net_fee is None: # noqa: E501 + raise ValueError("Invalid value for `net_fee`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + net_fee is not None and not re.search(r'^\d+(\.\d{1,6})?$', net_fee)): # noqa: E501 + raise ValueError(r"Invalid value for `net_fee`, must be a follow pattern or equal to `/^\d+(\.\d{1,6})?$/`") # noqa: E501 + + self._net_fee = net_fee + + @property + def customer_count(self): + """Gets the customer_count of this PartnerDataAggregated. # noqa: E501 + + Customer count (invited users) # noqa: E501 + + :return: The customer_count of this PartnerDataAggregated. # noqa: E501 + :rtype: int + """ + return self._customer_count + + @customer_count.setter + def customer_count(self, customer_count): + """Sets the customer_count of this PartnerDataAggregated. + + Customer count (invited users) # noqa: E501 + + :param customer_count: The customer_count of this PartnerDataAggregated. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and customer_count is None: # noqa: E501 + raise ValueError("Invalid value for `customer_count`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + customer_count is not None and customer_count < 0): # noqa: E501 + raise ValueError("Invalid value for `customer_count`, must be a value greater than or equal to `0`") # noqa: E501 + + self._customer_count = customer_count + + @property + def trading_user_count(self): + """Gets the trading_user_count of this PartnerDataAggregated. # noqa: E501 + + Transaction participant count​ (string format, consistent with online JSON serialization) only returns a specific value when business_type=0(all), and returns nullfor other business types. # noqa: E501 + + :return: The trading_user_count of this PartnerDataAggregated. # noqa: E501 + :rtype: str + """ + return self._trading_user_count + + @trading_user_count.setter + def trading_user_count(self, trading_user_count): + """Sets the trading_user_count of this PartnerDataAggregated. + + Transaction participant count​ (string format, consistent with online JSON serialization) only returns a specific value when business_type=0(all), and returns nullfor other business types. # noqa: E501 + + :param trading_user_count: The trading_user_count of this PartnerDataAggregated. # noqa: E501 + :type: str + """ + if (self.local_vars_configuration.client_side_validation and + trading_user_count is not None and not re.search(r'^\d+$', trading_user_count)): # noqa: E501 + raise ValueError(r"Invalid value for `trading_user_count`, must be a follow pattern or equal to `/^\d+$/`") # noqa: E501 + + self._trading_user_count = trading_user_count + + @property + def time_range_desc(self): + """Gets the time_range_desc of this PartnerDataAggregated. # noqa: E501 + + Time range description # noqa: E501 + + :return: The time_range_desc of this PartnerDataAggregated. # noqa: E501 + :rtype: str + """ + return self._time_range_desc + + @time_range_desc.setter + def time_range_desc(self, time_range_desc): + """Sets the time_range_desc of this PartnerDataAggregated. + + Time range description # noqa: E501 + + :param time_range_desc: The time_range_desc of this PartnerDataAggregated. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and time_range_desc is None: # noqa: E501 + raise ValueError("Invalid value for `time_range_desc`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + time_range_desc is not None and not re.search(r'^\d{4}-\d{2}-\d{2} ~ \d{4}-\d{2}-\d{2}$', time_range_desc)): # noqa: E501 + raise ValueError(r"Invalid value for `time_range_desc`, must be a follow pattern or equal to `/^\d{4}-\d{2}-\d{2} ~ \d{4}-\d{2}-\d{2}$/`") # noqa: E501 + + self._time_range_desc = time_range_desc + + @property + def business_type(self): + """Gets the business_type of this PartnerDataAggregated. # noqa: E501 + + Business Type # noqa: E501 + + :return: The business_type of this PartnerDataAggregated. # noqa: E501 + :rtype: int + """ + return self._business_type + + @business_type.setter + def business_type(self, business_type): + """Sets the business_type of this PartnerDataAggregated. + + Business Type # noqa: E501 + + :param business_type: The business_type of this PartnerDataAggregated. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and business_type is None: # noqa: E501 + raise ValueError("Invalid value for `business_type`, must not be `None`") # noqa: E501 + allowed_values = [0, 1, 2, 3, 4, 5, 6, 7, 8] # noqa: E501 + if self.local_vars_configuration.client_side_validation and business_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `business_type` ({0}), must be one of {1}" # noqa: E501 + .format(business_type, allowed_values) + ) + + self._business_type = business_type + + @property + def business_type_desc(self): + """Gets the business_type_desc of this PartnerDataAggregated. # noqa: E501 + + Business type description; allowed values: All, Spot, Futures, Alpha, Web3, Perps (DEX), Exchange All, Web3 All, TradFi # noqa: E501 + + :return: The business_type_desc of this PartnerDataAggregated. # noqa: E501 + :rtype: str + """ + return self._business_type_desc + + @business_type_desc.setter + def business_type_desc(self, business_type_desc): + """Sets the business_type_desc of this PartnerDataAggregated. + + Business type description; allowed values: All, Spot, Futures, Alpha, Web3, Perps (DEX), Exchange All, Web3 All, TradFi # noqa: E501 + + :param business_type_desc: The business_type_desc of this PartnerDataAggregated. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and business_type_desc is None: # noqa: E501 + raise ValueError("Invalid value for `business_type_desc`, must not be `None`") # noqa: E501 + + self._business_type_desc = business_type_desc + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PartnerDataAggregated): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PartnerDataAggregated): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/partner_data_aggregated_response.py b/gate_api/models/partner_data_aggregated_response.py new file mode 100644 index 00000000..5b9e7684 --- /dev/null +++ b/gate_api/models/partner_data_aggregated_response.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PartnerDataAggregatedResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'PartnerDataAggregated', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, PartnerDataAggregated, int, Configuration) -> None + """PartnerDataAggregatedResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + self.code = code + self.message = message + self.data = data + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this PartnerDataAggregatedResponse. # noqa: E501 + + Error Code, 0 Indicates Success # noqa: E501 + + :return: The code of this PartnerDataAggregatedResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this PartnerDataAggregatedResponse. + + Error Code, 0 Indicates Success # noqa: E501 + + :param code: The code of this PartnerDataAggregatedResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and code is None: # noqa: E501 + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self): + """Gets the message of this PartnerDataAggregatedResponse. # noqa: E501 + + Error message description # noqa: E501 + + :return: The message of this PartnerDataAggregatedResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this PartnerDataAggregatedResponse. + + Error message description # noqa: E501 + + :param message: The message of this PartnerDataAggregatedResponse. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def data(self): + """Gets the data of this PartnerDataAggregatedResponse. # noqa: E501 + + + :return: The data of this PartnerDataAggregatedResponse. # noqa: E501 + :rtype: PartnerDataAggregated + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this PartnerDataAggregatedResponse. + + + :param data: The data of this PartnerDataAggregatedResponse. # noqa: E501 + :type: PartnerDataAggregated + """ + if self.local_vars_configuration.client_side_validation and data is None: # noqa: E501 + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this PartnerDataAggregatedResponse. # noqa: E501 + + Unix timestamp # noqa: E501 + + :return: The timestamp of this PartnerDataAggregatedResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this PartnerDataAggregatedResponse. + + Unix timestamp # noqa: E501 + + :param timestamp: The timestamp of this PartnerDataAggregatedResponse. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501 + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PartnerDataAggregatedResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PartnerDataAggregatedResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/partner_data_aggregated_response_all_of.py b/gate_api/models/partner_data_aggregated_response_all_of.py new file mode 100644 index 00000000..e5464bbc --- /dev/null +++ b/gate_api/models/partner_data_aggregated_response_all_of.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PartnerDataAggregatedResponseAllOf(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'PartnerDataAggregated' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 + # type: (PartnerDataAggregated, Configuration) -> None + """PartnerDataAggregatedResponseAllOf - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self.discriminator = None + + if data is not None: + self.data = data + + @property + def data(self): + """Gets the data of this PartnerDataAggregatedResponseAllOf. # noqa: E501 + + + :return: The data of this PartnerDataAggregatedResponseAllOf. # noqa: E501 + :rtype: PartnerDataAggregated + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this PartnerDataAggregatedResponseAllOf. + + + :param data: The data of this PartnerDataAggregatedResponseAllOf. # noqa: E501 + :type: PartnerDataAggregated + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PartnerDataAggregatedResponseAllOf): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PartnerDataAggregatedResponseAllOf): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/place_biz_push_order.py b/gate_api/models/place_biz_push_order.py new file mode 100644 index 00000000..7e5b372f --- /dev/null +++ b/gate_api/models/place_biz_push_order.py @@ -0,0 +1,987 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PlaceBizPushOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency_type': 'str', + 'exchange_type': 'str', + 'type': 'str', + 'unit_price': 'str', + 'number': 'str', + 'pay_type': 'str', + 'pay_type_json': 'str', + 'rate_fixed': 'str', + 'oid': 'str', + 'min_amount': 'str', + 'max_amount': 'str', + 'limit_basis': 'int', + 'fiat_min_amount': 'str', + 'fiat_max_amount': 'str', + 'tier_limit': 'str', + 'verified_limit': 'str', + 'reg_time_limit': 'str', + 'advertisers_limit': 'str', + 'polymarket_limit': 'int', + 'expire_min': 'str', + 'trade_tips': 'str', + 'auto_reply': 'str', + 'min_completed_limit': 'str', + 'max_completed_limit': 'str', + 'completed_rate_limit': 'str', + 'user_country_limit': 'str', + 'user_order_limit': 'str', + 'rate_reference_id': 'str', + 'rate_offset': 'str', + 'float_trend': 'str', + 'team_payment_uid': 'str' + } + + attribute_map = { + 'currency_type': 'currencyType', + 'exchange_type': 'exchangeType', + 'type': 'type', + 'unit_price': 'unitPrice', + 'number': 'number', + 'pay_type': 'payType', + 'pay_type_json': 'pay_type_json', + 'rate_fixed': 'rateFixed', + 'oid': 'oid', + 'min_amount': 'minAmount', + 'max_amount': 'maxAmount', + 'limit_basis': 'limitBasis', + 'fiat_min_amount': 'fiatMinAmount', + 'fiat_max_amount': 'fiatMaxAmount', + 'tier_limit': 'tierLimit', + 'verified_limit': 'verifiedLimit', + 'reg_time_limit': 'regTimeLimit', + 'advertisers_limit': 'advertisersLimit', + 'polymarket_limit': 'polymarket_limit', + 'expire_min': 'expire_min', + 'trade_tips': 'trade_tips', + 'auto_reply': 'auto_reply', + 'min_completed_limit': 'min_completed_limit', + 'max_completed_limit': 'max_completed_limit', + 'completed_rate_limit': 'completed_rate_limit', + 'user_country_limit': 'user_country_limit', + 'user_order_limit': 'user_order_limit', + 'rate_reference_id': 'rateReferenceId', + 'rate_offset': 'rateOffset', + 'float_trend': 'float_trend', + 'team_payment_uid': 'team_payment_uid' + } + + def __init__(self, currency_type=None, exchange_type=None, type=None, unit_price=None, number=None, pay_type=None, pay_type_json=None, rate_fixed=None, oid=None, min_amount=None, max_amount=None, limit_basis=None, fiat_min_amount=None, fiat_max_amount=None, tier_limit=None, verified_limit=None, reg_time_limit=None, advertisers_limit=None, polymarket_limit=None, expire_min=None, trade_tips=None, auto_reply=None, min_completed_limit=None, max_completed_limit=None, completed_rate_limit=None, user_country_limit=None, user_order_limit=None, rate_reference_id=None, rate_offset=None, float_trend=None, team_payment_uid=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, int, str, str, str, str, str, str, int, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """PlaceBizPushOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency_type = None + self._exchange_type = None + self._type = None + self._unit_price = None + self._number = None + self._pay_type = None + self._pay_type_json = None + self._rate_fixed = None + self._oid = None + self._min_amount = None + self._max_amount = None + self._limit_basis = None + self._fiat_min_amount = None + self._fiat_max_amount = None + self._tier_limit = None + self._verified_limit = None + self._reg_time_limit = None + self._advertisers_limit = None + self._polymarket_limit = None + self._expire_min = None + self._trade_tips = None + self._auto_reply = None + self._min_completed_limit = None + self._max_completed_limit = None + self._completed_rate_limit = None + self._user_country_limit = None + self._user_order_limit = None + self._rate_reference_id = None + self._rate_offset = None + self._float_trend = None + self._team_payment_uid = None + self.discriminator = None + + self.currency_type = currency_type + self.exchange_type = exchange_type + self.type = type + self.unit_price = unit_price + self.number = number + self.pay_type = pay_type + if pay_type_json is not None: + self.pay_type_json = pay_type_json + if rate_fixed is not None: + self.rate_fixed = rate_fixed + if oid is not None: + self.oid = oid + if min_amount is not None: + self.min_amount = min_amount + if max_amount is not None: + self.max_amount = max_amount + if limit_basis is not None: + self.limit_basis = limit_basis + if fiat_min_amount is not None: + self.fiat_min_amount = fiat_min_amount + if fiat_max_amount is not None: + self.fiat_max_amount = fiat_max_amount + if tier_limit is not None: + self.tier_limit = tier_limit + if verified_limit is not None: + self.verified_limit = verified_limit + if reg_time_limit is not None: + self.reg_time_limit = reg_time_limit + if advertisers_limit is not None: + self.advertisers_limit = advertisers_limit + if polymarket_limit is not None: + self.polymarket_limit = polymarket_limit + if expire_min is not None: + self.expire_min = expire_min + if trade_tips is not None: + self.trade_tips = trade_tips + if auto_reply is not None: + self.auto_reply = auto_reply + if min_completed_limit is not None: + self.min_completed_limit = min_completed_limit + if max_completed_limit is not None: + self.max_completed_limit = max_completed_limit + if completed_rate_limit is not None: + self.completed_rate_limit = completed_rate_limit + if user_country_limit is not None: + self.user_country_limit = user_country_limit + if user_order_limit is not None: + self.user_order_limit = user_order_limit + if rate_reference_id is not None: + self.rate_reference_id = rate_reference_id + if rate_offset is not None: + self.rate_offset = rate_offset + if float_trend is not None: + self.float_trend = float_trend + if team_payment_uid is not None: + self.team_payment_uid = team_payment_uid + + @property + def currency_type(self): + """Gets the currency_type of this PlaceBizPushOrder. # noqa: E501 + + Cryptocurrency symbol. # noqa: E501 + + :return: The currency_type of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._currency_type + + @currency_type.setter + def currency_type(self, currency_type): + """Sets the currency_type of this PlaceBizPushOrder. + + Cryptocurrency symbol. # noqa: E501 + + :param currency_type: The currency_type of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and currency_type is None: # noqa: E501 + raise ValueError("Invalid value for `currency_type`, must not be `None`") # noqa: E501 + + self._currency_type = currency_type + + @property + def exchange_type(self): + """Gets the exchange_type of this PlaceBizPushOrder. # noqa: E501 + + Fiat currency # noqa: E501 + + :return: The exchange_type of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this PlaceBizPushOrder. + + Fiat currency # noqa: E501 + + :param exchange_type: The exchange_type of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and exchange_type is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_type`, must not be `None`") # noqa: E501 + + self._exchange_type = exchange_type + + @property + def type(self): + """Gets the type of this PlaceBizPushOrder. # noqa: E501 + + Ad operation type. `0`: publish sell ad; `1`: publish buy ad; `2`: edit sell ad; `3`: edit buy ad. # noqa: E501 + + :return: The type of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PlaceBizPushOrder. + + Ad operation type. `0`: publish sell ad; `1`: publish buy ad; `2`: edit sell ad; `3`: edit buy ad. # noqa: E501 + + :param type: The type of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["0", "1", "2", "3"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def unit_price(self): + """Gets the unit_price of this PlaceBizPushOrder. # noqa: E501 + + Per-unit price in fixed-price mode. # noqa: E501 + + :return: The unit_price of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this PlaceBizPushOrder. + + Per-unit price in fixed-price mode. # noqa: E501 + + :param unit_price: The unit_price of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and unit_price is None: # noqa: E501 + raise ValueError("Invalid value for `unit_price`, must not be `None`") # noqa: E501 + + self._unit_price = unit_price + + @property + def number(self): + """Gets the number of this PlaceBizPushOrder. # noqa: E501 + + Ad amount priced in `currencyType`. # noqa: E501 + + :return: The number of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this PlaceBizPushOrder. + + Ad amount priced in `currencyType`. # noqa: E501 + + :param number: The number of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501 + raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 + + self._number = number + + @property + def pay_type(self): + """Gets the pay_type of this PlaceBizPushOrder. # noqa: E501 + + Payment types enabled for the ad, comma-separated; values can be obtained from `pay_type` in the payment method list, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. `pay_type_json` uses the types in this field as keys to specify the corresponding payment accounts. # noqa: E501 + + :return: The pay_type of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._pay_type + + @pay_type.setter + def pay_type(self, pay_type): + """Sets the pay_type of this PlaceBizPushOrder. + + Payment types enabled for the ad, comma-separated; values can be obtained from `pay_type` in the payment method list, e.g. `bank`, `alipay`, `wechat`, `paypal`, `swift`, `wu`. `pay_type_json` uses the types in this field as keys to specify the corresponding payment accounts. # noqa: E501 + + :param pay_type: The pay_type of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and pay_type is None: # noqa: E501 + raise ValueError("Invalid value for `pay_type`, must not be `None`") # noqa: E501 + + self._pay_type = pay_type + + @property + def pay_type_json(self): + """Gets the pay_type_json of this PlaceBizPushOrder. # noqa: E501 + + JSON string of specific payment accounts corresponding to `payType`. Each key is a payment type listed in `payType`, and each value is the current user's payment method ID for that type. For example, when `payType` is `bank,swift`, this field can be {\"bank\":\"10001\",\"swift\":\"10002\"}. # noqa: E501 + + :return: The pay_type_json of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._pay_type_json + + @pay_type_json.setter + def pay_type_json(self, pay_type_json): + """Sets the pay_type_json of this PlaceBizPushOrder. + + JSON string of specific payment accounts corresponding to `payType`. Each key is a payment type listed in `payType`, and each value is the current user's payment method ID for that type. For example, when `payType` is `bank,swift`, this field can be {\"bank\":\"10001\",\"swift\":\"10002\"}. # noqa: E501 + + :param pay_type_json: The pay_type_json of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._pay_type_json = pay_type_json + + @property + def rate_fixed(self): + """Gets the rate_fixed of this PlaceBizPushOrder. # noqa: E501 + + Price type: `0` floating; `1` fixed. # noqa: E501 + + :return: The rate_fixed of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._rate_fixed + + @rate_fixed.setter + def rate_fixed(self, rate_fixed): + """Sets the rate_fixed of this PlaceBizPushOrder. + + Price type: `0` floating; `1` fixed. # noqa: E501 + + :param rate_fixed: The rate_fixed of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._rate_fixed = rate_fixed + + @property + def oid(self): + """Gets the oid of this PlaceBizPushOrder. # noqa: E501 + + Pass ad ID when editing; omit or empty when publishing a new ad. # noqa: E501 + + :return: The oid of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._oid + + @oid.setter + def oid(self, oid): + """Sets the oid of this PlaceBizPushOrder. + + Pass ad ID when editing; omit or empty when publishing a new ad. # noqa: E501 + + :param oid: The oid of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._oid = oid + + @property + def min_amount(self): + """Gets the min_amount of this PlaceBizPushOrder. # noqa: E501 + + Minimum quantity per order, denominated by currencyType; required when limitBasis is not passed or is 0 # noqa: E501 + + :return: The min_amount of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._min_amount + + @min_amount.setter + def min_amount(self, min_amount): + """Sets the min_amount of this PlaceBizPushOrder. + + Minimum quantity per order, denominated by currencyType; required when limitBasis is not passed or is 0 # noqa: E501 + + :param min_amount: The min_amount of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._min_amount = min_amount + + @property + def max_amount(self): + """Gets the max_amount of this PlaceBizPushOrder. # noqa: E501 + + Maximum quantity per order, denominated by currencyType; required when limitBasis is not passed or is 0 # noqa: E501 + + :return: The max_amount of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._max_amount + + @max_amount.setter + def max_amount(self, max_amount): + """Sets the max_amount of this PlaceBizPushOrder. + + Maximum quantity per order, denominated by currencyType; required when limitBasis is not passed or is 0 # noqa: E501 + + :param max_amount: The max_amount of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._max_amount = max_amount + + @property + def limit_basis(self): + """Gets the limit_basis of this PlaceBizPushOrder. # noqa: E501 + + Trading limit unit. 0: by crypto quantity, 1: by fiat amount; defaults to 0 when not passed for a new ad. The limit unit of an existing ad cannot be changed when editing; a fiat-limit ad must keep passing 1 when edited # noqa: E501 + + :return: The limit_basis of this PlaceBizPushOrder. # noqa: E501 + :rtype: int + """ + return self._limit_basis + + @limit_basis.setter + def limit_basis(self, limit_basis): + """Sets the limit_basis of this PlaceBizPushOrder. + + Trading limit unit. 0: by crypto quantity, 1: by fiat amount; defaults to 0 when not passed for a new ad. The limit unit of an existing ad cannot be changed when editing; a fiat-limit ad must keep passing 1 when edited # noqa: E501 + + :param limit_basis: The limit_basis of this PlaceBizPushOrder. # noqa: E501 + :type: int + """ + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and limit_basis not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `limit_basis` ({0}), must be one of {1}" # noqa: E501 + .format(limit_basis, allowed_values) + ) + + self._limit_basis = limit_basis + + @property + def fiat_min_amount(self): + """Gets the fiat_min_amount of this PlaceBizPushOrder. # noqa: E501 + + Minimum amount per order, denominated by exchangeType; required when limitBasis is 1 # noqa: E501 + + :return: The fiat_min_amount of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._fiat_min_amount + + @fiat_min_amount.setter + def fiat_min_amount(self, fiat_min_amount): + """Sets the fiat_min_amount of this PlaceBizPushOrder. + + Minimum amount per order, denominated by exchangeType; required when limitBasis is 1 # noqa: E501 + + :param fiat_min_amount: The fiat_min_amount of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._fiat_min_amount = fiat_min_amount + + @property + def fiat_max_amount(self): + """Gets the fiat_max_amount of this PlaceBizPushOrder. # noqa: E501 + + Maximum amount per order, denominated by exchangeType; required when limitBasis is 1, and must not exceed the total fiat value of the ad quantity converted at the price # noqa: E501 + + :return: The fiat_max_amount of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._fiat_max_amount + + @fiat_max_amount.setter + def fiat_max_amount(self, fiat_max_amount): + """Sets the fiat_max_amount of this PlaceBizPushOrder. + + Maximum amount per order, denominated by exchangeType; required when limitBasis is 1, and must not exceed the total fiat value of the ad quantity converted at the price # noqa: E501 + + :param fiat_max_amount: The fiat_max_amount of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._fiat_max_amount = fiat_max_amount + + @property + def tier_limit(self): + """Gets the tier_limit of this PlaceBizPushOrder. # noqa: E501 + + Minimum counterparty VIP level; `0` means no requirement. # noqa: E501 + + :return: The tier_limit of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._tier_limit + + @tier_limit.setter + def tier_limit(self, tier_limit): + """Sets the tier_limit of this PlaceBizPushOrder. + + Minimum counterparty VIP level; `0` means no requirement. # noqa: E501 + + :param tier_limit: The tier_limit of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._tier_limit = tier_limit + + @property + def verified_limit(self): + """Gets the verified_limit of this PlaceBizPushOrder. # noqa: E501 + + Minimum counterparty verification level; `0` means no limit. # noqa: E501 + + :return: The verified_limit of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._verified_limit + + @verified_limit.setter + def verified_limit(self, verified_limit): + """Sets the verified_limit of this PlaceBizPushOrder. + + Minimum counterparty verification level; `0` means no limit. # noqa: E501 + + :param verified_limit: The verified_limit of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._verified_limit = verified_limit + + @property + def reg_time_limit(self): + """Gets the reg_time_limit of this PlaceBizPushOrder. # noqa: E501 + + Minimum counterparty account age in days; `0` means no limit. # noqa: E501 + + :return: The reg_time_limit of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._reg_time_limit + + @reg_time_limit.setter + def reg_time_limit(self, reg_time_limit): + """Sets the reg_time_limit of this PlaceBizPushOrder. + + Minimum counterparty account age in days; `0` means no limit. # noqa: E501 + + :param reg_time_limit: The reg_time_limit of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._reg_time_limit = reg_time_limit + + @property + def advertisers_limit(self): + """Gets the advertisers_limit of this PlaceBizPushOrder. # noqa: E501 + + Whether trading with the advertiser is restricted. `0`: no; `1`: yes. # noqa: E501 + + :return: The advertisers_limit of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._advertisers_limit + + @advertisers_limit.setter + def advertisers_limit(self, advertisers_limit): + """Sets the advertisers_limit of this PlaceBizPushOrder. + + Whether trading with the advertiser is restricted. `0`: no; `1`: yes. # noqa: E501 + + :param advertisers_limit: The advertisers_limit of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._advertisers_limit = advertisers_limit + + @property + def polymarket_limit(self): + """Gets the polymarket_limit of this PlaceBizPushOrder. # noqa: E501 + + Whether to restrict trading with Polymarket users. 0: no restriction, 1: restricted # noqa: E501 + + :return: The polymarket_limit of this PlaceBizPushOrder. # noqa: E501 + :rtype: int + """ + return self._polymarket_limit + + @polymarket_limit.setter + def polymarket_limit(self, polymarket_limit): + """Sets the polymarket_limit of this PlaceBizPushOrder. + + Whether to restrict trading with Polymarket users. 0: no restriction, 1: restricted # noqa: E501 + + :param polymarket_limit: The polymarket_limit of this PlaceBizPushOrder. # noqa: E501 + :type: int + """ + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and polymarket_limit not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `polymarket_limit` ({0}), must be one of {1}" # noqa: E501 + .format(polymarket_limit, allowed_values) + ) + + self._polymarket_limit = polymarket_limit + + @property + def expire_min(self): + """Gets the expire_min of this PlaceBizPushOrder. # noqa: E501 + + Payment timeout in minutes. # noqa: E501 + + :return: The expire_min of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._expire_min + + @expire_min.setter + def expire_min(self, expire_min): + """Sets the expire_min of this PlaceBizPushOrder. + + Payment timeout in minutes. # noqa: E501 + + :param expire_min: The expire_min of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._expire_min = expire_min + + @property + def trade_tips(self): + """Gets the trade_tips of this PlaceBizPushOrder. # noqa: E501 + + Advertisement trade terms displayed to ordering users; goes through off-platform traffic diversion risk control on submission, and when hit, the advertisement is not saved and code 70305102 is returned # noqa: E501 + + :return: The trade_tips of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._trade_tips + + @trade_tips.setter + def trade_tips(self, trade_tips): + """Sets the trade_tips of this PlaceBizPushOrder. + + Advertisement trade terms displayed to ordering users; goes through off-platform traffic diversion risk control on submission, and when hit, the advertisement is not saved and code 70305102 is returned # noqa: E501 + + :param trade_tips: The trade_tips of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._trade_tips = trade_tips + + @property + def auto_reply(self): + """Gets the auto_reply of this PlaceBizPushOrder. # noqa: E501 + + Auto reply content after order creation; goes through off-platform traffic diversion risk control on submission, and when hit, the advertisement is not saved and code 70305102 is returned # noqa: E501 + + :return: The auto_reply of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._auto_reply + + @auto_reply.setter + def auto_reply(self, auto_reply): + """Sets the auto_reply of this PlaceBizPushOrder. + + Auto reply content after order creation; goes through off-platform traffic diversion risk control on submission, and when hit, the advertisement is not saved and code 70305102 is returned # noqa: E501 + + :param auto_reply: The auto_reply of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._auto_reply = auto_reply + + @property + def min_completed_limit(self): + """Gets the min_completed_limit of this PlaceBizPushOrder. # noqa: E501 + + Minimum completed orders for counterparty; `-1` unlimited. # noqa: E501 + + :return: The min_completed_limit of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._min_completed_limit + + @min_completed_limit.setter + def min_completed_limit(self, min_completed_limit): + """Sets the min_completed_limit of this PlaceBizPushOrder. + + Minimum completed orders for counterparty; `-1` unlimited. # noqa: E501 + + :param min_completed_limit: The min_completed_limit of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._min_completed_limit = min_completed_limit + + @property + def max_completed_limit(self): + """Gets the max_completed_limit of this PlaceBizPushOrder. # noqa: E501 + + Maximum completed orders for counterparty; `-1` unlimited. # noqa: E501 + + :return: The max_completed_limit of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._max_completed_limit + + @max_completed_limit.setter + def max_completed_limit(self, max_completed_limit): + """Sets the max_completed_limit of this PlaceBizPushOrder. + + Maximum completed orders for counterparty; `-1` unlimited. # noqa: E501 + + :param max_completed_limit: The max_completed_limit of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._max_completed_limit = max_completed_limit + + @property + def completed_rate_limit(self): + """Gets the completed_rate_limit of this PlaceBizPushOrder. # noqa: E501 + + Counterparty minimum 30-day completion rate; `-1` means no limit. # noqa: E501 + + :return: The completed_rate_limit of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._completed_rate_limit + + @completed_rate_limit.setter + def completed_rate_limit(self, completed_rate_limit): + """Sets the completed_rate_limit of this PlaceBizPushOrder. + + Counterparty minimum 30-day completion rate; `-1` means no limit. # noqa: E501 + + :param completed_rate_limit: The completed_rate_limit of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._completed_rate_limit = completed_rate_limit + + @property + def user_country_limit(self): + """Gets the user_country_limit of this PlaceBizPushOrder. # noqa: E501 + + KYC nationality restriction; `-1` means no restriction. # noqa: E501 + + :return: The user_country_limit of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._user_country_limit + + @user_country_limit.setter + def user_country_limit(self, user_country_limit): + """Sets the user_country_limit of this PlaceBizPushOrder. + + KYC nationality restriction; `-1` means no restriction. # noqa: E501 + + :param user_country_limit: The user_country_limit of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._user_country_limit = user_country_limit + + @property + def user_order_limit(self): + """Gets the user_order_limit of this PlaceBizPushOrder. # noqa: E501 + + Maximum concurrent orders allowed for the counterparty. `-1`: unlimited. # noqa: E501 + + :return: The user_order_limit of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._user_order_limit + + @user_order_limit.setter + def user_order_limit(self, user_order_limit): + """Sets the user_order_limit of this PlaceBizPushOrder. + + Maximum concurrent orders allowed for the counterparty. `-1`: unlimited. # noqa: E501 + + :param user_order_limit: The user_order_limit of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._user_order_limit = user_order_limit + + @property + def rate_reference_id(self): + """Gets the rate_reference_id of this PlaceBizPushOrder. # noqa: E501 + + Floating price reference. `1`: platform reference; `2`: Gate reference; `3`: spot reference. # noqa: E501 + + :return: The rate_reference_id of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._rate_reference_id + + @rate_reference_id.setter + def rate_reference_id(self, rate_reference_id): + """Sets the rate_reference_id of this PlaceBizPushOrder. + + Floating price reference. `1`: platform reference; `2`: Gate reference; `3`: spot reference. # noqa: E501 + + :param rate_reference_id: The rate_reference_id of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._rate_reference_id = rate_reference_id + + @property + def rate_offset(self): + """Gets the rate_offset of this PlaceBizPushOrder. # noqa: E501 + + Absolute floating offset ratio, e.g. `0.5` means 0.5%. # noqa: E501 + + :return: The rate_offset of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._rate_offset + + @rate_offset.setter + def rate_offset(self, rate_offset): + """Sets the rate_offset of this PlaceBizPushOrder. + + Absolute floating offset ratio, e.g. `0.5` means 0.5%. # noqa: E501 + + :param rate_offset: The rate_offset of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._rate_offset = rate_offset + + @property + def float_trend(self): + """Gets the float_trend of this PlaceBizPushOrder. # noqa: E501 + + Floating direction: `0` markup; `1` markdown. # noqa: E501 + + :return: The float_trend of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._float_trend + + @float_trend.setter + def float_trend(self, float_trend): + """Sets the float_trend of this PlaceBizPushOrder. + + Floating direction: `0` markup; `1` markdown. # noqa: E501 + + :param float_trend: The float_trend of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._float_trend = float_trend + + @property + def team_payment_uid(self): + """Gets the team_payment_uid of this PlaceBizPushOrder. # noqa: E501 + + Team payee UID; optional for non-team merchants. # noqa: E501 + + :return: The team_payment_uid of this PlaceBizPushOrder. # noqa: E501 + :rtype: str + """ + return self._team_payment_uid + + @team_payment_uid.setter + def team_payment_uid(self, team_payment_uid): + """Sets the team_payment_uid of this PlaceBizPushOrder. + + Team payee UID; optional for non-team merchants. # noqa: E501 + + :param team_payment_uid: The team_payment_uid of this PlaceBizPushOrder. # noqa: E501 + :type: str + """ + + self._team_payment_uid = team_payment_uid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PlaceBizPushOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PlaceBizPushOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/place_dual_investment_order.py b/gate_api/models/place_dual_investment_order.py index 46346c12..2af61ce1 100644 --- a/gate_api/models/place_dual_investment_order.py +++ b/gate_api/models/place_dual_investment_order.py @@ -33,34 +33,124 @@ class PlaceDualInvestmentOrder(object): and the value is json key in definition. """ openapi_types = { - 'plan_id': 'str', - 'amount': 'str', + 'id': 'int', + 'plan_id': 'int', + 'invest_amount': 'str', + 'settlement_amount': 'str', + 'create_time': 'int', + 'complete_time': 'int', + 'status': 'str', + 'invest_currency': 'str', + 'exercise_currency': 'str', + 'exercise_price': 'str', + 'settlement_price': 'str', + 'settlement_currency': 'str', + 'apy_display': 'str', + 'apy_settlement': 'str', + 'delivery_time': 'int', 'text': 'str' } attribute_map = { + 'id': 'id', 'plan_id': 'plan_id', - 'amount': 'amount', + 'invest_amount': 'invest_amount', + 'settlement_amount': 'settlement_amount', + 'create_time': 'create_time', + 'complete_time': 'complete_time', + 'status': 'status', + 'invest_currency': 'invest_currency', + 'exercise_currency': 'exercise_currency', + 'exercise_price': 'exercise_price', + 'settlement_price': 'settlement_price', + 'settlement_currency': 'settlement_currency', + 'apy_display': 'apy_display', + 'apy_settlement': 'apy_settlement', + 'delivery_time': 'delivery_time', 'text': 'text' } - def __init__(self, plan_id=None, amount=None, text=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, Configuration) -> None + def __init__(self, id=None, plan_id=None, invest_amount=None, settlement_amount=None, create_time=None, complete_time=None, status=None, invest_currency=None, exercise_currency=None, exercise_price=None, settlement_price=None, settlement_currency=None, apy_display=None, apy_settlement=None, delivery_time=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, str, int, int, str, str, str, str, str, str, str, str, int, str, Configuration) -> None """PlaceDualInvestmentOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration + self._id = None self._plan_id = None - self._amount = None + self._invest_amount = None + self._settlement_amount = None + self._create_time = None + self._complete_time = None + self._status = None + self._invest_currency = None + self._exercise_currency = None + self._exercise_price = None + self._settlement_price = None + self._settlement_currency = None + self._apy_display = None + self._apy_settlement = None + self._delivery_time = None self._text = None self.discriminator = None - self.plan_id = plan_id - self.amount = amount + if id is not None: + self.id = id + if plan_id is not None: + self.plan_id = plan_id + if invest_amount is not None: + self.invest_amount = invest_amount + if settlement_amount is not None: + self.settlement_amount = settlement_amount + if create_time is not None: + self.create_time = create_time + if complete_time is not None: + self.complete_time = complete_time + if status is not None: + self.status = status + if invest_currency is not None: + self.invest_currency = invest_currency + if exercise_currency is not None: + self.exercise_currency = exercise_currency + if exercise_price is not None: + self.exercise_price = exercise_price + if settlement_price is not None: + self.settlement_price = settlement_price + if settlement_currency is not None: + self.settlement_currency = settlement_currency + if apy_display is not None: + self.apy_display = apy_display + if apy_settlement is not None: + self.apy_settlement = apy_settlement + if delivery_time is not None: + self.delivery_time = delivery_time if text is not None: self.text = text + @property + def id(self): + """Gets the id of this PlaceDualInvestmentOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PlaceDualInvestmentOrder. + + Order ID # noqa: E501 + + :param id: The id of this PlaceDualInvestmentOrder. # noqa: E501 + :type: int + """ + + self._id = id + @property def plan_id(self): """Gets the plan_id of this PlaceDualInvestmentOrder. # noqa: E501 @@ -68,7 +158,7 @@ def plan_id(self): Product ID # noqa: E501 :return: The plan_id of this PlaceDualInvestmentOrder. # noqa: E501 - :rtype: str + :rtype: int """ return self._plan_id @@ -79,43 +169,315 @@ def plan_id(self, plan_id): Product ID # noqa: E501 :param plan_id: The plan_id of this PlaceDualInvestmentOrder. # noqa: E501 - :type: str + :type: int """ - if self.local_vars_configuration.client_side_validation and plan_id is None: # noqa: E501 - raise ValueError("Invalid value for `plan_id`, must not be `None`") # noqa: E501 self._plan_id = plan_id @property - def amount(self): - """Gets the amount of this PlaceDualInvestmentOrder. # noqa: E501 + def invest_amount(self): + """Gets the invest_amount of this PlaceDualInvestmentOrder. # noqa: E501 + + Investment Quantity # noqa: E501 + + :return: The invest_amount of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._invest_amount + + @invest_amount.setter + def invest_amount(self, invest_amount): + """Sets the invest_amount of this PlaceDualInvestmentOrder. + + Investment Quantity # noqa: E501 + + :param invest_amount: The invest_amount of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + + self._invest_amount = invest_amount + + @property + def settlement_amount(self): + """Gets the settlement_amount of this PlaceDualInvestmentOrder. # noqa: E501 + + Settlement Quantity # noqa: E501 + + :return: The settlement_amount of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._settlement_amount + + @settlement_amount.setter + def settlement_amount(self, settlement_amount): + """Sets the settlement_amount of this PlaceDualInvestmentOrder. + + Settlement Quantity # noqa: E501 + + :param settlement_amount: The settlement_amount of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + + self._settlement_amount = settlement_amount + + @property + def create_time(self): + """Gets the create_time of this PlaceDualInvestmentOrder. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this PlaceDualInvestmentOrder. + + Created time # noqa: E501 + + :param create_time: The create_time of this PlaceDualInvestmentOrder. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def complete_time(self): + """Gets the complete_time of this PlaceDualInvestmentOrder. # noqa: E501 + + Completed Time # noqa: E501 + + :return: The complete_time of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: int + """ + return self._complete_time + + @complete_time.setter + def complete_time(self, complete_time): + """Sets the complete_time of this PlaceDualInvestmentOrder. + + Completed Time # noqa: E501 + + :param complete_time: The complete_time of this PlaceDualInvestmentOrder. # noqa: E501 + :type: int + """ + + self._complete_time = complete_time + + @property + def status(self): + """Gets the status of this PlaceDualInvestmentOrder. # noqa: E501 + + Status: `INIT`-Created `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-Settlement Processing `CANCELED`-Canceled `FAILED`-Failed # noqa: E501 + + :return: The status of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this PlaceDualInvestmentOrder. + + Status: `INIT`-Created `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-Settlement Processing `CANCELED`-Canceled `FAILED`-Failed # noqa: E501 + + :param status: The status of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def invest_currency(self): + """Gets the invest_currency of this PlaceDualInvestmentOrder. # noqa: E501 + + Investment Token # noqa: E501 + + :return: The invest_currency of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._invest_currency + + @invest_currency.setter + def invest_currency(self, invest_currency): + """Sets the invest_currency of this PlaceDualInvestmentOrder. + + Investment Token # noqa: E501 + + :param invest_currency: The invest_currency of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + + self._invest_currency = invest_currency + + @property + def exercise_currency(self): + """Gets the exercise_currency of this PlaceDualInvestmentOrder. # noqa: E501 + + Strike Token # noqa: E501 + + :return: The exercise_currency of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._exercise_currency + + @exercise_currency.setter + def exercise_currency(self, exercise_currency): + """Sets the exercise_currency of this PlaceDualInvestmentOrder. + + Strike Token # noqa: E501 + + :param exercise_currency: The exercise_currency of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + + self._exercise_currency = exercise_currency + + @property + def exercise_price(self): + """Gets the exercise_price of this PlaceDualInvestmentOrder. # noqa: E501 + + Strike price # noqa: E501 + + :return: The exercise_price of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._exercise_price + + @exercise_price.setter + def exercise_price(self, exercise_price): + """Sets the exercise_price of this PlaceDualInvestmentOrder. + + Strike price # noqa: E501 + + :param exercise_price: The exercise_price of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + + self._exercise_price = exercise_price + + @property + def settlement_price(self): + """Gets the settlement_price of this PlaceDualInvestmentOrder. # noqa: E501 - Subscription amount, mutually exclusive with copies field # noqa: E501 + Settlement price # noqa: E501 - :return: The amount of this PlaceDualInvestmentOrder. # noqa: E501 + :return: The settlement_price of this PlaceDualInvestmentOrder. # noqa: E501 :rtype: str """ - return self._amount + return self._settlement_price - @amount.setter - def amount(self, amount): - """Sets the amount of this PlaceDualInvestmentOrder. + @settlement_price.setter + def settlement_price(self, settlement_price): + """Sets the settlement_price of this PlaceDualInvestmentOrder. - Subscription amount, mutually exclusive with copies field # noqa: E501 + Settlement price # noqa: E501 - :param amount: The amount of this PlaceDualInvestmentOrder. # noqa: E501 + :param settlement_price: The settlement_price of this PlaceDualInvestmentOrder. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 - self._amount = amount + self._settlement_price = settlement_price + + @property + def settlement_currency(self): + """Gets the settlement_currency of this PlaceDualInvestmentOrder. # noqa: E501 + + Settlement currency # noqa: E501 + + :return: The settlement_currency of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._settlement_currency + + @settlement_currency.setter + def settlement_currency(self, settlement_currency): + """Sets the settlement_currency of this PlaceDualInvestmentOrder. + + Settlement currency # noqa: E501 + + :param settlement_currency: The settlement_currency of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + + self._settlement_currency = settlement_currency + + @property + def apy_display(self): + """Gets the apy_display of this PlaceDualInvestmentOrder. # noqa: E501 + + Annual Yield # noqa: E501 + + :return: The apy_display of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._apy_display + + @apy_display.setter + def apy_display(self, apy_display): + """Sets the apy_display of this PlaceDualInvestmentOrder. + + Annual Yield # noqa: E501 + + :param apy_display: The apy_display of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + + self._apy_display = apy_display + + @property + def apy_settlement(self): + """Gets the apy_settlement of this PlaceDualInvestmentOrder. # noqa: E501 + + Settlement Annual Yield # noqa: E501 + + :return: The apy_settlement of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._apy_settlement + + @apy_settlement.setter + def apy_settlement(self, apy_settlement): + """Sets the apy_settlement of this PlaceDualInvestmentOrder. + + Settlement Annual Yield # noqa: E501 + + :param apy_settlement: The apy_settlement of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + + self._apy_settlement = apy_settlement + + @property + def delivery_time(self): + """Gets the delivery_time of this PlaceDualInvestmentOrder. # noqa: E501 + + Settlement time # noqa: E501 + + :return: The delivery_time of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: int + """ + return self._delivery_time + + @delivery_time.setter + def delivery_time(self, delivery_time): + """Sets the delivery_time of this PlaceDualInvestmentOrder. + + Settlement time # noqa: E501 + + :param delivery_time: The delivery_time of this PlaceDualInvestmentOrder. # noqa: E501 + :type: int + """ + + self._delivery_time = delivery_time @property def text(self): """Gets the text of this PlaceDualInvestmentOrder. # noqa: E501 - Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) # noqa: E501 + Custom order information # noqa: E501 :return: The text of this PlaceDualInvestmentOrder. # noqa: E501 :rtype: str @@ -126,7 +488,7 @@ def text(self): def text(self, text): """Sets the text of this PlaceDualInvestmentOrder. - Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) # noqa: E501 + Custom order information # noqa: E501 :param text: The text of this PlaceDualInvestmentOrder. # noqa: E501 :type: str diff --git a/gate_api/models/place_dual_investment_order_params.py b/gate_api/models/place_dual_investment_order_params.py new file mode 100644 index 00000000..9ced828b --- /dev/null +++ b/gate_api/models/place_dual_investment_order_params.py @@ -0,0 +1,181 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PlaceDualInvestmentOrderParams(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'plan_id': 'str', + 'amount': 'str', + 'text': 'str' + } + + attribute_map = { + 'plan_id': 'plan_id', + 'amount': 'amount', + 'text': 'text' + } + + def __init__(self, plan_id=None, amount=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """PlaceDualInvestmentOrderParams - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._plan_id = None + self._amount = None + self._text = None + self.discriminator = None + + self.plan_id = plan_id + self.amount = amount + if text is not None: + self.text = text + + @property + def plan_id(self): + """Gets the plan_id of this PlaceDualInvestmentOrderParams. # noqa: E501 + + Product ID # noqa: E501 + + :return: The plan_id of this PlaceDualInvestmentOrderParams. # noqa: E501 + :rtype: str + """ + return self._plan_id + + @plan_id.setter + def plan_id(self, plan_id): + """Sets the plan_id of this PlaceDualInvestmentOrderParams. + + Product ID # noqa: E501 + + :param plan_id: The plan_id of this PlaceDualInvestmentOrderParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and plan_id is None: # noqa: E501 + raise ValueError("Invalid value for `plan_id`, must not be `None`") # noqa: E501 + + self._plan_id = plan_id + + @property + def amount(self): + """Gets the amount of this PlaceDualInvestmentOrderParams. # noqa: E501 + + Subscription amount # noqa: E501 + + :return: The amount of this PlaceDualInvestmentOrderParams. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this PlaceDualInvestmentOrderParams. + + Subscription amount # noqa: E501 + + :param amount: The amount of this PlaceDualInvestmentOrderParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def text(self): + """Gets the text of this PlaceDualInvestmentOrderParams. # noqa: E501 + + Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :return: The text of this PlaceDualInvestmentOrderParams. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this PlaceDualInvestmentOrderParams. + + Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :param text: The text of this PlaceDualInvestmentOrderParams. # noqa: E501 + :type: str + """ + + self._text = text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PlaceDualInvestmentOrderParams): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PlaceDualInvestmentOrderParams): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/place_order_request.py b/gate_api/models/place_order_request.py new file mode 100644 index 00000000..5e01a9af --- /dev/null +++ b/gate_api/models/place_order_request.py @@ -0,0 +1,268 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PlaceOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency': 'str', + 'side': 'str', + 'amount': 'str', + 'gas_mode': 'str', + 'slippage': 'str', + 'quote_id': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'side': 'side', + 'amount': 'amount', + 'gas_mode': 'gas_mode', + 'slippage': 'slippage', + 'quote_id': 'quote_id' + } + + def __init__(self, currency=None, side=None, amount=None, gas_mode=None, slippage=None, quote_id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, Configuration) -> None + """PlaceOrderRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._side = None + self._amount = None + self._gas_mode = None + self._slippage = None + self._quote_id = None + self.discriminator = None + + self.currency = currency + self.side = side + self.amount = amount + self.gas_mode = gas_mode + if slippage is not None: + self.slippage = slippage + self.quote_id = quote_id + + @property + def currency(self): + """Gets the currency of this PlaceOrderRequest. # noqa: E501 + + Trading symbol # noqa: E501 + + :return: The currency of this PlaceOrderRequest. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this PlaceOrderRequest. + + Trading symbol # noqa: E501 + + :param currency: The currency of this PlaceOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501 + raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501 + + self._currency = currency + + @property + def side(self): + """Gets the side of this PlaceOrderRequest. # noqa: E501 + + Buy or sell orders - buy - sell # noqa: E501 + + :return: The side of this PlaceOrderRequest. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this PlaceOrderRequest. + + Buy or sell orders - buy - sell # noqa: E501 + + :param side: The side of this PlaceOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def amount(self): + """Gets the amount of this PlaceOrderRequest. # noqa: E501 + + Trade Quantity - `side` : `buy` refers to the quote currency, i.e., `USDT` - `side` : `sell` refers to the base currency # noqa: E501 + + :return: The amount of this PlaceOrderRequest. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this PlaceOrderRequest. + + Trade Quantity - `side` : `buy` refers to the quote currency, i.e., `USDT` - `side` : `sell` refers to the base currency # noqa: E501 + + :param amount: The amount of this PlaceOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def gas_mode(self): + """Gets the gas_mode of this PlaceOrderRequest. # noqa: E501 + + Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter # noqa: E501 + + :return: The gas_mode of this PlaceOrderRequest. # noqa: E501 + :rtype: str + """ + return self._gas_mode + + @gas_mode.setter + def gas_mode(self, gas_mode): + """Sets the gas_mode of this PlaceOrderRequest. + + Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter # noqa: E501 + + :param gas_mode: The gas_mode of this PlaceOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and gas_mode is None: # noqa: E501 + raise ValueError("Invalid value for `gas_mode`, must not be `None`") # noqa: E501 + + self._gas_mode = gas_mode + + @property + def slippage(self): + """Gets the slippage of this PlaceOrderRequest. # noqa: E501 + + Slippage tolerance (10 means 10% tolerance) # noqa: E501 + + :return: The slippage of this PlaceOrderRequest. # noqa: E501 + :rtype: str + """ + return self._slippage + + @slippage.setter + def slippage(self, slippage): + """Sets the slippage of this PlaceOrderRequest. + + Slippage tolerance (10 means 10% tolerance) # noqa: E501 + + :param slippage: The slippage of this PlaceOrderRequest. # noqa: E501 + :type: str + """ + + self._slippage = slippage + + @property + def quote_id(self): + """Gets the quote_id of this PlaceOrderRequest. # noqa: E501 + + Quote ID returned from quotation API # noqa: E501 + + :return: The quote_id of this PlaceOrderRequest. # noqa: E501 + :rtype: str + """ + return self._quote_id + + @quote_id.setter + def quote_id(self, quote_id): + """Sets the quote_id of this PlaceOrderRequest. + + Quote ID returned from quotation API # noqa: E501 + + :param quote_id: The quote_id of this PlaceOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and quote_id is None: # noqa: E501 + raise ValueError("Invalid value for `quote_id`, must not be `None`") # noqa: E501 + + self._quote_id = quote_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PlaceOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PlaceOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/place_order_response.py b/gate_api/models/place_order_response.py new file mode 100644 index 00000000..82a03527 --- /dev/null +++ b/gate_api/models/place_order_response.py @@ -0,0 +1,319 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PlaceOrderResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'str', + 'status': 'int', + 'side': 'str', + 'gas_mode': 'str', + 'create_time': 'int', + 'amount': 'str', + 'token_address': 'str', + 'chain': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'status': 'status', + 'side': 'side', + 'gas_mode': 'gas_mode', + 'create_time': 'create_time', + 'amount': 'amount', + 'token_address': 'token_address', + 'chain': 'chain' + } + + def __init__(self, order_id=None, status=None, side=None, gas_mode=None, create_time=None, amount=None, token_address=None, chain=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, str, str, int, str, str, str, Configuration) -> None + """PlaceOrderResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._status = None + self._side = None + self._gas_mode = None + self._create_time = None + self._amount = None + self._token_address = None + self._chain = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if status is not None: + self.status = status + if side is not None: + self.side = side + if gas_mode is not None: + self.gas_mode = gas_mode + if create_time is not None: + self.create_time = create_time + if amount is not None: + self.amount = amount + if token_address is not None: + self.token_address = token_address + if chain is not None: + self.chain = chain + + @property + def order_id(self): + """Gets the order_id of this PlaceOrderResponse. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this PlaceOrderResponse. # noqa: E501 + :rtype: str + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this PlaceOrderResponse. + + Order ID # noqa: E501 + + :param order_id: The order_id of this PlaceOrderResponse. # noqa: E501 + :type: str + """ + + self._order_id = order_id + + @property + def status(self): + """Gets the status of this PlaceOrderResponse. # noqa: E501 + + Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed # noqa: E501 + + :return: The status of this PlaceOrderResponse. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this PlaceOrderResponse. + + Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed # noqa: E501 + + :param status: The status of this PlaceOrderResponse. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def side(self): + """Gets the side of this PlaceOrderResponse. # noqa: E501 + + Buy or sell orders - buy - sell # noqa: E501 + + :return: The side of this PlaceOrderResponse. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this PlaceOrderResponse. + + Buy or sell orders - buy - sell # noqa: E501 + + :param side: The side of this PlaceOrderResponse. # noqa: E501 + :type: str + """ + + self._side = side + + @property + def gas_mode(self): + """Gets the gas_mode of this PlaceOrderResponse. # noqa: E501 + + Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter # noqa: E501 + + :return: The gas_mode of this PlaceOrderResponse. # noqa: E501 + :rtype: str + """ + return self._gas_mode + + @gas_mode.setter + def gas_mode(self, gas_mode): + """Sets the gas_mode of this PlaceOrderResponse. + + Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter # noqa: E501 + + :param gas_mode: The gas_mode of this PlaceOrderResponse. # noqa: E501 + :type: str + """ + + self._gas_mode = gas_mode + + @property + def create_time(self): + """Gets the create_time of this PlaceOrderResponse. # noqa: E501 + + Creation timestamp # noqa: E501 + + :return: The create_time of this PlaceOrderResponse. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this PlaceOrderResponse. + + Creation timestamp # noqa: E501 + + :param create_time: The create_time of this PlaceOrderResponse. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def amount(self): + """Gets the amount of this PlaceOrderResponse. # noqa: E501 + + Trade Quantity - `side` : `buy` refers to the quote currency, i.e., `USDT` - `side` : `sell` refers to the base currency # noqa: E501 + + :return: The amount of this PlaceOrderResponse. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this PlaceOrderResponse. + + Trade Quantity - `side` : `buy` refers to the quote currency, i.e., `USDT` - `side` : `sell` refers to the base currency # noqa: E501 + + :param amount: The amount of this PlaceOrderResponse. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def token_address(self): + """Gets the token_address of this PlaceOrderResponse. # noqa: E501 + + Token contract address # noqa: E501 + + :return: The token_address of this PlaceOrderResponse. # noqa: E501 + :rtype: str + """ + return self._token_address + + @token_address.setter + def token_address(self, token_address): + """Sets the token_address of this PlaceOrderResponse. + + Token contract address # noqa: E501 + + :param token_address: The token_address of this PlaceOrderResponse. # noqa: E501 + :type: str + """ + + self._token_address = token_address + + @property + def chain(self): + """Gets the chain of this PlaceOrderResponse. # noqa: E501 + + Blockchain name # noqa: E501 + + :return: The chain of this PlaceOrderResponse. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this PlaceOrderResponse. + + Blockchain name # noqa: E501 + + :param chain: The chain of this PlaceOrderResponse. # noqa: E501 + :type: str + """ + + self._chain = chain + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PlaceOrderResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PlaceOrderResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position.py b/gate_api/models/position.py index 09e08d35..7923b9e8 100644 --- a/gate_api/models/position.py +++ b/gate_api/models/position.py @@ -36,6 +36,9 @@ class Position(object): 'user': 'int', 'contract': 'str', 'size': 'str', + 'hedge_status': 'str', + 'hedged_size': 'str', + 'unhedged_size': 'str', 'leverage': 'str', 'risk_limit': 'str', 'leverage_max': 'str', @@ -66,13 +69,18 @@ class Position(object): 'open_time': 'int', 'risk_limit_table': 'str', 'average_maintenance_rate': 'str', - 'pid': 'int' + 'pid': 'int', + 'pos_margin_mode': 'str', + 'lever': 'str' } attribute_map = { 'user': 'user', 'contract': 'contract', 'size': 'size', + 'hedge_status': 'hedge_status', + 'hedged_size': 'hedged_size', + 'unhedged_size': 'unhedged_size', 'leverage': 'leverage', 'risk_limit': 'risk_limit', 'leverage_max': 'leverage_max', @@ -103,11 +111,13 @@ class Position(object): 'open_time': 'open_time', 'risk_limit_table': 'risk_limit_table', 'average_maintenance_rate': 'average_maintenance_rate', - 'pid': 'pid' + 'pid': 'pid', + 'pos_margin_mode': 'pos_margin_mode', + 'lever': 'lever' } - def __init__(self, user=None, contract=None, size=None, leverage=None, risk_limit=None, leverage_max=None, maintenance_rate=None, value=None, margin=None, entry_price=None, liq_price=None, mark_price=None, initial_margin=None, maintenance_margin=None, unrealised_pnl=None, realised_pnl=None, pnl_pnl=None, pnl_fund=None, pnl_fee=None, history_pnl=None, last_close_pnl=None, realised_point=None, history_point=None, adl_ranking=None, pending_orders=None, close_order=None, mode=None, cross_leverage_limit=None, update_time=None, update_id=None, open_time=None, risk_limit_table=None, average_maintenance_rate=None, pid=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, int, PositionCloseOrder, str, str, int, int, int, str, str, int, Configuration) -> None + def __init__(self, user=None, contract=None, size=None, hedge_status=None, hedged_size=None, unhedged_size=None, leverage=None, risk_limit=None, leverage_max=None, maintenance_rate=None, value=None, margin=None, entry_price=None, liq_price=None, mark_price=None, initial_margin=None, maintenance_margin=None, unrealised_pnl=None, realised_pnl=None, pnl_pnl=None, pnl_fund=None, pnl_fee=None, history_pnl=None, last_close_pnl=None, realised_point=None, history_point=None, adl_ranking=None, pending_orders=None, close_order=None, mode=None, cross_leverage_limit=None, update_time=None, update_id=None, open_time=None, risk_limit_table=None, average_maintenance_rate=None, pid=None, pos_margin_mode=None, lever=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, int, PositionCloseOrder, str, str, int, int, int, str, str, int, str, str, Configuration) -> None """Position - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -116,6 +126,9 @@ def __init__(self, user=None, contract=None, size=None, leverage=None, risk_limi self._user = None self._contract = None self._size = None + self._hedge_status = None + self._hedged_size = None + self._unhedged_size = None self._leverage = None self._risk_limit = None self._leverage_max = None @@ -147,6 +160,8 @@ def __init__(self, user=None, contract=None, size=None, leverage=None, risk_limi self._risk_limit_table = None self._average_maintenance_rate = None self._pid = None + self._pos_margin_mode = None + self._lever = None self.discriminator = None if user is not None: @@ -155,6 +170,12 @@ def __init__(self, user=None, contract=None, size=None, leverage=None, risk_limi self.contract = contract if size is not None: self.size = size + if hedge_status is not None: + self.hedge_status = hedge_status + if hedged_size is not None: + self.hedged_size = hedged_size + if unhedged_size is not None: + self.unhedged_size = unhedged_size if leverage is not None: self.leverage = leverage if risk_limit is not None: @@ -216,6 +237,10 @@ def __init__(self, user=None, contract=None, size=None, leverage=None, risk_limi self.average_maintenance_rate = average_maintenance_rate if pid is not None: self.pid = pid + if pos_margin_mode is not None: + self.pos_margin_mode = pos_margin_mode + if lever is not None: + self.lever = lever @property def user(self): @@ -286,6 +311,81 @@ def size(self, size): self._size = size + @property + def hedge_status(self): + """Gets the hedge_status of this Position. # noqa: E501 + + The hedging status of the position under the Delta-neutral strategy. Including: - `partial_hedged`: partially hedged - `full_hedged`: fully hedged # noqa: E501 + + :return: The hedge_status of this Position. # noqa: E501 + :rtype: str + """ + return self._hedge_status + + @hedge_status.setter + def hedge_status(self, hedge_status): + """Sets the hedge_status of this Position. + + The hedging status of the position under the Delta-neutral strategy. Including: - `partial_hedged`: partially hedged - `full_hedged`: fully hedged # noqa: E501 + + :param hedge_status: The hedge_status of this Position. # noqa: E501 + :type: str + """ + allowed_values = ["partial_hedged", "full_hedged"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and hedge_status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `hedge_status` ({0}), must be one of {1}" # noqa: E501 + .format(hedge_status, allowed_values) + ) + + self._hedge_status = hedge_status + + @property + def hedged_size(self): + """Gets the hedged_size of this Position. # noqa: E501 + + The hedged position size under the Delta-neutral strategy. # noqa: E501 + + :return: The hedged_size of this Position. # noqa: E501 + :rtype: str + """ + return self._hedged_size + + @hedged_size.setter + def hedged_size(self, hedged_size): + """Sets the hedged_size of this Position. + + The hedged position size under the Delta-neutral strategy. # noqa: E501 + + :param hedged_size: The hedged_size of this Position. # noqa: E501 + :type: str + """ + + self._hedged_size = hedged_size + + @property + def unhedged_size(self): + """Gets the unhedged_size of this Position. # noqa: E501 + + The unhedged position size under the Delta-neutral strategy, calculated as `max(abs(size) - abs(hedged_size), 0)`. # noqa: E501 + + :return: The unhedged_size of this Position. # noqa: E501 + :rtype: str + """ + return self._unhedged_size + + @unhedged_size.setter + def unhedged_size(self, unhedged_size): + """Sets the unhedged_size of this Position. + + The unhedged position size under the Delta-neutral strategy, calculated as `max(abs(size) - abs(hedged_size), 0)`. # noqa: E501 + + :param unhedged_size: The unhedged_size of this Position. # noqa: E501 + :type: str + """ + + self._unhedged_size = unhedged_size + @property def leverage(self): """Gets the leverage of this Position. # noqa: E501 @@ -405,7 +505,7 @@ def value(self, value): def margin(self): """Gets the margin of this Position. # noqa: E501 - Position margin # noqa: E501 + Margin # noqa: E501 :return: The margin of this Position. # noqa: E501 :rtype: str @@ -416,7 +516,7 @@ def margin(self): def margin(self, margin): """Sets the margin of this Position. - Position margin # noqa: E501 + Margin # noqa: E501 :param margin: The margin of this Position. # noqa: E501 :type: str @@ -1003,6 +1103,52 @@ def pid(self, pid): self._pid = pid + @property + def pos_margin_mode(self): + """Gets the pos_margin_mode of this Position. # noqa: E501 + + Position Margin Mode isolated - Isolated Margin, cross - Cross Margin # noqa: E501 + + :return: The pos_margin_mode of this Position. # noqa: E501 + :rtype: str + """ + return self._pos_margin_mode + + @pos_margin_mode.setter + def pos_margin_mode(self, pos_margin_mode): + """Sets the pos_margin_mode of this Position. + + Position Margin Mode isolated - Isolated Margin, cross - Cross Margin # noqa: E501 + + :param pos_margin_mode: The pos_margin_mode of this Position. # noqa: E501 + :type: str + """ + + self._pos_margin_mode = pos_margin_mode + + @property + def lever(self): + """Gets the lever of this Position. # noqa: E501 + + Indicates the current leverage of the position, applicable to both isolated and cross margin, gradually replacing the current leverage and cross_leverage_limit # noqa: E501 + + :return: The lever of this Position. # noqa: E501 + :rtype: str + """ + return self._lever + + @lever.setter + def lever(self, lever): + """Sets the lever of this Position. + + Indicates the current leverage of the position, applicable to both isolated and cross margin, gradually replacing the current leverage and cross_leverage_limit # noqa: E501 + + :param lever: The lever of this Position. # noqa: E501 + :type: str + """ + + self._lever = lever + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/position_history_list.py b/gate_api/models/position_history_list.py new file mode 100644 index 00000000..b1d909e2 --- /dev/null +++ b/gate_api/models/position_history_list.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionHistoryList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'PositionHistoryListData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, PositionHistoryListData, Configuration) -> None + """PositionHistoryList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this PositionHistoryList. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this PositionHistoryList. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this PositionHistoryList. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this PositionHistoryList. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this PositionHistoryList. # noqa: E501 + + + :return: The data of this PositionHistoryList. # noqa: E501 + :rtype: PositionHistoryListData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this PositionHistoryList. + + + :param data: The data of this PositionHistoryList. # noqa: E501 + :type: PositionHistoryListData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionHistoryList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionHistoryList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_history_list_data.py b/gate_api/models/position_history_list_data.py new file mode 100644 index 00000000..9807a2f8 --- /dev/null +++ b/gate_api/models/position_history_list_data.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionHistoryListData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'total': 'int', + 'total_page': 'int', + 'list': 'list[PositionHistoryListDataList]' + } + + attribute_map = { + 'total': 'total', + 'total_page': 'total_page', + 'list': 'list' + } + + def __init__(self, total=None, total_page=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, list[PositionHistoryListDataList], Configuration) -> None + """PositionHistoryListData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._total_page = None + self._list = None + self.discriminator = None + + if total is not None: + self.total = total + if total_page is not None: + self.total_page = total_page + if list is not None: + self.list = list + + @property + def total(self): + """Gets the total of this PositionHistoryListData. # noqa: E501 + + Total amount # noqa: E501 + + :return: The total of this PositionHistoryListData. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this PositionHistoryListData. + + Total amount # noqa: E501 + + :param total: The total of this PositionHistoryListData. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def total_page(self): + """Gets the total_page of this PositionHistoryListData. # noqa: E501 + + Total pages # noqa: E501 + + :return: The total_page of this PositionHistoryListData. # noqa: E501 + :rtype: int + """ + return self._total_page + + @total_page.setter + def total_page(self, total_page): + """Sets the total_page of this PositionHistoryListData. + + Total pages # noqa: E501 + + :param total_page: The total_page of this PositionHistoryListData. # noqa: E501 + :type: int + """ + + self._total_page = total_page + + @property + def list(self): + """Gets the list of this PositionHistoryListData. # noqa: E501 + + Query historical position list # noqa: E501 + + :return: The list of this PositionHistoryListData. # noqa: E501 + :rtype: list[PositionHistoryListDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this PositionHistoryListData. + + Query historical position list # noqa: E501 + + :param list: The list of this PositionHistoryListData. # noqa: E501 + :type: list[PositionHistoryListDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionHistoryListData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionHistoryListData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_history_list_data_close_detail.py b/gate_api/models/position_history_list_data_close_detail.py new file mode 100644 index 00000000..931ce0b4 --- /dev/null +++ b/gate_api/models/position_history_list_data_close_detail.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionHistoryListDataCloseDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'margin_level': 'str', + 'margin': 'str', + 'equity': 'str', + 'stop_out_level': 'str' + } + + attribute_map = { + 'margin_level': 'margin_level', + 'margin': 'margin', + 'equity': 'equity', + 'stop_out_level': 'stop_out_level' + } + + def __init__(self, margin_level=None, margin=None, equity=None, stop_out_level=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """PositionHistoryListDataCloseDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._margin_level = None + self._margin = None + self._equity = None + self._stop_out_level = None + self.discriminator = None + + if margin_level is not None: + self.margin_level = margin_level + if margin is not None: + self.margin = margin + if equity is not None: + self.equity = equity + if stop_out_level is not None: + self.stop_out_level = stop_out_level + + @property + def margin_level(self): + """Gets the margin_level of this PositionHistoryListDataCloseDetail. # noqa: E501 + + Margin ratio (multiplied by 100) # noqa: E501 + + :return: The margin_level of this PositionHistoryListDataCloseDetail. # noqa: E501 + :rtype: str + """ + return self._margin_level + + @margin_level.setter + def margin_level(self, margin_level): + """Sets the margin_level of this PositionHistoryListDataCloseDetail. + + Margin ratio (multiplied by 100) # noqa: E501 + + :param margin_level: The margin_level of this PositionHistoryListDataCloseDetail. # noqa: E501 + :type: str + """ + + self._margin_level = margin_level + + @property + def margin(self): + """Gets the margin of this PositionHistoryListDataCloseDetail. # noqa: E501 + + Margin # noqa: E501 + + :return: The margin of this PositionHistoryListDataCloseDetail. # noqa: E501 + :rtype: str + """ + return self._margin + + @margin.setter + def margin(self, margin): + """Sets the margin of this PositionHistoryListDataCloseDetail. + + Margin # noqa: E501 + + :param margin: The margin of this PositionHistoryListDataCloseDetail. # noqa: E501 + :type: str + """ + + self._margin = margin + + @property + def equity(self): + """Gets the equity of this PositionHistoryListDataCloseDetail. # noqa: E501 + + Net equity # noqa: E501 + + :return: The equity of this PositionHistoryListDataCloseDetail. # noqa: E501 + :rtype: str + """ + return self._equity + + @equity.setter + def equity(self, equity): + """Sets the equity of this PositionHistoryListDataCloseDetail. + + Net equity # noqa: E501 + + :param equity: The equity of this PositionHistoryListDataCloseDetail. # noqa: E501 + :type: str + """ + + self._equity = equity + + @property + def stop_out_level(self): + """Gets the stop_out_level of this PositionHistoryListDataCloseDetail. # noqa: E501 + + Liquidation ratio (multiplied by 100) # noqa: E501 + + :return: The stop_out_level of this PositionHistoryListDataCloseDetail. # noqa: E501 + :rtype: str + """ + return self._stop_out_level + + @stop_out_level.setter + def stop_out_level(self, stop_out_level): + """Sets the stop_out_level of this PositionHistoryListDataCloseDetail. + + Liquidation ratio (multiplied by 100) # noqa: E501 + + :param stop_out_level: The stop_out_level of this PositionHistoryListDataCloseDetail. # noqa: E501 + :type: str + """ + + self._stop_out_level = stop_out_level + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionHistoryListDataCloseDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionHistoryListDataCloseDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_history_list_data_list.py b/gate_api/models/position_history_list_data_list.py new file mode 100644 index 00000000..16ecf7af --- /dev/null +++ b/gate_api/models/position_history_list_data_list.py @@ -0,0 +1,584 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionHistoryListDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'position_id': 'int', + 'symbol': 'str', + 'realized_pnl': 'str', + 'realized_pnl_rate': 'str', + 'volume': 'str', + 'volume_closed': 'str', + 'price_open': 'str', + 'position_dir': 'str', + 'price_tp': 'str', + 'price_sl': 'str', + 'counterparty_price': 'str', + 'close_price': 'str', + 'time_create': 'str', + 'time_close': 'str', + 'position_status': 'str', + 'close_detail': 'PositionHistoryListDataCloseDetail', + 'realized_pnl_detail': 'PositionHistoryListDataRealizedPnlDetail' + } + + attribute_map = { + 'position_id': 'position_id', + 'symbol': 'symbol', + 'realized_pnl': 'realized_pnl', + 'realized_pnl_rate': 'realized_pnl_rate', + 'volume': 'volume', + 'volume_closed': 'volume_closed', + 'price_open': 'price_open', + 'position_dir': 'position_dir', + 'price_tp': 'price_tp', + 'price_sl': 'price_sl', + 'counterparty_price': 'counterparty_price', + 'close_price': 'close_price', + 'time_create': 'time_create', + 'time_close': 'time_close', + 'position_status': 'position_status', + 'close_detail': 'close_detail', + 'realized_pnl_detail': 'realized_pnl_detail' + } + + def __init__(self, position_id=None, symbol=None, realized_pnl=None, realized_pnl_rate=None, volume=None, volume_closed=None, price_open=None, position_dir=None, price_tp=None, price_sl=None, counterparty_price=None, close_price=None, time_create=None, time_close=None, position_status=None, close_detail=None, realized_pnl_detail=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, str, str, str, str, str, str, str, str, str, PositionHistoryListDataCloseDetail, PositionHistoryListDataRealizedPnlDetail, Configuration) -> None + """PositionHistoryListDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._position_id = None + self._symbol = None + self._realized_pnl = None + self._realized_pnl_rate = None + self._volume = None + self._volume_closed = None + self._price_open = None + self._position_dir = None + self._price_tp = None + self._price_sl = None + self._counterparty_price = None + self._close_price = None + self._time_create = None + self._time_close = None + self._position_status = None + self._close_detail = None + self._realized_pnl_detail = None + self.discriminator = None + + self.position_id = position_id + self.symbol = symbol + self.realized_pnl = realized_pnl + if realized_pnl_rate is not None: + self.realized_pnl_rate = realized_pnl_rate + self.volume = volume + self.volume_closed = volume_closed + self.price_open = price_open + self.position_dir = position_dir + if price_tp is not None: + self.price_tp = price_tp + if price_sl is not None: + self.price_sl = price_sl + if counterparty_price is not None: + self.counterparty_price = counterparty_price + self.close_price = close_price + self.time_create = time_create + self.time_close = time_close + self.position_status = position_status + self.close_detail = close_detail + self.realized_pnl_detail = realized_pnl_detail + + @property + def position_id(self): + """Gets the position_id of this PositionHistoryListDataList. # noqa: E501 + + Position ID # noqa: E501 + + :return: The position_id of this PositionHistoryListDataList. # noqa: E501 + :rtype: int + """ + return self._position_id + + @position_id.setter + def position_id(self, position_id): + """Sets the position_id of this PositionHistoryListDataList. + + Position ID # noqa: E501 + + :param position_id: The position_id of this PositionHistoryListDataList. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and position_id is None: # noqa: E501 + raise ValueError("Invalid value for `position_id`, must not be `None`") # noqa: E501 + + self._position_id = position_id + + @property + def symbol(self): + """Gets the symbol of this PositionHistoryListDataList. # noqa: E501 + + Market / Trading symbol # noqa: E501 + + :return: The symbol of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this PositionHistoryListDataList. + + Market / Trading symbol # noqa: E501 + + :param symbol: The symbol of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def realized_pnl(self): + """Gets the realized_pnl of this PositionHistoryListDataList. # noqa: E501 + + Realized PnL # noqa: E501 + + :return: The realized_pnl of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._realized_pnl + + @realized_pnl.setter + def realized_pnl(self, realized_pnl): + """Sets the realized_pnl of this PositionHistoryListDataList. + + Realized PnL # noqa: E501 + + :param realized_pnl: The realized_pnl of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and realized_pnl is None: # noqa: E501 + raise ValueError("Invalid value for `realized_pnl`, must not be `None`") # noqa: E501 + + self._realized_pnl = realized_pnl + + @property + def realized_pnl_rate(self): + """Gets the realized_pnl_rate of this PositionHistoryListDataList. # noqa: E501 + + Realized return rate # noqa: E501 + + :return: The realized_pnl_rate of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._realized_pnl_rate + + @realized_pnl_rate.setter + def realized_pnl_rate(self, realized_pnl_rate): + """Sets the realized_pnl_rate of this PositionHistoryListDataList. + + Realized return rate # noqa: E501 + + :param realized_pnl_rate: The realized_pnl_rate of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + + self._realized_pnl_rate = realized_pnl_rate + + @property + def volume(self): + """Gets the volume of this PositionHistoryListDataList. # noqa: E501 + + Position size / Maximum position size # noqa: E501 + + :return: The volume of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this PositionHistoryListDataList. + + Position size / Maximum position size # noqa: E501 + + :param volume: The volume of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and volume is None: # noqa: E501 + raise ValueError("Invalid value for `volume`, must not be `None`") # noqa: E501 + + self._volume = volume + + @property + def volume_closed(self): + """Gets the volume_closed of this PositionHistoryListDataList. # noqa: E501 + + Close volume # noqa: E501 + + :return: The volume_closed of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._volume_closed + + @volume_closed.setter + def volume_closed(self, volume_closed): + """Sets the volume_closed of this PositionHistoryListDataList. + + Close volume # noqa: E501 + + :param volume_closed: The volume_closed of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and volume_closed is None: # noqa: E501 + raise ValueError("Invalid value for `volume_closed`, must not be `None`") # noqa: E501 + + self._volume_closed = volume_closed + + @property + def price_open(self): + """Gets the price_open of this PositionHistoryListDataList. # noqa: E501 + + Average Opening Price # noqa: E501 + + :return: The price_open of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._price_open + + @price_open.setter + def price_open(self, price_open): + """Sets the price_open of this PositionHistoryListDataList. + + Average Opening Price # noqa: E501 + + :param price_open: The price_open of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price_open is None: # noqa: E501 + raise ValueError("Invalid value for `price_open`, must not be `None`") # noqa: E501 + + self._price_open = price_open + + @property + def position_dir(self): + """Gets the position_dir of this PositionHistoryListDataList. # noqa: E501 + + Position Direction - Long: Long Position - Short: Short Position # noqa: E501 + + :return: The position_dir of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._position_dir + + @position_dir.setter + def position_dir(self, position_dir): + """Sets the position_dir of this PositionHistoryListDataList. + + Position Direction - Long: Long Position - Short: Short Position # noqa: E501 + + :param position_dir: The position_dir of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and position_dir is None: # noqa: E501 + raise ValueError("Invalid value for `position_dir`, must not be `None`") # noqa: E501 + allowed_values = ["Long", "Short"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and position_dir not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `position_dir` ({0}), must be one of {1}" # noqa: E501 + .format(position_dir, allowed_values) + ) + + self._position_dir = position_dir + + @property + def price_tp(self): + """Gets the price_tp of this PositionHistoryListDataList. # noqa: E501 + + Take profit price # noqa: E501 + + :return: The price_tp of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._price_tp + + @price_tp.setter + def price_tp(self, price_tp): + """Sets the price_tp of this PositionHistoryListDataList. + + Take profit price # noqa: E501 + + :param price_tp: The price_tp of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + + self._price_tp = price_tp + + @property + def price_sl(self): + """Gets the price_sl of this PositionHistoryListDataList. # noqa: E501 + + Stop loss price # noqa: E501 + + :return: The price_sl of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._price_sl + + @price_sl.setter + def price_sl(self, price_sl): + """Sets the price_sl of this PositionHistoryListDataList. + + Stop loss price # noqa: E501 + + :param price_sl: The price_sl of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + + self._price_sl = price_sl + + @property + def counterparty_price(self): + """Gets the counterparty_price of this PositionHistoryListDataList. # noqa: E501 + + Counterparty price # noqa: E501 + + :return: The counterparty_price of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._counterparty_price + + @counterparty_price.setter + def counterparty_price(self, counterparty_price): + """Sets the counterparty_price of this PositionHistoryListDataList. + + Counterparty price # noqa: E501 + + :param counterparty_price: The counterparty_price of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + + self._counterparty_price = counterparty_price + + @property + def close_price(self): + """Gets the close_price of this PositionHistoryListDataList. # noqa: E501 + + Close price # noqa: E501 + + :return: The close_price of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._close_price + + @close_price.setter + def close_price(self, close_price): + """Sets the close_price of this PositionHistoryListDataList. + + Close price # noqa: E501 + + :param close_price: The close_price of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and close_price is None: # noqa: E501 + raise ValueError("Invalid value for `close_price`, must not be `None`") # noqa: E501 + + self._close_price = close_price + + @property + def time_create(self): + """Gets the time_create of this PositionHistoryListDataList. # noqa: E501 + + Open time (timestamp in seconds) # noqa: E501 + + :return: The time_create of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._time_create + + @time_create.setter + def time_create(self, time_create): + """Sets the time_create of this PositionHistoryListDataList. + + Open time (timestamp in seconds) # noqa: E501 + + :param time_create: The time_create of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and time_create is None: # noqa: E501 + raise ValueError("Invalid value for `time_create`, must not be `None`") # noqa: E501 + + self._time_create = time_create + + @property + def time_close(self): + """Gets the time_close of this PositionHistoryListDataList. # noqa: E501 + + Close time (timestamp in seconds) # noqa: E501 + + :return: The time_close of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._time_close + + @time_close.setter + def time_close(self, time_close): + """Sets the time_close of this PositionHistoryListDataList. + + Close time (timestamp in seconds) # noqa: E501 + + :param time_close: The time_close of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and time_close is None: # noqa: E501 + raise ValueError("Invalid value for `time_close`, must not be `None`") # noqa: E501 + + self._time_close = time_close + + @property + def position_status(self): + """Gets the position_status of this PositionHistoryListDataList. # noqa: E501 + + Position Status - 1: Fully Closed - 2: Forced Liquidation # noqa: E501 + + :return: The position_status of this PositionHistoryListDataList. # noqa: E501 + :rtype: str + """ + return self._position_status + + @position_status.setter + def position_status(self, position_status): + """Sets the position_status of this PositionHistoryListDataList. + + Position Status - 1: Fully Closed - 2: Forced Liquidation # noqa: E501 + + :param position_status: The position_status of this PositionHistoryListDataList. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and position_status is None: # noqa: E501 + raise ValueError("Invalid value for `position_status`, must not be `None`") # noqa: E501 + + self._position_status = position_status + + @property + def close_detail(self): + """Gets the close_detail of this PositionHistoryListDataList. # noqa: E501 + + + :return: The close_detail of this PositionHistoryListDataList. # noqa: E501 + :rtype: PositionHistoryListDataCloseDetail + """ + return self._close_detail + + @close_detail.setter + def close_detail(self, close_detail): + """Sets the close_detail of this PositionHistoryListDataList. + + + :param close_detail: The close_detail of this PositionHistoryListDataList. # noqa: E501 + :type: PositionHistoryListDataCloseDetail + """ + + self._close_detail = close_detail + + @property + def realized_pnl_detail(self): + """Gets the realized_pnl_detail of this PositionHistoryListDataList. # noqa: E501 + + + :return: The realized_pnl_detail of this PositionHistoryListDataList. # noqa: E501 + :rtype: PositionHistoryListDataRealizedPnlDetail + """ + return self._realized_pnl_detail + + @realized_pnl_detail.setter + def realized_pnl_detail(self, realized_pnl_detail): + """Sets the realized_pnl_detail of this PositionHistoryListDataList. + + + :param realized_pnl_detail: The realized_pnl_detail of this PositionHistoryListDataList. # noqa: E501 + :type: PositionHistoryListDataRealizedPnlDetail + """ + if self.local_vars_configuration.client_side_validation and realized_pnl_detail is None: # noqa: E501 + raise ValueError("Invalid value for `realized_pnl_detail`, must not be `None`") # noqa: E501 + + self._realized_pnl_detail = realized_pnl_detail + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionHistoryListDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionHistoryListDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_history_list_data_realized_pnl_detail.py b/gate_api/models/position_history_list_data_realized_pnl_detail.py new file mode 100644 index 00000000..3d70f147 --- /dev/null +++ b/gate_api/models/position_history_list_data_realized_pnl_detail.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionHistoryListDataRealizedPnlDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'closed_pnl': 'str', + 'swap': 'str', + 'fee': 'str' + } + + attribute_map = { + 'closed_pnl': 'closed_pnl', + 'swap': 'swap', + 'fee': 'fee' + } + + def __init__(self, closed_pnl=None, swap=None, fee=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """PositionHistoryListDataRealizedPnlDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._closed_pnl = None + self._swap = None + self._fee = None + self.discriminator = None + + if closed_pnl is not None: + self.closed_pnl = closed_pnl + if swap is not None: + self.swap = swap + if fee is not None: + self.fee = fee + + @property + def closed_pnl(self): + """Gets the closed_pnl of this PositionHistoryListDataRealizedPnlDetail. # noqa: E501 + + Close Position P&L # noqa: E501 + + :return: The closed_pnl of this PositionHistoryListDataRealizedPnlDetail. # noqa: E501 + :rtype: str + """ + return self._closed_pnl + + @closed_pnl.setter + def closed_pnl(self, closed_pnl): + """Sets the closed_pnl of this PositionHistoryListDataRealizedPnlDetail. + + Close Position P&L # noqa: E501 + + :param closed_pnl: The closed_pnl of this PositionHistoryListDataRealizedPnlDetail. # noqa: E501 + :type: str + """ + + self._closed_pnl = closed_pnl + + @property + def swap(self): + """Gets the swap of this PositionHistoryListDataRealizedPnlDetail. # noqa: E501 + + Swap fee # noqa: E501 + + :return: The swap of this PositionHistoryListDataRealizedPnlDetail. # noqa: E501 + :rtype: str + """ + return self._swap + + @swap.setter + def swap(self, swap): + """Sets the swap of this PositionHistoryListDataRealizedPnlDetail. + + Swap fee # noqa: E501 + + :param swap: The swap of this PositionHistoryListDataRealizedPnlDetail. # noqa: E501 + :type: str + """ + + self._swap = swap + + @property + def fee(self): + """Gets the fee of this PositionHistoryListDataRealizedPnlDetail. # noqa: E501 + + fee # noqa: E501 + + :return: The fee of this PositionHistoryListDataRealizedPnlDetail. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this PositionHistoryListDataRealizedPnlDetail. + + fee # noqa: E501 + + :param fee: The fee of this PositionHistoryListDataRealizedPnlDetail. # noqa: E501 + :type: str + """ + + self._fee = fee + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionHistoryListDataRealizedPnlDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionHistoryListDataRealizedPnlDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_list.py b/gate_api/models/position_list.py new file mode 100644 index 00000000..c04efc8c --- /dev/null +++ b/gate_api/models/position_list.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label': 'str', + 'message': 'str', + 'timestamp': 'int', + 'data': 'PositionListData' + } + + attribute_map = { + 'label': 'label', + 'message': 'message', + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, label=None, message=None, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, PositionListData, Configuration) -> None + """PositionList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._label = None + self._message = None + self._timestamp = None + self._data = None + self.discriminator = None + + if label is not None: + self.label = label + if message is not None: + self.message = message + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def label(self): + """Gets the label of this PositionList. # noqa: E501 + + Business status code, non-empty indicates request exception, please refer to TradFi error enumeration in documentation # noqa: E501 + + :return: The label of this PositionList. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this PositionList. + + Business status code, non-empty indicates request exception, please refer to TradFi error enumeration in documentation # noqa: E501 + + :param label: The label of this PositionList. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this PositionList. # noqa: E501 + + Return message, returned when request error occurs # noqa: E501 + + :return: The message of this PositionList. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this PositionList. + + Return message, returned when request error occurs # noqa: E501 + + :param message: The message of this PositionList. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def timestamp(self): + """Gets the timestamp of this PositionList. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this PositionList. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this PositionList. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this PositionList. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this PositionList. # noqa: E501 + + + :return: The data of this PositionList. # noqa: E501 + :rtype: PositionListData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this PositionList. + + + :param data: The data of this PositionList. # noqa: E501 + :type: PositionListData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_list2.py b/gate_api/models/position_list2.py new file mode 100644 index 00000000..a6fb7da2 --- /dev/null +++ b/gate_api/models/position_list2.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionList2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'PositionList2Data', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (PositionList2Data, int, Configuration) -> None + """PositionList2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this PositionList2. # noqa: E501 + + + :return: The data of this PositionList2. # noqa: E501 + :rtype: PositionList2Data + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this PositionList2. + + + :param data: The data of this PositionList2. # noqa: E501 + :type: PositionList2Data + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this PositionList2. # noqa: E501 + + + :return: The timestamp of this PositionList2. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this PositionList2. + + + :param timestamp: The timestamp of this PositionList2. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionList2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionList2): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_list2_data.py b/gate_api/models/position_list2_data.py new file mode 100644 index 00000000..7611b771 --- /dev/null +++ b/gate_api/models/position_list2_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionList2Data(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[PositionListItem]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[PositionListItem], Configuration) -> None + """PositionList2Data - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this PositionList2Data. # noqa: E501 + + Query active position list # noqa: E501 + + :return: The list of this PositionList2Data. # noqa: E501 + :rtype: list[PositionListItem] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this PositionList2Data. + + Query active position list # noqa: E501 + + :param list: The list of this PositionList2Data. # noqa: E501 + :type: list[PositionListItem] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionList2Data): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionList2Data): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_list_data.py b/gate_api/models/position_list_data.py new file mode 100644 index 00000000..f39278af --- /dev/null +++ b/gate_api/models/position_list_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionListData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[PositionListDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[PositionListDataList], Configuration) -> None + """PositionListData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this PositionListData. # noqa: E501 + + Position information # noqa: E501 + + :return: The list of this PositionListData. # noqa: E501 + :rtype: list[PositionListDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this PositionListData. + + Position information # noqa: E501 + + :param list: The list of this PositionListData. # noqa: E501 + :type: list[PositionListDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionListData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionListData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_list_data_list.py b/gate_api/models/position_list_data_list.py new file mode 100644 index 00000000..1bbd3231 --- /dev/null +++ b/gate_api/models/position_list_data_list.py @@ -0,0 +1,347 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionListDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'position_id': 'int', + 'symbol': 'str', + 'symbol_desc': 'str', + 'margin': 'str', + 'unrealized_pnl': 'str', + 'unrealized_pnl_rate': 'str', + 'volume': 'str', + 'price_open': 'str', + 'position_dir': 'str' + } + + attribute_map = { + 'position_id': 'position_id', + 'symbol': 'symbol', + 'symbol_desc': 'symbol_desc', + 'margin': 'margin', + 'unrealized_pnl': 'unrealized_pnl', + 'unrealized_pnl_rate': 'unrealized_pnl_rate', + 'volume': 'volume', + 'price_open': 'price_open', + 'position_dir': 'position_dir' + } + + def __init__(self, position_id=None, symbol=None, symbol_desc=None, margin=None, unrealized_pnl=None, unrealized_pnl_rate=None, volume=None, price_open=None, position_dir=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, str, str, str, Configuration) -> None + """PositionListDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._position_id = None + self._symbol = None + self._symbol_desc = None + self._margin = None + self._unrealized_pnl = None + self._unrealized_pnl_rate = None + self._volume = None + self._price_open = None + self._position_dir = None + self.discriminator = None + + if position_id is not None: + self.position_id = position_id + if symbol is not None: + self.symbol = symbol + if symbol_desc is not None: + self.symbol_desc = symbol_desc + if margin is not None: + self.margin = margin + if unrealized_pnl is not None: + self.unrealized_pnl = unrealized_pnl + if unrealized_pnl_rate is not None: + self.unrealized_pnl_rate = unrealized_pnl_rate + if volume is not None: + self.volume = volume + if price_open is not None: + self.price_open = price_open + if position_dir is not None: + self.position_dir = position_dir + + @property + def position_id(self): + """Gets the position_id of this PositionListDataList. # noqa: E501 + + Position ID # noqa: E501 + + :return: The position_id of this PositionListDataList. # noqa: E501 + :rtype: int + """ + return self._position_id + + @position_id.setter + def position_id(self, position_id): + """Sets the position_id of this PositionListDataList. + + Position ID # noqa: E501 + + :param position_id: The position_id of this PositionListDataList. # noqa: E501 + :type: int + """ + + self._position_id = position_id + + @property + def symbol(self): + """Gets the symbol of this PositionListDataList. # noqa: E501 + + Trading market code # noqa: E501 + + :return: The symbol of this PositionListDataList. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this PositionListDataList. + + Trading market code # noqa: E501 + + :param symbol: The symbol of this PositionListDataList. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def symbol_desc(self): + """Gets the symbol_desc of this PositionListDataList. # noqa: E501 + + Market description # noqa: E501 + + :return: The symbol_desc of this PositionListDataList. # noqa: E501 + :rtype: str + """ + return self._symbol_desc + + @symbol_desc.setter + def symbol_desc(self, symbol_desc): + """Sets the symbol_desc of this PositionListDataList. + + Market description # noqa: E501 + + :param symbol_desc: The symbol_desc of this PositionListDataList. # noqa: E501 + :type: str + """ + + self._symbol_desc = symbol_desc + + @property + def margin(self): + """Gets the margin of this PositionListDataList. # noqa: E501 + + Used margin # noqa: E501 + + :return: The margin of this PositionListDataList. # noqa: E501 + :rtype: str + """ + return self._margin + + @margin.setter + def margin(self, margin): + """Sets the margin of this PositionListDataList. + + Used margin # noqa: E501 + + :param margin: The margin of this PositionListDataList. # noqa: E501 + :type: str + """ + + self._margin = margin + + @property + def unrealized_pnl(self): + """Gets the unrealized_pnl of this PositionListDataList. # noqa: E501 + + Unrealized PNL # noqa: E501 + + :return: The unrealized_pnl of this PositionListDataList. # noqa: E501 + :rtype: str + """ + return self._unrealized_pnl + + @unrealized_pnl.setter + def unrealized_pnl(self, unrealized_pnl): + """Sets the unrealized_pnl of this PositionListDataList. + + Unrealized PNL # noqa: E501 + + :param unrealized_pnl: The unrealized_pnl of this PositionListDataList. # noqa: E501 + :type: str + """ + + self._unrealized_pnl = unrealized_pnl + + @property + def unrealized_pnl_rate(self): + """Gets the unrealized_pnl_rate of this PositionListDataList. # noqa: E501 + + Unrealized return rate # noqa: E501 + + :return: The unrealized_pnl_rate of this PositionListDataList. # noqa: E501 + :rtype: str + """ + return self._unrealized_pnl_rate + + @unrealized_pnl_rate.setter + def unrealized_pnl_rate(self, unrealized_pnl_rate): + """Sets the unrealized_pnl_rate of this PositionListDataList. + + Unrealized return rate # noqa: E501 + + :param unrealized_pnl_rate: The unrealized_pnl_rate of this PositionListDataList. # noqa: E501 + :type: str + """ + + self._unrealized_pnl_rate = unrealized_pnl_rate + + @property + def volume(self): + """Gets the volume of this PositionListDataList. # noqa: E501 + + Position size # noqa: E501 + + :return: The volume of this PositionListDataList. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this PositionListDataList. + + Position size # noqa: E501 + + :param volume: The volume of this PositionListDataList. # noqa: E501 + :type: str + """ + + self._volume = volume + + @property + def price_open(self): + """Gets the price_open of this PositionListDataList. # noqa: E501 + + Average Opening Price # noqa: E501 + + :return: The price_open of this PositionListDataList. # noqa: E501 + :rtype: str + """ + return self._price_open + + @price_open.setter + def price_open(self, price_open): + """Sets the price_open of this PositionListDataList. + + Average Opening Price # noqa: E501 + + :param price_open: The price_open of this PositionListDataList. # noqa: E501 + :type: str + """ + + self._price_open = price_open + + @property + def position_dir(self): + """Gets the position_dir of this PositionListDataList. # noqa: E501 + + Position direction (Long=long position, Short=short position) # noqa: E501 + + :return: The position_dir of this PositionListDataList. # noqa: E501 + :rtype: str + """ + return self._position_dir + + @position_dir.setter + def position_dir(self, position_dir): + """Sets the position_dir of this PositionListDataList. + + Position direction (Long=long position, Short=short position) # noqa: E501 + + :param position_dir: The position_dir of this PositionListDataList. # noqa: E501 + :type: str + """ + + self._position_dir = position_dir + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionListDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionListDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_list_item.py b/gate_api/models/position_list_item.py new file mode 100644 index 00000000..552d99f4 --- /dev/null +++ b/gate_api/models/position_list_item.py @@ -0,0 +1,956 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionListItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'exchange': 'str', + 'quote_currency': 'str', + 'quote_currency_precision': 'int', + 'fx_rate': 'str', + 'trade_status': 'str', + 'symbol_desc': 'str', + 'position_pnl': 'str', + 'today_pnl': 'str', + 'pnl_rate': 'str', + 'today_sell_amount': 'str', + 'today_buy_amount': 'str', + 'today_sell_volume': 'str', + 'today_buy_volume': 'str', + 'yesterday_volume': 'str', + 'volume': 'str', + 'available': 'str', + 'transfer_out_pending_qty': 'str', + 'avg_cost_price': 'str', + 'diluted_cost_price': 'str', + 'last_price': 'str', + 'extended_last_price': 'str', + 'max_order_volume': 'str', + 'step_order_volume': 'str', + 'min_order_volume': 'str', + 'price_precision': 'int', + 'price_protection': 'str', + 'sell_price_protection': 'str', + 'buy_price_protection': 'str', + 'commission_rate': 'str', + 'slippage_rate': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'exchange': 'exchange', + 'quote_currency': 'quote_currency', + 'quote_currency_precision': 'quote_currency_precision', + 'fx_rate': 'fx_rate', + 'trade_status': 'trade_status', + 'symbol_desc': 'symbol_desc', + 'position_pnl': 'position_pnl', + 'today_pnl': 'today_pnl', + 'pnl_rate': 'pnl_rate', + 'today_sell_amount': 'today_sell_amount', + 'today_buy_amount': 'today_buy_amount', + 'today_sell_volume': 'today_sell_volume', + 'today_buy_volume': 'today_buy_volume', + 'yesterday_volume': 'yesterday_volume', + 'volume': 'volume', + 'available': 'available', + 'transfer_out_pending_qty': 'transfer_out_pending_qty', + 'avg_cost_price': 'avg_cost_price', + 'diluted_cost_price': 'diluted_cost_price', + 'last_price': 'last_price', + 'extended_last_price': 'extended_last_price', + 'max_order_volume': 'max_order_volume', + 'step_order_volume': 'step_order_volume', + 'min_order_volume': 'min_order_volume', + 'price_precision': 'price_precision', + 'price_protection': 'price_protection', + 'sell_price_protection': 'sell_price_protection', + 'buy_price_protection': 'buy_price_protection', + 'commission_rate': 'commission_rate', + 'slippage_rate': 'slippage_rate' + } + + def __init__(self, symbol=None, exchange=None, quote_currency=None, quote_currency_precision=None, fx_rate=None, trade_status=None, symbol_desc=None, position_pnl=None, today_pnl=None, pnl_rate=None, today_sell_amount=None, today_buy_amount=None, today_sell_volume=None, today_buy_volume=None, yesterday_volume=None, volume=None, available=None, transfer_out_pending_qty=None, avg_cost_price=None, diluted_cost_price=None, last_price=None, extended_last_price=None, max_order_volume=None, step_order_volume=None, min_order_volume=None, price_precision=None, price_protection=None, sell_price_protection=None, buy_price_protection=None, commission_rate=None, slippage_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, str, str, str, str, str, Configuration) -> None + """PositionListItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._exchange = None + self._quote_currency = None + self._quote_currency_precision = None + self._fx_rate = None + self._trade_status = None + self._symbol_desc = None + self._position_pnl = None + self._today_pnl = None + self._pnl_rate = None + self._today_sell_amount = None + self._today_buy_amount = None + self._today_sell_volume = None + self._today_buy_volume = None + self._yesterday_volume = None + self._volume = None + self._available = None + self._transfer_out_pending_qty = None + self._avg_cost_price = None + self._diluted_cost_price = None + self._last_price = None + self._extended_last_price = None + self._max_order_volume = None + self._step_order_volume = None + self._min_order_volume = None + self._price_precision = None + self._price_protection = None + self._sell_price_protection = None + self._buy_price_protection = None + self._commission_rate = None + self._slippage_rate = None + self.discriminator = None + + if symbol is not None: + self.symbol = symbol + if exchange is not None: + self.exchange = exchange + if quote_currency is not None: + self.quote_currency = quote_currency + if quote_currency_precision is not None: + self.quote_currency_precision = quote_currency_precision + if fx_rate is not None: + self.fx_rate = fx_rate + if trade_status is not None: + self.trade_status = trade_status + if symbol_desc is not None: + self.symbol_desc = symbol_desc + if position_pnl is not None: + self.position_pnl = position_pnl + if today_pnl is not None: + self.today_pnl = today_pnl + if pnl_rate is not None: + self.pnl_rate = pnl_rate + if today_sell_amount is not None: + self.today_sell_amount = today_sell_amount + if today_buy_amount is not None: + self.today_buy_amount = today_buy_amount + if today_sell_volume is not None: + self.today_sell_volume = today_sell_volume + if today_buy_volume is not None: + self.today_buy_volume = today_buy_volume + if yesterday_volume is not None: + self.yesterday_volume = yesterday_volume + if volume is not None: + self.volume = volume + if available is not None: + self.available = available + if transfer_out_pending_qty is not None: + self.transfer_out_pending_qty = transfer_out_pending_qty + if avg_cost_price is not None: + self.avg_cost_price = avg_cost_price + if diluted_cost_price is not None: + self.diluted_cost_price = diluted_cost_price + if last_price is not None: + self.last_price = last_price + self.extended_last_price = extended_last_price + if max_order_volume is not None: + self.max_order_volume = max_order_volume + if step_order_volume is not None: + self.step_order_volume = step_order_volume + if min_order_volume is not None: + self.min_order_volume = min_order_volume + if price_precision is not None: + self.price_precision = price_precision + if price_protection is not None: + self.price_protection = price_protection + if sell_price_protection is not None: + self.sell_price_protection = sell_price_protection + if buy_price_protection is not None: + self.buy_price_protection = buy_price_protection + if commission_rate is not None: + self.commission_rate = commission_rate + if slippage_rate is not None: + self.slippage_rate = slippage_rate + + @property + def symbol(self): + """Gets the symbol of this PositionListItem. # noqa: E501 + + Symbol # noqa: E501 + + :return: The symbol of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this PositionListItem. + + Symbol # noqa: E501 + + :param symbol: The symbol of this PositionListItem. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def exchange(self): + """Gets the exchange of this PositionListItem. # noqa: E501 + + Exchange, supports us, hk, and kr # noqa: E501 + + :return: The exchange of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this PositionListItem. + + Exchange, supports us, hk, and kr # noqa: E501 + + :param exchange: The exchange of this PositionListItem. # noqa: E501 + :type: str + """ + allowed_values = ["us", "hk", "kr"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and exchange not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `exchange` ({0}), must be one of {1}" # noqa: E501 + .format(exchange, allowed_values) + ) + + self._exchange = exchange + + @property + def quote_currency(self): + """Gets the quote_currency of this PositionListItem. # noqa: E501 + + Quote currency # noqa: E501 + + :return: The quote_currency of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._quote_currency + + @quote_currency.setter + def quote_currency(self, quote_currency): + """Sets the quote_currency of this PositionListItem. + + Quote currency # noqa: E501 + + :param quote_currency: The quote_currency of this PositionListItem. # noqa: E501 + :type: str + """ + + self._quote_currency = quote_currency + + @property + def quote_currency_precision(self): + """Gets the quote_currency_precision of this PositionListItem. # noqa: E501 + + Quote currency precision # noqa: E501 + + :return: The quote_currency_precision of this PositionListItem. # noqa: E501 + :rtype: int + """ + return self._quote_currency_precision + + @quote_currency_precision.setter + def quote_currency_precision(self, quote_currency_precision): + """Sets the quote_currency_precision of this PositionListItem. + + Quote currency precision # noqa: E501 + + :param quote_currency_precision: The quote_currency_precision of this PositionListItem. # noqa: E501 + :type: int + """ + + self._quote_currency_precision = quote_currency_precision + + @property + def fx_rate(self): + """Gets the fx_rate of this PositionListItem. # noqa: E501 + + Quote currency to USD exchange rate # noqa: E501 + + :return: The fx_rate of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._fx_rate + + @fx_rate.setter + def fx_rate(self, fx_rate): + """Sets the fx_rate of this PositionListItem. + + Quote currency to USD exchange rate # noqa: E501 + + :param fx_rate: The fx_rate of this PositionListItem. # noqa: E501 + :type: str + """ + + self._fx_rate = fx_rate + + @property + def trade_status(self): + """Gets the trade_status of this PositionListItem. # noqa: E501 + + Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. # noqa: E501 + + :return: The trade_status of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._trade_status + + @trade_status.setter + def trade_status(self, trade_status): + """Sets the trade_status of this PositionListItem. + + Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. # noqa: E501 + + :param trade_status: The trade_status of this PositionListItem. # noqa: E501 + :type: str + """ + allowed_values = ["pre_market", "open", "post_market", "closed", "gt_lp"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and trade_status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `trade_status` ({0}), must be one of {1}" # noqa: E501 + .format(trade_status, allowed_values) + ) + + self._trade_status = trade_status + + @property + def symbol_desc(self): + """Gets the symbol_desc of this PositionListItem. # noqa: E501 + + + :return: The symbol_desc of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._symbol_desc + + @symbol_desc.setter + def symbol_desc(self, symbol_desc): + """Sets the symbol_desc of this PositionListItem. + + + :param symbol_desc: The symbol_desc of this PositionListItem. # noqa: E501 + :type: str + """ + + self._symbol_desc = symbol_desc + + @property + def position_pnl(self): + """Gets the position_pnl of this PositionListItem. # noqa: E501 + + Position P&L # noqa: E501 + + :return: The position_pnl of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._position_pnl + + @position_pnl.setter + def position_pnl(self, position_pnl): + """Sets the position_pnl of this PositionListItem. + + Position P&L # noqa: E501 + + :param position_pnl: The position_pnl of this PositionListItem. # noqa: E501 + :type: str + """ + + self._position_pnl = position_pnl + + @property + def today_pnl(self): + """Gets the today_pnl of this PositionListItem. # noqa: E501 + + Today's P&L # noqa: E501 + + :return: The today_pnl of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._today_pnl + + @today_pnl.setter + def today_pnl(self, today_pnl): + """Sets the today_pnl of this PositionListItem. + + Today's P&L # noqa: E501 + + :param today_pnl: The today_pnl of this PositionListItem. # noqa: E501 + :type: str + """ + + self._today_pnl = today_pnl + + @property + def pnl_rate(self): + """Gets the pnl_rate of this PositionListItem. # noqa: E501 + + Yield # noqa: E501 + + :return: The pnl_rate of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._pnl_rate + + @pnl_rate.setter + def pnl_rate(self, pnl_rate): + """Sets the pnl_rate of this PositionListItem. + + Yield # noqa: E501 + + :param pnl_rate: The pnl_rate of this PositionListItem. # noqa: E501 + :type: str + """ + + self._pnl_rate = pnl_rate + + @property + def today_sell_amount(self): + """Gets the today_sell_amount of this PositionListItem. # noqa: E501 + + Today's sales amount # noqa: E501 + + :return: The today_sell_amount of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._today_sell_amount + + @today_sell_amount.setter + def today_sell_amount(self, today_sell_amount): + """Sets the today_sell_amount of this PositionListItem. + + Today's sales amount # noqa: E501 + + :param today_sell_amount: The today_sell_amount of this PositionListItem. # noqa: E501 + :type: str + """ + + self._today_sell_amount = today_sell_amount + + @property + def today_buy_amount(self): + """Gets the today_buy_amount of this PositionListItem. # noqa: E501 + + Today's purchase amount # noqa: E501 + + :return: The today_buy_amount of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._today_buy_amount + + @today_buy_amount.setter + def today_buy_amount(self, today_buy_amount): + """Sets the today_buy_amount of this PositionListItem. + + Today's purchase amount # noqa: E501 + + :param today_buy_amount: The today_buy_amount of this PositionListItem. # noqa: E501 + :type: str + """ + + self._today_buy_amount = today_buy_amount + + @property + def today_sell_volume(self): + """Gets the today_sell_volume of this PositionListItem. # noqa: E501 + + Today's sell volume # noqa: E501 + + :return: The today_sell_volume of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._today_sell_volume + + @today_sell_volume.setter + def today_sell_volume(self, today_sell_volume): + """Sets the today_sell_volume of this PositionListItem. + + Today's sell volume # noqa: E501 + + :param today_sell_volume: The today_sell_volume of this PositionListItem. # noqa: E501 + :type: str + """ + + self._today_sell_volume = today_sell_volume + + @property + def today_buy_volume(self): + """Gets the today_buy_volume of this PositionListItem. # noqa: E501 + + Today's buy volume # noqa: E501 + + :return: The today_buy_volume of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._today_buy_volume + + @today_buy_volume.setter + def today_buy_volume(self, today_buy_volume): + """Sets the today_buy_volume of this PositionListItem. + + Today's buy volume # noqa: E501 + + :param today_buy_volume: The today_buy_volume of this PositionListItem. # noqa: E501 + :type: str + """ + + self._today_buy_volume = today_buy_volume + + @property + def yesterday_volume(self): + """Gets the yesterday_volume of this PositionListItem. # noqa: E501 + + Previous close position quantity # noqa: E501 + + :return: The yesterday_volume of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._yesterday_volume + + @yesterday_volume.setter + def yesterday_volume(self, yesterday_volume): + """Sets the yesterday_volume of this PositionListItem. + + Previous close position quantity # noqa: E501 + + :param yesterday_volume: The yesterday_volume of this PositionListItem. # noqa: E501 + :type: str + """ + + self._yesterday_volume = yesterday_volume + + @property + def volume(self): + """Gets the volume of this PositionListItem. # noqa: E501 + + Position quantity # noqa: E501 + + :return: The volume of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this PositionListItem. + + Position quantity # noqa: E501 + + :param volume: The volume of this PositionListItem. # noqa: E501 + :type: str + """ + + self._volume = volume + + @property + def available(self): + """Gets the available of this PositionListItem. # noqa: E501 + + Available position quantity # noqa: E501 + + :return: The available of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._available + + @available.setter + def available(self, available): + """Sets the available of this PositionListItem. + + Available position quantity # noqa: E501 + + :param available: The available of this PositionListItem. # noqa: E501 + :type: str + """ + + self._available = available + + @property + def transfer_out_pending_qty(self): + """Gets the transfer_out_pending_qty of this PositionListItem. # noqa: E501 + + Stock transfer in progress quantity # noqa: E501 + + :return: The transfer_out_pending_qty of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._transfer_out_pending_qty + + @transfer_out_pending_qty.setter + def transfer_out_pending_qty(self, transfer_out_pending_qty): + """Sets the transfer_out_pending_qty of this PositionListItem. + + Stock transfer in progress quantity # noqa: E501 + + :param transfer_out_pending_qty: The transfer_out_pending_qty of this PositionListItem. # noqa: E501 + :type: str + """ + + self._transfer_out_pending_qty = transfer_out_pending_qty + + @property + def avg_cost_price(self): + """Gets the avg_cost_price of this PositionListItem. # noqa: E501 + + Cost price # noqa: E501 + + :return: The avg_cost_price of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._avg_cost_price + + @avg_cost_price.setter + def avg_cost_price(self, avg_cost_price): + """Sets the avg_cost_price of this PositionListItem. + + Cost price # noqa: E501 + + :param avg_cost_price: The avg_cost_price of this PositionListItem. # noqa: E501 + :type: str + """ + + self._avg_cost_price = avg_cost_price + + @property + def diluted_cost_price(self): + """Gets the diluted_cost_price of this PositionListItem. # noqa: E501 + + Diluted cost price # noqa: E501 + + :return: The diluted_cost_price of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._diluted_cost_price + + @diluted_cost_price.setter + def diluted_cost_price(self, diluted_cost_price): + """Sets the diluted_cost_price of this PositionListItem. + + Diluted cost price # noqa: E501 + + :param diluted_cost_price: The diluted_cost_price of this PositionListItem. # noqa: E501 + :type: str + """ + + self._diluted_cost_price = diluted_cost_price + + @property + def last_price(self): + """Gets the last_price of this PositionListItem. # noqa: E501 + + Latest price # noqa: E501 + + :return: The last_price of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._last_price + + @last_price.setter + def last_price(self, last_price): + """Sets the last_price of this PositionListItem. + + Latest price # noqa: E501 + + :param last_price: The last_price of this PositionListItem. # noqa: E501 + :type: str + """ + + self._last_price = last_price + + @property + def extended_last_price(self): + """Gets the extended_last_price of this PositionListItem. # noqa: E501 + + Extended hours latest price # noqa: E501 + + :return: The extended_last_price of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._extended_last_price + + @extended_last_price.setter + def extended_last_price(self, extended_last_price): + """Sets the extended_last_price of this PositionListItem. + + Extended hours latest price # noqa: E501 + + :param extended_last_price: The extended_last_price of this PositionListItem. # noqa: E501 + :type: str + """ + + self._extended_last_price = extended_last_price + + @property + def max_order_volume(self): + """Gets the max_order_volume of this PositionListItem. # noqa: E501 + + + :return: The max_order_volume of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._max_order_volume + + @max_order_volume.setter + def max_order_volume(self, max_order_volume): + """Sets the max_order_volume of this PositionListItem. + + + :param max_order_volume: The max_order_volume of this PositionListItem. # noqa: E501 + :type: str + """ + + self._max_order_volume = max_order_volume + + @property + def step_order_volume(self): + """Gets the step_order_volume of this PositionListItem. # noqa: E501 + + + :return: The step_order_volume of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._step_order_volume + + @step_order_volume.setter + def step_order_volume(self, step_order_volume): + """Sets the step_order_volume of this PositionListItem. + + + :param step_order_volume: The step_order_volume of this PositionListItem. # noqa: E501 + :type: str + """ + + self._step_order_volume = step_order_volume + + @property + def min_order_volume(self): + """Gets the min_order_volume of this PositionListItem. # noqa: E501 + + + :return: The min_order_volume of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._min_order_volume + + @min_order_volume.setter + def min_order_volume(self, min_order_volume): + """Sets the min_order_volume of this PositionListItem. + + + :param min_order_volume: The min_order_volume of this PositionListItem. # noqa: E501 + :type: str + """ + + self._min_order_volume = min_order_volume + + @property + def price_precision(self): + """Gets the price_precision of this PositionListItem. # noqa: E501 + + + :return: The price_precision of this PositionListItem. # noqa: E501 + :rtype: int + """ + return self._price_precision + + @price_precision.setter + def price_precision(self, price_precision): + """Sets the price_precision of this PositionListItem. + + + :param price_precision: The price_precision of this PositionListItem. # noqa: E501 + :type: int + """ + + self._price_precision = price_precision + + @property + def price_protection(self): + """Gets the price_protection of this PositionListItem. # noqa: E501 + + + :return: The price_protection of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._price_protection + + @price_protection.setter + def price_protection(self, price_protection): + """Sets the price_protection of this PositionListItem. + + + :param price_protection: The price_protection of this PositionListItem. # noqa: E501 + :type: str + """ + + self._price_protection = price_protection + + @property + def sell_price_protection(self): + """Gets the sell_price_protection of this PositionListItem. # noqa: E501 + + + :return: The sell_price_protection of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._sell_price_protection + + @sell_price_protection.setter + def sell_price_protection(self, sell_price_protection): + """Sets the sell_price_protection of this PositionListItem. + + + :param sell_price_protection: The sell_price_protection of this PositionListItem. # noqa: E501 + :type: str + """ + + self._sell_price_protection = sell_price_protection + + @property + def buy_price_protection(self): + """Gets the buy_price_protection of this PositionListItem. # noqa: E501 + + + :return: The buy_price_protection of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._buy_price_protection + + @buy_price_protection.setter + def buy_price_protection(self, buy_price_protection): + """Sets the buy_price_protection of this PositionListItem. + + + :param buy_price_protection: The buy_price_protection of this PositionListItem. # noqa: E501 + :type: str + """ + + self._buy_price_protection = buy_price_protection + + @property + def commission_rate(self): + """Gets the commission_rate of this PositionListItem. # noqa: E501 + + Fee Rate # noqa: E501 + + :return: The commission_rate of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._commission_rate + + @commission_rate.setter + def commission_rate(self, commission_rate): + """Sets the commission_rate of this PositionListItem. + + Fee Rate # noqa: E501 + + :param commission_rate: The commission_rate of this PositionListItem. # noqa: E501 + :type: str + """ + + self._commission_rate = commission_rate + + @property + def slippage_rate(self): + """Gets the slippage_rate of this PositionListItem. # noqa: E501 + + + :return: The slippage_rate of this PositionListItem. # noqa: E501 + :rtype: str + """ + return self._slippage_rate + + @slippage_rate.setter + def slippage_rate(self, slippage_rate): + """Sets the slippage_rate of this PositionListItem. + + + :param slippage_rate: The slippage_rate of this PositionListItem. # noqa: E501 + :type: str + """ + + self._slippage_rate = slippage_rate + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionListItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionListItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/position_timerange.py b/gate_api/models/position_timerange.py new file mode 100644 index 00000000..5963885d --- /dev/null +++ b/gate_api/models/position_timerange.py @@ -0,0 +1,571 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PositionTimerange(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'contract': 'str', + 'size': 'str', + 'leverage': 'str', + 'risk_limit': 'str', + 'leverage_max': 'str', + 'maintenance_rate': 'str', + 'margin': 'str', + 'liq_price': 'str', + 'realised_pnl': 'str', + 'history_pnl': 'str', + 'last_close_pnl': 'str', + 'realised_point': 'str', + 'history_point': 'str', + 'mode': 'str', + 'cross_leverage_limit': 'str', + 'entry_price': 'str', + 'time': 'int' + } + + attribute_map = { + 'contract': 'contract', + 'size': 'size', + 'leverage': 'leverage', + 'risk_limit': 'risk_limit', + 'leverage_max': 'leverage_max', + 'maintenance_rate': 'maintenance_rate', + 'margin': 'margin', + 'liq_price': 'liq_price', + 'realised_pnl': 'realised_pnl', + 'history_pnl': 'history_pnl', + 'last_close_pnl': 'last_close_pnl', + 'realised_point': 'realised_point', + 'history_point': 'history_point', + 'mode': 'mode', + 'cross_leverage_limit': 'cross_leverage_limit', + 'entry_price': 'entry_price', + 'time': 'time' + } + + def __init__(self, contract=None, size=None, leverage=None, risk_limit=None, leverage_max=None, maintenance_rate=None, margin=None, liq_price=None, realised_pnl=None, history_pnl=None, last_close_pnl=None, realised_point=None, history_point=None, mode=None, cross_leverage_limit=None, entry_price=None, time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, Configuration) -> None + """PositionTimerange - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._contract = None + self._size = None + self._leverage = None + self._risk_limit = None + self._leverage_max = None + self._maintenance_rate = None + self._margin = None + self._liq_price = None + self._realised_pnl = None + self._history_pnl = None + self._last_close_pnl = None + self._realised_point = None + self._history_point = None + self._mode = None + self._cross_leverage_limit = None + self._entry_price = None + self._time = None + self.discriminator = None + + if contract is not None: + self.contract = contract + if size is not None: + self.size = size + if leverage is not None: + self.leverage = leverage + if risk_limit is not None: + self.risk_limit = risk_limit + if leverage_max is not None: + self.leverage_max = leverage_max + if maintenance_rate is not None: + self.maintenance_rate = maintenance_rate + if margin is not None: + self.margin = margin + if liq_price is not None: + self.liq_price = liq_price + if realised_pnl is not None: + self.realised_pnl = realised_pnl + if history_pnl is not None: + self.history_pnl = history_pnl + if last_close_pnl is not None: + self.last_close_pnl = last_close_pnl + if realised_point is not None: + self.realised_point = realised_point + if history_point is not None: + self.history_point = history_point + if mode is not None: + self.mode = mode + if cross_leverage_limit is not None: + self.cross_leverage_limit = cross_leverage_limit + if entry_price is not None: + self.entry_price = entry_price + if time is not None: + self.time = time + + @property + def contract(self): + """Gets the contract of this PositionTimerange. # noqa: E501 + + Futures contract # noqa: E501 + + :return: The contract of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this PositionTimerange. + + Futures contract # noqa: E501 + + :param contract: The contract of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def size(self): + """Gets the size of this PositionTimerange. # noqa: E501 + + Position size # noqa: E501 + + :return: The size of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this PositionTimerange. + + Position size # noqa: E501 + + :param size: The size of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._size = size + + @property + def leverage(self): + """Gets the leverage of this PositionTimerange. # noqa: E501 + + Position leverage. 0 means cross margin; positive number means isolated margin # noqa: E501 + + :return: The leverage of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this PositionTimerange. + + Position leverage. 0 means cross margin; positive number means isolated margin # noqa: E501 + + :param leverage: The leverage of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + @property + def risk_limit(self): + """Gets the risk_limit of this PositionTimerange. # noqa: E501 + + Position risk limit # noqa: E501 + + :return: The risk_limit of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._risk_limit + + @risk_limit.setter + def risk_limit(self, risk_limit): + """Sets the risk_limit of this PositionTimerange. + + Position risk limit # noqa: E501 + + :param risk_limit: The risk_limit of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._risk_limit = risk_limit + + @property + def leverage_max(self): + """Gets the leverage_max of this PositionTimerange. # noqa: E501 + + the maximum permissible leverage given to the current positon value: the higher positon value, the lower maximum permissible leverage # noqa: E501 + + :return: The leverage_max of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._leverage_max + + @leverage_max.setter + def leverage_max(self, leverage_max): + """Sets the leverage_max of this PositionTimerange. + + the maximum permissible leverage given to the current positon value: the higher positon value, the lower maximum permissible leverage # noqa: E501 + + :param leverage_max: The leverage_max of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._leverage_max = leverage_max + + @property + def maintenance_rate(self): + """Gets the maintenance_rate of this PositionTimerange. # noqa: E501 + + The maintenance margin rate of the first tier of risk limit sheet # noqa: E501 + + :return: The maintenance_rate of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._maintenance_rate + + @maintenance_rate.setter + def maintenance_rate(self, maintenance_rate): + """Sets the maintenance_rate of this PositionTimerange. + + The maintenance margin rate of the first tier of risk limit sheet # noqa: E501 + + :param maintenance_rate: The maintenance_rate of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._maintenance_rate = maintenance_rate + + @property + def margin(self): + """Gets the margin of this PositionTimerange. # noqa: E501 + + Margin # noqa: E501 + + :return: The margin of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._margin + + @margin.setter + def margin(self, margin): + """Sets the margin of this PositionTimerange. + + Margin # noqa: E501 + + :param margin: The margin of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._margin = margin + + @property + def liq_price(self): + """Gets the liq_price of this PositionTimerange. # noqa: E501 + + Liquidation price # noqa: E501 + + :return: The liq_price of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._liq_price + + @liq_price.setter + def liq_price(self, liq_price): + """Sets the liq_price of this PositionTimerange. + + Liquidation price # noqa: E501 + + :param liq_price: The liq_price of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._liq_price = liq_price + + @property + def realised_pnl(self): + """Gets the realised_pnl of this PositionTimerange. # noqa: E501 + + Realized PnL # noqa: E501 + + :return: The realised_pnl of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._realised_pnl + + @realised_pnl.setter + def realised_pnl(self, realised_pnl): + """Sets the realised_pnl of this PositionTimerange. + + Realized PnL # noqa: E501 + + :param realised_pnl: The realised_pnl of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._realised_pnl = realised_pnl + + @property + def history_pnl(self): + """Gets the history_pnl of this PositionTimerange. # noqa: E501 + + Total realized PnL from closed positions # noqa: E501 + + :return: The history_pnl of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._history_pnl + + @history_pnl.setter + def history_pnl(self, history_pnl): + """Sets the history_pnl of this PositionTimerange. + + Total realized PnL from closed positions # noqa: E501 + + :param history_pnl: The history_pnl of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._history_pnl = history_pnl + + @property + def last_close_pnl(self): + """Gets the last_close_pnl of this PositionTimerange. # noqa: E501 + + PNL of last position close # noqa: E501 + + :return: The last_close_pnl of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._last_close_pnl + + @last_close_pnl.setter + def last_close_pnl(self, last_close_pnl): + """Sets the last_close_pnl of this PositionTimerange. + + PNL of last position close # noqa: E501 + + :param last_close_pnl: The last_close_pnl of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._last_close_pnl = last_close_pnl + + @property + def realised_point(self): + """Gets the realised_point of this PositionTimerange. # noqa: E501 + + Realized POINT PNL # noqa: E501 + + :return: The realised_point of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._realised_point + + @realised_point.setter + def realised_point(self, realised_point): + """Sets the realised_point of this PositionTimerange. + + Realized POINT PNL # noqa: E501 + + :param realised_point: The realised_point of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._realised_point = realised_point + + @property + def history_point(self): + """Gets the history_point of this PositionTimerange. # noqa: E501 + + History realized POINT PNL # noqa: E501 + + :return: The history_point of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._history_point + + @history_point.setter + def history_point(self, history_point): + """Sets the history_point of this PositionTimerange. + + History realized POINT PNL # noqa: E501 + + :param history_point: The history_point of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._history_point = history_point + + @property + def mode(self): + """Gets the mode of this PositionTimerange. # noqa: E501 + + Position mode, including: - `single`: One-way Mode - `dual_long`: Long position in Hedge Mode - `dual_short`: Short position in Hedge Mode # noqa: E501 + + :return: The mode of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this PositionTimerange. + + Position mode, including: - `single`: One-way Mode - `dual_long`: Long position in Hedge Mode - `dual_short`: Short position in Hedge Mode # noqa: E501 + + :param mode: The mode of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._mode = mode + + @property + def cross_leverage_limit(self): + """Gets the cross_leverage_limit of this PositionTimerange. # noqa: E501 + + Cross margin leverage (valid only when `leverage` is 0) # noqa: E501 + + :return: The cross_leverage_limit of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._cross_leverage_limit + + @cross_leverage_limit.setter + def cross_leverage_limit(self, cross_leverage_limit): + """Sets the cross_leverage_limit of this PositionTimerange. + + Cross margin leverage (valid only when `leverage` is 0) # noqa: E501 + + :param cross_leverage_limit: The cross_leverage_limit of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._cross_leverage_limit = cross_leverage_limit + + @property + def entry_price(self): + """Gets the entry_price of this PositionTimerange. # noqa: E501 + + Entry price # noqa: E501 + + :return: The entry_price of this PositionTimerange. # noqa: E501 + :rtype: str + """ + return self._entry_price + + @entry_price.setter + def entry_price(self, entry_price): + """Sets the entry_price of this PositionTimerange. + + Entry price # noqa: E501 + + :param entry_price: The entry_price of this PositionTimerange. # noqa: E501 + :type: str + """ + + self._entry_price = entry_price + + @property + def time(self): + """Gets the time of this PositionTimerange. # noqa: E501 + + Timestamp # noqa: E501 + + :return: The time of this PositionTimerange. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this PositionTimerange. + + Timestamp # noqa: E501 + + :param time: The time of this PositionTimerange. # noqa: E501 + :type: int + """ + + self._time = time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionTimerange): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PositionTimerange): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/eth2_swap.py b/gate_api/models/preview_from_param.py similarity index 69% rename from gate_api/models/eth2_swap.py rename to gate_api/models/preview_from_param.py index 368d2c4c..f20b70f8 100644 --- a/gate_api/models/eth2_swap.py +++ b/gate_api/models/preview_from_param.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class Eth2Swap(object): +class PreviewFromParam(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -33,72 +33,72 @@ class Eth2Swap(object): and the value is json key in definition. """ openapi_types = { - 'side': 'str', + 'asset': 'str', 'amount': 'str' } attribute_map = { - 'side': 'side', + 'asset': 'asset', 'amount': 'amount' } - def __init__(self, side=None, amount=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, asset=None, amount=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, Configuration) -> None - """Eth2Swap - a model defined in OpenAPI""" # noqa: E501 + """PreviewFromParam - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration - self._side = None + self._asset = None self._amount = None self.discriminator = None - self.side = side + self.asset = asset self.amount = amount @property - def side(self): - """Gets the side of this Eth2Swap. # noqa: E501 + def asset(self): + """Gets the asset of this PreviewFromParam. # noqa: E501 - 1-Forward Swap (ETH -> GTETH), 2-Reverse Swap (GTETH -> ETH) # noqa: E501 + The currency symbol to be swapped out. # noqa: E501 - :return: The side of this Eth2Swap. # noqa: E501 + :return: The asset of this PreviewFromParam. # noqa: E501 :rtype: str """ - return self._side + return self._asset - @side.setter - def side(self, side): - """Sets the side of this Eth2Swap. + @asset.setter + def asset(self, asset): + """Sets the asset of this PreviewFromParam. - 1-Forward Swap (ETH -> GTETH), 2-Reverse Swap (GTETH -> ETH) # noqa: E501 + The currency symbol to be swapped out. # noqa: E501 - :param side: The side of this Eth2Swap. # noqa: E501 + :param asset: The asset of this PreviewFromParam. # noqa: E501 :type: str """ - if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 - raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 - self._side = side + self._asset = asset @property def amount(self): - """Gets the amount of this Eth2Swap. # noqa: E501 + """Gets the amount of this PreviewFromParam. # noqa: E501 - Swap Amount # noqa: E501 + The currency swap quantity, decimal string. # noqa: E501 - :return: The amount of this Eth2Swap. # noqa: E501 + :return: The amount of this PreviewFromParam. # noqa: E501 :rtype: str """ return self._amount @amount.setter def amount(self, amount): - """Sets the amount of this Eth2Swap. + """Sets the amount of this PreviewFromParam. - Swap Amount # noqa: E501 + The currency swap quantity, decimal string. # noqa: E501 - :param amount: The amount of this Eth2Swap. # noqa: E501 + :param amount: The amount of this PreviewFromParam. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 @@ -140,14 +140,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, Eth2Swap): + if not isinstance(other, PreviewFromParam): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, Eth2Swap): + if not isinstance(other, PreviewFromParam): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/preview_order.py b/gate_api/models/preview_order.py new file mode 100644 index 00000000..ac5d3f27 --- /dev/null +++ b/gate_api/models/preview_order.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PreviewOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + '_from': 'list[PreviewOrderDetail]', + 'to': 'list[PreviewOrderDetail]', + 'usdt_evaluated_value': 'str', + 'usdt_evaluated_value_show': 'str' + } + + attribute_map = { + '_from': 'from', + 'to': 'to', + 'usdt_evaluated_value': 'usdt_evaluated_value', + 'usdt_evaluated_value_show': 'usdt_evaluated_value_show' + } + + def __init__(self, _from=None, to=None, usdt_evaluated_value=None, usdt_evaluated_value_show=None, local_vars_configuration=None): # noqa: E501 + # type: (list[PreviewOrderDetail], list[PreviewOrderDetail], str, str, Configuration) -> None + """PreviewOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self.__from = None + self._to = None + self._usdt_evaluated_value = None + self._usdt_evaluated_value_show = None + self.discriminator = None + + self._from = _from + self.to = to + self.usdt_evaluated_value = usdt_evaluated_value + self.usdt_evaluated_value_show = usdt_evaluated_value_show + + @property + def _from(self): + """Gets the _from of this PreviewOrder. # noqa: E501 + + + :return: The _from of this PreviewOrder. # noqa: E501 + :rtype: list[PreviewOrderDetail] + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this PreviewOrder. + + + :param _from: The _from of this PreviewOrder. # noqa: E501 + :type: list[PreviewOrderDetail] + """ + if self.local_vars_configuration.client_side_validation and _from is None: # noqa: E501 + raise ValueError("Invalid value for `_from`, must not be `None`") # noqa: E501 + + self.__from = _from + + @property + def to(self): + """Gets the to of this PreviewOrder. # noqa: E501 + + + :return: The to of this PreviewOrder. # noqa: E501 + :rtype: list[PreviewOrderDetail] + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this PreviewOrder. + + + :param to: The to of this PreviewOrder. # noqa: E501 + :type: list[PreviewOrderDetail] + """ + if self.local_vars_configuration.client_side_validation and to is None: # noqa: E501 + raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501 + + self._to = to + + @property + def usdt_evaluated_value(self): + """Gets the usdt_evaluated_value of this PreviewOrder. # noqa: E501 + + + :return: The usdt_evaluated_value of this PreviewOrder. # noqa: E501 + :rtype: str + """ + return self._usdt_evaluated_value + + @usdt_evaluated_value.setter + def usdt_evaluated_value(self, usdt_evaluated_value): + """Sets the usdt_evaluated_value of this PreviewOrder. + + + :param usdt_evaluated_value: The usdt_evaluated_value of this PreviewOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and usdt_evaluated_value is None: # noqa: E501 + raise ValueError("Invalid value for `usdt_evaluated_value`, must not be `None`") # noqa: E501 + + self._usdt_evaluated_value = usdt_evaluated_value + + @property + def usdt_evaluated_value_show(self): + """Gets the usdt_evaluated_value_show of this PreviewOrder. # noqa: E501 + + + :return: The usdt_evaluated_value_show of this PreviewOrder. # noqa: E501 + :rtype: str + """ + return self._usdt_evaluated_value_show + + @usdt_evaluated_value_show.setter + def usdt_evaluated_value_show(self, usdt_evaluated_value_show): + """Sets the usdt_evaluated_value_show of this PreviewOrder. + + + :param usdt_evaluated_value_show: The usdt_evaluated_value_show of this PreviewOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and usdt_evaluated_value_show is None: # noqa: E501 + raise ValueError("Invalid value for `usdt_evaluated_value_show`, must not be `None`") # noqa: E501 + + self._usdt_evaluated_value_show = usdt_evaluated_value_show + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PreviewOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PreviewOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/preview_order_detail.py b/gate_api/models/preview_order_detail.py new file mode 100644 index 00000000..e35fd9df --- /dev/null +++ b/gate_api/models/preview_order_detail.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PreviewOrderDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'amount': 'str', + 'amount_show': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'amount': 'amount', + 'amount_show': 'amount_show' + } + + def __init__(self, asset=None, amount=None, amount_show=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """PreviewOrderDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._amount = None + self._amount_show = None + self.discriminator = None + + self.asset = asset + self.amount = amount + self.amount_show = amount_show + + @property + def asset(self): + """Gets the asset of this PreviewOrderDetail. # noqa: E501 + + + :return: The asset of this PreviewOrderDetail. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this PreviewOrderDetail. + + + :param asset: The asset of this PreviewOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def amount(self): + """Gets the amount of this PreviewOrderDetail. # noqa: E501 + + + :return: The amount of this PreviewOrderDetail. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this PreviewOrderDetail. + + + :param amount: The amount of this PreviewOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def amount_show(self): + """Gets the amount_show of this PreviewOrderDetail. # noqa: E501 + + + :return: The amount_show of this PreviewOrderDetail. # noqa: E501 + :rtype: str + """ + return self._amount_show + + @amount_show.setter + def amount_show(self, amount_show): + """Sets the amount_show of this PreviewOrderDetail. + + + :param amount_show: The amount_show of this PreviewOrderDetail. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount_show is None: # noqa: E501 + raise ValueError("Invalid value for `amount_show`, must not be `None`") # noqa: E501 + + self._amount_show = amount_show + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PreviewOrderDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PreviewOrderDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/preview_to_param.py b/gate_api/models/preview_to_param.py new file mode 100644 index 00000000..0be2ce7e --- /dev/null +++ b/gate_api/models/preview_to_param.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PreviewToParam(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'ratio': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'ratio': 'ratio' + } + + def __init__(self, asset=None, ratio=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """PreviewToParam - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._ratio = None + self.discriminator = None + + self.asset = asset + self.ratio = ratio + + @property + def asset(self): + """Gets the asset of this PreviewToParam. # noqa: E501 + + Target currency symbol; often corresponds to `recommend_v2.*[].schemes[].name` in config. # noqa: E501 + + :return: The asset of this PreviewToParam. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this PreviewToParam. + + Target currency symbol; often corresponds to `recommend_v2.*[].schemes[].name` in config. # noqa: E501 + + :param asset: The asset of this PreviewToParam. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def ratio(self): + """Gets the ratio of this PreviewToParam. # noqa: E501 + + The weight ratio of the target currency in the portfolio, **decimal string** (such as `0.2`, `0.5`). Often consistent with the `schemes[].ratio` of a strategy under `recommend_v2` of `GET /asset-swap/config`. # noqa: E501 + + :return: The ratio of this PreviewToParam. # noqa: E501 + :rtype: str + """ + return self._ratio + + @ratio.setter + def ratio(self, ratio): + """Sets the ratio of this PreviewToParam. + + The weight ratio of the target currency in the portfolio, **decimal string** (such as `0.2`, `0.5`). Often consistent with the `schemes[].ratio` of a strategy under `recommend_v2` of `GET /asset-swap/config`. # noqa: E501 + + :param ratio: The ratio of this PreviewToParam. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and ratio is None: # noqa: E501 + raise ValueError("Invalid value for `ratio`, must not be `None`") # noqa: E501 + + self._ratio = ratio + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PreviewToParam): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PreviewToParam): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/quick_estimated_repayment.py b/gate_api/models/quick_estimated_repayment.py new file mode 100644 index 00000000..582e6801 --- /dev/null +++ b/gate_api/models/quick_estimated_repayment.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class QuickEstimatedRepayment(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'debt_currencies': 'list[UnifiedQuickRepayDebtItem]', + 'available_currencies': 'list[UnifiedQuickRepayAvailableItem]' + } + + attribute_map = { + 'debt_currencies': 'debt_currencies', + 'available_currencies': 'available_currencies' + } + + def __init__(self, debt_currencies=None, available_currencies=None, local_vars_configuration=None): # noqa: E501 + # type: (list[UnifiedQuickRepayDebtItem], list[UnifiedQuickRepayAvailableItem], Configuration) -> None + """QuickEstimatedRepayment - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._debt_currencies = None + self._available_currencies = None + self.discriminator = None + + if debt_currencies is not None: + self.debt_currencies = debt_currencies + if available_currencies is not None: + self.available_currencies = available_currencies + + @property + def debt_currencies(self): + """Gets the debt_currencies of this QuickEstimatedRepayment. # noqa: E501 + + Liability currencies # noqa: E501 + + :return: The debt_currencies of this QuickEstimatedRepayment. # noqa: E501 + :rtype: list[UnifiedQuickRepayDebtItem] + """ + return self._debt_currencies + + @debt_currencies.setter + def debt_currencies(self, debt_currencies): + """Sets the debt_currencies of this QuickEstimatedRepayment. + + Liability currencies # noqa: E501 + + :param debt_currencies: The debt_currencies of this QuickEstimatedRepayment. # noqa: E501 + :type: list[UnifiedQuickRepayDebtItem] + """ + + self._debt_currencies = debt_currencies + + @property + def available_currencies(self): + """Gets the available_currencies of this QuickEstimatedRepayment. # noqa: E501 + + Currencies available for repayment # noqa: E501 + + :return: The available_currencies of this QuickEstimatedRepayment. # noqa: E501 + :rtype: list[UnifiedQuickRepayAvailableItem] + """ + return self._available_currencies + + @available_currencies.setter + def available_currencies(self, available_currencies): + """Sets the available_currencies of this QuickEstimatedRepayment. + + Currencies available for repayment # noqa: E501 + + :param available_currencies: The available_currencies of this QuickEstimatedRepayment. # noqa: E501 + :type: list[UnifiedQuickRepayAvailableItem] + """ + + self._available_currencies = available_currencies + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, QuickEstimatedRepayment): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, QuickEstimatedRepayment): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/quick_repayment_request.py b/gate_api/models/quick_repayment_request.py new file mode 100644 index 00000000..6cf92f2e --- /dev/null +++ b/gate_api/models/quick_repayment_request.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class QuickRepaymentRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'debt_currencies': 'list[str]', + 'available_currencies': 'list[str]' + } + + attribute_map = { + 'debt_currencies': 'debt_currencies', + 'available_currencies': 'available_currencies' + } + + def __init__(self, debt_currencies=None, available_currencies=None, local_vars_configuration=None): # noqa: E501 + # type: (list[str], list[str], Configuration) -> None + """QuickRepaymentRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._debt_currencies = None + self._available_currencies = None + self.discriminator = None + + self.debt_currencies = debt_currencies + self.available_currencies = available_currencies + + @property + def debt_currencies(self): + """Gets the debt_currencies of this QuickRepaymentRequest. # noqa: E501 + + Liability currencies # noqa: E501 + + :return: The debt_currencies of this QuickRepaymentRequest. # noqa: E501 + :rtype: list[str] + """ + return self._debt_currencies + + @debt_currencies.setter + def debt_currencies(self, debt_currencies): + """Sets the debt_currencies of this QuickRepaymentRequest. + + Liability currencies # noqa: E501 + + :param debt_currencies: The debt_currencies of this QuickRepaymentRequest. # noqa: E501 + :type: list[str] + """ + if self.local_vars_configuration.client_side_validation and debt_currencies is None: # noqa: E501 + raise ValueError("Invalid value for `debt_currencies`, must not be `None`") # noqa: E501 + + self._debt_currencies = debt_currencies + + @property + def available_currencies(self): + """Gets the available_currencies of this QuickRepaymentRequest. # noqa: E501 + + Currencies to repay with # noqa: E501 + + :return: The available_currencies of this QuickRepaymentRequest. # noqa: E501 + :rtype: list[str] + """ + return self._available_currencies + + @available_currencies.setter + def available_currencies(self, available_currencies): + """Sets the available_currencies of this QuickRepaymentRequest. + + Currencies to repay with # noqa: E501 + + :param available_currencies: The available_currencies of this QuickRepaymentRequest. # noqa: E501 + :type: list[str] + """ + if self.local_vars_configuration.client_side_validation and available_currencies is None: # noqa: E501 + raise ValueError("Invalid value for `available_currencies`, must not be `None`") # noqa: E501 + + self._available_currencies = available_currencies + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, QuickRepaymentRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, QuickRepaymentRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_loan.py b/gate_api/models/quick_repayment_response.py similarity index 56% rename from gate_api/models/repay_loan.py rename to gate_api/models/quick_repayment_response.py index f8d97d6e..96e3d4f8 100644 --- a/gate_api/models/repay_loan.py +++ b/gate_api/models/quick_repayment_response.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class RepayLoan(object): +class QuickRepaymentResponse(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -33,52 +33,52 @@ class RepayLoan(object): and the value is json key in definition. """ openapi_types = { - 'order_id': 'int', - 'repay_amount': 'str', - 'repaid_all': 'bool' + 'order_id': 'str', + 'repaid_infos': 'list[UnifiedQuickRepayRepaidInfo]', + 'used_infos': 'list[UnifiedQuickRepayUsedInfo]' } attribute_map = { 'order_id': 'order_id', - 'repay_amount': 'repay_amount', - 'repaid_all': 'repaid_all' + 'repaid_infos': 'repaid_infos', + 'used_infos': 'used_infos' } - def __init__(self, order_id=None, repay_amount=None, repaid_all=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, bool, Configuration) -> None - """RepayLoan - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, order_id=None, repaid_infos=None, used_infos=None, local_vars_configuration=None): # noqa: E501 + # type: (str, list[UnifiedQuickRepayRepaidInfo], list[UnifiedQuickRepayUsedInfo], Configuration) -> None + """QuickRepaymentResponse - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._order_id = None - self._repay_amount = None - self._repaid_all = None + self._repaid_infos = None + self._used_infos = None self.discriminator = None self.order_id = order_id - self.repay_amount = repay_amount - self.repaid_all = repaid_all + self.repaid_infos = repaid_infos + self.used_infos = used_infos @property def order_id(self): - """Gets the order_id of this RepayLoan. # noqa: E501 + """Gets the order_id of this QuickRepaymentResponse. # noqa: E501 Order ID # noqa: E501 - :return: The order_id of this RepayLoan. # noqa: E501 - :rtype: int + :return: The order_id of this QuickRepaymentResponse. # noqa: E501 + :rtype: str """ return self._order_id @order_id.setter def order_id(self, order_id): - """Sets the order_id of this RepayLoan. + """Sets the order_id of this QuickRepaymentResponse. Order ID # noqa: E501 - :param order_id: The order_id of this RepayLoan. # noqa: E501 - :type: int + :param order_id: The order_id of this QuickRepaymentResponse. # noqa: E501 + :type: str """ if self.local_vars_configuration.client_side_validation and order_id is None: # noqa: E501 raise ValueError("Invalid value for `order_id`, must not be `None`") # noqa: E501 @@ -86,54 +86,54 @@ def order_id(self, order_id): self._order_id = order_id @property - def repay_amount(self): - """Gets the repay_amount of this RepayLoan. # noqa: E501 + def repaid_infos(self): + """Gets the repaid_infos of this QuickRepaymentResponse. # noqa: E501 - Repayment amount, it is mandatory when making partial repayments # noqa: E501 + Repaid currency details # noqa: E501 - :return: The repay_amount of this RepayLoan. # noqa: E501 - :rtype: str + :return: The repaid_infos of this QuickRepaymentResponse. # noqa: E501 + :rtype: list[UnifiedQuickRepayRepaidInfo] """ - return self._repay_amount + return self._repaid_infos - @repay_amount.setter - def repay_amount(self, repay_amount): - """Sets the repay_amount of this RepayLoan. + @repaid_infos.setter + def repaid_infos(self, repaid_infos): + """Sets the repaid_infos of this QuickRepaymentResponse. - Repayment amount, it is mandatory when making partial repayments # noqa: E501 + Repaid currency details # noqa: E501 - :param repay_amount: The repay_amount of this RepayLoan. # noqa: E501 - :type: str + :param repaid_infos: The repaid_infos of this QuickRepaymentResponse. # noqa: E501 + :type: list[UnifiedQuickRepayRepaidInfo] """ - if self.local_vars_configuration.client_side_validation and repay_amount is None: # noqa: E501 - raise ValueError("Invalid value for `repay_amount`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and repaid_infos is None: # noqa: E501 + raise ValueError("Invalid value for `repaid_infos`, must not be `None`") # noqa: E501 - self._repay_amount = repay_amount + self._repaid_infos = repaid_infos @property - def repaid_all(self): - """Gets the repaid_all of this RepayLoan. # noqa: E501 + def used_infos(self): + """Gets the used_infos of this QuickRepaymentResponse. # noqa: E501 - Repayment method, set to `true` for full repayment, and `false` for partial repayment; When partial repayment, the repay_amount parameter cannot be greater than the remaining amount to be repaid by the user. # noqa: E501 + Currencies used for repayment # noqa: E501 - :return: The repaid_all of this RepayLoan. # noqa: E501 - :rtype: bool + :return: The used_infos of this QuickRepaymentResponse. # noqa: E501 + :rtype: list[UnifiedQuickRepayUsedInfo] """ - return self._repaid_all + return self._used_infos - @repaid_all.setter - def repaid_all(self, repaid_all): - """Sets the repaid_all of this RepayLoan. + @used_infos.setter + def used_infos(self, used_infos): + """Sets the used_infos of this QuickRepaymentResponse. - Repayment method, set to `true` for full repayment, and `false` for partial repayment; When partial repayment, the repay_amount parameter cannot be greater than the remaining amount to be repaid by the user. # noqa: E501 + Currencies used for repayment # noqa: E501 - :param repaid_all: The repaid_all of this RepayLoan. # noqa: E501 - :type: bool + :param used_infos: The used_infos of this QuickRepaymentResponse. # noqa: E501 + :type: list[UnifiedQuickRepayUsedInfo] """ - if self.local_vars_configuration.client_side_validation and repaid_all is None: # noqa: E501 - raise ValueError("Invalid value for `repaid_all`, must not be `None`") # noqa: E501 + if self.local_vars_configuration.client_side_validation and used_infos is None: # noqa: E501 + raise ValueError("Invalid value for `used_infos`, must not be `None`") # noqa: E501 - self._repaid_all = repaid_all + self._used_infos = used_infos def to_dict(self): """Returns the model properties as a dict""" @@ -169,14 +169,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, RepayLoan): + if not isinstance(other, QuickRepaymentResponse): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, RepayLoan): + if not isinstance(other, QuickRepaymentResponse): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/quote_request.py b/gate_api/models/quote_request.py new file mode 100644 index 00000000..99d9368d --- /dev/null +++ b/gate_api/models/quote_request.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class QuoteRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency': 'str', + 'side': 'str', + 'amount': 'str', + 'gas_mode': 'str', + 'slippage': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'side': 'side', + 'amount': 'amount', + 'gas_mode': 'gas_mode', + 'slippage': 'slippage' + } + + def __init__(self, currency=None, side=None, amount=None, gas_mode=None, slippage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """QuoteRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._side = None + self._amount = None + self._gas_mode = None + self._slippage = None + self.discriminator = None + + self.currency = currency + self.side = side + self.amount = amount + self.gas_mode = gas_mode + if slippage is not None: + self.slippage = slippage + + @property + def currency(self): + """Gets the currency of this QuoteRequest. # noqa: E501 + + Trading symbol # noqa: E501 + + :return: The currency of this QuoteRequest. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this QuoteRequest. + + Trading symbol # noqa: E501 + + :param currency: The currency of this QuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501 + raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501 + + self._currency = currency + + @property + def side(self): + """Gets the side of this QuoteRequest. # noqa: E501 + + Buy or sell orders - buy - sell # noqa: E501 + + :return: The side of this QuoteRequest. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this QuoteRequest. + + Buy or sell orders - buy - sell # noqa: E501 + + :param side: The side of this QuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def amount(self): + """Gets the amount of this QuoteRequest. # noqa: E501 + + Trade Quantity - `side` : `buy` refers to the quote currency, i.e., `USDT` - `side` : `sell` refers to the base currency # noqa: E501 + + :return: The amount of this QuoteRequest. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this QuoteRequest. + + Trade Quantity - `side` : `buy` refers to the quote currency, i.e., `USDT` - `side` : `sell` refers to the base currency # noqa: E501 + + :param amount: The amount of this QuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def gas_mode(self): + """Gets the gas_mode of this QuoteRequest. # noqa: E501 + + Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter # noqa: E501 + + :return: The gas_mode of this QuoteRequest. # noqa: E501 + :rtype: str + """ + return self._gas_mode + + @gas_mode.setter + def gas_mode(self, gas_mode): + """Sets the gas_mode of this QuoteRequest. + + Trading mode affects slippage selection - `speed` : Smart mode - `custom` : Custom mode, uses `slippage` parameter # noqa: E501 + + :param gas_mode: The gas_mode of this QuoteRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and gas_mode is None: # noqa: E501 + raise ValueError("Invalid value for `gas_mode`, must not be `None`") # noqa: E501 + + self._gas_mode = gas_mode + + @property + def slippage(self): + """Gets the slippage of this QuoteRequest. # noqa: E501 + + Slippage tolerance (10 means 10% tolerance) # noqa: E501 + + :return: The slippage of this QuoteRequest. # noqa: E501 + :rtype: str + """ + return self._slippage + + @slippage.setter + def slippage(self, slippage): + """Sets the slippage of this QuoteRequest. + + Slippage tolerance (10 means 10% tolerance) # noqa: E501 + + :param slippage: The slippage of this QuoteRequest. # noqa: E501 + :type: str + """ + + self._slippage = slippage + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, QuoteRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, QuoteRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/quote_response.py b/gate_api/models/quote_response.py new file mode 100644 index 00000000..8cb88550 --- /dev/null +++ b/gate_api/models/quote_response.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class QuoteResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'quote_id': 'str', + 'min_amount': 'str', + 'max_amount': 'str', + 'price': 'str', + 'slippage': 'str', + 'estimate_gas_fee_amount_usdt': 'str', + 'order_fee': 'str', + 'target_token_min_amount': 'str', + 'target_token_max_amount': 'str', + 'error_type': 'int' + } + + attribute_map = { + 'quote_id': 'quote_id', + 'min_amount': 'min_amount', + 'max_amount': 'max_amount', + 'price': 'price', + 'slippage': 'slippage', + 'estimate_gas_fee_amount_usdt': 'estimate_gas_fee_amount_usdt', + 'order_fee': 'order_fee', + 'target_token_min_amount': 'target_token_min_amount', + 'target_token_max_amount': 'target_token_max_amount', + 'error_type': 'error_type' + } + + def __init__(self, quote_id=None, min_amount=None, max_amount=None, price=None, slippage=None, estimate_gas_fee_amount_usdt=None, order_fee=None, target_token_min_amount=None, target_token_max_amount=None, error_type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, int, Configuration) -> None + """QuoteResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._quote_id = None + self._min_amount = None + self._max_amount = None + self._price = None + self._slippage = None + self._estimate_gas_fee_amount_usdt = None + self._order_fee = None + self._target_token_min_amount = None + self._target_token_max_amount = None + self._error_type = None + self.discriminator = None + + if quote_id is not None: + self.quote_id = quote_id + if min_amount is not None: + self.min_amount = min_amount + if max_amount is not None: + self.max_amount = max_amount + if price is not None: + self.price = price + if slippage is not None: + self.slippage = slippage + if estimate_gas_fee_amount_usdt is not None: + self.estimate_gas_fee_amount_usdt = estimate_gas_fee_amount_usdt + if order_fee is not None: + self.order_fee = order_fee + if target_token_min_amount is not None: + self.target_token_min_amount = target_token_min_amount + if target_token_max_amount is not None: + self.target_token_max_amount = target_token_max_amount + if error_type is not None: + self.error_type = error_type + + @property + def quote_id(self): + """Gets the quote_id of this QuoteResponse. # noqa: E501 + + Quote ID for order placement, valid for 1 minute # noqa: E501 + + :return: The quote_id of this QuoteResponse. # noqa: E501 + :rtype: str + """ + return self._quote_id + + @quote_id.setter + def quote_id(self, quote_id): + """Sets the quote_id of this QuoteResponse. + + Quote ID for order placement, valid for 1 minute # noqa: E501 + + :param quote_id: The quote_id of this QuoteResponse. # noqa: E501 + :type: str + """ + + self._quote_id = quote_id + + @property + def min_amount(self): + """Gets the min_amount of this QuoteResponse. # noqa: E501 + + Minimum order size # noqa: E501 + + :return: The min_amount of this QuoteResponse. # noqa: E501 + :rtype: str + """ + return self._min_amount + + @min_amount.setter + def min_amount(self, min_amount): + """Sets the min_amount of this QuoteResponse. + + Minimum order size # noqa: E501 + + :param min_amount: The min_amount of this QuoteResponse. # noqa: E501 + :type: str + """ + + self._min_amount = min_amount + + @property + def max_amount(self): + """Gets the max_amount of this QuoteResponse. # noqa: E501 + + Maximum order size # noqa: E501 + + :return: The max_amount of this QuoteResponse. # noqa: E501 + :rtype: str + """ + return self._max_amount + + @max_amount.setter + def max_amount(self, max_amount): + """Sets the max_amount of this QuoteResponse. + + Maximum order size # noqa: E501 + + :param max_amount: The max_amount of this QuoteResponse. # noqa: E501 + :type: str + """ + + self._max_amount = max_amount + + @property + def price(self): + """Gets the price of this QuoteResponse. # noqa: E501 + + Token Price (USDT-based) # noqa: E501 + + :return: The price of this QuoteResponse. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this QuoteResponse. + + Token Price (USDT-based) # noqa: E501 + + :param price: The price of this QuoteResponse. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def slippage(self): + """Gets the slippage of this QuoteResponse. # noqa: E501 + + Slippage # noqa: E501 + + :return: The slippage of this QuoteResponse. # noqa: E501 + :rtype: str + """ + return self._slippage + + @slippage.setter + def slippage(self, slippage): + """Sets the slippage of this QuoteResponse. + + Slippage # noqa: E501 + + :param slippage: The slippage of this QuoteResponse. # noqa: E501 + :type: str + """ + + self._slippage = slippage + + @property + def estimate_gas_fee_amount_usdt(self): + """Gets the estimate_gas_fee_amount_usdt of this QuoteResponse. # noqa: E501 + + Estimated Gas Fee (USDT-based) # noqa: E501 + + :return: The estimate_gas_fee_amount_usdt of this QuoteResponse. # noqa: E501 + :rtype: str + """ + return self._estimate_gas_fee_amount_usdt + + @estimate_gas_fee_amount_usdt.setter + def estimate_gas_fee_amount_usdt(self, estimate_gas_fee_amount_usdt): + """Sets the estimate_gas_fee_amount_usdt of this QuoteResponse. + + Estimated Gas Fee (USDT-based) # noqa: E501 + + :param estimate_gas_fee_amount_usdt: The estimate_gas_fee_amount_usdt of this QuoteResponse. # noqa: E501 + :type: str + """ + + self._estimate_gas_fee_amount_usdt = estimate_gas_fee_amount_usdt + + @property + def order_fee(self): + """Gets the order_fee of this QuoteResponse. # noqa: E501 + + Trading fee # noqa: E501 + + :return: The order_fee of this QuoteResponse. # noqa: E501 + :rtype: str + """ + return self._order_fee + + @order_fee.setter + def order_fee(self, order_fee): + """Sets the order_fee of this QuoteResponse. + + Trading fee # noqa: E501 + + :param order_fee: The order_fee of this QuoteResponse. # noqa: E501 + :type: str + """ + + self._order_fee = order_fee + + @property + def target_token_min_amount(self): + """Gets the target_token_min_amount of this QuoteResponse. # noqa: E501 + + Minimum received amount # noqa: E501 + + :return: The target_token_min_amount of this QuoteResponse. # noqa: E501 + :rtype: str + """ + return self._target_token_min_amount + + @target_token_min_amount.setter + def target_token_min_amount(self, target_token_min_amount): + """Sets the target_token_min_amount of this QuoteResponse. + + Minimum received amount # noqa: E501 + + :param target_token_min_amount: The target_token_min_amount of this QuoteResponse. # noqa: E501 + :type: str + """ + + self._target_token_min_amount = target_token_min_amount + + @property + def target_token_max_amount(self): + """Gets the target_token_max_amount of this QuoteResponse. # noqa: E501 + + Maximum received amount # noqa: E501 + + :return: The target_token_max_amount of this QuoteResponse. # noqa: E501 + :rtype: str + """ + return self._target_token_max_amount + + @target_token_max_amount.setter + def target_token_max_amount(self, target_token_max_amount): + """Sets the target_token_max_amount of this QuoteResponse. + + Maximum received amount # noqa: E501 + + :param target_token_max_amount: The target_token_max_amount of this QuoteResponse. # noqa: E501 + :type: str + """ + + self._target_token_max_amount = target_token_max_amount + + @property + def error_type(self): + """Gets the error_type of this QuoteResponse. # noqa: E501 + + Failure Type - `0` : Success - `1` : Exceeds maximum value - `2` : Below minimum value # noqa: E501 + + :return: The error_type of this QuoteResponse. # noqa: E501 + :rtype: int + """ + return self._error_type + + @error_type.setter + def error_type(self, error_type): + """Sets the error_type of this QuoteResponse. + + Failure Type - `0` : Success - `1` : Exceeds maximum value - `2` : Below minimum value # noqa: E501 + + :param error_type: The error_type of this QuoteResponse. # noqa: E501 + :type: int + """ + + self._error_type = error_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, QuoteResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, QuoteResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/recommend.py b/gate_api/models/recommend.py new file mode 100644 index 00000000..82bf3e48 --- /dev/null +++ b/gate_api/models/recommend.py @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Recommend(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'balance': 'dict(str, str)', + 'btc_faith': 'dict(str, str)', + 'conservative': 'dict(str, str)', + 'gt_faith': 'dict(str, str)' + } + + attribute_map = { + 'balance': 'balance', + 'btc_faith': 'btc_faith', + 'conservative': 'conservative', + 'gt_faith': 'gt_faith' + } + + def __init__(self, balance=None, btc_faith=None, conservative=None, gt_faith=None, local_vars_configuration=None): # noqa: E501 + # type: (dict(str, str), dict(str, str), dict(str, str), dict(str, str), Configuration) -> None + """Recommend - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._balance = None + self._btc_faith = None + self._conservative = None + self._gt_faith = None + self.discriminator = None + + self.balance = balance + self.btc_faith = btc_faith + self.conservative = conservative + self.gt_faith = gt_faith + + @property + def balance(self): + """Gets the balance of this Recommend. # noqa: E501 + + Mapping of string keys to string values, corresponding to Go's map[string]string. # noqa: E501 + + :return: The balance of this Recommend. # noqa: E501 + :rtype: dict(str, str) + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this Recommend. + + Mapping of string keys to string values, corresponding to Go's map[string]string. # noqa: E501 + + :param balance: The balance of this Recommend. # noqa: E501 + :type: dict(str, str) + """ + if self.local_vars_configuration.client_side_validation and balance is None: # noqa: E501 + raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 + + self._balance = balance + + @property + def btc_faith(self): + """Gets the btc_faith of this Recommend. # noqa: E501 + + Mapping of string keys to string values, corresponding to Go's map[string]string. # noqa: E501 + + :return: The btc_faith of this Recommend. # noqa: E501 + :rtype: dict(str, str) + """ + return self._btc_faith + + @btc_faith.setter + def btc_faith(self, btc_faith): + """Sets the btc_faith of this Recommend. + + Mapping of string keys to string values, corresponding to Go's map[string]string. # noqa: E501 + + :param btc_faith: The btc_faith of this Recommend. # noqa: E501 + :type: dict(str, str) + """ + if self.local_vars_configuration.client_side_validation and btc_faith is None: # noqa: E501 + raise ValueError("Invalid value for `btc_faith`, must not be `None`") # noqa: E501 + + self._btc_faith = btc_faith + + @property + def conservative(self): + """Gets the conservative of this Recommend. # noqa: E501 + + Mapping of string keys to string values, corresponding to Go's map[string]string. # noqa: E501 + + :return: The conservative of this Recommend. # noqa: E501 + :rtype: dict(str, str) + """ + return self._conservative + + @conservative.setter + def conservative(self, conservative): + """Sets the conservative of this Recommend. + + Mapping of string keys to string values, corresponding to Go's map[string]string. # noqa: E501 + + :param conservative: The conservative of this Recommend. # noqa: E501 + :type: dict(str, str) + """ + if self.local_vars_configuration.client_side_validation and conservative is None: # noqa: E501 + raise ValueError("Invalid value for `conservative`, must not be `None`") # noqa: E501 + + self._conservative = conservative + + @property + def gt_faith(self): + """Gets the gt_faith of this Recommend. # noqa: E501 + + Mapping of string keys to string values, corresponding to Go's map[string]string. # noqa: E501 + + :return: The gt_faith of this Recommend. # noqa: E501 + :rtype: dict(str, str) + """ + return self._gt_faith + + @gt_faith.setter + def gt_faith(self, gt_faith): + """Sets the gt_faith of this Recommend. + + Mapping of string keys to string values, corresponding to Go's map[string]string. # noqa: E501 + + :param gt_faith: The gt_faith of this Recommend. # noqa: E501 + :type: dict(str, str) + """ + if self.local_vars_configuration.client_side_validation and gt_faith is None: # noqa: E501 + raise ValueError("Invalid value for `gt_faith`, must not be `None`") # noqa: E501 + + self._gt_faith = gt_faith + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Recommend): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Recommend): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/recommend_v2_scheme.py b/gate_api/models/recommend_v2_scheme.py new file mode 100644 index 00000000..134ca061 --- /dev/null +++ b/gate_api/models/recommend_v2_scheme.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class RecommendV2Scheme(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str', + 'priority': 'int', + 'ratio': 'str' + } + + attribute_map = { + 'name': 'name', + 'priority': 'priority', + 'ratio': 'ratio' + } + + def __init__(self, name=None, priority=None, ratio=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, str, Configuration) -> None + """RecommendV2Scheme - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._name = None + self._priority = None + self._ratio = None + self.discriminator = None + + self.name = name + self.priority = priority + self.ratio = ratio + + @property + def name(self): + """Gets the name of this RecommendV2Scheme. # noqa: E501 + + + :return: The name of this RecommendV2Scheme. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this RecommendV2Scheme. + + + :param name: The name of this RecommendV2Scheme. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def priority(self): + """Gets the priority of this RecommendV2Scheme. # noqa: E501 + + + :return: The priority of this RecommendV2Scheme. # noqa: E501 + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this RecommendV2Scheme. + + + :param priority: The priority of this RecommendV2Scheme. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and priority is None: # noqa: E501 + raise ValueError("Invalid value for `priority`, must not be `None`") # noqa: E501 + + self._priority = priority + + @property + def ratio(self): + """Gets the ratio of this RecommendV2Scheme. # noqa: E501 + + + :return: The ratio of this RecommendV2Scheme. # noqa: E501 + :rtype: str + """ + return self._ratio + + @ratio.setter + def ratio(self, ratio): + """Sets the ratio of this RecommendV2Scheme. + + + :param ratio: The ratio of this RecommendV2Scheme. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and ratio is None: # noqa: E501 + raise ValueError("Invalid value for `ratio`, must not be `None`") # noqa: E501 + + self._ratio = ratio + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RecommendV2Scheme): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RecommendV2Scheme): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/recommend_v2_strategy.py b/gate_api/models/recommend_v2_strategy.py new file mode 100644 index 00000000..1c9616a1 --- /dev/null +++ b/gate_api/models/recommend_v2_strategy.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class RecommendV2Strategy(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str', + 'priority': 'int', + 'schemes': 'list[RecommendV2Scheme]' + } + + attribute_map = { + 'name': 'name', + 'priority': 'priority', + 'schemes': 'schemes' + } + + def __init__(self, name=None, priority=None, schemes=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, list[RecommendV2Scheme], Configuration) -> None + """RecommendV2Strategy - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._name = None + self._priority = None + self._schemes = None + self.discriminator = None + + self.name = name + self.priority = priority + self.schemes = schemes + + @property + def name(self): + """Gets the name of this RecommendV2Strategy. # noqa: E501 + + + :return: The name of this RecommendV2Strategy. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this RecommendV2Strategy. + + + :param name: The name of this RecommendV2Strategy. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def priority(self): + """Gets the priority of this RecommendV2Strategy. # noqa: E501 + + + :return: The priority of this RecommendV2Strategy. # noqa: E501 + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this RecommendV2Strategy. + + + :param priority: The priority of this RecommendV2Strategy. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and priority is None: # noqa: E501 + raise ValueError("Invalid value for `priority`, must not be `None`") # noqa: E501 + + self._priority = priority + + @property + def schemes(self): + """Gets the schemes of this RecommendV2Strategy. # noqa: E501 + + + :return: The schemes of this RecommendV2Strategy. # noqa: E501 + :rtype: list[RecommendV2Scheme] + """ + return self._schemes + + @schemes.setter + def schemes(self, schemes): + """Sets the schemes of this RecommendV2Strategy. + + + :param schemes: The schemes of this RecommendV2Strategy. # noqa: E501 + :type: list[RecommendV2Scheme] + """ + if self.local_vars_configuration.client_side_validation and schemes is None: # noqa: E501 + raise ValueError("Invalid value for `schemes`, must not be `None`") # noqa: E501 + + self._schemes = schemes + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RecommendV2Strategy): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RecommendV2Strategy): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/repay_record.py b/gate_api/models/repay_record.py deleted file mode 100644 index faef08c0..00000000 --- a/gate_api/models/repay_record.py +++ /dev/null @@ -1,459 +0,0 @@ -# coding: utf-8 - -""" - Gate API - - Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - - Contact: support@mail.gate.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class RepayRecord(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'order_id': 'int', - 'record_id': 'int', - 'repaid_amount': 'str', - 'borrow_currency': 'str', - 'collateral_currency': 'str', - 'init_ltv': 'str', - 'borrow_time': 'int', - 'repay_time': 'int', - 'total_interest': 'str', - 'before_left_principal': 'str', - 'after_left_principal': 'str', - 'before_left_collateral': 'str', - 'after_left_collateral': 'str' - } - - attribute_map = { - 'order_id': 'order_id', - 'record_id': 'record_id', - 'repaid_amount': 'repaid_amount', - 'borrow_currency': 'borrow_currency', - 'collateral_currency': 'collateral_currency', - 'init_ltv': 'init_ltv', - 'borrow_time': 'borrow_time', - 'repay_time': 'repay_time', - 'total_interest': 'total_interest', - 'before_left_principal': 'before_left_principal', - 'after_left_principal': 'after_left_principal', - 'before_left_collateral': 'before_left_collateral', - 'after_left_collateral': 'after_left_collateral' - } - - def __init__(self, order_id=None, record_id=None, repaid_amount=None, borrow_currency=None, collateral_currency=None, init_ltv=None, borrow_time=None, repay_time=None, total_interest=None, before_left_principal=None, after_left_principal=None, before_left_collateral=None, after_left_collateral=None, local_vars_configuration=None): # noqa: E501 - # type: (int, int, str, str, str, str, int, int, str, str, str, str, str, Configuration) -> None - """RepayRecord - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._order_id = None - self._record_id = None - self._repaid_amount = None - self._borrow_currency = None - self._collateral_currency = None - self._init_ltv = None - self._borrow_time = None - self._repay_time = None - self._total_interest = None - self._before_left_principal = None - self._after_left_principal = None - self._before_left_collateral = None - self._after_left_collateral = None - self.discriminator = None - - if order_id is not None: - self.order_id = order_id - if record_id is not None: - self.record_id = record_id - if repaid_amount is not None: - self.repaid_amount = repaid_amount - if borrow_currency is not None: - self.borrow_currency = borrow_currency - if collateral_currency is not None: - self.collateral_currency = collateral_currency - if init_ltv is not None: - self.init_ltv = init_ltv - if borrow_time is not None: - self.borrow_time = borrow_time - if repay_time is not None: - self.repay_time = repay_time - if total_interest is not None: - self.total_interest = total_interest - if before_left_principal is not None: - self.before_left_principal = before_left_principal - if after_left_principal is not None: - self.after_left_principal = after_left_principal - if before_left_collateral is not None: - self.before_left_collateral = before_left_collateral - if after_left_collateral is not None: - self.after_left_collateral = after_left_collateral - - @property - def order_id(self): - """Gets the order_id of this RepayRecord. # noqa: E501 - - Order ID # noqa: E501 - - :return: The order_id of this RepayRecord. # noqa: E501 - :rtype: int - """ - return self._order_id - - @order_id.setter - def order_id(self, order_id): - """Sets the order_id of this RepayRecord. - - Order ID # noqa: E501 - - :param order_id: The order_id of this RepayRecord. # noqa: E501 - :type: int - """ - - self._order_id = order_id - - @property - def record_id(self): - """Gets the record_id of this RepayRecord. # noqa: E501 - - Repayment record ID # noqa: E501 - - :return: The record_id of this RepayRecord. # noqa: E501 - :rtype: int - """ - return self._record_id - - @record_id.setter - def record_id(self, record_id): - """Sets the record_id of this RepayRecord. - - Repayment record ID # noqa: E501 - - :param record_id: The record_id of this RepayRecord. # noqa: E501 - :type: int - """ - - self._record_id = record_id - - @property - def repaid_amount(self): - """Gets the repaid_amount of this RepayRecord. # noqa: E501 - - Repayment amount # noqa: E501 - - :return: The repaid_amount of this RepayRecord. # noqa: E501 - :rtype: str - """ - return self._repaid_amount - - @repaid_amount.setter - def repaid_amount(self, repaid_amount): - """Sets the repaid_amount of this RepayRecord. - - Repayment amount # noqa: E501 - - :param repaid_amount: The repaid_amount of this RepayRecord. # noqa: E501 - :type: str - """ - - self._repaid_amount = repaid_amount - - @property - def borrow_currency(self): - """Gets the borrow_currency of this RepayRecord. # noqa: E501 - - Borrowed currency # noqa: E501 - - :return: The borrow_currency of this RepayRecord. # noqa: E501 - :rtype: str - """ - return self._borrow_currency - - @borrow_currency.setter - def borrow_currency(self, borrow_currency): - """Sets the borrow_currency of this RepayRecord. - - Borrowed currency # noqa: E501 - - :param borrow_currency: The borrow_currency of this RepayRecord. # noqa: E501 - :type: str - """ - - self._borrow_currency = borrow_currency - - @property - def collateral_currency(self): - """Gets the collateral_currency of this RepayRecord. # noqa: E501 - - Collateral currency # noqa: E501 - - :return: The collateral_currency of this RepayRecord. # noqa: E501 - :rtype: str - """ - return self._collateral_currency - - @collateral_currency.setter - def collateral_currency(self, collateral_currency): - """Sets the collateral_currency of this RepayRecord. - - Collateral currency # noqa: E501 - - :param collateral_currency: The collateral_currency of this RepayRecord. # noqa: E501 - :type: str - """ - - self._collateral_currency = collateral_currency - - @property - def init_ltv(self): - """Gets the init_ltv of this RepayRecord. # noqa: E501 - - Initial collateralization rate # noqa: E501 - - :return: The init_ltv of this RepayRecord. # noqa: E501 - :rtype: str - """ - return self._init_ltv - - @init_ltv.setter - def init_ltv(self, init_ltv): - """Sets the init_ltv of this RepayRecord. - - Initial collateralization rate # noqa: E501 - - :param init_ltv: The init_ltv of this RepayRecord. # noqa: E501 - :type: str - """ - - self._init_ltv = init_ltv - - @property - def borrow_time(self): - """Gets the borrow_time of this RepayRecord. # noqa: E501 - - Borrowing time, timestamp # noqa: E501 - - :return: The borrow_time of this RepayRecord. # noqa: E501 - :rtype: int - """ - return self._borrow_time - - @borrow_time.setter - def borrow_time(self, borrow_time): - """Sets the borrow_time of this RepayRecord. - - Borrowing time, timestamp # noqa: E501 - - :param borrow_time: The borrow_time of this RepayRecord. # noqa: E501 - :type: int - """ - - self._borrow_time = borrow_time - - @property - def repay_time(self): - """Gets the repay_time of this RepayRecord. # noqa: E501 - - Repayment time, timestamp # noqa: E501 - - :return: The repay_time of this RepayRecord. # noqa: E501 - :rtype: int - """ - return self._repay_time - - @repay_time.setter - def repay_time(self, repay_time): - """Sets the repay_time of this RepayRecord. - - Repayment time, timestamp # noqa: E501 - - :param repay_time: The repay_time of this RepayRecord. # noqa: E501 - :type: int - """ - - self._repay_time = repay_time - - @property - def total_interest(self): - """Gets the total_interest of this RepayRecord. # noqa: E501 - - Total interest # noqa: E501 - - :return: The total_interest of this RepayRecord. # noqa: E501 - :rtype: str - """ - return self._total_interest - - @total_interest.setter - def total_interest(self, total_interest): - """Sets the total_interest of this RepayRecord. - - Total interest # noqa: E501 - - :param total_interest: The total_interest of this RepayRecord. # noqa: E501 - :type: str - """ - - self._total_interest = total_interest - - @property - def before_left_principal(self): - """Gets the before_left_principal of this RepayRecord. # noqa: E501 - - Principal to be repaid before repayment # noqa: E501 - - :return: The before_left_principal of this RepayRecord. # noqa: E501 - :rtype: str - """ - return self._before_left_principal - - @before_left_principal.setter - def before_left_principal(self, before_left_principal): - """Sets the before_left_principal of this RepayRecord. - - Principal to be repaid before repayment # noqa: E501 - - :param before_left_principal: The before_left_principal of this RepayRecord. # noqa: E501 - :type: str - """ - - self._before_left_principal = before_left_principal - - @property - def after_left_principal(self): - """Gets the after_left_principal of this RepayRecord. # noqa: E501 - - Principal to be repaid after repayment # noqa: E501 - - :return: The after_left_principal of this RepayRecord. # noqa: E501 - :rtype: str - """ - return self._after_left_principal - - @after_left_principal.setter - def after_left_principal(self, after_left_principal): - """Sets the after_left_principal of this RepayRecord. - - Principal to be repaid after repayment # noqa: E501 - - :param after_left_principal: The after_left_principal of this RepayRecord. # noqa: E501 - :type: str - """ - - self._after_left_principal = after_left_principal - - @property - def before_left_collateral(self): - """Gets the before_left_collateral of this RepayRecord. # noqa: E501 - - Collateral amount before repayment # noqa: E501 - - :return: The before_left_collateral of this RepayRecord. # noqa: E501 - :rtype: str - """ - return self._before_left_collateral - - @before_left_collateral.setter - def before_left_collateral(self, before_left_collateral): - """Sets the before_left_collateral of this RepayRecord. - - Collateral amount before repayment # noqa: E501 - - :param before_left_collateral: The before_left_collateral of this RepayRecord. # noqa: E501 - :type: str - """ - - self._before_left_collateral = before_left_collateral - - @property - def after_left_collateral(self): - """Gets the after_left_collateral of this RepayRecord. # noqa: E501 - - Collateral amount after repayment # noqa: E501 - - :return: The after_left_collateral of this RepayRecord. # noqa: E501 - :rtype: str - """ - return self._after_left_collateral - - @after_left_collateral.setter - def after_left_collateral(self, after_left_collateral): - """Sets the after_left_collateral of this RepayRecord. - - Collateral amount after repayment # noqa: E501 - - :param after_left_collateral: The after_left_collateral of this RepayRecord. # noqa: E501 - :type: str - """ - - self._after_left_collateral = after_left_collateral - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, RepayRecord): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, RepayRecord): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/send_chat_message_request.py b/gate_api/models/send_chat_message_request.py new file mode 100644 index 00000000..3a58ccc1 --- /dev/null +++ b/gate_api/models/send_chat_message_request.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SendChatMessageRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'txid': 'int', + 'type': 'int', + 'message': 'str' + } + + attribute_map = { + 'txid': 'txid', + 'type': 'type', + 'message': 'message' + } + + def __init__(self, txid=None, type=None, message=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, str, Configuration) -> None + """SendChatMessageRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._txid = None + self._type = None + self._message = None + self.discriminator = None + + self.txid = txid + if type is not None: + self.type = type + self.message = message + + @property + def txid(self): + """Gets the txid of this SendChatMessageRequest. # noqa: E501 + + Order ID # noqa: E501 + + :return: The txid of this SendChatMessageRequest. # noqa: E501 + :rtype: int + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this SendChatMessageRequest. + + Order ID # noqa: E501 + + :param txid: The txid of this SendChatMessageRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and txid is None: # noqa: E501 + raise ValueError("Invalid value for `txid`, must not be `None`") # noqa: E501 + + self._txid = txid + + @property + def type(self): + """Gets the type of this SendChatMessageRequest. # noqa: E501 + + Message type: `0` text; `1` file (image or video); defaults to `0`. # noqa: E501 + + :return: The type of this SendChatMessageRequest. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SendChatMessageRequest. + + Message type: `0` text; `1` file (image or video); defaults to `0`. # noqa: E501 + + :param type: The type of this SendChatMessageRequest. # noqa: E501 + :type: int + """ + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def message(self): + """Gets the message of this SendChatMessageRequest. # noqa: E501 + + Message content. When type=0, pass text up to 500 characters, which goes through off-platform traffic diversion risk control; when hit, the response contains risk_type=1 and toast_msg. When type=1, pass the file_key returned by upload_chat_file # noqa: E501 + + :return: The message of this SendChatMessageRequest. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this SendChatMessageRequest. + + Message content. When type=0, pass text up to 500 characters, which goes through off-platform traffic diversion risk control; when hit, the response contains risk_type=1 and toast_msg. When type=1, pass the file_key returned by upload_chat_file # noqa: E501 + + :param message: The message of this SendChatMessageRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SendChatMessageRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SendChatMessageRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/set_merchant_work_hours_request.py b/gate_api/models/set_merchant_work_hours_request.py new file mode 100644 index 00000000..87683735 --- /dev/null +++ b/gate_api/models/set_merchant_work_hours_request.py @@ -0,0 +1,276 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SetMerchantWorkHoursRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'work_status': 'int', + 'cycle_type': 'str', + 'day_of_week': 'str', + 'time_zone': 'str', + 'start_time': 'str', + 'end_time': 'str' + } + + attribute_map = { + 'work_status': 'work_status', + 'cycle_type': 'cycle_type', + 'day_of_week': 'day_of_week', + 'time_zone': 'time_zone', + 'start_time': 'start_time', + 'end_time': 'end_time' + } + + def __init__(self, work_status=None, cycle_type=None, day_of_week=None, time_zone=None, start_time=None, end_time=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, Configuration) -> None + """SetMerchantWorkHoursRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._work_status = None + self._cycle_type = None + self._day_of_week = None + self._time_zone = None + self._start_time = None + self._end_time = None + self.discriminator = None + + self.work_status = work_status + if cycle_type is not None: + self.cycle_type = cycle_type + if day_of_week is not None: + self.day_of_week = day_of_week + if time_zone is not None: + self.time_zone = time_zone + if start_time is not None: + self.start_time = start_time + if end_time is not None: + self.end_time = end_time + + @property + def work_status(self): + """Gets the work_status of this SetMerchantWorkHoursRequest. # noqa: E501 + + Working status. 0: resting, 1: working, 2: using custom working hours # noqa: E501 + + :return: The work_status of this SetMerchantWorkHoursRequest. # noqa: E501 + :rtype: int + """ + return self._work_status + + @work_status.setter + def work_status(self, work_status): + """Sets the work_status of this SetMerchantWorkHoursRequest. + + Working status. 0: resting, 1: working, 2: using custom working hours # noqa: E501 + + :param work_status: The work_status of this SetMerchantWorkHoursRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and work_status is None: # noqa: E501 + raise ValueError("Invalid value for `work_status`, must not be `None`") # noqa: E501 + allowed_values = [0, 1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and work_status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `work_status` ({0}), must be one of {1}" # noqa: E501 + .format(work_status, allowed_values) + ) + + self._work_status = work_status + + @property + def cycle_type(self): + """Gets the cycle_type of this SetMerchantWorkHoursRequest. # noqa: E501 + + Custom working cycle; required when work_status is 2 # noqa: E501 + + :return: The cycle_type of this SetMerchantWorkHoursRequest. # noqa: E501 + :rtype: str + """ + return self._cycle_type + + @cycle_type.setter + def cycle_type(self, cycle_type): + """Sets the cycle_type of this SetMerchantWorkHoursRequest. + + Custom working cycle; required when work_status is 2 # noqa: E501 + + :param cycle_type: The cycle_type of this SetMerchantWorkHoursRequest. # noqa: E501 + :type: str + """ + allowed_values = ["Weekly", "Daily"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and cycle_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `cycle_type` ({0}), must be one of {1}" # noqa: E501 + .format(cycle_type, allowed_values) + ) + + self._cycle_type = cycle_type + + @property + def day_of_week(self): + """Gets the day_of_week of this SetMerchantWorkHoursRequest. # noqa: E501 + + Weekly working days, comma-separated values 1-7 for Monday to Sunday; required when work_status is 2 and cycle_type is Weekly # noqa: E501 + + :return: The day_of_week of this SetMerchantWorkHoursRequest. # noqa: E501 + :rtype: str + """ + return self._day_of_week + + @day_of_week.setter + def day_of_week(self, day_of_week): + """Sets the day_of_week of this SetMerchantWorkHoursRequest. + + Weekly working days, comma-separated values 1-7 for Monday to Sunday; required when work_status is 2 and cycle_type is Weekly # noqa: E501 + + :param day_of_week: The day_of_week of this SetMerchantWorkHoursRequest. # noqa: E501 + :type: str + """ + + self._day_of_week = day_of_week + + @property + def time_zone(self): + """Gets the time_zone of this SetMerchantWorkHoursRequest. # noqa: E501 + + UTC timezone offset, ranging from -12 to +14; required when work_status is 2 # noqa: E501 + + :return: The time_zone of this SetMerchantWorkHoursRequest. # noqa: E501 + :rtype: str + """ + return self._time_zone + + @time_zone.setter + def time_zone(self, time_zone): + """Sets the time_zone of this SetMerchantWorkHoursRequest. + + UTC timezone offset, ranging from -12 to +14; required when work_status is 2 # noqa: E501 + + :param time_zone: The time_zone of this SetMerchantWorkHoursRequest. # noqa: E501 + :type: str + """ + + self._time_zone = time_zone + + @property + def start_time(self): + """Gets the start_time of this SetMerchantWorkHoursRequest. # noqa: E501 + + Custom working start time in HH:mm format; required when work_status is 2 and must not be later than end_time # noqa: E501 + + :return: The start_time of this SetMerchantWorkHoursRequest. # noqa: E501 + :rtype: str + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this SetMerchantWorkHoursRequest. + + Custom working start time in HH:mm format; required when work_status is 2 and must not be later than end_time # noqa: E501 + + :param start_time: The start_time of this SetMerchantWorkHoursRequest. # noqa: E501 + :type: str + """ + + self._start_time = start_time + + @property + def end_time(self): + """Gets the end_time of this SetMerchantWorkHoursRequest. # noqa: E501 + + Custom working end time in HH:mm format; required when work_status is 2 and must not be earlier than start_time # noqa: E501 + + :return: The end_time of this SetMerchantWorkHoursRequest. # noqa: E501 + :rtype: str + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this SetMerchantWorkHoursRequest. + + Custom working end time in HH:mm format; required when work_status is 2 and must not be earlier than start_time # noqa: E501 + + :param end_time: The end_time of this SetMerchantWorkHoursRequest. # noqa: E501 + :type: str + """ + + self._end_time = end_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SetMerchantWorkHoursRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SetMerchantWorkHoursRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_account_book.py b/gate_api/models/spot_account_book.py index 081b2813..1c7edcba 100644 --- a/gate_api/models/spot_account_book.py +++ b/gate_api/models/spot_account_book.py @@ -207,7 +207,7 @@ def balance(self, balance): def type(self): """Gets the type of this SpotAccountBook. # noqa: E501 - Account book type. Please refer to [account book type](#accountbook-type) for more detail # noqa: E501 + Account change type; deprecated (see `code` for account change type encoding) # noqa: E501 :return: The type of this SpotAccountBook. # noqa: E501 :rtype: str @@ -218,7 +218,7 @@ def type(self): def type(self, type): """Sets the type of this SpotAccountBook. - Account book type. Please refer to [account book type](#accountbook-type) for more detail # noqa: E501 + Account change type; deprecated (see `code` for account change type encoding) # noqa: E501 :param type: The type of this SpotAccountBook. # noqa: E501 :type: str diff --git a/gate_api/models/spot_grid_create_params.py b/gate_api/models/spot_grid_create_params.py new file mode 100644 index 00000000..bcc66b7e --- /dev/null +++ b/gate_api/models/spot_grid_create_params.py @@ -0,0 +1,377 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SpotGridCreateParams(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'money': 'str', + 'low_price': 'str', + 'high_price': 'str', + 'grid_num': 'int', + 'price_type': 'int', + 'trigger_price': 'str', + 'stop_profit': 'str', + 'stop_loss': 'str', + 'profit_sharing_ratio': 'str', + 'is_use_base': 'bool' + } + + attribute_map = { + 'money': 'money', + 'low_price': 'low_price', + 'high_price': 'high_price', + 'grid_num': 'grid_num', + 'price_type': 'price_type', + 'trigger_price': 'trigger_price', + 'stop_profit': 'stop_profit', + 'stop_loss': 'stop_loss', + 'profit_sharing_ratio': 'profit_sharing_ratio', + 'is_use_base': 'is_use_base' + } + + def __init__(self, money=None, low_price=None, high_price=None, grid_num=None, price_type=None, trigger_price=None, stop_profit=None, stop_loss=None, profit_sharing_ratio=None, is_use_base=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, int, str, str, str, str, bool, Configuration) -> None + """SpotGridCreateParams - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._money = None + self._low_price = None + self._high_price = None + self._grid_num = None + self._price_type = None + self._trigger_price = None + self._stop_profit = None + self._stop_loss = None + self._profit_sharing_ratio = None + self._is_use_base = None + self.discriminator = None + + self.money = money + self.low_price = low_price + self.high_price = high_price + self.grid_num = grid_num + self.price_type = price_type + if trigger_price is not None: + self.trigger_price = trigger_price + if stop_profit is not None: + self.stop_profit = stop_profit + if stop_loss is not None: + self.stop_loss = stop_loss + if profit_sharing_ratio is not None: + self.profit_sharing_ratio = profit_sharing_ratio + if is_use_base is not None: + self.is_use_base = is_use_base + + @property + def money(self): + """Gets the money of this SpotGridCreateParams. # noqa: E501 + + Amount of investment # noqa: E501 + + :return: The money of this SpotGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this SpotGridCreateParams. + + Amount of investment # noqa: E501 + + :param money: The money of this SpotGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and money is None: # noqa: E501 + raise ValueError("Invalid value for `money`, must not be `None`") # noqa: E501 + + self._money = money + + @property + def low_price(self): + """Gets the low_price of this SpotGridCreateParams. # noqa: E501 + + Range lower limit # noqa: E501 + + :return: The low_price of this SpotGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._low_price + + @low_price.setter + def low_price(self, low_price): + """Sets the low_price of this SpotGridCreateParams. + + Range lower limit # noqa: E501 + + :param low_price: The low_price of this SpotGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and low_price is None: # noqa: E501 + raise ValueError("Invalid value for `low_price`, must not be `None`") # noqa: E501 + + self._low_price = low_price + + @property + def high_price(self): + """Gets the high_price of this SpotGridCreateParams. # noqa: E501 + + Range upper limit # noqa: E501 + + :return: The high_price of this SpotGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._high_price + + @high_price.setter + def high_price(self, high_price): + """Sets the high_price of this SpotGridCreateParams. + + Range upper limit # noqa: E501 + + :param high_price: The high_price of this SpotGridCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and high_price is None: # noqa: E501 + raise ValueError("Invalid value for `high_price`, must not be `None`") # noqa: E501 + + self._high_price = high_price + + @property + def grid_num(self): + """Gets the grid_num of this SpotGridCreateParams. # noqa: E501 + + Number of grids # noqa: E501 + + :return: The grid_num of this SpotGridCreateParams. # noqa: E501 + :rtype: int + """ + return self._grid_num + + @grid_num.setter + def grid_num(self, grid_num): + """Sets the grid_num of this SpotGridCreateParams. + + Number of grids # noqa: E501 + + :param grid_num: The grid_num of this SpotGridCreateParams. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and grid_num is None: # noqa: E501 + raise ValueError("Invalid value for `grid_num`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + grid_num is not None and grid_num < 1): # noqa: E501 + raise ValueError("Invalid value for `grid_num`, must be a value greater than or equal to `1`") # noqa: E501 + + self._grid_num = grid_num + + @property + def price_type(self): + """Gets the price_type of this SpotGridCreateParams. # noqa: E501 + + + :return: The price_type of this SpotGridCreateParams. # noqa: E501 + :rtype: int + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this SpotGridCreateParams. + + + :param price_type: The price_type of this SpotGridCreateParams. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and price_type is None: # noqa: E501 + raise ValueError("Invalid value for `price_type`, must not be `None`") # noqa: E501 + allowed_values = [0, 1] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def trigger_price(self): + """Gets the trigger_price of this SpotGridCreateParams. # noqa: E501 + + + :return: The trigger_price of this SpotGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this SpotGridCreateParams. + + + :param trigger_price: The trigger_price of this SpotGridCreateParams. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def stop_profit(self): + """Gets the stop_profit of this SpotGridCreateParams. # noqa: E501 + + + :return: The stop_profit of this SpotGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._stop_profit + + @stop_profit.setter + def stop_profit(self, stop_profit): + """Sets the stop_profit of this SpotGridCreateParams. + + + :param stop_profit: The stop_profit of this SpotGridCreateParams. # noqa: E501 + :type: str + """ + + self._stop_profit = stop_profit + + @property + def stop_loss(self): + """Gets the stop_loss of this SpotGridCreateParams. # noqa: E501 + + + :return: The stop_loss of this SpotGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._stop_loss + + @stop_loss.setter + def stop_loss(self, stop_loss): + """Sets the stop_loss of this SpotGridCreateParams. + + + :param stop_loss: The stop_loss of this SpotGridCreateParams. # noqa: E501 + :type: str + """ + + self._stop_loss = stop_loss + + @property + def profit_sharing_ratio(self): + """Gets the profit_sharing_ratio of this SpotGridCreateParams. # noqa: E501 + + + :return: The profit_sharing_ratio of this SpotGridCreateParams. # noqa: E501 + :rtype: str + """ + return self._profit_sharing_ratio + + @profit_sharing_ratio.setter + def profit_sharing_ratio(self, profit_sharing_ratio): + """Sets the profit_sharing_ratio of this SpotGridCreateParams. + + + :param profit_sharing_ratio: The profit_sharing_ratio of this SpotGridCreateParams. # noqa: E501 + :type: str + """ + + self._profit_sharing_ratio = profit_sharing_ratio + + @property + def is_use_base(self): + """Gets the is_use_base of this SpotGridCreateParams. # noqa: E501 + + + :return: The is_use_base of this SpotGridCreateParams. # noqa: E501 + :rtype: bool + """ + return self._is_use_base + + @is_use_base.setter + def is_use_base(self, is_use_base): + """Sets the is_use_base of this SpotGridCreateParams. + + + :param is_use_base: The is_use_base of this SpotGridCreateParams. # noqa: E501 + :type: bool + """ + + self._is_use_base = is_use_base + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpotGridCreateParams): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotGridCreateParams): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_grid_create_request.py b/gate_api/models/spot_grid_create_request.py new file mode 100644 index 00000000..9896e745 --- /dev/null +++ b/gate_api/models/spot_grid_create_request.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SpotGridCreateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_type': 'str', + 'market': 'str', + 'create_params': 'SpotGridCreateParams' + } + + attribute_map = { + 'strategy_type': 'strategy_type', + 'market': 'market', + 'create_params': 'create_params' + } + + def __init__(self, strategy_type=None, market=None, create_params=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, SpotGridCreateParams, Configuration) -> None + """SpotGridCreateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_type = None + self._market = None + self._create_params = None + self.discriminator = None + + self.strategy_type = strategy_type + self.market = market + self.create_params = create_params + + @property + def strategy_type(self): + """Gets the strategy_type of this SpotGridCreateRequest. # noqa: E501 + + + :return: The strategy_type of this SpotGridCreateRequest. # noqa: E501 + :rtype: str + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this SpotGridCreateRequest. + + + :param strategy_type: The strategy_type of this SpotGridCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + allowed_values = ["spot_grid"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and strategy_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `strategy_type` ({0}), must be one of {1}" # noqa: E501 + .format(strategy_type, allowed_values) + ) + + self._strategy_type = strategy_type + + @property + def market(self): + """Gets the market of this SpotGridCreateRequest. # noqa: E501 + + + :return: The market of this SpotGridCreateRequest. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this SpotGridCreateRequest. + + + :param market: The market of this SpotGridCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def create_params(self): + """Gets the create_params of this SpotGridCreateRequest. # noqa: E501 + + + :return: The create_params of this SpotGridCreateRequest. # noqa: E501 + :rtype: SpotGridCreateParams + """ + return self._create_params + + @create_params.setter + def create_params(self, create_params): + """Sets the create_params of this SpotGridCreateRequest. + + + :param create_params: The create_params of this SpotGridCreateRequest. # noqa: E501 + :type: SpotGridCreateParams + """ + if self.local_vars_configuration.client_side_validation and create_params is None: # noqa: E501 + raise ValueError("Invalid value for `create_params`, must not be `None`") # noqa: E501 + + self._create_params = create_params + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpotGridCreateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotGridCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_martingale_create_params.py b/gate_api/models/spot_martingale_create_params.py new file mode 100644 index 00000000..f6ab30ae --- /dev/null +++ b/gate_api/models/spot_martingale_create_params.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SpotMartingaleCreateParams(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'invest_amount': 'str', + 'price_deviation': 'str', + 'max_orders': 'int', + 'take_profit_ratio': 'str', + 'stop_loss_per_cycle': 'str', + 'trigger_price': 'str', + 'profit_sharing_ratio': 'str' + } + + attribute_map = { + 'invest_amount': 'invest_amount', + 'price_deviation': 'price_deviation', + 'max_orders': 'max_orders', + 'take_profit_ratio': 'take_profit_ratio', + 'stop_loss_per_cycle': 'stop_loss_per_cycle', + 'trigger_price': 'trigger_price', + 'profit_sharing_ratio': 'profit_sharing_ratio' + } + + def __init__(self, invest_amount=None, price_deviation=None, max_orders=None, take_profit_ratio=None, stop_loss_per_cycle=None, trigger_price=None, profit_sharing_ratio=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, str, str, str, str, Configuration) -> None + """SpotMartingaleCreateParams - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._invest_amount = None + self._price_deviation = None + self._max_orders = None + self._take_profit_ratio = None + self._stop_loss_per_cycle = None + self._trigger_price = None + self._profit_sharing_ratio = None + self.discriminator = None + + self.invest_amount = invest_amount + self.price_deviation = price_deviation + self.max_orders = max_orders + self.take_profit_ratio = take_profit_ratio + if stop_loss_per_cycle is not None: + self.stop_loss_per_cycle = stop_loss_per_cycle + if trigger_price is not None: + self.trigger_price = trigger_price + if profit_sharing_ratio is not None: + self.profit_sharing_ratio = profit_sharing_ratio + + @property + def invest_amount(self): + """Gets the invest_amount of this SpotMartingaleCreateParams. # noqa: E501 + + + :return: The invest_amount of this SpotMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._invest_amount + + @invest_amount.setter + def invest_amount(self, invest_amount): + """Sets the invest_amount of this SpotMartingaleCreateParams. + + + :param invest_amount: The invest_amount of this SpotMartingaleCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and invest_amount is None: # noqa: E501 + raise ValueError("Invalid value for `invest_amount`, must not be `None`") # noqa: E501 + + self._invest_amount = invest_amount + + @property + def price_deviation(self): + """Gets the price_deviation of this SpotMartingaleCreateParams. # noqa: E501 + + Add-position deviation ratio as a decimal string (e.g. a 2% drop is `0.02`). # noqa: E501 + + :return: The price_deviation of this SpotMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._price_deviation + + @price_deviation.setter + def price_deviation(self, price_deviation): + """Sets the price_deviation of this SpotMartingaleCreateParams. + + Add-position deviation ratio as a decimal string (e.g. a 2% drop is `0.02`). # noqa: E501 + + :param price_deviation: The price_deviation of this SpotMartingaleCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price_deviation is None: # noqa: E501 + raise ValueError("Invalid value for `price_deviation`, must not be `None`") # noqa: E501 + + self._price_deviation = price_deviation + + @property + def max_orders(self): + """Gets the max_orders of this SpotMartingaleCreateParams. # noqa: E501 + + + :return: The max_orders of this SpotMartingaleCreateParams. # noqa: E501 + :rtype: int + """ + return self._max_orders + + @max_orders.setter + def max_orders(self, max_orders): + """Sets the max_orders of this SpotMartingaleCreateParams. + + + :param max_orders: The max_orders of this SpotMartingaleCreateParams. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and max_orders is None: # noqa: E501 + raise ValueError("Invalid value for `max_orders`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + max_orders is not None and max_orders < 1): # noqa: E501 + raise ValueError("Invalid value for `max_orders`, must be a value greater than or equal to `1`") # noqa: E501 + + self._max_orders = max_orders + + @property + def take_profit_ratio(self): + """Gets the take_profit_ratio of this SpotMartingaleCreateParams. # noqa: E501 + + Take-profit ratio per round as a decimal string. # noqa: E501 + + :return: The take_profit_ratio of this SpotMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._take_profit_ratio + + @take_profit_ratio.setter + def take_profit_ratio(self, take_profit_ratio): + """Sets the take_profit_ratio of this SpotMartingaleCreateParams. + + Take-profit ratio per round as a decimal string. # noqa: E501 + + :param take_profit_ratio: The take_profit_ratio of this SpotMartingaleCreateParams. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and take_profit_ratio is None: # noqa: E501 + raise ValueError("Invalid value for `take_profit_ratio`, must not be `None`") # noqa: E501 + + self._take_profit_ratio = take_profit_ratio + + @property + def stop_loss_per_cycle(self): + """Gets the stop_loss_per_cycle of this SpotMartingaleCreateParams. # noqa: E501 + + Stop-loss ratio per round as a decimal string; optional; aligned with app `stop_loss_per_cycle`. # noqa: E501 + + :return: The stop_loss_per_cycle of this SpotMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._stop_loss_per_cycle + + @stop_loss_per_cycle.setter + def stop_loss_per_cycle(self, stop_loss_per_cycle): + """Sets the stop_loss_per_cycle of this SpotMartingaleCreateParams. + + Stop-loss ratio per round as a decimal string; optional; aligned with app `stop_loss_per_cycle`. # noqa: E501 + + :param stop_loss_per_cycle: The stop_loss_per_cycle of this SpotMartingaleCreateParams. # noqa: E501 + :type: str + """ + + self._stop_loss_per_cycle = stop_loss_per_cycle + + @property + def trigger_price(self): + """Gets the trigger_price of this SpotMartingaleCreateParams. # noqa: E501 + + Trigger price; optional. # noqa: E501 + + :return: The trigger_price of this SpotMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this SpotMartingaleCreateParams. + + Trigger price; optional. # noqa: E501 + + :param trigger_price: The trigger_price of this SpotMartingaleCreateParams. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def profit_sharing_ratio(self): + """Gets the profit_sharing_ratio of this SpotMartingaleCreateParams. # noqa: E501 + + + :return: The profit_sharing_ratio of this SpotMartingaleCreateParams. # noqa: E501 + :rtype: str + """ + return self._profit_sharing_ratio + + @profit_sharing_ratio.setter + def profit_sharing_ratio(self, profit_sharing_ratio): + """Sets the profit_sharing_ratio of this SpotMartingaleCreateParams. + + + :param profit_sharing_ratio: The profit_sharing_ratio of this SpotMartingaleCreateParams. # noqa: E501 + :type: str + """ + + self._profit_sharing_ratio = profit_sharing_ratio + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpotMartingaleCreateParams): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotMartingaleCreateParams): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_martingale_create_request.py b/gate_api/models/spot_martingale_create_request.py new file mode 100644 index 00000000..d43b8210 --- /dev/null +++ b/gate_api/models/spot_martingale_create_request.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SpotMartingaleCreateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy_type': 'str', + 'market': 'str', + 'create_params': 'SpotMartingaleCreateParams' + } + + attribute_map = { + 'strategy_type': 'strategy_type', + 'market': 'market', + 'create_params': 'create_params' + } + + def __init__(self, strategy_type=None, market=None, create_params=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, SpotMartingaleCreateParams, Configuration) -> None + """SpotMartingaleCreateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._strategy_type = None + self._market = None + self._create_params = None + self.discriminator = None + + self.strategy_type = strategy_type + self.market = market + self.create_params = create_params + + @property + def strategy_type(self): + """Gets the strategy_type of this SpotMartingaleCreateRequest. # noqa: E501 + + + :return: The strategy_type of this SpotMartingaleCreateRequest. # noqa: E501 + :rtype: str + """ + return self._strategy_type + + @strategy_type.setter + def strategy_type(self, strategy_type): + """Sets the strategy_type of this SpotMartingaleCreateRequest. + + + :param strategy_type: The strategy_type of this SpotMartingaleCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and strategy_type is None: # noqa: E501 + raise ValueError("Invalid value for `strategy_type`, must not be `None`") # noqa: E501 + allowed_values = ["spot_martingale"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and strategy_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `strategy_type` ({0}), must be one of {1}" # noqa: E501 + .format(strategy_type, allowed_values) + ) + + self._strategy_type = strategy_type + + @property + def market(self): + """Gets the market of this SpotMartingaleCreateRequest. # noqa: E501 + + + :return: The market of this SpotMartingaleCreateRequest. # noqa: E501 + :rtype: str + """ + return self._market + + @market.setter + def market(self, market): + """Sets the market of this SpotMartingaleCreateRequest. + + + :param market: The market of this SpotMartingaleCreateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and market is None: # noqa: E501 + raise ValueError("Invalid value for `market`, must not be `None`") # noqa: E501 + + self._market = market + + @property + def create_params(self): + """Gets the create_params of this SpotMartingaleCreateRequest. # noqa: E501 + + + :return: The create_params of this SpotMartingaleCreateRequest. # noqa: E501 + :rtype: SpotMartingaleCreateParams + """ + return self._create_params + + @create_params.setter + def create_params(self, create_params): + """Sets the create_params of this SpotMartingaleCreateRequest. + + + :param create_params: The create_params of this SpotMartingaleCreateRequest. # noqa: E501 + :type: SpotMartingaleCreateParams + """ + if self.local_vars_configuration.client_side_validation and create_params is None: # noqa: E501 + raise ValueError("Invalid value for `create_params`, must not be `None`") # noqa: E501 + + self._create_params = create_params + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpotMartingaleCreateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotMartingaleCreateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_order_stop_loss.py b/gate_api/models/spot_order_stop_loss.py new file mode 100644 index 00000000..635b63a8 --- /dev/null +++ b/gate_api/models/spot_order_stop_loss.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SpotOrderStopLoss(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'trigger_price': 'str', + 'order_price': 'str' + } + + attribute_map = { + 'trigger_price': 'trigger_price', + 'order_price': 'order_price' + } + + def __init__(self, trigger_price=None, order_price=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """SpotOrderStopLoss - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._trigger_price = None + self._order_price = None + self.discriminator = None + + if trigger_price is not None: + self.trigger_price = trigger_price + if order_price is not None: + self.order_price = order_price + + @property + def trigger_price(self): + """Gets the trigger_price of this SpotOrderStopLoss. # noqa: E501 + + Stop loss trigger price When `side == \"buy\"`, `trigger_price` must be less than `price` When `side == \"sell\"`, `trigger_price` must be greater than `price` # noqa: E501 + + :return: The trigger_price of this SpotOrderStopLoss. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this SpotOrderStopLoss. + + Stop loss trigger price When `side == \"buy\"`, `trigger_price` must be less than `price` When `side == \"sell\"`, `trigger_price` must be greater than `price` # noqa: E501 + + :param trigger_price: The trigger_price of this SpotOrderStopLoss. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def order_price(self): + """Gets the order_price of this SpotOrderStopLoss. # noqa: E501 + + Stop-loss order price # noqa: E501 + + :return: The order_price of this SpotOrderStopLoss. # noqa: E501 + :rtype: str + """ + return self._order_price + + @order_price.setter + def order_price(self, order_price): + """Sets the order_price of this SpotOrderStopLoss. + + Stop-loss order price # noqa: E501 + + :param order_price: The order_price of this SpotOrderStopLoss. # noqa: E501 + :type: str + """ + + self._order_price = order_price + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpotOrderStopLoss): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotOrderStopLoss): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_order_stop_profit.py b/gate_api/models/spot_order_stop_profit.py new file mode 100644 index 00000000..cd45d3a6 --- /dev/null +++ b/gate_api/models/spot_order_stop_profit.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SpotOrderStopProfit(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'trigger_price': 'str', + 'order_price': 'str' + } + + attribute_map = { + 'trigger_price': 'trigger_price', + 'order_price': 'order_price' + } + + def __init__(self, trigger_price=None, order_price=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """SpotOrderStopProfit - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._trigger_price = None + self._order_price = None + self.discriminator = None + + if trigger_price is not None: + self.trigger_price = trigger_price + if order_price is not None: + self.order_price = order_price + + @property + def trigger_price(self): + """Gets the trigger_price of this SpotOrderStopProfit. # noqa: E501 + + Take profit trigger price When `side == \"buy\"`, `trigger_price` must be greater than `price` When `side == \"sell\"`, `trigger_price` must be less than `price` # noqa: E501 + + :return: The trigger_price of this SpotOrderStopProfit. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this SpotOrderStopProfit. + + Take profit trigger price When `side == \"buy\"`, `trigger_price` must be greater than `price` When `side == \"sell\"`, `trigger_price` must be less than `price` # noqa: E501 + + :param trigger_price: The trigger_price of this SpotOrderStopProfit. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def order_price(self): + """Gets the order_price of this SpotOrderStopProfit. # noqa: E501 + + Take profit order price # noqa: E501 + + :return: The order_price of this SpotOrderStopProfit. # noqa: E501 + :rtype: str + """ + return self._order_price + + @order_price.setter + def order_price(self, order_price): + """Sets the order_price of this SpotOrderStopProfit. + + Take profit order price # noqa: E501 + + :param order_price: The order_price of this SpotOrderStopProfit. # noqa: E501 + :type: str + """ + + self._order_price = order_price + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpotOrderStopProfit): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotOrderStopProfit): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_pov_order.py b/gate_api/models/spot_pov_order.py new file mode 100644 index 00000000..a2ee8541 --- /dev/null +++ b/gate_api/models/spot_pov_order.py @@ -0,0 +1,551 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SpotPovOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'currency_pair': 'str', + 'side': 'str', + 'amount': 'str', + 'participation_rate': 'int', + 'ttl': 'str', + 'limit_price': 'str', + 'trigger_price': 'str', + 'status': 'str', + 'terminated_as': 'str', + 'start_time_ms': 'int', + 'end_time_ms': 'int', + 'expire_time_ms': 'int', + 'create_time_ms': 'int', + 'update_time_ms': 'int', + 'text': 'str' + } + + attribute_map = { + 'id': 'id', + 'currency_pair': 'currency_pair', + 'side': 'side', + 'amount': 'amount', + 'participation_rate': 'participation_rate', + 'ttl': 'ttl', + 'limit_price': 'limit_price', + 'trigger_price': 'trigger_price', + 'status': 'status', + 'terminated_as': 'terminated_as', + 'start_time_ms': 'start_time_ms', + 'end_time_ms': 'end_time_ms', + 'expire_time_ms': 'expire_time_ms', + 'create_time_ms': 'create_time_ms', + 'update_time_ms': 'update_time_ms', + 'text': 'text' + } + + def __init__(self, id=None, currency_pair=None, side=None, amount=None, participation_rate=None, ttl=None, limit_price=None, trigger_price=None, status=None, terminated_as=None, start_time_ms=None, end_time_ms=None, expire_time_ms=None, create_time_ms=None, update_time_ms=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, str, str, str, str, str, int, int, int, int, int, str, Configuration) -> None + """SpotPovOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._currency_pair = None + self._side = None + self._amount = None + self._participation_rate = None + self._ttl = None + self._limit_price = None + self._trigger_price = None + self._status = None + self._terminated_as = None + self._start_time_ms = None + self._end_time_ms = None + self._expire_time_ms = None + self._create_time_ms = None + self._update_time_ms = None + self._text = None + self.discriminator = None + + self.id = id + self.currency_pair = currency_pair + self.side = side + self.amount = amount + self.participation_rate = participation_rate + self.ttl = ttl + if limit_price is not None: + self.limit_price = limit_price + if trigger_price is not None: + self.trigger_price = trigger_price + self.status = status + if terminated_as is not None: + self.terminated_as = terminated_as + if start_time_ms is not None: + self.start_time_ms = start_time_ms + if end_time_ms is not None: + self.end_time_ms = end_time_ms + if expire_time_ms is not None: + self.expire_time_ms = expire_time_ms + self.create_time_ms = create_time_ms + if update_time_ms is not None: + self.update_time_ms = update_time_ms + if text is not None: + self.text = text + + @property + def id(self): + """Gets the id of this SpotPovOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this SpotPovOrder. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SpotPovOrder. + + Order ID # noqa: E501 + + :param id: The id of this SpotPovOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def currency_pair(self): + """Gets the currency_pair of this SpotPovOrder. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this SpotPovOrder. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this SpotPovOrder. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this SpotPovOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and currency_pair is None: # noqa: E501 + raise ValueError("Invalid value for `currency_pair`, must not be `None`") # noqa: E501 + + self._currency_pair = currency_pair + + @property + def side(self): + """Gets the side of this SpotPovOrder. # noqa: E501 + + Buy or sell order # noqa: E501 + + :return: The side of this SpotPovOrder. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this SpotPovOrder. + + Buy or sell order # noqa: E501 + + :param side: The side of this SpotPovOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def amount(self): + """Gets the amount of this SpotPovOrder. # noqa: E501 + + Trade amount # noqa: E501 + + :return: The amount of this SpotPovOrder. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this SpotPovOrder. + + Trade amount # noqa: E501 + + :param amount: The amount of this SpotPovOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def participation_rate(self): + """Gets the participation_rate of this SpotPovOrder. # noqa: E501 + + Target participation rate as a percentage. Allowed values: 5, 10, 20, and 40 # noqa: E501 + + :return: The participation_rate of this SpotPovOrder. # noqa: E501 + :rtype: int + """ + return self._participation_rate + + @participation_rate.setter + def participation_rate(self, participation_rate): + """Sets the participation_rate of this SpotPovOrder. + + Target participation rate as a percentage. Allowed values: 5, 10, 20, and 40 # noqa: E501 + + :param participation_rate: The participation_rate of this SpotPovOrder. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and participation_rate is None: # noqa: E501 + raise ValueError("Invalid value for `participation_rate`, must not be `None`") # noqa: E501 + + self._participation_rate = participation_rate + + @property + def ttl(self): + """Gets the ttl of this SpotPovOrder. # noqa: E501 + + Time to live. Valid values: 1h, 6h, 12h, 1d, 2d, 3d, 4d, 5d, 6d, and 7d # noqa: E501 + + :return: The ttl of this SpotPovOrder. # noqa: E501 + :rtype: str + """ + return self._ttl + + @ttl.setter + def ttl(self, ttl): + """Sets the ttl of this SpotPovOrder. + + Time to live. Valid values: 1h, 6h, 12h, 1d, 2d, 3d, 4d, 5d, 6d, and 7d # noqa: E501 + + :param ttl: The ttl of this SpotPovOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and ttl is None: # noqa: E501 + raise ValueError("Invalid value for `ttl`, must not be `None`") # noqa: E501 + + self._ttl = ttl + + @property + def limit_price(self): + """Gets the limit_price of this SpotPovOrder. # noqa: E501 + + Limit price. If omitted, the market price is used # noqa: E501 + + :return: The limit_price of this SpotPovOrder. # noqa: E501 + :rtype: str + """ + return self._limit_price + + @limit_price.setter + def limit_price(self, limit_price): + """Sets the limit_price of this SpotPovOrder. + + Limit price. If omitted, the market price is used # noqa: E501 + + :param limit_price: The limit_price of this SpotPovOrder. # noqa: E501 + :type: str + """ + + self._limit_price = limit_price + + @property + def trigger_price(self): + """Gets the trigger_price of this SpotPovOrder. # noqa: E501 + + Trigger price. If omitted, the order is triggered immediately # noqa: E501 + + :return: The trigger_price of this SpotPovOrder. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this SpotPovOrder. + + Trigger price. If omitted, the order is triggered immediately # noqa: E501 + + :param trigger_price: The trigger_price of this SpotPovOrder. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def status(self): + """Gets the status of this SpotPovOrder. # noqa: E501 + + Order status - CREATED: Created - CANCELING: Canceling - RUNNING: Running - COMPLETED: Completed - EXPIRED: Expired - TERMINATED: Terminated # noqa: E501 + + :return: The status of this SpotPovOrder. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this SpotPovOrder. + + Order status - CREATED: Created - CANCELING: Canceling - RUNNING: Running - COMPLETED: Completed - EXPIRED: Expired - TERMINATED: Terminated # noqa: E501 + + :param status: The status of this SpotPovOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def terminated_as(self): + """Gets the terminated_as of this SpotPovOrder. # noqa: E501 + + Order termination reason code # noqa: E501 + + :return: The terminated_as of this SpotPovOrder. # noqa: E501 + :rtype: str + """ + return self._terminated_as + + @terminated_as.setter + def terminated_as(self, terminated_as): + """Sets the terminated_as of this SpotPovOrder. + + Order termination reason code # noqa: E501 + + :param terminated_as: The terminated_as of this SpotPovOrder. # noqa: E501 + :type: str + """ + + self._terminated_as = terminated_as + + @property + def start_time_ms(self): + """Gets the start_time_ms of this SpotPovOrder. # noqa: E501 + + Order execution start time in milliseconds # noqa: E501 + + :return: The start_time_ms of this SpotPovOrder. # noqa: E501 + :rtype: int + """ + return self._start_time_ms + + @start_time_ms.setter + def start_time_ms(self, start_time_ms): + """Sets the start_time_ms of this SpotPovOrder. + + Order execution start time in milliseconds # noqa: E501 + + :param start_time_ms: The start_time_ms of this SpotPovOrder. # noqa: E501 + :type: int + """ + + self._start_time_ms = start_time_ms + + @property + def end_time_ms(self): + """Gets the end_time_ms of this SpotPovOrder. # noqa: E501 + + Order execution end time in milliseconds # noqa: E501 + + :return: The end_time_ms of this SpotPovOrder. # noqa: E501 + :rtype: int + """ + return self._end_time_ms + + @end_time_ms.setter + def end_time_ms(self, end_time_ms): + """Sets the end_time_ms of this SpotPovOrder. + + Order execution end time in milliseconds # noqa: E501 + + :param end_time_ms: The end_time_ms of this SpotPovOrder. # noqa: E501 + :type: int + """ + + self._end_time_ms = end_time_ms + + @property + def expire_time_ms(self): + """Gets the expire_time_ms of this SpotPovOrder. # noqa: E501 + + Order expiration time in milliseconds # noqa: E501 + + :return: The expire_time_ms of this SpotPovOrder. # noqa: E501 + :rtype: int + """ + return self._expire_time_ms + + @expire_time_ms.setter + def expire_time_ms(self, expire_time_ms): + """Sets the expire_time_ms of this SpotPovOrder. + + Order expiration time in milliseconds # noqa: E501 + + :param expire_time_ms: The expire_time_ms of this SpotPovOrder. # noqa: E501 + :type: int + """ + + self._expire_time_ms = expire_time_ms + + @property + def create_time_ms(self): + """Gets the create_time_ms of this SpotPovOrder. # noqa: E501 + + Creation time of order (in milliseconds) # noqa: E501 + + :return: The create_time_ms of this SpotPovOrder. # noqa: E501 + :rtype: int + """ + return self._create_time_ms + + @create_time_ms.setter + def create_time_ms(self, create_time_ms): + """Sets the create_time_ms of this SpotPovOrder. + + Creation time of order (in milliseconds) # noqa: E501 + + :param create_time_ms: The create_time_ms of this SpotPovOrder. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and create_time_ms is None: # noqa: E501 + raise ValueError("Invalid value for `create_time_ms`, must not be `None`") # noqa: E501 + + self._create_time_ms = create_time_ms + + @property + def update_time_ms(self): + """Gets the update_time_ms of this SpotPovOrder. # noqa: E501 + + Last modification time of order (in milliseconds) # noqa: E501 + + :return: The update_time_ms of this SpotPovOrder. # noqa: E501 + :rtype: int + """ + return self._update_time_ms + + @update_time_ms.setter + def update_time_ms(self, update_time_ms): + """Sets the update_time_ms of this SpotPovOrder. + + Last modification time of order (in milliseconds) # noqa: E501 + + :param update_time_ms: The update_time_ms of this SpotPovOrder. # noqa: E501 + :type: int + """ + + self._update_time_ms = update_time_ms + + @property + def text(self): + """Gets the text of this SpotPovOrder. # noqa: E501 + + Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :return: The text of this SpotPovOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this SpotPovOrder. + + Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :param text: The text of this SpotPovOrder. # noqa: E501 + :type: str + """ + + self._text = text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpotPovOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotPovOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_pov_order_creator.py b/gate_api/models/spot_pov_order_creator.py new file mode 100644 index 00000000..f08ceddf --- /dev/null +++ b/gate_api/models/spot_pov_order_creator.py @@ -0,0 +1,330 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SpotPovOrderCreator(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency_pair': 'str', + 'side': 'str', + 'amount': 'str', + 'participation_rate': 'int', + 'ttl': 'str', + 'limit_price': 'str', + 'trigger_price': 'str', + 'text': 'str' + } + + attribute_map = { + 'currency_pair': 'currency_pair', + 'side': 'side', + 'amount': 'amount', + 'participation_rate': 'participation_rate', + 'ttl': 'ttl', + 'limit_price': 'limit_price', + 'trigger_price': 'trigger_price', + 'text': 'text' + } + + def __init__(self, currency_pair=None, side=None, amount=None, participation_rate=None, ttl=None, limit_price=None, trigger_price=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, int, str, str, str, str, Configuration) -> None + """SpotPovOrderCreator - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency_pair = None + self._side = None + self._amount = None + self._participation_rate = None + self._ttl = None + self._limit_price = None + self._trigger_price = None + self._text = None + self.discriminator = None + + self.currency_pair = currency_pair + self.side = side + self.amount = amount + self.participation_rate = participation_rate + self.ttl = ttl + if limit_price is not None: + self.limit_price = limit_price + if trigger_price is not None: + self.trigger_price = trigger_price + if text is not None: + self.text = text + + @property + def currency_pair(self): + """Gets the currency_pair of this SpotPovOrderCreator. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this SpotPovOrderCreator. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this SpotPovOrderCreator. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this SpotPovOrderCreator. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and currency_pair is None: # noqa: E501 + raise ValueError("Invalid value for `currency_pair`, must not be `None`") # noqa: E501 + + self._currency_pair = currency_pair + + @property + def side(self): + """Gets the side of this SpotPovOrderCreator. # noqa: E501 + + Buy or sell order # noqa: E501 + + :return: The side of this SpotPovOrderCreator. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this SpotPovOrderCreator. + + Buy or sell order # noqa: E501 + + :param side: The side of this SpotPovOrderCreator. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + allowed_values = ["buy", "sell"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) + ) + + self._side = side + + @property + def amount(self): + """Gets the amount of this SpotPovOrderCreator. # noqa: E501 + + Trade amount # noqa: E501 + + :return: The amount of this SpotPovOrderCreator. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this SpotPovOrderCreator. + + Trade amount # noqa: E501 + + :param amount: The amount of this SpotPovOrderCreator. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def participation_rate(self): + """Gets the participation_rate of this SpotPovOrderCreator. # noqa: E501 + + Target participation rate as a percentage. Valid values: 5, 10, 20, and 40 # noqa: E501 + + :return: The participation_rate of this SpotPovOrderCreator. # noqa: E501 + :rtype: int + """ + return self._participation_rate + + @participation_rate.setter + def participation_rate(self, participation_rate): + """Sets the participation_rate of this SpotPovOrderCreator. + + Target participation rate as a percentage. Valid values: 5, 10, 20, and 40 # noqa: E501 + + :param participation_rate: The participation_rate of this SpotPovOrderCreator. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and participation_rate is None: # noqa: E501 + raise ValueError("Invalid value for `participation_rate`, must not be `None`") # noqa: E501 + + self._participation_rate = participation_rate + + @property + def ttl(self): + """Gets the ttl of this SpotPovOrderCreator. # noqa: E501 + + Time to live. Valid values: 1h, 6h, 12h, 1d, 2d, 3d, 4d, 5d, 6d, and 7d # noqa: E501 + + :return: The ttl of this SpotPovOrderCreator. # noqa: E501 + :rtype: str + """ + return self._ttl + + @ttl.setter + def ttl(self, ttl): + """Sets the ttl of this SpotPovOrderCreator. + + Time to live. Valid values: 1h, 6h, 12h, 1d, 2d, 3d, 4d, 5d, 6d, and 7d # noqa: E501 + + :param ttl: The ttl of this SpotPovOrderCreator. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and ttl is None: # noqa: E501 + raise ValueError("Invalid value for `ttl`, must not be `None`") # noqa: E501 + + self._ttl = ttl + + @property + def limit_price(self): + """Gets the limit_price of this SpotPovOrderCreator. # noqa: E501 + + Limit price. If omitted, the market price is used # noqa: E501 + + :return: The limit_price of this SpotPovOrderCreator. # noqa: E501 + :rtype: str + """ + return self._limit_price + + @limit_price.setter + def limit_price(self, limit_price): + """Sets the limit_price of this SpotPovOrderCreator. + + Limit price. If omitted, the market price is used # noqa: E501 + + :param limit_price: The limit_price of this SpotPovOrderCreator. # noqa: E501 + :type: str + """ + + self._limit_price = limit_price + + @property + def trigger_price(self): + """Gets the trigger_price of this SpotPovOrderCreator. # noqa: E501 + + Trigger price. If omitted, the order is triggered immediately # noqa: E501 + + :return: The trigger_price of this SpotPovOrderCreator. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this SpotPovOrderCreator. + + Trigger price. If omitted, the order is triggered immediately # noqa: E501 + + :param trigger_price: The trigger_price of this SpotPovOrderCreator. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def text(self): + """Gets the text of this SpotPovOrderCreator. # noqa: E501 + + Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :return: The text of this SpotPovOrderCreator. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this SpotPovOrderCreator. + + Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :param text: The text of this SpotPovOrderCreator. # noqa: E501 + :type: str + """ + + self._text = text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpotPovOrderCreator): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SpotPovOrderCreator): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_price_put_order.py b/gate_api/models/spot_price_put_order.py index 499044d0..0231e9b1 100644 --- a/gate_api/models/spot_price_put_order.py +++ b/gate_api/models/spot_price_put_order.py @@ -80,8 +80,7 @@ def __init__(self, type='limit', side=None, price=None, amount=None, account='no self.price = price self.amount = amount self.account = account - if time_in_force is not None: - self.time_in_force = time_in_force + self.time_in_force = time_in_force if auto_borrow is not None: self.auto_borrow = auto_borrow if auto_repay is not None: @@ -250,6 +249,8 @@ def time_in_force(self, time_in_force): :param time_in_force: The time_in_force of this SpotPricePutOrder. # noqa: E501 :type: str """ + if self.local_vars_configuration.client_side_validation and time_in_force is None: # noqa: E501 + raise ValueError("Invalid value for `time_in_force`, must not be `None`") # noqa: E501 allowed_values = ["gtc", "ioc"] # noqa: E501 if self.local_vars_configuration.client_side_validation and time_in_force not in allowed_values: # noqa: E501 raise ValueError( diff --git a/gate_api/models/spot_price_trigger.py b/gate_api/models/spot_price_trigger.py index 5e49da64..97ba1c1d 100644 --- a/gate_api/models/spot_price_trigger.py +++ b/gate_api/models/spot_price_trigger.py @@ -58,7 +58,8 @@ def __init__(self, price=None, rule=None, expiration=None, local_vars_configurat self.price = price self.rule = rule - self.expiration = expiration + if expiration is not None: + self.expiration = expiration @property def price(self): @@ -136,8 +137,6 @@ def expiration(self, expiration): :param expiration: The expiration of this SpotPriceTrigger. # noqa: E501 :type: int """ - if self.local_vars_configuration.client_side_validation and expiration is None: # noqa: E501 - raise ValueError("Invalid value for `expiration`, must not be `None`") # noqa: E501 self._expiration = expiration diff --git a/gate_api/models/stop_all_chase_orders_req.py b/gate_api/models/stop_all_chase_orders_req.py new file mode 100644 index 00000000..3ba885bc --- /dev/null +++ b/gate_api/models/stop_all_chase_orders_req.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StopAllChaseOrdersReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'contract': 'str', + 'settle': 'str', + 'pos_margin_mode': 'str' + } + + attribute_map = { + 'contract': 'contract', + 'settle': 'settle', + 'pos_margin_mode': 'pos_margin_mode' + } + + def __init__(self, contract=None, settle=None, pos_margin_mode=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """StopAllChaseOrdersReq - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._contract = None + self._settle = None + self._pos_margin_mode = None + self.discriminator = None + + if contract is not None: + self.contract = contract + if settle is not None: + self.settle = settle + if pos_margin_mode is not None: + self.pos_margin_mode = pos_margin_mode + + @property + def contract(self): + """Gets the contract of this StopAllChaseOrdersReq. # noqa: E501 + + Optional contract name # noqa: E501 + + :return: The contract of this StopAllChaseOrdersReq. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this StopAllChaseOrdersReq. + + Optional contract name # noqa: E501 + + :param contract: The contract of this StopAllChaseOrdersReq. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def settle(self): + """Gets the settle of this StopAllChaseOrdersReq. # noqa: E501 + + Overridden by the path parameter # noqa: E501 + + :return: The settle of this StopAllChaseOrdersReq. # noqa: E501 + :rtype: str + """ + return self._settle + + @settle.setter + def settle(self, settle): + """Sets the settle of this StopAllChaseOrdersReq. + + Overridden by the path parameter # noqa: E501 + + :param settle: The settle of this StopAllChaseOrdersReq. # noqa: E501 + :type: str + """ + + self._settle = settle + + @property + def pos_margin_mode(self): + """Gets the pos_margin_mode of this StopAllChaseOrdersReq. # noqa: E501 + + Optional margin mode # noqa: E501 + + :return: The pos_margin_mode of this StopAllChaseOrdersReq. # noqa: E501 + :rtype: str + """ + return self._pos_margin_mode + + @pos_margin_mode.setter + def pos_margin_mode(self, pos_margin_mode): + """Sets the pos_margin_mode of this StopAllChaseOrdersReq. + + Optional margin mode # noqa: E501 + + :param pos_margin_mode: The pos_margin_mode of this StopAllChaseOrdersReq. # noqa: E501 + :type: str + """ + + self._pos_margin_mode = pos_margin_mode + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StopAllChaseOrdersReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StopAllChaseOrdersReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/stop_all_chase_orders_resp.py b/gate_api/models/stop_all_chase_orders_resp.py new file mode 100644 index 00000000..aed39f2a --- /dev/null +++ b/gate_api/models/stop_all_chase_orders_resp.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StopAllChaseOrdersResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'orders': 'list[ChaseOrder]' + } + + attribute_map = { + 'orders': 'orders' + } + + def __init__(self, orders=None, local_vars_configuration=None): # noqa: E501 + # type: (list[ChaseOrder], Configuration) -> None + """StopAllChaseOrdersResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._orders = None + self.discriminator = None + + if orders is not None: + self.orders = orders + + @property + def orders(self): + """Gets the orders of this StopAllChaseOrdersResp. # noqa: E501 + + + :return: The orders of this StopAllChaseOrdersResp. # noqa: E501 + :rtype: list[ChaseOrder] + """ + return self._orders + + @orders.setter + def orders(self, orders): + """Sets the orders of this StopAllChaseOrdersResp. + + + :param orders: The orders of this StopAllChaseOrdersResp. # noqa: E501 + :type: list[ChaseOrder] + """ + + self._orders = orders + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StopAllChaseOrdersResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StopAllChaseOrdersResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/stop_all_trail_orders.py b/gate_api/models/stop_all_trail_orders.py new file mode 100644 index 00000000..fad2ebee --- /dev/null +++ b/gate_api/models/stop_all_trail_orders.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StopAllTrailOrders(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'contract': 'str', + 'related_position': 'int' + } + + attribute_map = { + 'contract': 'contract', + 'related_position': 'related_position' + } + + def __init__(self, contract=None, related_position=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, Configuration) -> None + """StopAllTrailOrders - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._contract = None + self._related_position = None + self.discriminator = None + + if contract is not None: + self.contract = contract + if related_position is not None: + self.related_position = related_position + + @property + def contract(self): + """Gets the contract of this StopAllTrailOrders. # noqa: E501 + + Contract name # noqa: E501 + + :return: The contract of this StopAllTrailOrders. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this StopAllTrailOrders. + + Contract name # noqa: E501 + + :param contract: The contract of this StopAllTrailOrders. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def related_position(self): + """Gets the related_position of this StopAllTrailOrders. # noqa: E501 + + Associated position, if provided, only cancel orders associated with this position, 1-long, 2-short # noqa: E501 + + :return: The related_position of this StopAllTrailOrders. # noqa: E501 + :rtype: int + """ + return self._related_position + + @related_position.setter + def related_position(self, related_position): + """Sets the related_position of this StopAllTrailOrders. + + Associated position, if provided, only cancel orders associated with this position, 1-long, 2-short # noqa: E501 + + :param related_position: The related_position of this StopAllTrailOrders. # noqa: E501 + :type: int + """ + allowed_values = [1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and related_position not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `related_position` ({0}), must be one of {1}" # noqa: E501 + .format(related_position, allowed_values) + ) + + self._related_position = related_position + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StopAllTrailOrders): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StopAllTrailOrders): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/stop_chase_order_req.py b/gate_api/models/stop_chase_order_req.py new file mode 100644 index 00000000..af9f4a32 --- /dev/null +++ b/gate_api/models/stop_chase_order_req.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StopChaseOrderReq(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'text': 'str', + 'settle': 'str' + } + + attribute_map = { + 'id': 'id', + 'text': 'text', + 'settle': 'settle' + } + + def __init__(self, id=None, text=None, settle=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """StopChaseOrderReq - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._text = None + self._settle = None + self.discriminator = None + + if id is not None: + self.id = id + if text is not None: + self.text = text + if settle is not None: + self.settle = settle + + @property + def id(self): + """Gets the id of this StopChaseOrderReq. # noqa: E501 + + Order ID. Either id or text must be provided # noqa: E501 + + :return: The id of this StopChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this StopChaseOrderReq. + + Order ID. Either id or text must be provided # noqa: E501 + + :param id: The id of this StopChaseOrderReq. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def text(self): + """Gets the text of this StopChaseOrderReq. # noqa: E501 + + Custom text. Required only when id is 0 or omitted # noqa: E501 + + :return: The text of this StopChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this StopChaseOrderReq. + + Custom text. Required only when id is 0 or omitted # noqa: E501 + + :param text: The text of this StopChaseOrderReq. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def settle(self): + """Gets the settle of this StopChaseOrderReq. # noqa: E501 + + Overridden by the path parameter # noqa: E501 + + :return: The settle of this StopChaseOrderReq. # noqa: E501 + :rtype: str + """ + return self._settle + + @settle.setter + def settle(self, settle): + """Sets the settle of this StopChaseOrderReq. + + Overridden by the path parameter # noqa: E501 + + :param settle: The settle of this StopChaseOrderReq. # noqa: E501 + :type: str + """ + + self._settle = settle + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StopChaseOrderReq): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StopChaseOrderReq): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/stop_chase_order_resp.py b/gate_api/models/stop_chase_order_resp.py new file mode 100644 index 00000000..50faa4e1 --- /dev/null +++ b/gate_api/models/stop_chase_order_resp.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StopChaseOrderResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order': 'ChaseOrder' + } + + attribute_map = { + 'order': 'order' + } + + def __init__(self, order=None, local_vars_configuration=None): # noqa: E501 + # type: (ChaseOrder, Configuration) -> None + """StopChaseOrderResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order = None + self.discriminator = None + + if order is not None: + self.order = order + + @property + def order(self): + """Gets the order of this StopChaseOrderResp. # noqa: E501 + + + :return: The order of this StopChaseOrderResp. # noqa: E501 + :rtype: ChaseOrder + """ + return self._order + + @order.setter + def order(self, order): + """Sets the order of this StopChaseOrderResp. + + + :param order: The order of this StopChaseOrderResp. # noqa: E501 + :type: ChaseOrder + """ + + self._order = order + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StopChaseOrderResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StopChaseOrderResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/stop_trail_order.py b/gate_api/models/stop_trail_order.py new file mode 100644 index 00000000..67395507 --- /dev/null +++ b/gate_api/models/stop_trail_order.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StopTrailOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'text': 'str' + } + + attribute_map = { + 'id': 'id', + 'text': 'text' + } + + def __init__(self, id=None, text=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """StopTrailOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._text = None + self.discriminator = None + + if id is not None: + self.id = id + if text is not None: + self.text = text + + @property + def id(self): + """Gets the id of this StopTrailOrder. # noqa: E501 + + Order ID, if ID is specified, text is not needed # noqa: E501 + + :return: The id of this StopTrailOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this StopTrailOrder. + + Order ID, if ID is specified, text is not needed # noqa: E501 + + :param id: The id of this StopTrailOrder. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def text(self): + """Gets the text of this StopTrailOrder. # noqa: E501 + + Custom text, if ID is not specified, terminate based on user_id and text # noqa: E501 + + :return: The text of this StopTrailOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this StopTrailOrder. + + Custom text, if ID is not specified, terminate based on user_id and text # noqa: E501 + + :param text: The text of this StopTrailOrder. # noqa: E501 + :type: str + """ + + self._text = text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StopTrailOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StopTrailOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/strategy_type.py b/gate_api/models/strategy_type.py new file mode 100644 index 00000000..b46f1e70 --- /dev/null +++ b/gate_api/models/strategy_type.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StrategyType(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + SPOT_GRID = "spot_grid" + MARGIN_GRID = "margin_grid" + INFINITE_GRID = "infinite_grid" + FUTURES_GRID = "futures_grid" + SPOT_MARTINGALE = "spot_martingale" + CONTRACT_MARTINGALE = "contract_martingale" + + allowable_values = [SPOT_GRID, MARGIN_GRID, INFINITE_GRID, FUTURES_GRID, SPOT_MARTINGALE, CONTRACT_MARTINGALE] # noqa: E501 + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + } + + attribute_map = { + } + + def __init__(self, local_vars_configuration=None): # noqa: E501 + # type: (Configuration) -> None + """StrategyType - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StrategyType): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StrategyType): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/structured_get_project_list.py b/gate_api/models/structured_get_project_list.py deleted file mode 100644 index a60c6f80..00000000 --- a/gate_api/models/structured_get_project_list.py +++ /dev/null @@ -1,431 +0,0 @@ -# coding: utf-8 - -""" - Gate API - - Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - - Contact: support@mail.gate.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class StructuredGetProjectList(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'type': 'str', - 'name_en': 'str', - 'investment_coin': 'str', - 'investment_period': 'str', - 'min_annual_rate': 'str', - 'mid_annual_rate': 'str', - 'max_annual_rate': 'str', - 'watch_market': 'str', - 'start_time': 'int', - 'end_time': 'int', - 'status': 'str' - } - - attribute_map = { - 'id': 'id', - 'type': 'type', - 'name_en': 'name_en', - 'investment_coin': 'investment_coin', - 'investment_period': 'investment_period', - 'min_annual_rate': 'min_annual_rate', - 'mid_annual_rate': 'mid_annual_rate', - 'max_annual_rate': 'max_annual_rate', - 'watch_market': 'watch_market', - 'start_time': 'start_time', - 'end_time': 'end_time', - 'status': 'status' - } - - def __init__(self, id=None, type=None, name_en=None, investment_coin=None, investment_period=None, min_annual_rate=None, mid_annual_rate=None, max_annual_rate=None, watch_market=None, start_time=None, end_time=None, status=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, str, str, str, str, str, str, str, int, int, str, Configuration) -> None - """StructuredGetProjectList - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._type = None - self._name_en = None - self._investment_coin = None - self._investment_period = None - self._min_annual_rate = None - self._mid_annual_rate = None - self._max_annual_rate = None - self._watch_market = None - self._start_time = None - self._end_time = None - self._status = None - self.discriminator = None - - if id is not None: - self.id = id - if type is not None: - self.type = type - if name_en is not None: - self.name_en = name_en - if investment_coin is not None: - self.investment_coin = investment_coin - if investment_period is not None: - self.investment_period = investment_period - if min_annual_rate is not None: - self.min_annual_rate = min_annual_rate - if mid_annual_rate is not None: - self.mid_annual_rate = mid_annual_rate - if max_annual_rate is not None: - self.max_annual_rate = max_annual_rate - if watch_market is not None: - self.watch_market = watch_market - if start_time is not None: - self.start_time = start_time - if end_time is not None: - self.end_time = end_time - if status is not None: - self.status = status - - @property - def id(self): - """Gets the id of this StructuredGetProjectList. # noqa: E501 - - Product ID # noqa: E501 - - :return: The id of this StructuredGetProjectList. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this StructuredGetProjectList. - - Product ID # noqa: E501 - - :param id: The id of this StructuredGetProjectList. # noqa: E501 - :type: int - """ - - self._id = id - - @property - def type(self): - """Gets the type of this StructuredGetProjectList. # noqa: E501 - - Product Type: `SharkFin2.0`-Shark Fin 2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-Range Accrual `SnowBall`-Snow Ball # noqa: E501 - - :return: The type of this StructuredGetProjectList. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this StructuredGetProjectList. - - Product Type: `SharkFin2.0`-Shark Fin 2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-Range Accrual `SnowBall`-Snow Ball # noqa: E501 - - :param type: The type of this StructuredGetProjectList. # noqa: E501 - :type: str - """ - - self._type = type - - @property - def name_en(self): - """Gets the name_en of this StructuredGetProjectList. # noqa: E501 - - Product Name # noqa: E501 - - :return: The name_en of this StructuredGetProjectList. # noqa: E501 - :rtype: str - """ - return self._name_en - - @name_en.setter - def name_en(self, name_en): - """Sets the name_en of this StructuredGetProjectList. - - Product Name # noqa: E501 - - :param name_en: The name_en of this StructuredGetProjectList. # noqa: E501 - :type: str - """ - - self._name_en = name_en - - @property - def investment_coin(self): - """Gets the investment_coin of this StructuredGetProjectList. # noqa: E501 - - Investment Token # noqa: E501 - - :return: The investment_coin of this StructuredGetProjectList. # noqa: E501 - :rtype: str - """ - return self._investment_coin - - @investment_coin.setter - def investment_coin(self, investment_coin): - """Sets the investment_coin of this StructuredGetProjectList. - - Investment Token # noqa: E501 - - :param investment_coin: The investment_coin of this StructuredGetProjectList. # noqa: E501 - :type: str - """ - - self._investment_coin = investment_coin - - @property - def investment_period(self): - """Gets the investment_period of this StructuredGetProjectList. # noqa: E501 - - Investment Period # noqa: E501 - - :return: The investment_period of this StructuredGetProjectList. # noqa: E501 - :rtype: str - """ - return self._investment_period - - @investment_period.setter - def investment_period(self, investment_period): - """Sets the investment_period of this StructuredGetProjectList. - - Investment Period # noqa: E501 - - :param investment_period: The investment_period of this StructuredGetProjectList. # noqa: E501 - :type: str - """ - - self._investment_period = investment_period - - @property - def min_annual_rate(self): - """Gets the min_annual_rate of this StructuredGetProjectList. # noqa: E501 - - Minimum Annual Rate # noqa: E501 - - :return: The min_annual_rate of this StructuredGetProjectList. # noqa: E501 - :rtype: str - """ - return self._min_annual_rate - - @min_annual_rate.setter - def min_annual_rate(self, min_annual_rate): - """Sets the min_annual_rate of this StructuredGetProjectList. - - Minimum Annual Rate # noqa: E501 - - :param min_annual_rate: The min_annual_rate of this StructuredGetProjectList. # noqa: E501 - :type: str - """ - - self._min_annual_rate = min_annual_rate - - @property - def mid_annual_rate(self): - """Gets the mid_annual_rate of this StructuredGetProjectList. # noqa: E501 - - Intermediate Annual Rate # noqa: E501 - - :return: The mid_annual_rate of this StructuredGetProjectList. # noqa: E501 - :rtype: str - """ - return self._mid_annual_rate - - @mid_annual_rate.setter - def mid_annual_rate(self, mid_annual_rate): - """Sets the mid_annual_rate of this StructuredGetProjectList. - - Intermediate Annual Rate # noqa: E501 - - :param mid_annual_rate: The mid_annual_rate of this StructuredGetProjectList. # noqa: E501 - :type: str - """ - - self._mid_annual_rate = mid_annual_rate - - @property - def max_annual_rate(self): - """Gets the max_annual_rate of this StructuredGetProjectList. # noqa: E501 - - Maximum Annual Rate # noqa: E501 - - :return: The max_annual_rate of this StructuredGetProjectList. # noqa: E501 - :rtype: str - """ - return self._max_annual_rate - - @max_annual_rate.setter - def max_annual_rate(self, max_annual_rate): - """Sets the max_annual_rate of this StructuredGetProjectList. - - Maximum Annual Rate # noqa: E501 - - :param max_annual_rate: The max_annual_rate of this StructuredGetProjectList. # noqa: E501 - :type: str - """ - - self._max_annual_rate = max_annual_rate - - @property - def watch_market(self): - """Gets the watch_market of this StructuredGetProjectList. # noqa: E501 - - Underlying Market # noqa: E501 - - :return: The watch_market of this StructuredGetProjectList. # noqa: E501 - :rtype: str - """ - return self._watch_market - - @watch_market.setter - def watch_market(self, watch_market): - """Sets the watch_market of this StructuredGetProjectList. - - Underlying Market # noqa: E501 - - :param watch_market: The watch_market of this StructuredGetProjectList. # noqa: E501 - :type: str - """ - - self._watch_market = watch_market - - @property - def start_time(self): - """Gets the start_time of this StructuredGetProjectList. # noqa: E501 - - Start Time # noqa: E501 - - :return: The start_time of this StructuredGetProjectList. # noqa: E501 - :rtype: int - """ - return self._start_time - - @start_time.setter - def start_time(self, start_time): - """Sets the start_time of this StructuredGetProjectList. - - Start Time # noqa: E501 - - :param start_time: The start_time of this StructuredGetProjectList. # noqa: E501 - :type: int - """ - - self._start_time = start_time - - @property - def end_time(self): - """Gets the end_time of this StructuredGetProjectList. # noqa: E501 - - End time # noqa: E501 - - :return: The end_time of this StructuredGetProjectList. # noqa: E501 - :rtype: int - """ - return self._end_time - - @end_time.setter - def end_time(self, end_time): - """Sets the end_time of this StructuredGetProjectList. - - End time # noqa: E501 - - :param end_time: The end_time of this StructuredGetProjectList. # noqa: E501 - :type: int - """ - - self._end_time = end_time - - @property - def status(self): - """Gets the status of this StructuredGetProjectList. # noqa: E501 - - Status: `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done # noqa: E501 - - :return: The status of this StructuredGetProjectList. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this StructuredGetProjectList. - - Status: `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done # noqa: E501 - - :param status: The status of this StructuredGetProjectList. # noqa: E501 - :type: str - """ - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StructuredGetProjectList): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, StructuredGetProjectList): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/structured_order_list.py b/gate_api/models/structured_order_list.py deleted file mode 100644 index 4f752229..00000000 --- a/gate_api/models/structured_order_list.py +++ /dev/null @@ -1,291 +0,0 @@ -# coding: utf-8 - -""" - Gate API - - Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - - Contact: support@mail.gate.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class StructuredOrderList(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'id': 'int', - 'pid': 'str', - 'lock_coin': 'str', - 'amount': 'str', - 'status': 'str', - 'income': 'str', - 'create_time': 'int' - } - - attribute_map = { - 'id': 'id', - 'pid': 'pid', - 'lock_coin': 'lock_coin', - 'amount': 'amount', - 'status': 'status', - 'income': 'income', - 'create_time': 'create_time' - } - - def __init__(self, id=None, pid=None, lock_coin=None, amount=None, status=None, income=None, create_time=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, str, str, str, str, int, Configuration) -> None - """StructuredOrderList - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._pid = None - self._lock_coin = None - self._amount = None - self._status = None - self._income = None - self._create_time = None - self.discriminator = None - - if id is not None: - self.id = id - if pid is not None: - self.pid = pid - if lock_coin is not None: - self.lock_coin = lock_coin - if amount is not None: - self.amount = amount - if status is not None: - self.status = status - if income is not None: - self.income = income - if create_time is not None: - self.create_time = create_time - - @property - def id(self): - """Gets the id of this StructuredOrderList. # noqa: E501 - - Order ID # noqa: E501 - - :return: The id of this StructuredOrderList. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this StructuredOrderList. - - Order ID # noqa: E501 - - :param id: The id of this StructuredOrderList. # noqa: E501 - :type: int - """ - - self._id = id - - @property - def pid(self): - """Gets the pid of this StructuredOrderList. # noqa: E501 - - Product ID # noqa: E501 - - :return: The pid of this StructuredOrderList. # noqa: E501 - :rtype: str - """ - return self._pid - - @pid.setter - def pid(self, pid): - """Sets the pid of this StructuredOrderList. - - Product ID # noqa: E501 - - :param pid: The pid of this StructuredOrderList. # noqa: E501 - :type: str - """ - - self._pid = pid - - @property - def lock_coin(self): - """Gets the lock_coin of this StructuredOrderList. # noqa: E501 - - Locked coin # noqa: E501 - - :return: The lock_coin of this StructuredOrderList. # noqa: E501 - :rtype: str - """ - return self._lock_coin - - @lock_coin.setter - def lock_coin(self, lock_coin): - """Sets the lock_coin of this StructuredOrderList. - - Locked coin # noqa: E501 - - :param lock_coin: The lock_coin of this StructuredOrderList. # noqa: E501 - :type: str - """ - - self._lock_coin = lock_coin - - @property - def amount(self): - """Gets the amount of this StructuredOrderList. # noqa: E501 - - Locked amount # noqa: E501 - - :return: The amount of this StructuredOrderList. # noqa: E501 - :rtype: str - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this StructuredOrderList. - - Locked amount # noqa: E501 - - :param amount: The amount of this StructuredOrderList. # noqa: E501 - :type: str - """ - - self._amount = amount - - @property - def status(self): - """Gets the status of this StructuredOrderList. # noqa: E501 - - Status: SUCCESS - SUCCESS FAILED - FAILED DONE - DONE # noqa: E501 - - :return: The status of this StructuredOrderList. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this StructuredOrderList. - - Status: SUCCESS - SUCCESS FAILED - FAILED DONE - DONE # noqa: E501 - - :param status: The status of this StructuredOrderList. # noqa: E501 - :type: str - """ - - self._status = status - - @property - def income(self): - """Gets the income of this StructuredOrderList. # noqa: E501 - - Income # noqa: E501 - - :return: The income of this StructuredOrderList. # noqa: E501 - :rtype: str - """ - return self._income - - @income.setter - def income(self, income): - """Sets the income of this StructuredOrderList. - - Income # noqa: E501 - - :param income: The income of this StructuredOrderList. # noqa: E501 - :type: str - """ - - self._income = income - - @property - def create_time(self): - """Gets the create_time of this StructuredOrderList. # noqa: E501 - - Created time # noqa: E501 - - :return: The create_time of this StructuredOrderList. # noqa: E501 - :rtype: int - """ - return self._create_time - - @create_time.setter - def create_time(self, create_time): - """Sets the create_time of this StructuredOrderList. - - Created time # noqa: E501 - - :param create_time: The create_time of this StructuredOrderList. # noqa: E501 - :type: int - """ - - self._create_time = create_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StructuredOrderList): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, StructuredOrderList): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/sub_account_balance.py b/gate_api/models/sub_account_balance.py index 7af2fb8c..94b92509 100644 --- a/gate_api/models/sub_account_balance.py +++ b/gate_api/models/sub_account_balance.py @@ -34,16 +34,18 @@ class SubAccountBalance(object): """ openapi_types = { 'uid': 'str', - 'available': 'dict(str, str)' + 'available': 'dict(str, str)', + 'locking': 'dict(str, str)' } attribute_map = { 'uid': 'uid', - 'available': 'available' + 'available': 'available', + 'locking': 'locking' } - def __init__(self, uid=None, available=None, local_vars_configuration=None): # noqa: E501 - # type: (str, dict(str, str), Configuration) -> None + def __init__(self, uid=None, available=None, locking=None, local_vars_configuration=None): # noqa: E501 + # type: (str, dict(str, str), dict(str, str), Configuration) -> None """SubAccountBalance - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -51,12 +53,15 @@ def __init__(self, uid=None, available=None, local_vars_configuration=None): # self._uid = None self._available = None + self._locking = None self.discriminator = None if uid is not None: self.uid = uid if available is not None: self.available = available + if locking is not None: + self.locking = locking @property def uid(self): @@ -104,6 +109,29 @@ def available(self, available): self._available = available + @property + def locking(self): + """Gets the locking of this SubAccountBalance. # noqa: E501 + + Locked amount by currency # noqa: E501 + + :return: The locking of this SubAccountBalance. # noqa: E501 + :rtype: dict(str, str) + """ + return self._locking + + @locking.setter + def locking(self, locking): + """Sets the locking of this SubAccountBalance. + + Locked amount by currency # noqa: E501 + + :param locking: The locking of this SubAccountBalance. # noqa: E501 + :type: dict(str, str) + """ + + self._locking = locking + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/sub_account_to_sub_account.py b/gate_api/models/sub_account_to_sub_account.py index c0825210..ca772713 100644 --- a/gate_api/models/sub_account_to_sub_account.py +++ b/gate_api/models/sub_account_to_sub_account.py @@ -229,7 +229,7 @@ def sub_account_to_type(self, sub_account_to_type): def amount(self): """Gets the amount of this SubAccountToSubAccount. # noqa: E501 - Transfer amount # noqa: E501 + Transfer Amount, supports up to 8 decimal places, must be greater than 0 # noqa: E501 :return: The amount of this SubAccountToSubAccount. # noqa: E501 :rtype: str @@ -240,7 +240,7 @@ def amount(self): def amount(self, amount): """Sets the amount of this SubAccountToSubAccount. - Transfer amount # noqa: E501 + Transfer Amount, supports up to 8 decimal places, must be greater than 0 # noqa: E501 :param amount: The amount of this SubAccountToSubAccount. # noqa: E501 :type: str diff --git a/gate_api/models/sub_account_transfer.py b/gate_api/models/sub_account_transfer.py index 9ab7c798..397dafc6 100644 --- a/gate_api/models/sub_account_transfer.py +++ b/gate_api/models/sub_account_transfer.py @@ -151,7 +151,7 @@ def currency(self, currency): def amount(self): """Gets the amount of this SubAccountTransfer. # noqa: E501 - Transfer amount # noqa: E501 + Transfer Amount, supports up to 8 decimal places, must be greater than 0 # noqa: E501 :return: The amount of this SubAccountTransfer. # noqa: E501 :rtype: str @@ -162,7 +162,7 @@ def amount(self): def amount(self, amount): """Sets the amount of this SubAccountTransfer. - Transfer amount # noqa: E501 + Transfer Amount, supports up to 8 decimal places, must be greater than 0 # noqa: E501 :param amount: The amount of this SubAccountTransfer. # noqa: E501 :type: str diff --git a/gate_api/models/sub_account_transfer_record_item.py b/gate_api/models/sub_account_transfer_record_item.py index 650a5952..4bec6595 100644 --- a/gate_api/models/sub_account_transfer_record_item.py +++ b/gate_api/models/sub_account_transfer_record_item.py @@ -217,7 +217,7 @@ def currency(self, currency): def amount(self): """Gets the amount of this SubAccountTransferRecordItem. # noqa: E501 - Transfer amount # noqa: E501 + Transfer Amount # noqa: E501 :return: The amount of this SubAccountTransferRecordItem. # noqa: E501 :rtype: str @@ -228,7 +228,7 @@ def amount(self): def amount(self, amount): """Sets the amount of this SubAccountTransferRecordItem. - Transfer amount # noqa: E501 + Transfer Amount # noqa: E501 :param amount: The amount of this SubAccountTransferRecordItem. # noqa: E501 :type: str diff --git a/gate_api/models/sub_cross_margin_account.py b/gate_api/models/sub_cross_margin_account.py index 0e43bca8..34cb0745 100644 --- a/gate_api/models/sub_cross_margin_account.py +++ b/gate_api/models/sub_cross_margin_account.py @@ -291,7 +291,7 @@ def net(self, net): def leverage(self): """Gets the leverage of this SubCrossMarginAccount. # noqa: E501 - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :return: The leverage of this SubCrossMarginAccount. # noqa: E501 :rtype: str @@ -302,7 +302,7 @@ def leverage(self): def leverage(self, leverage): """Sets the leverage of this SubCrossMarginAccount. - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :param leverage: The leverage of this SubCrossMarginAccount. # noqa: E501 :type: str diff --git a/gate_api/models/swap_coin.py b/gate_api/models/swap_coin.py index 14d56e41..690e1fa7 100644 --- a/gate_api/models/swap_coin.py +++ b/gate_api/models/swap_coin.py @@ -34,7 +34,7 @@ class SwapCoin(object): """ openapi_types = { 'coin': 'str', - 'side': 'str', + 'side': 'int', 'amount': 'str', 'pid': 'int' } @@ -47,7 +47,7 @@ class SwapCoin(object): } def __init__(self, coin=None, side=None, amount=None, pid=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, int, Configuration) -> None + # type: (str, int, str, int, Configuration) -> None """SwapCoin - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -97,7 +97,7 @@ def side(self): 0 - Stake 1 - Redeem # noqa: E501 :return: The side of this SwapCoin. # noqa: E501 - :rtype: str + :rtype: int """ return self._side @@ -108,7 +108,7 @@ def side(self, side): 0 - Stake 1 - Redeem # noqa: E501 :param side: The side of this SwapCoin. # noqa: E501 - :type: str + :type: int """ if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 diff --git a/gate_api/models/swap_coin_struct.py b/gate_api/models/swap_coin_struct.py index 8a7ae01e..ea3d9a0f 100644 --- a/gate_api/models/swap_coin_struct.py +++ b/gate_api/models/swap_coin_struct.py @@ -334,7 +334,7 @@ def exchange_amount(self, exchange_amount): def update_stamp(self): """Gets the update_stamp of this SwapCoinStruct. # noqa: E501 - UpdateTimestamp # noqa: E501 + Update timestamp # noqa: E501 :return: The update_stamp of this SwapCoinStruct. # noqa: E501 :rtype: int @@ -345,7 +345,7 @@ def update_stamp(self): def update_stamp(self, update_stamp): """Sets the update_stamp of this SwapCoinStruct. - UpdateTimestamp # noqa: E501 + Update timestamp # noqa: E501 :param update_stamp: The update_stamp of this SwapCoinStruct. # noqa: E501 :type: int diff --git a/gate_api/models/symbol.py b/gate_api/models/symbol.py new file mode 100644 index 00000000..12d1aae9 --- /dev/null +++ b/gate_api/models/symbol.py @@ -0,0 +1,529 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Symbol(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'exchange_type': 'str', + 'business_type': 'str', + 'state': 'str', + 'min_size': 'str', + 'min_notional': 'str', + 'lot_size': 'str', + 'tick_size': 'str', + 'max_num_orders': 'str', + 'max_market_size': 'str', + 'max_limit_size': 'str', + 'contract_size': 'str', + 'liquidation_fee': 'str', + 'delist_time': 'str', + 'support_rpi': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'exchange_type': 'exchange_type', + 'business_type': 'business_type', + 'state': 'state', + 'min_size': 'min_size', + 'min_notional': 'min_notional', + 'lot_size': 'lot_size', + 'tick_size': 'tick_size', + 'max_num_orders': 'max_num_orders', + 'max_market_size': 'max_market_size', + 'max_limit_size': 'max_limit_size', + 'contract_size': 'contract_size', + 'liquidation_fee': 'liquidation_fee', + 'delist_time': 'delist_time', + 'support_rpi': 'support_rpi' + } + + def __init__(self, symbol=None, exchange_type=None, business_type=None, state=None, min_size=None, min_notional=None, lot_size=None, tick_size=None, max_num_orders=None, max_market_size=None, max_limit_size=None, contract_size=None, liquidation_fee=None, delist_time=None, support_rpi=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """Symbol - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._exchange_type = None + self._business_type = None + self._state = None + self._min_size = None + self._min_notional = None + self._lot_size = None + self._tick_size = None + self._max_num_orders = None + self._max_market_size = None + self._max_limit_size = None + self._contract_size = None + self._liquidation_fee = None + self._delist_time = None + self._support_rpi = None + self.discriminator = None + + self.symbol = symbol + self.exchange_type = exchange_type + self.business_type = business_type + self.state = state + self.min_size = min_size + self.min_notional = min_notional + self.lot_size = lot_size + self.tick_size = tick_size + self.max_num_orders = max_num_orders + self.max_market_size = max_market_size + self.max_limit_size = max_limit_size + self.contract_size = contract_size + self.liquidation_fee = liquidation_fee + self.delist_time = delist_time + if support_rpi is not None: + self.support_rpi = support_rpi + + @property + def symbol(self): + """Gets the symbol of this Symbol. # noqa: E501 + + Unique trading pair identifier in the form ExchangeType_BusinessType_Base_Counter. # noqa: E501 + + :return: The symbol of this Symbol. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this Symbol. + + Unique trading pair identifier in the form ExchangeType_BusinessType_Base_Counter. # noqa: E501 + + :param symbol: The symbol of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def exchange_type(self): + """Gets the exchange_type of this Symbol. # noqa: E501 + + Venue bucket (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT`). # noqa: E501 + + :return: The exchange_type of this Symbol. # noqa: E501 + :rtype: str + """ + return self._exchange_type + + @exchange_type.setter + def exchange_type(self, exchange_type): + """Sets the exchange_type of this Symbol. + + Venue bucket (`BINANCE` / `OKX` / `GATE` / `BYBIT` / `KRAKEN` / `HYPERLIQUID` / `DERIBIT`). # noqa: E501 + + :param exchange_type: The exchange_type of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and exchange_type is None: # noqa: E501 + raise ValueError("Invalid value for `exchange_type`, must not be `None`") # noqa: E501 + + self._exchange_type = exchange_type + + @property + def business_type(self): + """Gets the business_type of this Symbol. # noqa: E501 + + Business type (`SPOT` Spot / `FUTURE` Futures / `MARGIN` Margin). # noqa: E501 + + :return: The business_type of this Symbol. # noqa: E501 + :rtype: str + """ + return self._business_type + + @business_type.setter + def business_type(self, business_type): + """Sets the business_type of this Symbol. + + Business type (`SPOT` Spot / `FUTURE` Futures / `MARGIN` Margin). # noqa: E501 + + :param business_type: The business_type of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and business_type is None: # noqa: E501 + raise ValueError("Invalid value for `business_type`, must not be `None`") # noqa: E501 + + self._business_type = business_type + + @property + def state(self): + """Gets the state of this Symbol. # noqa: E501 + + Status (`live` running / `suspend` paused). # noqa: E501 + + :return: The state of this Symbol. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this Symbol. + + Status (`live` running / `suspend` paused). # noqa: E501 + + :param state: The state of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and state is None: # noqa: E501 + raise ValueError("Invalid value for `state`, must not be `None`") # noqa: E501 + + self._state = state + + @property + def min_size(self): + """Gets the min_size of this Symbol. # noqa: E501 + + Minimum order quantity # noqa: E501 + + :return: The min_size of this Symbol. # noqa: E501 + :rtype: str + """ + return self._min_size + + @min_size.setter + def min_size(self, min_size): + """Sets the min_size of this Symbol. + + Minimum order quantity # noqa: E501 + + :param min_size: The min_size of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and min_size is None: # noqa: E501 + raise ValueError("Invalid value for `min_size`, must not be `None`") # noqa: E501 + + self._min_size = min_size + + @property + def min_notional(self): + """Gets the min_notional of this Symbol. # noqa: E501 + + Minimum Order Value # noqa: E501 + + :return: The min_notional of this Symbol. # noqa: E501 + :rtype: str + """ + return self._min_notional + + @min_notional.setter + def min_notional(self, min_notional): + """Sets the min_notional of this Symbol. + + Minimum Order Value # noqa: E501 + + :param min_notional: The min_notional of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and min_notional is None: # noqa: E501 + raise ValueError("Invalid value for `min_notional`, must not be `None`") # noqa: E501 + + self._min_notional = min_notional + + @property + def lot_size(self): + """Gets the lot_size of this Symbol. # noqa: E501 + + Quantity Step # noqa: E501 + + :return: The lot_size of this Symbol. # noqa: E501 + :rtype: str + """ + return self._lot_size + + @lot_size.setter + def lot_size(self, lot_size): + """Sets the lot_size of this Symbol. + + Quantity Step # noqa: E501 + + :param lot_size: The lot_size of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and lot_size is None: # noqa: E501 + raise ValueError("Invalid value for `lot_size`, must not be `None`") # noqa: E501 + + self._lot_size = lot_size + + @property + def tick_size(self): + """Gets the tick_size of this Symbol. # noqa: E501 + + Price Step # noqa: E501 + + :return: The tick_size of this Symbol. # noqa: E501 + :rtype: str + """ + return self._tick_size + + @tick_size.setter + def tick_size(self, tick_size): + """Sets the tick_size of this Symbol. + + Price Step # noqa: E501 + + :param tick_size: The tick_size of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and tick_size is None: # noqa: E501 + raise ValueError("Invalid value for `tick_size`, must not be `None`") # noqa: E501 + + self._tick_size = tick_size + + @property + def max_num_orders(self): + """Gets the max_num_orders of this Symbol. # noqa: E501 + + maximumopen orderamount # noqa: E501 + + :return: The max_num_orders of this Symbol. # noqa: E501 + :rtype: str + """ + return self._max_num_orders + + @max_num_orders.setter + def max_num_orders(self, max_num_orders): + """Sets the max_num_orders of this Symbol. + + maximumopen orderamount # noqa: E501 + + :param max_num_orders: The max_num_orders of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and max_num_orders is None: # noqa: E501 + raise ValueError("Invalid value for `max_num_orders`, must not be `None`") # noqa: E501 + + self._max_num_orders = max_num_orders + + @property + def max_market_size(self): + """Gets the max_market_size of this Symbol. # noqa: E501 + + Maximum Market Order Quantity # noqa: E501 + + :return: The max_market_size of this Symbol. # noqa: E501 + :rtype: str + """ + return self._max_market_size + + @max_market_size.setter + def max_market_size(self, max_market_size): + """Sets the max_market_size of this Symbol. + + Maximum Market Order Quantity # noqa: E501 + + :param max_market_size: The max_market_size of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and max_market_size is None: # noqa: E501 + raise ValueError("Invalid value for `max_market_size`, must not be `None`") # noqa: E501 + + self._max_market_size = max_market_size + + @property + def max_limit_size(self): + """Gets the max_limit_size of this Symbol. # noqa: E501 + + Maximum order quantity for limit orders. # noqa: E501 + + :return: The max_limit_size of this Symbol. # noqa: E501 + :rtype: str + """ + return self._max_limit_size + + @max_limit_size.setter + def max_limit_size(self, max_limit_size): + """Sets the max_limit_size of this Symbol. + + Maximum order quantity for limit orders. # noqa: E501 + + :param max_limit_size: The max_limit_size of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and max_limit_size is None: # noqa: E501 + raise ValueError("Invalid value for `max_limit_size`, must not be `None`") # noqa: E501 + + self._max_limit_size = max_limit_size + + @property + def contract_size(self): + """Gets the contract_size of this Symbol. # noqa: E501 + + Contract multiplier (deprecated; quantity is used uniformly) # noqa: E501 + + :return: The contract_size of this Symbol. # noqa: E501 + :rtype: str + """ + return self._contract_size + + @contract_size.setter + def contract_size(self, contract_size): + """Sets the contract_size of this Symbol. + + Contract multiplier (deprecated; quantity is used uniformly) # noqa: E501 + + :param contract_size: The contract_size of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and contract_size is None: # noqa: E501 + raise ValueError("Invalid value for `contract_size`, must not be `None`") # noqa: E501 + + self._contract_size = contract_size + + @property + def liquidation_fee(self): + """Gets the liquidation_fee of this Symbol. # noqa: E501 + + Liquidation Fee Rate # noqa: E501 + + :return: The liquidation_fee of this Symbol. # noqa: E501 + :rtype: str + """ + return self._liquidation_fee + + @liquidation_fee.setter + def liquidation_fee(self, liquidation_fee): + """Sets the liquidation_fee of this Symbol. + + Liquidation Fee Rate # noqa: E501 + + :param liquidation_fee: The liquidation_fee of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and liquidation_fee is None: # noqa: E501 + raise ValueError("Invalid value for `liquidation_fee`, must not be `None`") # noqa: E501 + + self._liquidation_fee = liquidation_fee + + @property + def delist_time(self): + """Gets the delist_time of this Symbol. # noqa: E501 + + Millisecond timestamp; `0` means not delisted. # noqa: E501 + + :return: The delist_time of this Symbol. # noqa: E501 + :rtype: str + """ + return self._delist_time + + @delist_time.setter + def delist_time(self, delist_time): + """Sets the delist_time of this Symbol. + + Millisecond timestamp; `0` means not delisted. # noqa: E501 + + :param delist_time: The delist_time of this Symbol. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and delist_time is None: # noqa: E501 + raise ValueError("Invalid value for `delist_time`, must not be `None`") # noqa: E501 + + self._delist_time = delist_time + + @property + def support_rpi(self): + """Gets the support_rpi of this Symbol. # noqa: E501 + + Whether RPI order placement is supported (true if supported; false otherwise) # noqa: E501 + + :return: The support_rpi of this Symbol. # noqa: E501 + :rtype: str + """ + return self._support_rpi + + @support_rpi.setter + def support_rpi(self, support_rpi): + """Sets the support_rpi of this Symbol. + + Whether RPI order placement is supported (true if supported; false otherwise) # noqa: E501 + + :param support_rpi: The support_rpi of this Symbol. # noqa: E501 + :type: str + """ + + self._support_rpi = support_rpi + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Symbol): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Symbol): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbol_commissions.py b/gate_api/models/symbol_commissions.py new file mode 100644 index 00000000..5be9383b --- /dev/null +++ b/gate_api/models/symbol_commissions.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SymbolCommissions(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'SymbolCommissionsData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, SymbolCommissionsData, Configuration) -> None + """SymbolCommissions - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this SymbolCommissions. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this SymbolCommissions. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this SymbolCommissions. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this SymbolCommissions. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this SymbolCommissions. # noqa: E501 + + + :return: The data of this SymbolCommissions. # noqa: E501 + :rtype: SymbolCommissionsData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this SymbolCommissions. + + + :param data: The data of this SymbolCommissions. # noqa: E501 + :type: SymbolCommissionsData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SymbolCommissions): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SymbolCommissions): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbol_commissions_data.py b/gate_api/models/symbol_commissions_data.py new file mode 100644 index 00000000..21e5a988 --- /dev/null +++ b/gate_api/models/symbol_commissions_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SymbolCommissionsData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[SymbolCommissionsDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[SymbolCommissionsDataList], Configuration) -> None + """SymbolCommissionsData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this SymbolCommissionsData. # noqa: E501 + + List of symbol commission rates # noqa: E501 + + :return: The list of this SymbolCommissionsData. # noqa: E501 + :rtype: list[SymbolCommissionsDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this SymbolCommissionsData. + + List of symbol commission rates # noqa: E501 + + :param list: The list of this SymbolCommissionsData. # noqa: E501 + :type: list[SymbolCommissionsDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SymbolCommissionsData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SymbolCommissionsData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbol_commissions_data_list.py b/gate_api/models/symbol_commissions_data_list.py new file mode 100644 index 00000000..e539c601 --- /dev/null +++ b/gate_api/models/symbol_commissions_data_list.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SymbolCommissionsDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'category_code': 'str', + 'symbol': 'str', + 'fee_per_lot': 'str' + } + + attribute_map = { + 'category_code': 'category_code', + 'symbol': 'symbol', + 'fee_per_lot': 'fee_per_lot' + } + + def __init__(self, category_code=None, symbol=None, fee_per_lot=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """SymbolCommissionsDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._category_code = None + self._symbol = None + self._fee_per_lot = None + self.discriminator = None + + if category_code is not None: + self.category_code = category_code + if symbol is not None: + self.symbol = symbol + if fee_per_lot is not None: + self.fee_per_lot = fee_per_lot + + @property + def category_code(self): + """Gets the category_code of this SymbolCommissionsDataList. # noqa: E501 + + Category code # noqa: E501 + + :return: The category_code of this SymbolCommissionsDataList. # noqa: E501 + :rtype: str + """ + return self._category_code + + @category_code.setter + def category_code(self, category_code): + """Sets the category_code of this SymbolCommissionsDataList. + + Category code # noqa: E501 + + :param category_code: The category_code of this SymbolCommissionsDataList. # noqa: E501 + :type: str + """ + + self._category_code = category_code + + @property + def symbol(self): + """Gets the symbol of this SymbolCommissionsDataList. # noqa: E501 + + Trading symbol code # noqa: E501 + + :return: The symbol of this SymbolCommissionsDataList. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this SymbolCommissionsDataList. + + Trading symbol code # noqa: E501 + + :param symbol: The symbol of this SymbolCommissionsDataList. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def fee_per_lot(self): + """Gets the fee_per_lot of this SymbolCommissionsDataList. # noqa: E501 + + Commission rate per lot # noqa: E501 + + :return: The fee_per_lot of this SymbolCommissionsDataList. # noqa: E501 + :rtype: str + """ + return self._fee_per_lot + + @fee_per_lot.setter + def fee_per_lot(self, fee_per_lot): + """Sets the fee_per_lot of this SymbolCommissionsDataList. + + Commission rate per lot # noqa: E501 + + :param fee_per_lot: The fee_per_lot of this SymbolCommissionsDataList. # noqa: E501 + :type: str + """ + + self._fee_per_lot = fee_per_lot + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SymbolCommissionsDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SymbolCommissionsDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbol_detail.py b/gate_api/models/symbol_detail.py new file mode 100644 index 00000000..c72e0fe2 --- /dev/null +++ b/gate_api/models/symbol_detail.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SymbolDetail(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'SymbolDetailData', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (SymbolDetailData, int, Configuration) -> None + """SymbolDetail - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this SymbolDetail. # noqa: E501 + + + :return: The data of this SymbolDetail. # noqa: E501 + :rtype: SymbolDetailData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this SymbolDetail. + + + :param data: The data of this SymbolDetail. # noqa: E501 + :type: SymbolDetailData + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this SymbolDetail. # noqa: E501 + + + :return: The timestamp of this SymbolDetail. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this SymbolDetail. + + + :param timestamp: The timestamp of this SymbolDetail. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SymbolDetail): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SymbolDetail): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/eth2_rate_list.py b/gate_api/models/symbol_detail_data.py similarity index 55% rename from gate_api/models/eth2_rate_list.py rename to gate_api/models/symbol_detail_data.py index c714e00c..f784acaa 100644 --- a/gate_api/models/eth2_rate_list.py +++ b/gate_api/models/symbol_detail_data.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class Eth2RateList(object): +class SymbolDetailData(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -33,104 +33,98 @@ class Eth2RateList(object): and the value is json key in definition. """ openapi_types = { - 'date_time': 'int', - 'date': 'str', - 'rate': 'str' + 'total': 'int', + 'total_page': 'int', + 'list': 'list[SymbolDetailItem]' } attribute_map = { - 'date_time': 'date_time', - 'date': 'date', - 'rate': 'rate' + 'total': 'total', + 'total_page': 'total_page', + 'list': 'list' } - def __init__(self, date_time=None, date=None, rate=None, local_vars_configuration=None): # noqa: E501 - # type: (int, str, str, Configuration) -> None - """Eth2RateList - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, total=None, total_page=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, list[SymbolDetailItem], Configuration) -> None + """SymbolDetailData - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration - self._date_time = None - self._date = None - self._rate = None + self._total = None + self._total_page = None + self._list = None self.discriminator = None - if date_time is not None: - self.date_time = date_time - if date is not None: - self.date = date - if rate is not None: - self.rate = rate + if total is not None: + self.total = total + if total_page is not None: + self.total_page = total_page + if list is not None: + self.list = list @property - def date_time(self): - """Gets the date_time of this Eth2RateList. # noqa: E501 + def total(self): + """Gets the total of this SymbolDetailData. # noqa: E501 - Date Timestamp # noqa: E501 - :return: The date_time of this Eth2RateList. # noqa: E501 + :return: The total of this SymbolDetailData. # noqa: E501 :rtype: int """ - return self._date_time + return self._total - @date_time.setter - def date_time(self, date_time): - """Sets the date_time of this Eth2RateList. + @total.setter + def total(self, total): + """Sets the total of this SymbolDetailData. - Date Timestamp # noqa: E501 - :param date_time: The date_time of this Eth2RateList. # noqa: E501 + :param total: The total of this SymbolDetailData. # noqa: E501 :type: int """ - self._date_time = date_time + self._total = total @property - def date(self): - """Gets the date of this Eth2RateList. # noqa: E501 + def total_page(self): + """Gets the total_page of this SymbolDetailData. # noqa: E501 - Date # noqa: E501 - :return: The date of this Eth2RateList. # noqa: E501 - :rtype: str + :return: The total_page of this SymbolDetailData. # noqa: E501 + :rtype: int """ - return self._date + return self._total_page - @date.setter - def date(self, date): - """Sets the date of this Eth2RateList. + @total_page.setter + def total_page(self, total_page): + """Sets the total_page of this SymbolDetailData. - Date # noqa: E501 - :param date: The date of this Eth2RateList. # noqa: E501 - :type: str + :param total_page: The total_page of this SymbolDetailData. # noqa: E501 + :type: int """ - self._date = date + self._total_page = total_page @property - def rate(self): - """Gets the rate of this Eth2RateList. # noqa: E501 + def list(self): + """Gets the list of this SymbolDetailData. # noqa: E501 - Percentage Rate # noqa: E501 - :return: The rate of this Eth2RateList. # noqa: E501 - :rtype: str + :return: The list of this SymbolDetailData. # noqa: E501 + :rtype: list[SymbolDetailItem] """ - return self._rate + return self._list - @rate.setter - def rate(self, rate): - """Sets the rate of this Eth2RateList. + @list.setter + def list(self, list): + """Sets the list of this SymbolDetailData. - Percentage Rate # noqa: E501 - :param rate: The rate of this Eth2RateList. # noqa: E501 - :type: str + :param list: The list of this SymbolDetailData. # noqa: E501 + :type: list[SymbolDetailItem] """ - self._rate = rate + self._list = list def to_dict(self): """Returns the model properties as a dict""" @@ -166,14 +160,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, Eth2RateList): + if not isinstance(other, SymbolDetailData): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, Eth2RateList): + if not isinstance(other, SymbolDetailData): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbol_detail_item.py b/gate_api/models/symbol_detail_item.py new file mode 100644 index 00000000..7e46766c --- /dev/null +++ b/gate_api/models/symbol_detail_item.py @@ -0,0 +1,809 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SymbolDetailItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'exchange': 'str', + 'exchange_desc': 'str', + 'quote_currency': 'str', + 'quote_currency_precision': 'int', + 'fx_rate': 'str', + 'symbol_desc': 'str', + 'category': 'str', + 'settlement_currency': 'str', + 'max_order_volume': 'str', + 'step_order_volume': 'str', + 'min_order_volume': 'str', + 'price_precision': 'int', + 'volume_precision': 'int', + 'is_ipo': 'bool', + 'ipo_price': 'str', + 'price_protection': 'str', + 'sell_price_protection': 'str', + 'buy_price_protection': 'str', + 'slippage_rate': 'str', + 'commission_rate': 'str', + 'trade_status': 'str', + 'trade_mode': 'int', + 'order_fill_timing': 'int', + 'symbol_descs': 'list[SymbolDetailItemSymbolDescs]', + 'icon_link': 'str' + } + + attribute_map = { + 'symbol': 'symbol', + 'exchange': 'exchange', + 'exchange_desc': 'exchange_desc', + 'quote_currency': 'quote_currency', + 'quote_currency_precision': 'quote_currency_precision', + 'fx_rate': 'fx_rate', + 'symbol_desc': 'symbol_desc', + 'category': 'category', + 'settlement_currency': 'settlement_currency', + 'max_order_volume': 'max_order_volume', + 'step_order_volume': 'step_order_volume', + 'min_order_volume': 'min_order_volume', + 'price_precision': 'price_precision', + 'volume_precision': 'volume_precision', + 'is_ipo': 'is_ipo', + 'ipo_price': 'ipo_price', + 'price_protection': 'price_protection', + 'sell_price_protection': 'sell_price_protection', + 'buy_price_protection': 'buy_price_protection', + 'slippage_rate': 'slippage_rate', + 'commission_rate': 'commission_rate', + 'trade_status': 'trade_status', + 'trade_mode': 'trade_mode', + 'order_fill_timing': 'order_fill_timing', + 'symbol_descs': 'symbol_descs', + 'icon_link': 'icon_link' + } + + def __init__(self, symbol=None, exchange=None, exchange_desc=None, quote_currency=None, quote_currency_precision=None, fx_rate=None, symbol_desc=None, category=None, settlement_currency=None, max_order_volume=None, step_order_volume=None, min_order_volume=None, price_precision=None, volume_precision=None, is_ipo=None, ipo_price=None, price_protection=None, sell_price_protection=None, buy_price_protection=None, slippage_rate=None, commission_rate=None, trade_status=None, trade_mode=None, order_fill_timing=None, symbol_descs=None, icon_link=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, str, str, str, str, str, str, str, int, int, bool, str, str, str, str, str, str, str, int, int, list[SymbolDetailItemSymbolDescs], str, Configuration) -> None + """SymbolDetailItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._exchange = None + self._exchange_desc = None + self._quote_currency = None + self._quote_currency_precision = None + self._fx_rate = None + self._symbol_desc = None + self._category = None + self._settlement_currency = None + self._max_order_volume = None + self._step_order_volume = None + self._min_order_volume = None + self._price_precision = None + self._volume_precision = None + self._is_ipo = None + self._ipo_price = None + self._price_protection = None + self._sell_price_protection = None + self._buy_price_protection = None + self._slippage_rate = None + self._commission_rate = None + self._trade_status = None + self._trade_mode = None + self._order_fill_timing = None + self._symbol_descs = None + self._icon_link = None + self.discriminator = None + + if symbol is not None: + self.symbol = symbol + if exchange is not None: + self.exchange = exchange + if exchange_desc is not None: + self.exchange_desc = exchange_desc + if quote_currency is not None: + self.quote_currency = quote_currency + if quote_currency_precision is not None: + self.quote_currency_precision = quote_currency_precision + if fx_rate is not None: + self.fx_rate = fx_rate + if symbol_desc is not None: + self.symbol_desc = symbol_desc + if category is not None: + self.category = category + if settlement_currency is not None: + self.settlement_currency = settlement_currency + if max_order_volume is not None: + self.max_order_volume = max_order_volume + if step_order_volume is not None: + self.step_order_volume = step_order_volume + if min_order_volume is not None: + self.min_order_volume = min_order_volume + if price_precision is not None: + self.price_precision = price_precision + if volume_precision is not None: + self.volume_precision = volume_precision + if is_ipo is not None: + self.is_ipo = is_ipo + if ipo_price is not None: + self.ipo_price = ipo_price + if price_protection is not None: + self.price_protection = price_protection + if sell_price_protection is not None: + self.sell_price_protection = sell_price_protection + if buy_price_protection is not None: + self.buy_price_protection = buy_price_protection + if slippage_rate is not None: + self.slippage_rate = slippage_rate + if commission_rate is not None: + self.commission_rate = commission_rate + if trade_status is not None: + self.trade_status = trade_status + if trade_mode is not None: + self.trade_mode = trade_mode + if order_fill_timing is not None: + self.order_fill_timing = order_fill_timing + if symbol_descs is not None: + self.symbol_descs = symbol_descs + if icon_link is not None: + self.icon_link = icon_link + + @property + def symbol(self): + """Gets the symbol of this SymbolDetailItem. # noqa: E501 + + + :return: The symbol of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this SymbolDetailItem. + + + :param symbol: The symbol of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def exchange(self): + """Gets the exchange of this SymbolDetailItem. # noqa: E501 + + Exchange, supports us, hk, and kr # noqa: E501 + + :return: The exchange of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this SymbolDetailItem. + + Exchange, supports us, hk, and kr # noqa: E501 + + :param exchange: The exchange of this SymbolDetailItem. # noqa: E501 + :type: str + """ + allowed_values = ["us", "hk", "kr"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and exchange not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `exchange` ({0}), must be one of {1}" # noqa: E501 + .format(exchange, allowed_values) + ) + + self._exchange = exchange + + @property + def exchange_desc(self): + """Gets the exchange_desc of this SymbolDetailItem. # noqa: E501 + + + :return: The exchange_desc of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._exchange_desc + + @exchange_desc.setter + def exchange_desc(self, exchange_desc): + """Sets the exchange_desc of this SymbolDetailItem. + + + :param exchange_desc: The exchange_desc of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._exchange_desc = exchange_desc + + @property + def quote_currency(self): + """Gets the quote_currency of this SymbolDetailItem. # noqa: E501 + + + :return: The quote_currency of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._quote_currency + + @quote_currency.setter + def quote_currency(self, quote_currency): + """Sets the quote_currency of this SymbolDetailItem. + + + :param quote_currency: The quote_currency of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._quote_currency = quote_currency + + @property + def quote_currency_precision(self): + """Gets the quote_currency_precision of this SymbolDetailItem. # noqa: E501 + + + :return: The quote_currency_precision of this SymbolDetailItem. # noqa: E501 + :rtype: int + """ + return self._quote_currency_precision + + @quote_currency_precision.setter + def quote_currency_precision(self, quote_currency_precision): + """Sets the quote_currency_precision of this SymbolDetailItem. + + + :param quote_currency_precision: The quote_currency_precision of this SymbolDetailItem. # noqa: E501 + :type: int + """ + + self._quote_currency_precision = quote_currency_precision + + @property + def fx_rate(self): + """Gets the fx_rate of this SymbolDetailItem. # noqa: E501 + + Quote currency to USD exchange rate # noqa: E501 + + :return: The fx_rate of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._fx_rate + + @fx_rate.setter + def fx_rate(self, fx_rate): + """Sets the fx_rate of this SymbolDetailItem. + + Quote currency to USD exchange rate # noqa: E501 + + :param fx_rate: The fx_rate of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._fx_rate = fx_rate + + @property + def symbol_desc(self): + """Gets the symbol_desc of this SymbolDetailItem. # noqa: E501 + + + :return: The symbol_desc of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._symbol_desc + + @symbol_desc.setter + def symbol_desc(self, symbol_desc): + """Sets the symbol_desc of this SymbolDetailItem. + + + :param symbol_desc: The symbol_desc of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._symbol_desc = symbol_desc + + @property + def category(self): + """Gets the category of this SymbolDetailItem. # noqa: E501 + + + :return: The category of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this SymbolDetailItem. + + + :param category: The category of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._category = category + + @property + def settlement_currency(self): + """Gets the settlement_currency of this SymbolDetailItem. # noqa: E501 + + + :return: The settlement_currency of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._settlement_currency + + @settlement_currency.setter + def settlement_currency(self, settlement_currency): + """Sets the settlement_currency of this SymbolDetailItem. + + + :param settlement_currency: The settlement_currency of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._settlement_currency = settlement_currency + + @property + def max_order_volume(self): + """Gets the max_order_volume of this SymbolDetailItem. # noqa: E501 + + + :return: The max_order_volume of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._max_order_volume + + @max_order_volume.setter + def max_order_volume(self, max_order_volume): + """Sets the max_order_volume of this SymbolDetailItem. + + + :param max_order_volume: The max_order_volume of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._max_order_volume = max_order_volume + + @property + def step_order_volume(self): + """Gets the step_order_volume of this SymbolDetailItem. # noqa: E501 + + + :return: The step_order_volume of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._step_order_volume + + @step_order_volume.setter + def step_order_volume(self, step_order_volume): + """Sets the step_order_volume of this SymbolDetailItem. + + + :param step_order_volume: The step_order_volume of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._step_order_volume = step_order_volume + + @property + def min_order_volume(self): + """Gets the min_order_volume of this SymbolDetailItem. # noqa: E501 + + + :return: The min_order_volume of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._min_order_volume + + @min_order_volume.setter + def min_order_volume(self, min_order_volume): + """Sets the min_order_volume of this SymbolDetailItem. + + + :param min_order_volume: The min_order_volume of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._min_order_volume = min_order_volume + + @property + def price_precision(self): + """Gets the price_precision of this SymbolDetailItem. # noqa: E501 + + Price precision # noqa: E501 + + :return: The price_precision of this SymbolDetailItem. # noqa: E501 + :rtype: int + """ + return self._price_precision + + @price_precision.setter + def price_precision(self, price_precision): + """Sets the price_precision of this SymbolDetailItem. + + Price precision # noqa: E501 + + :param price_precision: The price_precision of this SymbolDetailItem. # noqa: E501 + :type: int + """ + + self._price_precision = price_precision + + @property + def volume_precision(self): + """Gets the volume_precision of this SymbolDetailItem. # noqa: E501 + + + :return: The volume_precision of this SymbolDetailItem. # noqa: E501 + :rtype: int + """ + return self._volume_precision + + @volume_precision.setter + def volume_precision(self, volume_precision): + """Sets the volume_precision of this SymbolDetailItem. + + + :param volume_precision: The volume_precision of this SymbolDetailItem. # noqa: E501 + :type: int + """ + + self._volume_precision = volume_precision + + @property + def is_ipo(self): + """Gets the is_ipo of this SymbolDetailItem. # noqa: E501 + + + :return: The is_ipo of this SymbolDetailItem. # noqa: E501 + :rtype: bool + """ + return self._is_ipo + + @is_ipo.setter + def is_ipo(self, is_ipo): + """Sets the is_ipo of this SymbolDetailItem. + + + :param is_ipo: The is_ipo of this SymbolDetailItem. # noqa: E501 + :type: bool + """ + + self._is_ipo = is_ipo + + @property + def ipo_price(self): + """Gets the ipo_price of this SymbolDetailItem. # noqa: E501 + + + :return: The ipo_price of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._ipo_price + + @ipo_price.setter + def ipo_price(self, ipo_price): + """Sets the ipo_price of this SymbolDetailItem. + + + :param ipo_price: The ipo_price of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._ipo_price = ipo_price + + @property + def price_protection(self): + """Gets the price_protection of this SymbolDetailItem. # noqa: E501 + + + :return: The price_protection of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._price_protection + + @price_protection.setter + def price_protection(self, price_protection): + """Sets the price_protection of this SymbolDetailItem. + + + :param price_protection: The price_protection of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._price_protection = price_protection + + @property + def sell_price_protection(self): + """Gets the sell_price_protection of this SymbolDetailItem. # noqa: E501 + + + :return: The sell_price_protection of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._sell_price_protection + + @sell_price_protection.setter + def sell_price_protection(self, sell_price_protection): + """Sets the sell_price_protection of this SymbolDetailItem. + + + :param sell_price_protection: The sell_price_protection of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._sell_price_protection = sell_price_protection + + @property + def buy_price_protection(self): + """Gets the buy_price_protection of this SymbolDetailItem. # noqa: E501 + + + :return: The buy_price_protection of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._buy_price_protection + + @buy_price_protection.setter + def buy_price_protection(self, buy_price_protection): + """Sets the buy_price_protection of this SymbolDetailItem. + + + :param buy_price_protection: The buy_price_protection of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._buy_price_protection = buy_price_protection + + @property + def slippage_rate(self): + """Gets the slippage_rate of this SymbolDetailItem. # noqa: E501 + + + :return: The slippage_rate of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._slippage_rate + + @slippage_rate.setter + def slippage_rate(self, slippage_rate): + """Sets the slippage_rate of this SymbolDetailItem. + + + :param slippage_rate: The slippage_rate of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._slippage_rate = slippage_rate + + @property + def commission_rate(self): + """Gets the commission_rate of this SymbolDetailItem. # noqa: E501 + + Fee Rate # noqa: E501 + + :return: The commission_rate of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._commission_rate + + @commission_rate.setter + def commission_rate(self, commission_rate): + """Sets the commission_rate of this SymbolDetailItem. + + Fee Rate # noqa: E501 + + :param commission_rate: The commission_rate of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._commission_rate = commission_rate + + @property + def trade_status(self): + """Gets the trade_status of this SymbolDetailItem. # noqa: E501 + + Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. # noqa: E501 + + :return: The trade_status of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._trade_status + + @trade_status.setter + def trade_status(self, trade_status): + """Sets the trade_status of this SymbolDetailItem. + + Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. # noqa: E501 + + :param trade_status: The trade_status of this SymbolDetailItem. # noqa: E501 + :type: str + """ + allowed_values = ["pre_market", "open", "post_market", "closed", "gt_lp"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and trade_status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `trade_status` ({0}), must be one of {1}" # noqa: E501 + .format(trade_status, allowed_values) + ) + + self._trade_status = trade_status + + @property + def trade_mode(self): + """Gets the trade_mode of this SymbolDetailItem. # noqa: E501 + + Current session trading mode. - 0: Trading disabled. - 1: Buy only. - 2: Sell only. - 4: Buy and sell supported. # noqa: E501 + + :return: The trade_mode of this SymbolDetailItem. # noqa: E501 + :rtype: int + """ + return self._trade_mode + + @trade_mode.setter + def trade_mode(self, trade_mode): + """Sets the trade_mode of this SymbolDetailItem. + + Current session trading mode. - 0: Trading disabled. - 1: Buy only. - 2: Sell only. - 4: Buy and sell supported. # noqa: E501 + + :param trade_mode: The trade_mode of this SymbolDetailItem. # noqa: E501 + :type: int + """ + allowed_values = [0, 1, 2, 4] # noqa: E501 + if self.local_vars_configuration.client_side_validation and trade_mode not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `trade_mode` ({0}), must be one of {1}" # noqa: E501 + .format(trade_mode, allowed_values) + ) + + self._trade_mode = trade_mode + + @property + def order_fill_timing(self): + """Gets the order_fill_timing of this SymbolDetailItem. # noqa: E501 + + Order fill timing (1=immediate, 2=after pre-market opens, 3=after regular session opens) # noqa: E501 + + :return: The order_fill_timing of this SymbolDetailItem. # noqa: E501 + :rtype: int + """ + return self._order_fill_timing + + @order_fill_timing.setter + def order_fill_timing(self, order_fill_timing): + """Sets the order_fill_timing of this SymbolDetailItem. + + Order fill timing (1=immediate, 2=after pre-market opens, 3=after regular session opens) # noqa: E501 + + :param order_fill_timing: The order_fill_timing of this SymbolDetailItem. # noqa: E501 + :type: int + """ + allowed_values = [1, 2, 3] # noqa: E501 + if self.local_vars_configuration.client_side_validation and order_fill_timing not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `order_fill_timing` ({0}), must be one of {1}" # noqa: E501 + .format(order_fill_timing, allowed_values) + ) + + self._order_fill_timing = order_fill_timing + + @property + def symbol_descs(self): + """Gets the symbol_descs of this SymbolDetailItem. # noqa: E501 + + + :return: The symbol_descs of this SymbolDetailItem. # noqa: E501 + :rtype: list[SymbolDetailItemSymbolDescs] + """ + return self._symbol_descs + + @symbol_descs.setter + def symbol_descs(self, symbol_descs): + """Sets the symbol_descs of this SymbolDetailItem. + + + :param symbol_descs: The symbol_descs of this SymbolDetailItem. # noqa: E501 + :type: list[SymbolDetailItemSymbolDescs] + """ + + self._symbol_descs = symbol_descs + + @property + def icon_link(self): + """Gets the icon_link of this SymbolDetailItem. # noqa: E501 + + + :return: The icon_link of this SymbolDetailItem. # noqa: E501 + :rtype: str + """ + return self._icon_link + + @icon_link.setter + def icon_link(self, icon_link): + """Sets the icon_link of this SymbolDetailItem. + + + :param icon_link: The icon_link of this SymbolDetailItem. # noqa: E501 + :type: str + """ + + self._icon_link = icon_link + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SymbolDetailItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SymbolDetailItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbol_detail_item_symbol_descs.py b/gate_api/models/symbol_detail_item_symbol_descs.py new file mode 100644 index 00000000..5ad3dcd4 --- /dev/null +++ b/gate_api/models/symbol_detail_item_symbol_descs.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SymbolDetailItemSymbolDescs(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'lang': 'str', + 'value': 'str' + } + + attribute_map = { + 'lang': 'lang', + 'value': 'value' + } + + def __init__(self, lang=None, value=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """SymbolDetailItemSymbolDescs - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._lang = None + self._value = None + self.discriminator = None + + if lang is not None: + self.lang = lang + if value is not None: + self.value = value + + @property + def lang(self): + """Gets the lang of this SymbolDetailItemSymbolDescs. # noqa: E501 + + + :return: The lang of this SymbolDetailItemSymbolDescs. # noqa: E501 + :rtype: str + """ + return self._lang + + @lang.setter + def lang(self, lang): + """Sets the lang of this SymbolDetailItemSymbolDescs. + + + :param lang: The lang of this SymbolDetailItemSymbolDescs. # noqa: E501 + :type: str + """ + + self._lang = lang + + @property + def value(self): + """Gets the value of this SymbolDetailItemSymbolDescs. # noqa: E501 + + + :return: The value of this SymbolDetailItemSymbolDescs. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this SymbolDetailItemSymbolDescs. + + + :param value: The value of this SymbolDetailItemSymbolDescs. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SymbolDetailItemSymbolDescs): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SymbolDetailItemSymbolDescs): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbol_list_item.py b/gate_api/models/symbol_list_item.py new file mode 100644 index 00000000..2d03bd1a --- /dev/null +++ b/gate_api/models/symbol_list_item.py @@ -0,0 +1,679 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SymbolListItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'exchange': 'str', + 'exchange_desc': 'str', + 'quote_currency': 'str', + 'quote_currency_precision': 'int', + 'fx_rate': 'str', + 'symbol_desc': 'str', + 'category': 'str', + 'trade_status': 'str', + 'trade_mode': 'int', + 'order_fill_timing': 'int', + 'icon_link': 'str', + 'quote_currency_symbol': 'str', + 'price_precision': 'int', + 'volume_precision': 'int', + 'is_ipo': 'bool', + 'ipo_price': 'str', + 'sell_price_protection': 'str', + 'buy_price_protection': 'str', + 'symbol_descs': 'list[I18nTxt]' + } + + attribute_map = { + 'symbol': 'symbol', + 'exchange': 'exchange', + 'exchange_desc': 'exchange_desc', + 'quote_currency': 'quote_currency', + 'quote_currency_precision': 'quote_currency_precision', + 'fx_rate': 'fx_rate', + 'symbol_desc': 'symbol_desc', + 'category': 'category', + 'trade_status': 'trade_status', + 'trade_mode': 'trade_mode', + 'order_fill_timing': 'order_fill_timing', + 'icon_link': 'icon_link', + 'quote_currency_symbol': 'quote_currency_symbol', + 'price_precision': 'price_precision', + 'volume_precision': 'volume_precision', + 'is_ipo': 'is_ipo', + 'ipo_price': 'ipo_price', + 'sell_price_protection': 'sell_price_protection', + 'buy_price_protection': 'buy_price_protection', + 'symbol_descs': 'symbol_descs' + } + + def __init__(self, symbol=None, exchange=None, exchange_desc=None, quote_currency=None, quote_currency_precision=None, fx_rate=None, symbol_desc=None, category=None, trade_status=None, trade_mode=None, order_fill_timing=None, icon_link=None, quote_currency_symbol=None, price_precision=None, volume_precision=None, is_ipo=None, ipo_price=None, sell_price_protection=None, buy_price_protection=None, symbol_descs=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, str, str, str, str, int, int, str, str, int, int, bool, str, str, str, list[I18nTxt], Configuration) -> None + """SymbolListItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._exchange = None + self._exchange_desc = None + self._quote_currency = None + self._quote_currency_precision = None + self._fx_rate = None + self._symbol_desc = None + self._category = None + self._trade_status = None + self._trade_mode = None + self._order_fill_timing = None + self._icon_link = None + self._quote_currency_symbol = None + self._price_precision = None + self._volume_precision = None + self._is_ipo = None + self._ipo_price = None + self._sell_price_protection = None + self._buy_price_protection = None + self._symbol_descs = None + self.discriminator = None + + if symbol is not None: + self.symbol = symbol + if exchange is not None: + self.exchange = exchange + if exchange_desc is not None: + self.exchange_desc = exchange_desc + if quote_currency is not None: + self.quote_currency = quote_currency + if quote_currency_precision is not None: + self.quote_currency_precision = quote_currency_precision + if fx_rate is not None: + self.fx_rate = fx_rate + if symbol_desc is not None: + self.symbol_desc = symbol_desc + if category is not None: + self.category = category + if trade_status is not None: + self.trade_status = trade_status + if trade_mode is not None: + self.trade_mode = trade_mode + if order_fill_timing is not None: + self.order_fill_timing = order_fill_timing + if icon_link is not None: + self.icon_link = icon_link + if quote_currency_symbol is not None: + self.quote_currency_symbol = quote_currency_symbol + if price_precision is not None: + self.price_precision = price_precision + if volume_precision is not None: + self.volume_precision = volume_precision + if is_ipo is not None: + self.is_ipo = is_ipo + if ipo_price is not None: + self.ipo_price = ipo_price + if sell_price_protection is not None: + self.sell_price_protection = sell_price_protection + if buy_price_protection is not None: + self.buy_price_protection = buy_price_protection + if symbol_descs is not None: + self.symbol_descs = symbol_descs + + @property + def symbol(self): + """Gets the symbol of this SymbolListItem. # noqa: E501 + + Symbol # noqa: E501 + + :return: The symbol of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this SymbolListItem. + + Symbol # noqa: E501 + + :param symbol: The symbol of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def exchange(self): + """Gets the exchange of this SymbolListItem. # noqa: E501 + + Exchange, supports us, hk, and kr # noqa: E501 + + :return: The exchange of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._exchange + + @exchange.setter + def exchange(self, exchange): + """Sets the exchange of this SymbolListItem. + + Exchange, supports us, hk, and kr # noqa: E501 + + :param exchange: The exchange of this SymbolListItem. # noqa: E501 + :type: str + """ + allowed_values = ["us", "hk", "kr"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and exchange not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `exchange` ({0}), must be one of {1}" # noqa: E501 + .format(exchange, allowed_values) + ) + + self._exchange = exchange + + @property + def exchange_desc(self): + """Gets the exchange_desc of this SymbolListItem. # noqa: E501 + + Exchange description # noqa: E501 + + :return: The exchange_desc of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._exchange_desc + + @exchange_desc.setter + def exchange_desc(self, exchange_desc): + """Sets the exchange_desc of this SymbolListItem. + + Exchange description # noqa: E501 + + :param exchange_desc: The exchange_desc of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._exchange_desc = exchange_desc + + @property + def quote_currency(self): + """Gets the quote_currency of this SymbolListItem. # noqa: E501 + + Quote currency # noqa: E501 + + :return: The quote_currency of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._quote_currency + + @quote_currency.setter + def quote_currency(self, quote_currency): + """Sets the quote_currency of this SymbolListItem. + + Quote currency # noqa: E501 + + :param quote_currency: The quote_currency of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._quote_currency = quote_currency + + @property + def quote_currency_precision(self): + """Gets the quote_currency_precision of this SymbolListItem. # noqa: E501 + + Quote currency precision # noqa: E501 + + :return: The quote_currency_precision of this SymbolListItem. # noqa: E501 + :rtype: int + """ + return self._quote_currency_precision + + @quote_currency_precision.setter + def quote_currency_precision(self, quote_currency_precision): + """Sets the quote_currency_precision of this SymbolListItem. + + Quote currency precision # noqa: E501 + + :param quote_currency_precision: The quote_currency_precision of this SymbolListItem. # noqa: E501 + :type: int + """ + + self._quote_currency_precision = quote_currency_precision + + @property + def fx_rate(self): + """Gets the fx_rate of this SymbolListItem. # noqa: E501 + + Quote currency to USD exchange rate # noqa: E501 + + :return: The fx_rate of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._fx_rate + + @fx_rate.setter + def fx_rate(self, fx_rate): + """Sets the fx_rate of this SymbolListItem. + + Quote currency to USD exchange rate # noqa: E501 + + :param fx_rate: The fx_rate of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._fx_rate = fx_rate + + @property + def symbol_desc(self): + """Gets the symbol_desc of this SymbolListItem. # noqa: E501 + + Symbol description # noqa: E501 + + :return: The symbol_desc of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._symbol_desc + + @symbol_desc.setter + def symbol_desc(self, symbol_desc): + """Sets the symbol_desc of this SymbolListItem. + + Symbol description # noqa: E501 + + :param symbol_desc: The symbol_desc of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._symbol_desc = symbol_desc + + @property + def category(self): + """Gets the category of this SymbolListItem. # noqa: E501 + + Category # noqa: E501 + + :return: The category of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this SymbolListItem. + + Category # noqa: E501 + + :param category: The category of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._category = category + + @property + def trade_status(self): + """Gets the trade_status of this SymbolListItem. # noqa: E501 + + Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. # noqa: E501 + + :return: The trade_status of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._trade_status + + @trade_status.setter + def trade_status(self, trade_status): + """Sets the trade_status of this SymbolListItem. + + Trading status. - pre_market: Pre-market. - open: Regular trading session. - post_market: Post-market. - closed: Market closed. - gt_lp: GT LP session. # noqa: E501 + + :param trade_status: The trade_status of this SymbolListItem. # noqa: E501 + :type: str + """ + allowed_values = ["pre_market", "open", "post_market", "closed", "gt_lp"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and trade_status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `trade_status` ({0}), must be one of {1}" # noqa: E501 + .format(trade_status, allowed_values) + ) + + self._trade_status = trade_status + + @property + def trade_mode(self): + """Gets the trade_mode of this SymbolListItem. # noqa: E501 + + Current session trading mode. - 0: Trading disabled. - 1: Buy only. - 2: Sell only. - 4: Buy and sell supported. # noqa: E501 + + :return: The trade_mode of this SymbolListItem. # noqa: E501 + :rtype: int + """ + return self._trade_mode + + @trade_mode.setter + def trade_mode(self, trade_mode): + """Sets the trade_mode of this SymbolListItem. + + Current session trading mode. - 0: Trading disabled. - 1: Buy only. - 2: Sell only. - 4: Buy and sell supported. # noqa: E501 + + :param trade_mode: The trade_mode of this SymbolListItem. # noqa: E501 + :type: int + """ + allowed_values = [0, 1, 2, 4] # noqa: E501 + if self.local_vars_configuration.client_side_validation and trade_mode not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `trade_mode` ({0}), must be one of {1}" # noqa: E501 + .format(trade_mode, allowed_values) + ) + + self._trade_mode = trade_mode + + @property + def order_fill_timing(self): + """Gets the order_fill_timing of this SymbolListItem. # noqa: E501 + + Order fill timing (1=immediate, 2=after pre-market opens, 3=after regular session opens) # noqa: E501 + + :return: The order_fill_timing of this SymbolListItem. # noqa: E501 + :rtype: int + """ + return self._order_fill_timing + + @order_fill_timing.setter + def order_fill_timing(self, order_fill_timing): + """Sets the order_fill_timing of this SymbolListItem. + + Order fill timing (1=immediate, 2=after pre-market opens, 3=after regular session opens) # noqa: E501 + + :param order_fill_timing: The order_fill_timing of this SymbolListItem. # noqa: E501 + :type: int + """ + allowed_values = [1, 2, 3] # noqa: E501 + if self.local_vars_configuration.client_side_validation and order_fill_timing not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `order_fill_timing` ({0}), must be one of {1}" # noqa: E501 + .format(order_fill_timing, allowed_values) + ) + + self._order_fill_timing = order_fill_timing + + @property + def icon_link(self): + """Gets the icon_link of this SymbolListItem. # noqa: E501 + + Icon URL # noqa: E501 + + :return: The icon_link of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._icon_link + + @icon_link.setter + def icon_link(self, icon_link): + """Sets the icon_link of this SymbolListItem. + + Icon URL # noqa: E501 + + :param icon_link: The icon_link of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._icon_link = icon_link + + @property + def quote_currency_symbol(self): + """Gets the quote_currency_symbol of this SymbolListItem. # noqa: E501 + + Quote currency symbol # noqa: E501 + + :return: The quote_currency_symbol of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._quote_currency_symbol + + @quote_currency_symbol.setter + def quote_currency_symbol(self, quote_currency_symbol): + """Sets the quote_currency_symbol of this SymbolListItem. + + Quote currency symbol # noqa: E501 + + :param quote_currency_symbol: The quote_currency_symbol of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._quote_currency_symbol = quote_currency_symbol + + @property + def price_precision(self): + """Gets the price_precision of this SymbolListItem. # noqa: E501 + + Price precision # noqa: E501 + + :return: The price_precision of this SymbolListItem. # noqa: E501 + :rtype: int + """ + return self._price_precision + + @price_precision.setter + def price_precision(self, price_precision): + """Sets the price_precision of this SymbolListItem. + + Price precision # noqa: E501 + + :param price_precision: The price_precision of this SymbolListItem. # noqa: E501 + :type: int + """ + + self._price_precision = price_precision + + @property + def volume_precision(self): + """Gets the volume_precision of this SymbolListItem. # noqa: E501 + + Quantity precision # noqa: E501 + + :return: The volume_precision of this SymbolListItem. # noqa: E501 + :rtype: int + """ + return self._volume_precision + + @volume_precision.setter + def volume_precision(self, volume_precision): + """Sets the volume_precision of this SymbolListItem. + + Quantity precision # noqa: E501 + + :param volume_precision: The volume_precision of this SymbolListItem. # noqa: E501 + :type: int + """ + + self._volume_precision = volume_precision + + @property + def is_ipo(self): + """Gets the is_ipo of this SymbolListItem. # noqa: E501 + + Whether it is an IPO symbol # noqa: E501 + + :return: The is_ipo of this SymbolListItem. # noqa: E501 + :rtype: bool + """ + return self._is_ipo + + @is_ipo.setter + def is_ipo(self, is_ipo): + """Sets the is_ipo of this SymbolListItem. + + Whether it is an IPO symbol # noqa: E501 + + :param is_ipo: The is_ipo of this SymbolListItem. # noqa: E501 + :type: bool + """ + + self._is_ipo = is_ipo + + @property + def ipo_price(self): + """Gets the ipo_price of this SymbolListItem. # noqa: E501 + + IPO price # noqa: E501 + + :return: The ipo_price of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._ipo_price + + @ipo_price.setter + def ipo_price(self, ipo_price): + """Sets the ipo_price of this SymbolListItem. + + IPO price # noqa: E501 + + :param ipo_price: The ipo_price of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._ipo_price = ipo_price + + @property + def sell_price_protection(self): + """Gets the sell_price_protection of this SymbolListItem. # noqa: E501 + + Sell price protection rate # noqa: E501 + + :return: The sell_price_protection of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._sell_price_protection + + @sell_price_protection.setter + def sell_price_protection(self, sell_price_protection): + """Sets the sell_price_protection of this SymbolListItem. + + Sell price protection rate # noqa: E501 + + :param sell_price_protection: The sell_price_protection of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._sell_price_protection = sell_price_protection + + @property + def buy_price_protection(self): + """Gets the buy_price_protection of this SymbolListItem. # noqa: E501 + + Buy price protection rate # noqa: E501 + + :return: The buy_price_protection of this SymbolListItem. # noqa: E501 + :rtype: str + """ + return self._buy_price_protection + + @buy_price_protection.setter + def buy_price_protection(self, buy_price_protection): + """Sets the buy_price_protection of this SymbolListItem. + + Buy price protection rate # noqa: E501 + + :param buy_price_protection: The buy_price_protection of this SymbolListItem. # noqa: E501 + :type: str + """ + + self._buy_price_protection = buy_price_protection + + @property + def symbol_descs(self): + """Gets the symbol_descs of this SymbolListItem. # noqa: E501 + + Multilingual symbol description # noqa: E501 + + :return: The symbol_descs of this SymbolListItem. # noqa: E501 + :rtype: list[I18nTxt] + """ + return self._symbol_descs + + @symbol_descs.setter + def symbol_descs(self, symbol_descs): + """Sets the symbol_descs of this SymbolListItem. + + Multilingual symbol description # noqa: E501 + + :param symbol_descs: The symbol_descs of this SymbolListItem. # noqa: E501 + :type: list[I18nTxt] + """ + + self._symbol_descs = symbol_descs + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SymbolListItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SymbolListItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbols.py b/gate_api/models/symbols.py new file mode 100644 index 00000000..ca232ff1 --- /dev/null +++ b/gate_api/models/symbols.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Symbols(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'SymbolsData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, SymbolsData, Configuration) -> None + """Symbols - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this Symbols. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this Symbols. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this Symbols. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this Symbols. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this Symbols. # noqa: E501 + + + :return: The data of this Symbols. # noqa: E501 + :rtype: SymbolsData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this Symbols. + + + :param data: The data of this Symbols. # noqa: E501 + :type: SymbolsData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Symbols): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Symbols): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbols2.py b/gate_api/models/symbols2.py new file mode 100644 index 00000000..1e8865e2 --- /dev/null +++ b/gate_api/models/symbols2.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Symbols2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'Symbols2Data', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (Symbols2Data, int, Configuration) -> None + """Symbols2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this Symbols2. # noqa: E501 + + + :return: The data of this Symbols2. # noqa: E501 + :rtype: Symbols2Data + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this Symbols2. + + + :param data: The data of this Symbols2. # noqa: E501 + :type: Symbols2Data + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this Symbols2. # noqa: E501 + + + :return: The timestamp of this Symbols2. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this Symbols2. + + + :param timestamp: The timestamp of this Symbols2. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Symbols2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Symbols2): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbols2_data.py b/gate_api/models/symbols2_data.py new file mode 100644 index 00000000..e166921b --- /dev/null +++ b/gate_api/models/symbols2_data.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Symbols2Data(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'total': 'int', + 'total_page': 'int', + 'list': 'list[SymbolListItem]' + } + + attribute_map = { + 'total': 'total', + 'total_page': 'total_page', + 'list': 'list' + } + + def __init__(self, total=None, total_page=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, list[SymbolListItem], Configuration) -> None + """Symbols2Data - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._total_page = None + self._list = None + self.discriminator = None + + if total is not None: + self.total = total + if total_page is not None: + self.total_page = total_page + if list is not None: + self.list = list + + @property + def total(self): + """Gets the total of this Symbols2Data. # noqa: E501 + + Total quantity # noqa: E501 + + :return: The total of this Symbols2Data. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this Symbols2Data. + + Total quantity # noqa: E501 + + :param total: The total of this Symbols2Data. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def total_page(self): + """Gets the total_page of this Symbols2Data. # noqa: E501 + + Total pages # noqa: E501 + + :return: The total_page of this Symbols2Data. # noqa: E501 + :rtype: int + """ + return self._total_page + + @total_page.setter + def total_page(self, total_page): + """Sets the total_page of this Symbols2Data. + + Total pages # noqa: E501 + + :param total_page: The total_page of this Symbols2Data. # noqa: E501 + :type: int + """ + + self._total_page = total_page + + @property + def list(self): + """Gets the list of this Symbols2Data. # noqa: E501 + + Symbol list # noqa: E501 + + :return: The list of this Symbols2Data. # noqa: E501 + :rtype: list[SymbolListItem] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this Symbols2Data. + + Symbol list # noqa: E501 + + :param list: The list of this Symbols2Data. # noqa: E501 + :type: list[SymbolListItem] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Symbols2Data): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Symbols2Data): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbols_data.py b/gate_api/models/symbols_data.py new file mode 100644 index 00000000..6e1de4c6 --- /dev/null +++ b/gate_api/models/symbols_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SymbolsData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'list': 'list[SymbolsDataList]' + } + + attribute_map = { + 'list': 'list' + } + + def __init__(self, list=None, local_vars_configuration=None): # noqa: E501 + # type: (list[SymbolsDataList], Configuration) -> None + """SymbolsData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._list = None + self.discriminator = None + + if list is not None: + self.list = list + + @property + def list(self): + """Gets the list of this SymbolsData. # noqa: E501 + + Trading symbol list # noqa: E501 + + :return: The list of this SymbolsData. # noqa: E501 + :rtype: list[SymbolsDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this SymbolsData. + + Trading symbol list # noqa: E501 + + :param list: The list of this SymbolsData. # noqa: E501 + :type: list[SymbolsDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SymbolsData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SymbolsData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/symbols_data_list.py b/gate_api/models/symbols_data_list.py new file mode 100644 index 00000000..f7c706ae --- /dev/null +++ b/gate_api/models/symbols_data_list.py @@ -0,0 +1,431 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class SymbolsDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'symbol_desc': 'str', + 'category_id': 'int', + 'status': 'str', + 'trade_mode': 'str', + 'icon_link': 'str', + 'close_time': 'int', + 'open_time': 'int', + 'next_open_time': 'int', + 'settlement_currency': 'str', + 'settlement_currency_symbol': 'str', + 'price_precision': 'int' + } + + attribute_map = { + 'symbol': 'symbol', + 'symbol_desc': 'symbol_desc', + 'category_id': 'category_id', + 'status': 'status', + 'trade_mode': 'trade_mode', + 'icon_link': 'icon_link', + 'close_time': 'close_time', + 'open_time': 'open_time', + 'next_open_time': 'next_open_time', + 'settlement_currency': 'settlement_currency', + 'settlement_currency_symbol': 'settlement_currency_symbol', + 'price_precision': 'price_precision' + } + + def __init__(self, symbol=None, symbol_desc=None, category_id=None, status=None, trade_mode=None, icon_link=None, close_time=None, open_time=None, next_open_time=None, settlement_currency=None, settlement_currency_symbol=None, price_precision=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, str, str, str, int, int, int, str, str, int, Configuration) -> None + """SymbolsDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._symbol_desc = None + self._category_id = None + self._status = None + self._trade_mode = None + self._icon_link = None + self._close_time = None + self._open_time = None + self._next_open_time = None + self._settlement_currency = None + self._settlement_currency_symbol = None + self._price_precision = None + self.discriminator = None + + if symbol is not None: + self.symbol = symbol + if symbol_desc is not None: + self.symbol_desc = symbol_desc + if category_id is not None: + self.category_id = category_id + if status is not None: + self.status = status + if trade_mode is not None: + self.trade_mode = trade_mode + if icon_link is not None: + self.icon_link = icon_link + if close_time is not None: + self.close_time = close_time + if open_time is not None: + self.open_time = open_time + if next_open_time is not None: + self.next_open_time = next_open_time + if settlement_currency is not None: + self.settlement_currency = settlement_currency + if settlement_currency_symbol is not None: + self.settlement_currency_symbol = settlement_currency_symbol + if price_precision is not None: + self.price_precision = price_precision + + @property + def symbol(self): + """Gets the symbol of this SymbolsDataList. # noqa: E501 + + Trading symbol code # noqa: E501 + + :return: The symbol of this SymbolsDataList. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this SymbolsDataList. + + Trading symbol code # noqa: E501 + + :param symbol: The symbol of this SymbolsDataList. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def symbol_desc(self): + """Gets the symbol_desc of this SymbolsDataList. # noqa: E501 + + Trading symbol description # noqa: E501 + + :return: The symbol_desc of this SymbolsDataList. # noqa: E501 + :rtype: str + """ + return self._symbol_desc + + @symbol_desc.setter + def symbol_desc(self, symbol_desc): + """Sets the symbol_desc of this SymbolsDataList. + + Trading symbol description # noqa: E501 + + :param symbol_desc: The symbol_desc of this SymbolsDataList. # noqa: E501 + :type: str + """ + + self._symbol_desc = symbol_desc + + @property + def category_id(self): + """Gets the category_id of this SymbolsDataList. # noqa: E501 + + Category ID # noqa: E501 + + :return: The category_id of this SymbolsDataList. # noqa: E501 + :rtype: int + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """Sets the category_id of this SymbolsDataList. + + Category ID # noqa: E501 + + :param category_id: The category_id of this SymbolsDataList. # noqa: E501 + :type: int + """ + + self._category_id = category_id + + @property + def status(self): + """Gets the status of this SymbolsDataList. # noqa: E501 + + Trading status (open=tradable, closed=non-tradable) # noqa: E501 + + :return: The status of this SymbolsDataList. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this SymbolsDataList. + + Trading status (open=tradable, closed=non-tradable) # noqa: E501 + + :param status: The status of this SymbolsDataList. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def trade_mode(self): + """Gets the trade_mode of this SymbolsDataList. # noqa: E501 + + Trading mode code (0=disabled, 1=long only, 2=short only, 3=close only, 4=full trading access) # noqa: E501 + + :return: The trade_mode of this SymbolsDataList. # noqa: E501 + :rtype: str + """ + return self._trade_mode + + @trade_mode.setter + def trade_mode(self, trade_mode): + """Sets the trade_mode of this SymbolsDataList. + + Trading mode code (0=disabled, 1=long only, 2=short only, 3=close only, 4=full trading access) # noqa: E501 + + :param trade_mode: The trade_mode of this SymbolsDataList. # noqa: E501 + :type: str + """ + + self._trade_mode = trade_mode + + @property + def icon_link(self): + """Gets the icon_link of this SymbolsDataList. # noqa: E501 + + Symbol icon URL # noqa: E501 + + :return: The icon_link of this SymbolsDataList. # noqa: E501 + :rtype: str + """ + return self._icon_link + + @icon_link.setter + def icon_link(self, icon_link): + """Sets the icon_link of this SymbolsDataList. + + Symbol icon URL # noqa: E501 + + :param icon_link: The icon_link of this SymbolsDataList. # noqa: E501 + :type: str + """ + + self._icon_link = icon_link + + @property + def close_time(self): + """Gets the close_time of this SymbolsDataList. # noqa: E501 + + Close time (Unix timestamp in seconds) # noqa: E501 + + :return: The close_time of this SymbolsDataList. # noqa: E501 + :rtype: int + """ + return self._close_time + + @close_time.setter + def close_time(self, close_time): + """Sets the close_time of this SymbolsDataList. + + Close time (Unix timestamp in seconds) # noqa: E501 + + :param close_time: The close_time of this SymbolsDataList. # noqa: E501 + :type: int + """ + + self._close_time = close_time + + @property + def open_time(self): + """Gets the open_time of this SymbolsDataList. # noqa: E501 + + Open time (Unix timestamp in seconds) # noqa: E501 + + :return: The open_time of this SymbolsDataList. # noqa: E501 + :rtype: int + """ + return self._open_time + + @open_time.setter + def open_time(self, open_time): + """Sets the open_time of this SymbolsDataList. + + Open time (Unix timestamp in seconds) # noqa: E501 + + :param open_time: The open_time of this SymbolsDataList. # noqa: E501 + :type: int + """ + + self._open_time = open_time + + @property + def next_open_time(self): + """Gets the next_open_time of this SymbolsDataList. # noqa: E501 + + Next open time (Unix timestamp in seconds, 0 means none) # noqa: E501 + + :return: The next_open_time of this SymbolsDataList. # noqa: E501 + :rtype: int + """ + return self._next_open_time + + @next_open_time.setter + def next_open_time(self, next_open_time): + """Sets the next_open_time of this SymbolsDataList. + + Next open time (Unix timestamp in seconds, 0 means none) # noqa: E501 + + :param next_open_time: The next_open_time of this SymbolsDataList. # noqa: E501 + :type: int + """ + + self._next_open_time = next_open_time + + @property + def settlement_currency(self): + """Gets the settlement_currency of this SymbolsDataList. # noqa: E501 + + Settlement currency # noqa: E501 + + :return: The settlement_currency of this SymbolsDataList. # noqa: E501 + :rtype: str + """ + return self._settlement_currency + + @settlement_currency.setter + def settlement_currency(self, settlement_currency): + """Sets the settlement_currency of this SymbolsDataList. + + Settlement currency # noqa: E501 + + :param settlement_currency: The settlement_currency of this SymbolsDataList. # noqa: E501 + :type: str + """ + + self._settlement_currency = settlement_currency + + @property + def settlement_currency_symbol(self): + """Gets the settlement_currency_symbol of this SymbolsDataList. # noqa: E501 + + Settlement currency symbol # noqa: E501 + + :return: The settlement_currency_symbol of this SymbolsDataList. # noqa: E501 + :rtype: str + """ + return self._settlement_currency_symbol + + @settlement_currency_symbol.setter + def settlement_currency_symbol(self, settlement_currency_symbol): + """Sets the settlement_currency_symbol of this SymbolsDataList. + + Settlement currency symbol # noqa: E501 + + :param settlement_currency_symbol: The settlement_currency_symbol of this SymbolsDataList. # noqa: E501 + :type: str + """ + + self._settlement_currency_symbol = settlement_currency_symbol + + @property + def price_precision(self): + """Gets the price_precision of this SymbolsDataList. # noqa: E501 + + Price precision (decimal places) # noqa: E501 + + :return: The price_precision of this SymbolsDataList. # noqa: E501 + :rtype: int + """ + return self._price_precision + + @price_precision.setter + def price_precision(self, price_precision): + """Sets the price_precision of this SymbolsDataList. + + Price precision (decimal places) # noqa: E501 + + :param price_precision: The price_precision of this SymbolsDataList. # noqa: E501 + :type: int + """ + + self._price_precision = price_precision + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SymbolsDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SymbolsDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/tokens.py b/gate_api/models/tokens.py new file mode 100644 index 00000000..e5fb0a8e --- /dev/null +++ b/gate_api/models/tokens.py @@ -0,0 +1,291 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Tokens(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency': 'str', + 'name': 'str', + 'chain': 'str', + 'address': 'str', + 'amount_precision': 'int', + 'precision': 'int', + 'status': 'int' + } + + attribute_map = { + 'currency': 'currency', + 'name': 'name', + 'chain': 'chain', + 'address': 'address', + 'amount_precision': 'amount_precision', + 'precision': 'precision', + 'status': 'status' + } + + def __init__(self, currency=None, name=None, chain=None, address=None, amount_precision=None, precision=None, status=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, int, int, int, Configuration) -> None + """Tokens - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._name = None + self._chain = None + self._address = None + self._amount_precision = None + self._precision = None + self._status = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if name is not None: + self.name = name + if chain is not None: + self.chain = chain + if address is not None: + self.address = address + if amount_precision is not None: + self.amount_precision = amount_precision + if precision is not None: + self.precision = precision + if status is not None: + self.status = status + + @property + def currency(self): + """Gets the currency of this Tokens. # noqa: E501 + + Currency symbol # noqa: E501 + + :return: The currency of this Tokens. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this Tokens. + + Currency symbol # noqa: E501 + + :param currency: The currency of this Tokens. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def name(self): + """Gets the name of this Tokens. # noqa: E501 + + Currency name # noqa: E501 + + :return: The name of this Tokens. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Tokens. + + Currency name # noqa: E501 + + :param name: The name of this Tokens. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def chain(self): + """Gets the chain of this Tokens. # noqa: E501 + + The main chain corresponding to the coin # noqa: E501 + + :return: The chain of this Tokens. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this Tokens. + + The main chain corresponding to the coin # noqa: E501 + + :param chain: The chain of this Tokens. # noqa: E501 + :type: str + """ + + self._chain = chain + + @property + def address(self): + """Gets the address of this Tokens. # noqa: E501 + + Contract Address # noqa: E501 + + :return: The address of this Tokens. # noqa: E501 + :rtype: str + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this Tokens. + + Contract Address # noqa: E501 + + :param address: The address of this Tokens. # noqa: E501 + :type: str + """ + + self._address = address + + @property + def amount_precision(self): + """Gets the amount_precision of this Tokens. # noqa: E501 + + Quantity precision # noqa: E501 + + :return: The amount_precision of this Tokens. # noqa: E501 + :rtype: int + """ + return self._amount_precision + + @amount_precision.setter + def amount_precision(self, amount_precision): + """Sets the amount_precision of this Tokens. + + Quantity precision # noqa: E501 + + :param amount_precision: The amount_precision of this Tokens. # noqa: E501 + :type: int + """ + + self._amount_precision = amount_precision + + @property + def precision(self): + """Gets the precision of this Tokens. # noqa: E501 + + Price precision # noqa: E501 + + :return: The precision of this Tokens. # noqa: E501 + :rtype: int + """ + return self._precision + + @precision.setter + def precision(self, precision): + """Sets the precision of this Tokens. + + Price precision # noqa: E501 + + :param precision: The precision of this Tokens. # noqa: E501 + :type: int + """ + + self._precision = precision + + @property + def status(self): + """Gets the status of this Tokens. # noqa: E501 + + Currency Trading Status - `1` : Normal trading - `2` : Suspended trading - `3` : Delisted # noqa: E501 + + :return: The status of this Tokens. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Tokens. + + Currency Trading Status - `1` : Normal trading - `2` : Suspended trading - `3` : Delisted # noqa: E501 + + :param status: The status of this Tokens. # noqa: E501 + :type: int + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Tokens): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Tokens): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/total_balance.py b/gate_api/models/total_balance.py index 9dd8b785..39b055d4 100644 --- a/gate_api/models/total_balance.py +++ b/gate_api/models/total_balance.py @@ -83,7 +83,7 @@ def total(self, total): def details(self): """Gets the details of this TotalBalance. # noqa: E501 - Total balances in different accounts - cross_margin: cross margin account - spot: spot account - finance: finance account - margin: margin account - quant: quant account - futures: perpetual contract account - delivery: delivery contract account - warrant: warrant account - cbbc: CBBC account # noqa: E501 + Total Balances of All Accounts - cross_margin: Cross Margin Account - spot: Spot Account - finance: Finance Account - margin: Margin Account - quant: Quantitative Account - futures: Futures Account (Perpetual Contracts) - delivery: Delivery Account (Delivery Contracts) - warrant: Warrant Account - cbbc: CBBC Account (Covered Bull/Bear Contract) - meme_box: Alpha Account - options: Options Account - payment: Payment Account # noqa: E501 :return: The details of this TotalBalance. # noqa: E501 :rtype: dict(str, AccountBalance) @@ -94,7 +94,7 @@ def details(self): def details(self, details): """Sets the details of this TotalBalance. - Total balances in different accounts - cross_margin: cross margin account - spot: spot account - finance: finance account - margin: margin account - quant: quant account - futures: perpetual contract account - delivery: delivery contract account - warrant: warrant account - cbbc: CBBC account # noqa: E501 + Total Balances of All Accounts - cross_margin: Cross Margin Account - spot: Spot Account - finance: Finance Account - margin: Margin Account - quant: Quantitative Account - futures: Futures Account (Perpetual Contracts) - delivery: Delivery Account (Delivery Contracts) - warrant: Warrant Account - cbbc: CBBC Account (Covered Bull/Bear Contract) - meme_box: Alpha Account - options: Options Account - payment: Payment Account # noqa: E501 :param details: The details of this TotalBalance. # noqa: E501 :type: dict(str, AccountBalance) diff --git a/gate_api/models/trad_fi_close_position_request.py b/gate_api/models/trad_fi_close_position_request.py new file mode 100644 index 00000000..e3cc58f1 --- /dev/null +++ b/gate_api/models/trad_fi_close_position_request.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiClosePositionRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'close_type': 'int', + 'close_volume': 'str' + } + + attribute_map = { + 'close_type': 'close_type', + 'close_volume': 'close_volume' + } + + def __init__(self, close_type=None, close_volume=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """TradFiClosePositionRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._close_type = None + self._close_volume = None + self.discriminator = None + + self.close_type = close_type + self.close_volume = close_volume + + @property + def close_type(self): + """Gets the close_type of this TradFiClosePositionRequest. # noqa: E501 + + Close Type Description: - 1: Partial Close (close_volume is required) - 2: Full Close (close_volume is not required) # noqa: E501 + + :return: The close_type of this TradFiClosePositionRequest. # noqa: E501 + :rtype: int + """ + return self._close_type + + @close_type.setter + def close_type(self, close_type): + """Sets the close_type of this TradFiClosePositionRequest. + + Close Type Description: - 1: Partial Close (close_volume is required) - 2: Full Close (close_volume is not required) # noqa: E501 + + :param close_type: The close_type of this TradFiClosePositionRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and close_type is None: # noqa: E501 + raise ValueError("Invalid value for `close_type`, must not be `None`") # noqa: E501 + allowed_values = [1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and close_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `close_type` ({0}), must be one of {1}" # noqa: E501 + .format(close_type, allowed_values) + ) + + self._close_type = close_type + + @property + def close_volume(self): + """Gets the close_volume of this TradFiClosePositionRequest. # noqa: E501 + + Close Volume Description: - Required when close_type = 1 - Ignored when close_type = 2 # noqa: E501 + + :return: The close_volume of this TradFiClosePositionRequest. # noqa: E501 + :rtype: str + """ + return self._close_volume + + @close_volume.setter + def close_volume(self, close_volume): + """Sets the close_volume of this TradFiClosePositionRequest. + + Close Volume Description: - Required when close_type = 1 - Ignored when close_type = 2 # noqa: E501 + + :param close_volume: The close_volume of this TradFiClosePositionRequest. # noqa: E501 + :type: str + """ + + self._close_volume = close_volume + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiClosePositionRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiClosePositionRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_error.py b/gate_api/models/trad_fi_error.py new file mode 100644 index 00000000..7a6cd503 --- /dev/null +++ b/gate_api/models/trad_fi_error.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiError(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label': 'str', + 'message': 'str', + 'timestamp': 'int' + } + + attribute_map = { + 'label': 'label', + 'message': 'message', + 'timestamp': 'timestamp' + } + + def __init__(self, label=None, message=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, Configuration) -> None + """TradFiError - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._label = None + self._message = None + self._timestamp = None + self.discriminator = None + + if label is not None: + self.label = label + if message is not None: + self.message = message + if timestamp is not None: + self.timestamp = timestamp + + @property + def label(self): + """Gets the label of this TradFiError. # noqa: E501 + + Business status code, non-empty indicates request exception, please refer to TradFi error enumeration in documentation # noqa: E501 + + :return: The label of this TradFiError. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this TradFiError. + + Business status code, non-empty indicates request exception, please refer to TradFi error enumeration in documentation # noqa: E501 + + :param label: The label of this TradFiError. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this TradFiError. # noqa: E501 + + Return message, returned when request error occurs # noqa: E501 + + :return: The message of this TradFiError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this TradFiError. + + Return message, returned when request error occurs # noqa: E501 + + :param message: The message of this TradFiError. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def timestamp(self): + """Gets the timestamp of this TradFiError. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this TradFiError. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this TradFiError. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this TradFiError. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiError): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_order_request.py b/gate_api/models/trad_fi_order_request.py new file mode 100644 index 00000000..72919a06 --- /dev/null +++ b/gate_api/models/trad_fi_order_request.py @@ -0,0 +1,308 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'price': 'str', + 'price_type': 'str', + 'side': 'int', + 'symbol': 'str', + 'volume': 'str', + 'price_tp': 'str', + 'price_sl': 'str' + } + + attribute_map = { + 'price': 'price', + 'price_type': 'price_type', + 'side': 'side', + 'symbol': 'symbol', + 'volume': 'volume', + 'price_tp': 'price_tp', + 'price_sl': 'price_sl' + } + + def __init__(self, price=None, price_type=None, side=None, symbol=None, volume=None, price_tp=None, price_sl=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, str, str, str, str, Configuration) -> None + """TradFiOrderRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._price = None + self._price_type = None + self._side = None + self._symbol = None + self._volume = None + self._price_tp = None + self._price_sl = None + self.discriminator = None + + self.price = price + self.price_type = price_type + self.side = side + self.symbol = symbol + self.volume = volume + if price_tp is not None: + self.price_tp = price_tp + if price_sl is not None: + self.price_sl = price_sl + + @property + def price(self): + """Gets the price of this TradFiOrderRequest. # noqa: E501 + + Order price # noqa: E501 + + :return: The price of this TradFiOrderRequest. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this TradFiOrderRequest. + + Order price # noqa: E501 + + :param price: The price of this TradFiOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price is None: # noqa: E501 + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + @property + def price_type(self): + """Gets the price_type of this TradFiOrderRequest. # noqa: E501 + + Price type (trigger=trigger price, market=market price) # noqa: E501 + + :return: The price_type of this TradFiOrderRequest. # noqa: E501 + :rtype: str + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this TradFiOrderRequest. + + Price type (trigger=trigger price, market=market price) # noqa: E501 + + :param price_type: The price_type of this TradFiOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price_type is None: # noqa: E501 + raise ValueError("Invalid value for `price_type`, must not be `None`") # noqa: E501 + allowed_values = ["trigger", "market"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def side(self): + """Gets the side of this TradFiOrderRequest. # noqa: E501 + + Side (1=sell, 2=buy) # noqa: E501 + + :return: The side of this TradFiOrderRequest. # noqa: E501 + :rtype: int + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this TradFiOrderRequest. + + Side (1=sell, 2=buy) # noqa: E501 + + :param side: The side of this TradFiOrderRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + allowed_values = [1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) + ) + + self._side = side + + @property + def symbol(self): + """Gets the symbol of this TradFiOrderRequest. # noqa: E501 + + Trading symbol code # noqa: E501 + + :return: The symbol of this TradFiOrderRequest. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this TradFiOrderRequest. + + Trading symbol code # noqa: E501 + + :param symbol: The symbol of this TradFiOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def volume(self): + """Gets the volume of this TradFiOrderRequest. # noqa: E501 + + Order quantity # noqa: E501 + + :return: The volume of this TradFiOrderRequest. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this TradFiOrderRequest. + + Order quantity # noqa: E501 + + :param volume: The volume of this TradFiOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and volume is None: # noqa: E501 + raise ValueError("Invalid value for `volume`, must not be `None`") # noqa: E501 + + self._volume = volume + + @property + def price_tp(self): + """Gets the price_tp of this TradFiOrderRequest. # noqa: E501 + + Take profit price (optional) # noqa: E501 + + :return: The price_tp of this TradFiOrderRequest. # noqa: E501 + :rtype: str + """ + return self._price_tp + + @price_tp.setter + def price_tp(self, price_tp): + """Sets the price_tp of this TradFiOrderRequest. + + Take profit price (optional) # noqa: E501 + + :param price_tp: The price_tp of this TradFiOrderRequest. # noqa: E501 + :type: str + """ + + self._price_tp = price_tp + + @property + def price_sl(self): + """Gets the price_sl of this TradFiOrderRequest. # noqa: E501 + + Stop loss price (optional) # noqa: E501 + + :return: The price_sl of this TradFiOrderRequest. # noqa: E501 + :rtype: str + """ + return self._price_sl + + @price_sl.setter + def price_sl(self, price_sl): + """Sets the price_sl of this TradFiOrderRequest. + + Stop loss price (optional) # noqa: E501 + + :param price_sl: The price_sl of this TradFiOrderRequest. # noqa: E501 + :type: str + """ + + self._price_sl = price_sl + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_order_update_request.py b/gate_api/models/trad_fi_order_update_request.py new file mode 100644 index 00000000..42b8b367 --- /dev/null +++ b/gate_api/models/trad_fi_order_update_request.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiOrderUpdateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'price': 'str', + 'price_tp': 'str', + 'price_sl': 'str' + } + + attribute_map = { + 'price': 'price', + 'price_tp': 'price_tp', + 'price_sl': 'price_sl' + } + + def __init__(self, price=None, price_tp=None, price_sl=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """TradFiOrderUpdateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._price = None + self._price_tp = None + self._price_sl = None + self.discriminator = None + + self.price = price + self.price_tp = price_tp + self.price_sl = price_sl + + @property + def price(self): + """Gets the price of this TradFiOrderUpdateRequest. # noqa: E501 + + Price Description: - Required # noqa: E501 + + :return: The price of this TradFiOrderUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this TradFiOrderUpdateRequest. + + Price Description: - Required # noqa: E501 + + :param price: The price of this TradFiOrderUpdateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price is None: # noqa: E501 + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + @property + def price_tp(self): + """Gets the price_tp of this TradFiOrderUpdateRequest. # noqa: E501 + + Take Profit Price Description: - If not provided or set to \"0\": The original take profit price will be cleared - If you do not want to clear it, pass the original take profit price returned by the interface # noqa: E501 + + :return: The price_tp of this TradFiOrderUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._price_tp + + @price_tp.setter + def price_tp(self, price_tp): + """Sets the price_tp of this TradFiOrderUpdateRequest. + + Take Profit Price Description: - If not provided or set to \"0\": The original take profit price will be cleared - If you do not want to clear it, pass the original take profit price returned by the interface # noqa: E501 + + :param price_tp: The price_tp of this TradFiOrderUpdateRequest. # noqa: E501 + :type: str + """ + + self._price_tp = price_tp + + @property + def price_sl(self): + """Gets the price_sl of this TradFiOrderUpdateRequest. # noqa: E501 + + Stop Loss Price Description: - If not provided or set to \"0\": The original stop loss price will be cleared - If you do not want to clear it, pass the original stop loss price returned by the interface # noqa: E501 + + :return: The price_sl of this TradFiOrderUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._price_sl + + @price_sl.setter + def price_sl(self, price_sl): + """Sets the price_sl of this TradFiOrderUpdateRequest. + + Stop Loss Price Description: - If not provided or set to \"0\": The original stop loss price will be cleared - If you do not want to clear it, pass the original stop loss price returned by the interface # noqa: E501 + + :param price_sl: The price_sl of this TradFiOrderUpdateRequest. # noqa: E501 + :type: str + """ + + self._price_sl = price_sl + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiOrderUpdateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiOrderUpdateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_position_update_request.py b/gate_api/models/trad_fi_position_update_request.py new file mode 100644 index 00000000..118627a5 --- /dev/null +++ b/gate_api/models/trad_fi_position_update_request.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiPositionUpdateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'price_tp': 'str', + 'price_sl': 'str' + } + + attribute_map = { + 'price_tp': 'price_tp', + 'price_sl': 'price_sl' + } + + def __init__(self, price_tp=None, price_sl=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """TradFiPositionUpdateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._price_tp = None + self._price_sl = None + self.discriminator = None + + self.price_tp = price_tp + self.price_sl = price_sl + + @property + def price_tp(self): + """Gets the price_tp of this TradFiPositionUpdateRequest. # noqa: E501 + + Take Profit Price Description: - If not provided or set to \"0\": The original take profit price will be cleared - If you do not want to clear it, pass the original take profit price returned by the interface # noqa: E501 + + :return: The price_tp of this TradFiPositionUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._price_tp + + @price_tp.setter + def price_tp(self, price_tp): + """Sets the price_tp of this TradFiPositionUpdateRequest. + + Take Profit Price Description: - If not provided or set to \"0\": The original take profit price will be cleared - If you do not want to clear it, pass the original take profit price returned by the interface # noqa: E501 + + :param price_tp: The price_tp of this TradFiPositionUpdateRequest. # noqa: E501 + :type: str + """ + + self._price_tp = price_tp + + @property + def price_sl(self): + """Gets the price_sl of this TradFiPositionUpdateRequest. # noqa: E501 + + Stop Loss Price Description: - If not provided or set to \"0\": The original stop loss price will be cleared - If you do not want to clear it, pass the original stop loss price returned by the interface # noqa: E501 + + :return: The price_sl of this TradFiPositionUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._price_sl + + @price_sl.setter + def price_sl(self, price_sl): + """Sets the price_sl of this TradFiPositionUpdateRequest. + + Stop Loss Price Description: - If not provided or set to \"0\": The original stop loss price will be cleared - If you do not want to clear it, pass the original stop loss price returned by the interface # noqa: E501 + + :param price_sl: The price_sl of this TradFiPositionUpdateRequest. # noqa: E501 + :type: str + """ + + self._price_sl = price_sl + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiPositionUpdateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiPositionUpdateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_spot_close_position_request.py b/gate_api/models/trad_fi_spot_close_position_request.py new file mode 100644 index 00000000..1b3432fd --- /dev/null +++ b/gate_api/models/trad_fi_spot_close_position_request.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiSpotClosePositionRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'symbol': 'str', + 'close_volume': 'str', + 'close_type': 'int' + } + + attribute_map = { + 'symbol': 'symbol', + 'close_volume': 'close_volume', + 'close_type': 'close_type' + } + + def __init__(self, symbol=None, close_volume=None, close_type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, Configuration) -> None + """TradFiSpotClosePositionRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._symbol = None + self._close_volume = None + self._close_type = None + self.discriminator = None + + self.symbol = symbol + if close_volume is not None: + self.close_volume = close_volume + self.close_type = close_type + + @property + def symbol(self): + """Gets the symbol of this TradFiSpotClosePositionRequest. # noqa: E501 + + Symbol # noqa: E501 + + :return: The symbol of this TradFiSpotClosePositionRequest. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this TradFiSpotClosePositionRequest. + + Symbol # noqa: E501 + + :param symbol: The symbol of this TradFiSpotClosePositionRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def close_volume(self): + """Gets the close_volume of this TradFiSpotClosePositionRequest. # noqa: E501 + + Close quantity; required for partial close # noqa: E501 + + :return: The close_volume of this TradFiSpotClosePositionRequest. # noqa: E501 + :rtype: str + """ + return self._close_volume + + @close_volume.setter + def close_volume(self, close_volume): + """Sets the close_volume of this TradFiSpotClosePositionRequest. + + Close quantity; required for partial close # noqa: E501 + + :param close_volume: The close_volume of this TradFiSpotClosePositionRequest. # noqa: E501 + :type: str + """ + + self._close_volume = close_volume + + @property + def close_type(self): + """Gets the close_type of this TradFiSpotClosePositionRequest. # noqa: E501 + + Close type (1=partial close, 2=close all) # noqa: E501 + + :return: The close_type of this TradFiSpotClosePositionRequest. # noqa: E501 + :rtype: int + """ + return self._close_type + + @close_type.setter + def close_type(self, close_type): + """Sets the close_type of this TradFiSpotClosePositionRequest. + + Close type (1=partial close, 2=close all) # noqa: E501 + + :param close_type: The close_type of this TradFiSpotClosePositionRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and close_type is None: # noqa: E501 + raise ValueError("Invalid value for `close_type`, must not be `None`") # noqa: E501 + allowed_values = [1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and close_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `close_type` ({0}), must be one of {1}" # noqa: E501 + .format(close_type, allowed_values) + ) + + self._close_type = close_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiSpotClosePositionRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiSpotClosePositionRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_spot_error.py b/gate_api/models/trad_fi_spot_error.py new file mode 100644 index 00000000..839fd39e --- /dev/null +++ b/gate_api/models/trad_fi_spot_error.py @@ -0,0 +1,206 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiSpotError(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label': 'str', + 'message': 'str', + 'data': 'object', + 'timestamp': 'int' + } + + attribute_map = { + 'label': 'label', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, label=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, object, int, Configuration) -> None + """TradFiSpotError - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._label = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + if label is not None: + self.label = label + if message is not None: + self.message = message + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def label(self): + """Gets the label of this TradFiSpotError. # noqa: E501 + + Business error label # noqa: E501 + + :return: The label of this TradFiSpotError. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this TradFiSpotError. + + Business error label # noqa: E501 + + :param label: The label of this TradFiSpotError. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this TradFiSpotError. # noqa: E501 + + Error message # noqa: E501 + + :return: The message of this TradFiSpotError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this TradFiSpotError. + + Error message # noqa: E501 + + :param message: The message of this TradFiSpotError. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this TradFiSpotError. # noqa: E501 + + Error additional data # noqa: E501 + + :return: The data of this TradFiSpotError. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this TradFiSpotError. + + Error additional data # noqa: E501 + + :param data: The data of this TradFiSpotError. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this TradFiSpotError. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this TradFiSpotError. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this TradFiSpotError. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this TradFiSpotError. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiSpotError): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiSpotError): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_spot_order_request.py b/gate_api/models/trad_fi_spot_order_request.py new file mode 100644 index 00000000..3d1cf461 --- /dev/null +++ b/gate_api/models/trad_fi_spot_order_request.py @@ -0,0 +1,349 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiSpotOrderRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'volume': 'str', + 'symbol': 'str', + 'side': 'int', + 'price_type': 'str', + 'trading_session': 'str', + 'time_in_force': 'str', + 'price': 'str', + 'client_order_id': 'str' + } + + attribute_map = { + 'volume': 'volume', + 'symbol': 'symbol', + 'side': 'side', + 'price_type': 'price_type', + 'trading_session': 'trading_session', + 'time_in_force': 'time_in_force', + 'price': 'price', + 'client_order_id': 'client_order_id' + } + + def __init__(self, volume=None, symbol=None, side=None, price_type=None, trading_session=None, time_in_force=None, price=None, client_order_id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, str, str, str, str, str, Configuration) -> None + """TradFiSpotOrderRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._volume = None + self._symbol = None + self._side = None + self._price_type = None + self._trading_session = None + self._time_in_force = None + self._price = None + self._client_order_id = None + self.discriminator = None + + self.volume = volume + self.symbol = symbol + self.side = side + self.price_type = price_type + self.trading_session = trading_session + self.time_in_force = time_in_force + if price is not None: + self.price = price + if client_order_id is not None: + self.client_order_id = client_order_id + + @property + def volume(self): + """Gets the volume of this TradFiSpotOrderRequest. # noqa: E501 + + Order quantity # noqa: E501 + + :return: The volume of this TradFiSpotOrderRequest. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this TradFiSpotOrderRequest. + + Order quantity # noqa: E501 + + :param volume: The volume of this TradFiSpotOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and volume is None: # noqa: E501 + raise ValueError("Invalid value for `volume`, must not be `None`") # noqa: E501 + + self._volume = volume + + @property + def symbol(self): + """Gets the symbol of this TradFiSpotOrderRequest. # noqa: E501 + + Symbol # noqa: E501 + + :return: The symbol of this TradFiSpotOrderRequest. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this TradFiSpotOrderRequest. + + Symbol # noqa: E501 + + :param symbol: The symbol of this TradFiSpotOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and symbol is None: # noqa: E501 + raise ValueError("Invalid value for `symbol`, must not be `None`") # noqa: E501 + + self._symbol = symbol + + @property + def side(self): + """Gets the side of this TradFiSpotOrderRequest. # noqa: E501 + + Side (1=sell, 2=buy) # noqa: E501 + + :return: The side of this TradFiSpotOrderRequest. # noqa: E501 + :rtype: int + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this TradFiSpotOrderRequest. + + Side (1=sell, 2=buy) # noqa: E501 + + :param side: The side of this TradFiSpotOrderRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + allowed_values = [1, 2] # noqa: E501 + if self.local_vars_configuration.client_side_validation and side not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `side` ({0}), must be one of {1}" # noqa: E501 + .format(side, allowed_values) + ) + + self._side = side + + @property + def price_type(self): + """Gets the price_type of this TradFiSpotOrderRequest. # noqa: E501 + + Price type (market = market order, limit = limit order) # noqa: E501 + + :return: The price_type of this TradFiSpotOrderRequest. # noqa: E501 + :rtype: str + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this TradFiSpotOrderRequest. + + Price type (market = market order, limit = limit order) # noqa: E501 + + :param price_type: The price_type of this TradFiSpotOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price_type is None: # noqa: E501 + raise ValueError("Invalid value for `price_type`, must not be `None`") # noqa: E501 + allowed_values = ["market", "limit"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def trading_session(self): + """Gets the trading_session of this TradFiSpotOrderRequest. # noqa: E501 + + Trading session. Limit orders support only All, while market orders support only Regular. # noqa: E501 + + :return: The trading_session of this TradFiSpotOrderRequest. # noqa: E501 + :rtype: str + """ + return self._trading_session + + @trading_session.setter + def trading_session(self, trading_session): + """Sets the trading_session of this TradFiSpotOrderRequest. + + Trading session. Limit orders support only All, while market orders support only Regular. # noqa: E501 + + :param trading_session: The trading_session of this TradFiSpotOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and trading_session is None: # noqa: E501 + raise ValueError("Invalid value for `trading_session`, must not be `None`") # noqa: E501 + allowed_values = ["regular", "all"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and trading_session not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `trading_session` ({0}), must be one of {1}" # noqa: E501 + .format(trading_session, allowed_values) + ) + + self._trading_session = trading_session + + @property + def time_in_force(self): + """Gets the time_in_force of this TradFiSpotOrderRequest. # noqa: E501 + + Time in force. - day: Day order. # noqa: E501 + + :return: The time_in_force of this TradFiSpotOrderRequest. # noqa: E501 + :rtype: str + """ + return self._time_in_force + + @time_in_force.setter + def time_in_force(self, time_in_force): + """Sets the time_in_force of this TradFiSpotOrderRequest. + + Time in force. - day: Day order. # noqa: E501 + + :param time_in_force: The time_in_force of this TradFiSpotOrderRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and time_in_force is None: # noqa: E501 + raise ValueError("Invalid value for `time_in_force`, must not be `None`") # noqa: E501 + allowed_values = ["day"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and time_in_force not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `time_in_force` ({0}), must be one of {1}" # noqa: E501 + .format(time_in_force, allowed_values) + ) + + self._time_in_force = time_in_force + + @property + def price(self): + """Gets the price of this TradFiSpotOrderRequest. # noqa: E501 + + Order price, used for limit orders # noqa: E501 + + :return: The price of this TradFiSpotOrderRequest. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this TradFiSpotOrderRequest. + + Order price, used for limit orders # noqa: E501 + + :param price: The price of this TradFiSpotOrderRequest. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def client_order_id(self): + """Gets the client_order_id of this TradFiSpotOrderRequest. # noqa: E501 + + Client-defined order ID # noqa: E501 + + :return: The client_order_id of this TradFiSpotOrderRequest. # noqa: E501 + :rtype: str + """ + return self._client_order_id + + @client_order_id.setter + def client_order_id(self, client_order_id): + """Sets the client_order_id of this TradFiSpotOrderRequest. + + Client-defined order ID # noqa: E501 + + :param client_order_id: The client_order_id of this TradFiSpotOrderRequest. # noqa: E501 + :type: str + """ + + self._client_order_id = client_order_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiSpotOrderRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiSpotOrderRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_spot_order_update_request.py b/gate_api/models/trad_fi_spot_order_update_request.py new file mode 100644 index 00000000..69458998 --- /dev/null +++ b/gate_api/models/trad_fi_spot_order_update_request.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiSpotOrderUpdateRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'volume': 'str', + 'price': 'str' + } + + attribute_map = { + 'volume': 'volume', + 'price': 'price' + } + + def __init__(self, volume=None, price=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """TradFiSpotOrderUpdateRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._volume = None + self._price = None + self.discriminator = None + + self.volume = volume + self.price = price + + @property + def volume(self): + """Gets the volume of this TradFiSpotOrderUpdateRequest. # noqa: E501 + + Modified order quantity # noqa: E501 + + :return: The volume of this TradFiSpotOrderUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this TradFiSpotOrderUpdateRequest. + + Modified order quantity # noqa: E501 + + :param volume: The volume of this TradFiSpotOrderUpdateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and volume is None: # noqa: E501 + raise ValueError("Invalid value for `volume`, must not be `None`") # noqa: E501 + + self._volume = volume + + @property + def price(self): + """Gets the price of this TradFiSpotOrderUpdateRequest. # noqa: E501 + + Modified order price # noqa: E501 + + :return: The price of this TradFiSpotOrderUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this TradFiSpotOrderUpdateRequest. + + Modified order price # noqa: E501 + + :param price: The price of this TradFiSpotOrderUpdateRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and price is None: # noqa: E501 + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 + + self._price = price + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiSpotOrderUpdateRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiSpotOrderUpdateRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_spot_transaction_request.py b/gate_api/models/trad_fi_spot_transaction_request.py new file mode 100644 index 00000000..ca9a0e4f --- /dev/null +++ b/gate_api/models/trad_fi_spot_transaction_request.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiSpotTransactionRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'change': 'str', + 'type': 'str', + 'ref_id': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'change': 'change', + 'type': 'type', + 'ref_id': 'ref_id' + } + + def __init__(self, asset=None, change=None, type=None, ref_id=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, Configuration) -> None + """TradFiSpotTransactionRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._change = None + self._type = None + self._ref_id = None + self.discriminator = None + + self.asset = asset + self.change = change + self.type = type + self.ref_id = ref_id + + @property + def asset(self): + """Gets the asset of this TradFiSpotTransactionRequest. # noqa: E501 + + Asset, USDT only # noqa: E501 + + :return: The asset of this TradFiSpotTransactionRequest. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this TradFiSpotTransactionRequest. + + Asset, USDT only # noqa: E501 + + :param asset: The asset of this TradFiSpotTransactionRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + allowed_values = ["USDT"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and asset not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `asset` ({0}), must be one of {1}" # noqa: E501 + .format(asset, allowed_values) + ) + + self._asset = asset + + @property + def change(self): + """Gets the change of this TradFiSpotTransactionRequest. # noqa: E501 + + Change amount # noqa: E501 + + :return: The change of this TradFiSpotTransactionRequest. # noqa: E501 + :rtype: str + """ + return self._change + + @change.setter + def change(self, change): + """Sets the change of this TradFiSpotTransactionRequest. + + Change amount # noqa: E501 + + :param change: The change of this TradFiSpotTransactionRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and change is None: # noqa: E501 + raise ValueError("Invalid value for `change`, must not be `None`") # noqa: E501 + + self._change = change + + @property + def type(self): + """Gets the type of this TradFiSpotTransactionRequest. # noqa: E501 + + Transaction type (deposit=deposit, withdraw=withdrawal) # noqa: E501 + + :return: The type of this TradFiSpotTransactionRequest. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this TradFiSpotTransactionRequest. + + Transaction type (deposit=deposit, withdraw=withdrawal) # noqa: E501 + + :param type: The type of this TradFiSpotTransactionRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["deposit", "withdraw"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def ref_id(self): + """Gets the ref_id of this TradFiSpotTransactionRequest. # noqa: E501 + + Business idempotent ID # noqa: E501 + + :return: The ref_id of this TradFiSpotTransactionRequest. # noqa: E501 + :rtype: str + """ + return self._ref_id + + @ref_id.setter + def ref_id(self, ref_id): + """Sets the ref_id of this TradFiSpotTransactionRequest. + + Business idempotent ID # noqa: E501 + + :param ref_id: The ref_id of this TradFiSpotTransactionRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and ref_id is None: # noqa: E501 + raise ValueError("Invalid value for `ref_id`, must not be `None`") # noqa: E501 + + self._ref_id = ref_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiSpotTransactionRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiSpotTransactionRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_ticker.py b/gate_api/models/trad_fi_ticker.py new file mode 100644 index 00000000..28ccb248 --- /dev/null +++ b/gate_api/models/trad_fi_ticker.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiTicker(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label': 'str', + 'message': 'str', + 'timestamp': 'int', + 'data': 'TradFiTickerData' + } + + attribute_map = { + 'label': 'label', + 'message': 'message', + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, label=None, message=None, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, TradFiTickerData, Configuration) -> None + """TradFiTicker - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._label = None + self._message = None + self._timestamp = None + self._data = None + self.discriminator = None + + if label is not None: + self.label = label + if message is not None: + self.message = message + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def label(self): + """Gets the label of this TradFiTicker. # noqa: E501 + + Business status code, non-empty indicates request exception, please refer to TradFi error enumeration in documentation # noqa: E501 + + :return: The label of this TradFiTicker. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this TradFiTicker. + + Business status code, non-empty indicates request exception, please refer to TradFi error enumeration in documentation # noqa: E501 + + :param label: The label of this TradFiTicker. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def message(self): + """Gets the message of this TradFiTicker. # noqa: E501 + + Return message, returned when request error occurs # noqa: E501 + + :return: The message of this TradFiTicker. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this TradFiTicker. + + Return message, returned when request error occurs # noqa: E501 + + :param message: The message of this TradFiTicker. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def timestamp(self): + """Gets the timestamp of this TradFiTicker. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this TradFiTicker. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this TradFiTicker. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this TradFiTicker. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this TradFiTicker. # noqa: E501 + + + :return: The data of this TradFiTicker. # noqa: E501 + :rtype: TradFiTickerData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this TradFiTicker. + + + :param data: The data of this TradFiTicker. # noqa: E501 + :type: TradFiTickerData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiTicker): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiTicker): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_ticker_data.py b/gate_api/models/trad_fi_ticker_data.py new file mode 100644 index 00000000..842f4bb1 --- /dev/null +++ b/gate_api/models/trad_fi_ticker_data.py @@ -0,0 +1,543 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiTickerData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'highest_price': 'str', + 'lowest_price': 'str', + 'price_change': 'str', + 'price_change_amount': 'str', + 'today_open_price': 'str', + 'last_today_close_price': 'str', + 'last_price': 'str', + 'bid_price': 'str', + 'ask_price': 'str', + 'favorite': 'bool', + 'status': 'str', + 'close_time': 'int', + 'open_time': 'int', + 'next_open_time': 'int', + 'trade_mode': 'str', + 'category_name': 'str' + } + + attribute_map = { + 'highest_price': 'highest_price', + 'lowest_price': 'lowest_price', + 'price_change': 'price_change', + 'price_change_amount': 'price_change_amount', + 'today_open_price': 'today_open_price', + 'last_today_close_price': 'last_today_close_price', + 'last_price': 'last_price', + 'bid_price': 'bid_price', + 'ask_price': 'ask_price', + 'favorite': 'favorite', + 'status': 'status', + 'close_time': 'close_time', + 'open_time': 'open_time', + 'next_open_time': 'next_open_time', + 'trade_mode': 'trade_mode', + 'category_name': 'category_name' + } + + def __init__(self, highest_price=None, lowest_price=None, price_change=None, price_change_amount=None, today_open_price=None, last_today_close_price=None, last_price=None, bid_price=None, ask_price=None, favorite=None, status=None, close_time=None, open_time=None, next_open_time=None, trade_mode=None, category_name=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, bool, str, int, int, int, str, str, Configuration) -> None + """TradFiTickerData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._highest_price = None + self._lowest_price = None + self._price_change = None + self._price_change_amount = None + self._today_open_price = None + self._last_today_close_price = None + self._last_price = None + self._bid_price = None + self._ask_price = None + self._favorite = None + self._status = None + self._close_time = None + self._open_time = None + self._next_open_time = None + self._trade_mode = None + self._category_name = None + self.discriminator = None + + if highest_price is not None: + self.highest_price = highest_price + if lowest_price is not None: + self.lowest_price = lowest_price + if price_change is not None: + self.price_change = price_change + if price_change_amount is not None: + self.price_change_amount = price_change_amount + if today_open_price is not None: + self.today_open_price = today_open_price + if last_today_close_price is not None: + self.last_today_close_price = last_today_close_price + if last_price is not None: + self.last_price = last_price + if bid_price is not None: + self.bid_price = bid_price + if ask_price is not None: + self.ask_price = ask_price + if favorite is not None: + self.favorite = favorite + if status is not None: + self.status = status + if close_time is not None: + self.close_time = close_time + if open_time is not None: + self.open_time = open_time + if next_open_time is not None: + self.next_open_time = next_open_time + if trade_mode is not None: + self.trade_mode = trade_mode + if category_name is not None: + self.category_name = category_name + + @property + def highest_price(self): + """Gets the highest_price of this TradFiTickerData. # noqa: E501 + + High price # noqa: E501 + + :return: The highest_price of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._highest_price + + @highest_price.setter + def highest_price(self, highest_price): + """Sets the highest_price of this TradFiTickerData. + + High price # noqa: E501 + + :param highest_price: The highest_price of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._highest_price = highest_price + + @property + def lowest_price(self): + """Gets the lowest_price of this TradFiTickerData. # noqa: E501 + + Low price # noqa: E501 + + :return: The lowest_price of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._lowest_price + + @lowest_price.setter + def lowest_price(self, lowest_price): + """Sets the lowest_price of this TradFiTickerData. + + Low price # noqa: E501 + + :param lowest_price: The lowest_price of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._lowest_price = lowest_price + + @property + def price_change(self): + """Gets the price_change of this TradFiTickerData. # noqa: E501 + + Price change percentage (multiplied by 100) # noqa: E501 + + :return: The price_change of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._price_change + + @price_change.setter + def price_change(self, price_change): + """Sets the price_change of this TradFiTickerData. + + Price change percentage (multiplied by 100) # noqa: E501 + + :param price_change: The price_change of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._price_change = price_change + + @property + def price_change_amount(self): + """Gets the price_change_amount of this TradFiTickerData. # noqa: E501 + + Price change amount # noqa: E501 + + :return: The price_change_amount of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._price_change_amount + + @price_change_amount.setter + def price_change_amount(self, price_change_amount): + """Sets the price_change_amount of this TradFiTickerData. + + Price change amount # noqa: E501 + + :param price_change_amount: The price_change_amount of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._price_change_amount = price_change_amount + + @property + def today_open_price(self): + """Gets the today_open_price of this TradFiTickerData. # noqa: E501 + + Today's open price # noqa: E501 + + :return: The today_open_price of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._today_open_price + + @today_open_price.setter + def today_open_price(self, today_open_price): + """Sets the today_open_price of this TradFiTickerData. + + Today's open price # noqa: E501 + + :param today_open_price: The today_open_price of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._today_open_price = today_open_price + + @property + def last_today_close_price(self): + """Gets the last_today_close_price of this TradFiTickerData. # noqa: E501 + + Previous close price # noqa: E501 + + :return: The last_today_close_price of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._last_today_close_price + + @last_today_close_price.setter + def last_today_close_price(self, last_today_close_price): + """Sets the last_today_close_price of this TradFiTickerData. + + Previous close price # noqa: E501 + + :param last_today_close_price: The last_today_close_price of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._last_today_close_price = last_today_close_price + + @property + def last_price(self): + """Gets the last_price of this TradFiTickerData. # noqa: E501 + + Last trading price # noqa: E501 + + :return: The last_price of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._last_price + + @last_price.setter + def last_price(self, last_price): + """Sets the last_price of this TradFiTickerData. + + Last trading price # noqa: E501 + + :param last_price: The last_price of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._last_price = last_price + + @property + def bid_price(self): + """Gets the bid_price of this TradFiTickerData. # noqa: E501 + + Bid price # noqa: E501 + + :return: The bid_price of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._bid_price + + @bid_price.setter + def bid_price(self, bid_price): + """Sets the bid_price of this TradFiTickerData. + + Bid price # noqa: E501 + + :param bid_price: The bid_price of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._bid_price = bid_price + + @property + def ask_price(self): + """Gets the ask_price of this TradFiTickerData. # noqa: E501 + + Ask price # noqa: E501 + + :return: The ask_price of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._ask_price + + @ask_price.setter + def ask_price(self, ask_price): + """Sets the ask_price of this TradFiTickerData. + + Ask price # noqa: E501 + + :param ask_price: The ask_price of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._ask_price = ask_price + + @property + def favorite(self): + """Gets the favorite of this TradFiTickerData. # noqa: E501 + + Is favorited # noqa: E501 + + :return: The favorite of this TradFiTickerData. # noqa: E501 + :rtype: bool + """ + return self._favorite + + @favorite.setter + def favorite(self, favorite): + """Sets the favorite of this TradFiTickerData. + + Is favorited # noqa: E501 + + :param favorite: The favorite of this TradFiTickerData. # noqa: E501 + :type: bool + """ + + self._favorite = favorite + + @property + def status(self): + """Gets the status of this TradFiTickerData. # noqa: E501 + + Trading status (open=tradable, closed=non-tradable) # noqa: E501 + + :return: The status of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this TradFiTickerData. + + Trading status (open=tradable, closed=non-tradable) # noqa: E501 + + :param status: The status of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def close_time(self): + """Gets the close_time of this TradFiTickerData. # noqa: E501 + + Close time (Unix timestamp in seconds) # noqa: E501 + + :return: The close_time of this TradFiTickerData. # noqa: E501 + :rtype: int + """ + return self._close_time + + @close_time.setter + def close_time(self, close_time): + """Sets the close_time of this TradFiTickerData. + + Close time (Unix timestamp in seconds) # noqa: E501 + + :param close_time: The close_time of this TradFiTickerData. # noqa: E501 + :type: int + """ + + self._close_time = close_time + + @property + def open_time(self): + """Gets the open_time of this TradFiTickerData. # noqa: E501 + + Open time (Unix timestamp in seconds) # noqa: E501 + + :return: The open_time of this TradFiTickerData. # noqa: E501 + :rtype: int + """ + return self._open_time + + @open_time.setter + def open_time(self, open_time): + """Sets the open_time of this TradFiTickerData. + + Open time (Unix timestamp in seconds) # noqa: E501 + + :param open_time: The open_time of this TradFiTickerData. # noqa: E501 + :type: int + """ + + self._open_time = open_time + + @property + def next_open_time(self): + """Gets the next_open_time of this TradFiTickerData. # noqa: E501 + + Next open time (0 means none) # noqa: E501 + + :return: The next_open_time of this TradFiTickerData. # noqa: E501 + :rtype: int + """ + return self._next_open_time + + @next_open_time.setter + def next_open_time(self, next_open_time): + """Sets the next_open_time of this TradFiTickerData. + + Next open time (0 means none) # noqa: E501 + + :param next_open_time: The next_open_time of this TradFiTickerData. # noqa: E501 + :type: int + """ + + self._next_open_time = next_open_time + + @property + def trade_mode(self): + """Gets the trade_mode of this TradFiTickerData. # noqa: E501 + + Trading mode code # noqa: E501 + + :return: The trade_mode of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._trade_mode + + @trade_mode.setter + def trade_mode(self, trade_mode): + """Sets the trade_mode of this TradFiTickerData. + + Trading mode code # noqa: E501 + + :param trade_mode: The trade_mode of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._trade_mode = trade_mode + + @property + def category_name(self): + """Gets the category_name of this TradFiTickerData. # noqa: E501 + + Category name # noqa: E501 + + :return: The category_name of this TradFiTickerData. # noqa: E501 + :rtype: str + """ + return self._category_name + + @category_name.setter + def category_name(self, category_name): + """Sets the category_name of this TradFiTickerData. + + Category name # noqa: E501 + + :param category_name: The category_name of this TradFiTickerData. # noqa: E501 + :type: str + """ + + self._category_name = category_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiTickerData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiTickerData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trad_fi_transaction_request.py b/gate_api/models/trad_fi_transaction_request.py new file mode 100644 index 00000000..17434cac --- /dev/null +++ b/gate_api/models/trad_fi_transaction_request.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TradFiTransactionRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'change': 'str', + 'type': 'str' + } + + attribute_map = { + 'asset': 'asset', + 'change': 'change', + 'type': 'type' + } + + def __init__(self, asset=None, change=None, type=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """TradFiTransactionRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._change = None + self._type = None + self.discriminator = None + + self.asset = asset + self.change = change + self.type = type + + @property + def asset(self): + """Gets the asset of this TradFiTransactionRequest. # noqa: E501 + + Asset type, e.g., USDT, currently only USDT is supported # noqa: E501 + + :return: The asset of this TradFiTransactionRequest. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this TradFiTransactionRequest. + + Asset type, e.g., USDT, currently only USDT is supported # noqa: E501 + + :param asset: The asset of this TradFiTransactionRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and asset is None: # noqa: E501 + raise ValueError("Invalid value for `asset`, must not be `None`") # noqa: E501 + + self._asset = asset + + @property + def change(self): + """Gets the change of this TradFiTransactionRequest. # noqa: E501 + + Change Quantity, supports up to two decimal places # noqa: E501 + + :return: The change of this TradFiTransactionRequest. # noqa: E501 + :rtype: str + """ + return self._change + + @change.setter + def change(self, change): + """Sets the change of this TradFiTransactionRequest. + + Change Quantity, supports up to two decimal places # noqa: E501 + + :param change: The change of this TradFiTransactionRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and change is None: # noqa: E501 + raise ValueError("Invalid value for `change`, must not be `None`") # noqa: E501 + + self._change = change + + @property + def type(self): + """Gets the type of this TradFiTransactionRequest. # noqa: E501 + + Transaction Type (deposit - transfer in, withdraw - transfer out) # noqa: E501 + + :return: The type of this TradFiTransactionRequest. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this TradFiTransactionRequest. + + Transaction Type (deposit - transfer in, withdraw - transfer out) # noqa: E501 + + :param type: The type of this TradFiTransactionRequest. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["deposit", "withdraw"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TradFiTransactionRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TradFiTransactionRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trade.py b/gate_api/models/trade.py index ced357c5..a7a50ea0 100644 --- a/gate_api/models/trade.py +++ b/gate_api/models/trade.py @@ -494,7 +494,7 @@ def sequence_id(self, sequence_id): def text(self): """Gets the text of this Trade. # noqa: E501 - User-defined information, not returned in public endpoints # noqa: E501 + Order's Custom Information. This field is not returned by public interfaces. The scenarios pm_liquidate, comb_margin_liquidate, and scm_liquidate represent full-account forced liquidation orders. liquidate represents isolated-account forced liquidation orders. # noqa: E501 :return: The text of this Trade. # noqa: E501 :rtype: str @@ -505,7 +505,7 @@ def text(self): def text(self, text): """Sets the text of this Trade. - User-defined information, not returned in public endpoints # noqa: E501 + Order's Custom Information. This field is not returned by public interfaces. The scenarios pm_liquidate, comb_margin_liquidate, and scm_liquidate represent full-account forced liquidation orders. liquidate represents isolated-account forced liquidation orders. # noqa: E501 :param text: The text of this Trade. # noqa: E501 :type: str diff --git a/gate_api/models/trail_change_log.py b/gate_api/models/trail_change_log.py new file mode 100644 index 00000000..2ec5ff45 --- /dev/null +++ b/gate_api/models/trail_change_log.py @@ -0,0 +1,297 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TrailChangeLog(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'updated_at': 'int', + 'amount': 'str', + 'is_gte': 'bool', + 'activation_price': 'str', + 'price_type': 'int', + 'price_offset': 'str', + 'is_create': 'bool' + } + + attribute_map = { + 'updated_at': 'updated_at', + 'amount': 'amount', + 'is_gte': 'is_gte', + 'activation_price': 'activation_price', + 'price_type': 'price_type', + 'price_offset': 'price_offset', + 'is_create': 'is_create' + } + + def __init__(self, updated_at=None, amount=None, is_gte=None, activation_price=None, price_type=None, price_offset=None, is_create=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, bool, str, int, str, bool, Configuration) -> None + """TrailChangeLog - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._updated_at = None + self._amount = None + self._is_gte = None + self._activation_price = None + self._price_type = None + self._price_offset = None + self._is_create = None + self.discriminator = None + + if updated_at is not None: + self.updated_at = updated_at + if amount is not None: + self.amount = amount + if is_gte is not None: + self.is_gte = is_gte + if activation_price is not None: + self.activation_price = activation_price + if price_type is not None: + self.price_type = price_type + if price_offset is not None: + self.price_offset = price_offset + if is_create is not None: + self.is_create = is_create + + @property + def updated_at(self): + """Gets the updated_at of this TrailChangeLog. # noqa: E501 + + Update time # noqa: E501 + + :return: The updated_at of this TrailChangeLog. # noqa: E501 + :rtype: int + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this TrailChangeLog. + + Update time # noqa: E501 + + :param updated_at: The updated_at of this TrailChangeLog. # noqa: E501 + :type: int + """ + + self._updated_at = updated_at + + @property + def amount(self): + """Gets the amount of this TrailChangeLog. # noqa: E501 + + Trading quantity in contracts, positive for buy, negative for sell # noqa: E501 + + :return: The amount of this TrailChangeLog. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this TrailChangeLog. + + Trading quantity in contracts, positive for buy, negative for sell # noqa: E501 + + :param amount: The amount of this TrailChangeLog. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def is_gte(self): + """Gets the is_gte of this TrailChangeLog. # noqa: E501 + + true: activate when market price >= activation price, false: <= activation price # noqa: E501 + + :return: The is_gte of this TrailChangeLog. # noqa: E501 + :rtype: bool + """ + return self._is_gte + + @is_gte.setter + def is_gte(self, is_gte): + """Sets the is_gte of this TrailChangeLog. + + true: activate when market price >= activation price, false: <= activation price # noqa: E501 + + :param is_gte: The is_gte of this TrailChangeLog. # noqa: E501 + :type: bool + """ + + self._is_gte = is_gte + + @property + def activation_price(self): + """Gets the activation_price of this TrailChangeLog. # noqa: E501 + + Activation price, 0 means trigger immediately # noqa: E501 + + :return: The activation_price of this TrailChangeLog. # noqa: E501 + :rtype: str + """ + return self._activation_price + + @activation_price.setter + def activation_price(self, activation_price): + """Sets the activation_price of this TrailChangeLog. + + Activation price, 0 means trigger immediately # noqa: E501 + + :param activation_price: The activation_price of this TrailChangeLog. # noqa: E501 + :type: str + """ + + self._activation_price = activation_price + + @property + def price_type(self): + """Gets the price_type of this TrailChangeLog. # noqa: E501 + + Activation price type: 0-unknown, 1-latest price, 2-index price, 3-mark price # noqa: E501 + + :return: The price_type of this TrailChangeLog. # noqa: E501 + :rtype: int + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this TrailChangeLog. + + Activation price type: 0-unknown, 1-latest price, 2-index price, 3-mark price # noqa: E501 + + :param price_type: The price_type of this TrailChangeLog. # noqa: E501 + :type: int + """ + allowed_values = [0, 1, 2, 3] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def price_offset(self): + """Gets the price_offset of this TrailChangeLog. # noqa: E501 + + Callback ratio or price distance, e.g., `0.1` or `0.1%` # noqa: E501 + + :return: The price_offset of this TrailChangeLog. # noqa: E501 + :rtype: str + """ + return self._price_offset + + @price_offset.setter + def price_offset(self, price_offset): + """Sets the price_offset of this TrailChangeLog. + + Callback ratio or price distance, e.g., `0.1` or `0.1%` # noqa: E501 + + :param price_offset: The price_offset of this TrailChangeLog. # noqa: E501 + :type: str + """ + + self._price_offset = price_offset + + @property + def is_create(self): + """Gets the is_create of this TrailChangeLog. # noqa: E501 + + true - order creation, false - order modification # noqa: E501 + + :return: The is_create of this TrailChangeLog. # noqa: E501 + :rtype: bool + """ + return self._is_create + + @is_create.setter + def is_create(self, is_create): + """Sets the is_create of this TrailChangeLog. + + true - order creation, false - order modification # noqa: E501 + + :param is_create: The is_create of this TrailChangeLog. # noqa: E501 + :type: bool + """ + + self._is_create = is_create + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TrailChangeLog): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TrailChangeLog): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trail_order.py b/gate_api/models/trail_order.py new file mode 100644 index 00000000..fa589d3a --- /dev/null +++ b/gate_api/models/trail_order.py @@ -0,0 +1,1199 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TrailOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'user_id': 'int', + 'user': 'int', + 'contract': 'str', + 'settle': 'str', + 'amount': 'str', + 'is_gte': 'bool', + 'activation_price': 'str', + 'price_type': 'int', + 'price_offset': 'str', + 'text': 'str', + 'reduce_only': 'bool', + 'position_related': 'bool', + 'created_at': 'int', + 'activated_at': 'int', + 'finished_at': 'int', + 'create_time': 'int', + 'active_time': 'int', + 'finish_time': 'int', + 'reason': 'str', + 'suborder_text': 'str', + 'is_dual_mode': 'bool', + 'trigger_price': 'str', + 'suborder_id': 'int', + 'side_label': 'str', + 'original_status': 'int', + 'status': 'str', + 'position_side_output': 'str', + 'updated_at': 'int', + 'extremum_price': 'str', + 'status_code': 'str', + 'created_at_precise': 'str', + 'finished_at_precise': 'str', + 'activated_at_precise': 'str', + 'status_label': 'str', + 'pos_margin_mode': 'str', + 'position_mode': 'str', + 'error_label': 'str', + 'leverage': 'str' + } + + attribute_map = { + 'id': 'id', + 'user_id': 'user_id', + 'user': 'user', + 'contract': 'contract', + 'settle': 'settle', + 'amount': 'amount', + 'is_gte': 'is_gte', + 'activation_price': 'activation_price', + 'price_type': 'price_type', + 'price_offset': 'price_offset', + 'text': 'text', + 'reduce_only': 'reduce_only', + 'position_related': 'position_related', + 'created_at': 'created_at', + 'activated_at': 'activated_at', + 'finished_at': 'finished_at', + 'create_time': 'create_time', + 'active_time': 'active_time', + 'finish_time': 'finish_time', + 'reason': 'reason', + 'suborder_text': 'suborder_text', + 'is_dual_mode': 'is_dual_mode', + 'trigger_price': 'trigger_price', + 'suborder_id': 'suborder_id', + 'side_label': 'side_label', + 'original_status': 'original_status', + 'status': 'status', + 'position_side_output': 'position_side_output', + 'updated_at': 'updated_at', + 'extremum_price': 'extremum_price', + 'status_code': 'status_code', + 'created_at_precise': 'created_at_precise', + 'finished_at_precise': 'finished_at_precise', + 'activated_at_precise': 'activated_at_precise', + 'status_label': 'status_label', + 'pos_margin_mode': 'pos_margin_mode', + 'position_mode': 'position_mode', + 'error_label': 'error_label', + 'leverage': 'leverage' + } + + def __init__(self, id=None, user_id=None, user=None, contract=None, settle=None, amount=None, is_gte=None, activation_price=None, price_type=None, price_offset=None, text=None, reduce_only=None, position_related=None, created_at=None, activated_at=None, finished_at=None, create_time=None, active_time=None, finish_time=None, reason=None, suborder_text=None, is_dual_mode=None, trigger_price=None, suborder_id=None, side_label=None, original_status=None, status=None, position_side_output=None, updated_at=None, extremum_price=None, status_code=None, created_at_precise=None, finished_at_precise=None, activated_at_precise=None, status_label=None, pos_margin_mode=None, position_mode=None, error_label=None, leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, str, str, str, bool, str, int, str, str, bool, bool, int, int, int, int, int, int, str, str, bool, str, int, str, int, str, str, int, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """TrailOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._user_id = None + self._user = None + self._contract = None + self._settle = None + self._amount = None + self._is_gte = None + self._activation_price = None + self._price_type = None + self._price_offset = None + self._text = None + self._reduce_only = None + self._position_related = None + self._created_at = None + self._activated_at = None + self._finished_at = None + self._create_time = None + self._active_time = None + self._finish_time = None + self._reason = None + self._suborder_text = None + self._is_dual_mode = None + self._trigger_price = None + self._suborder_id = None + self._side_label = None + self._original_status = None + self._status = None + self._position_side_output = None + self._updated_at = None + self._extremum_price = None + self._status_code = None + self._created_at_precise = None + self._finished_at_precise = None + self._activated_at_precise = None + self._status_label = None + self._pos_margin_mode = None + self._position_mode = None + self._error_label = None + self._leverage = None + self.discriminator = None + + if id is not None: + self.id = id + if user_id is not None: + self.user_id = user_id + if user is not None: + self.user = user + if contract is not None: + self.contract = contract + if settle is not None: + self.settle = settle + if amount is not None: + self.amount = amount + if is_gte is not None: + self.is_gte = is_gte + if activation_price is not None: + self.activation_price = activation_price + if price_type is not None: + self.price_type = price_type + if price_offset is not None: + self.price_offset = price_offset + if text is not None: + self.text = text + if reduce_only is not None: + self.reduce_only = reduce_only + if position_related is not None: + self.position_related = position_related + if created_at is not None: + self.created_at = created_at + if activated_at is not None: + self.activated_at = activated_at + if finished_at is not None: + self.finished_at = finished_at + if create_time is not None: + self.create_time = create_time + if active_time is not None: + self.active_time = active_time + if finish_time is not None: + self.finish_time = finish_time + if reason is not None: + self.reason = reason + if suborder_text is not None: + self.suborder_text = suborder_text + if is_dual_mode is not None: + self.is_dual_mode = is_dual_mode + if trigger_price is not None: + self.trigger_price = trigger_price + if suborder_id is not None: + self.suborder_id = suborder_id + if side_label is not None: + self.side_label = side_label + if original_status is not None: + self.original_status = original_status + if status is not None: + self.status = status + if position_side_output is not None: + self.position_side_output = position_side_output + if updated_at is not None: + self.updated_at = updated_at + if extremum_price is not None: + self.extremum_price = extremum_price + if status_code is not None: + self.status_code = status_code + if created_at_precise is not None: + self.created_at_precise = created_at_precise + if finished_at_precise is not None: + self.finished_at_precise = finished_at_precise + if activated_at_precise is not None: + self.activated_at_precise = activated_at_precise + if status_label is not None: + self.status_label = status_label + if pos_margin_mode is not None: + self.pos_margin_mode = pos_margin_mode + if position_mode is not None: + self.position_mode = position_mode + if error_label is not None: + self.error_label = error_label + if leverage is not None: + self.leverage = leverage + + @property + def id(self): + """Gets the id of this TrailOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TrailOrder. + + Order ID # noqa: E501 + + :param id: The id of this TrailOrder. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def user_id(self): + """Gets the user_id of this TrailOrder. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this TrailOrder. + + User ID # noqa: E501 + + :param user_id: The user_id of this TrailOrder. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def user(self): + """Gets the user of this TrailOrder. # noqa: E501 + + User ID # noqa: E501 + + :return: The user of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this TrailOrder. + + User ID # noqa: E501 + + :param user: The user of this TrailOrder. # noqa: E501 + :type: int + """ + + self._user = user + + @property + def contract(self): + """Gets the contract of this TrailOrder. # noqa: E501 + + Contract name # noqa: E501 + + :return: The contract of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this TrailOrder. + + Contract name # noqa: E501 + + :param contract: The contract of this TrailOrder. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def settle(self): + """Gets the settle of this TrailOrder. # noqa: E501 + + Settle currency # noqa: E501 + + :return: The settle of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._settle + + @settle.setter + def settle(self, settle): + """Sets the settle of this TrailOrder. + + Settle currency # noqa: E501 + + :param settle: The settle of this TrailOrder. # noqa: E501 + :type: str + """ + + self._settle = settle + + @property + def amount(self): + """Gets the amount of this TrailOrder. # noqa: E501 + + Trading quantity in contracts, positive for buy, negative for sell # noqa: E501 + + :return: The amount of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this TrailOrder. + + Trading quantity in contracts, positive for buy, negative for sell # noqa: E501 + + :param amount: The amount of this TrailOrder. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def is_gte(self): + """Gets the is_gte of this TrailOrder. # noqa: E501 + + true: activate when market price >= activation price, false: <= activation price # noqa: E501 + + :return: The is_gte of this TrailOrder. # noqa: E501 + :rtype: bool + """ + return self._is_gte + + @is_gte.setter + def is_gte(self, is_gte): + """Sets the is_gte of this TrailOrder. + + true: activate when market price >= activation price, false: <= activation price # noqa: E501 + + :param is_gte: The is_gte of this TrailOrder. # noqa: E501 + :type: bool + """ + + self._is_gte = is_gte + + @property + def activation_price(self): + """Gets the activation_price of this TrailOrder. # noqa: E501 + + Activation price, 0 means trigger immediately # noqa: E501 + + :return: The activation_price of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._activation_price + + @activation_price.setter + def activation_price(self, activation_price): + """Sets the activation_price of this TrailOrder. + + Activation price, 0 means trigger immediately # noqa: E501 + + :param activation_price: The activation_price of this TrailOrder. # noqa: E501 + :type: str + """ + + self._activation_price = activation_price + + @property + def price_type(self): + """Gets the price_type of this TrailOrder. # noqa: E501 + + Activation price type: 0-unknown, 1-latest price, 2-index price, 3-mark price # noqa: E501 + + :return: The price_type of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this TrailOrder. + + Activation price type: 0-unknown, 1-latest price, 2-index price, 3-mark price # noqa: E501 + + :param price_type: The price_type of this TrailOrder. # noqa: E501 + :type: int + """ + allowed_values = [0, 1, 2, 3] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def price_offset(self): + """Gets the price_offset of this TrailOrder. # noqa: E501 + + Callback ratio or price distance, e.g., `0.1` or `0.1%` # noqa: E501 + + :return: The price_offset of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._price_offset + + @price_offset.setter + def price_offset(self, price_offset): + """Sets the price_offset of this TrailOrder. + + Callback ratio or price distance, e.g., `0.1` or `0.1%` # noqa: E501 + + :param price_offset: The price_offset of this TrailOrder. # noqa: E501 + :type: str + """ + + self._price_offset = price_offset + + @property + def text(self): + """Gets the text of this TrailOrder. # noqa: E501 + + Custom field # noqa: E501 + + :return: The text of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this TrailOrder. + + Custom field # noqa: E501 + + :param text: The text of this TrailOrder. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def reduce_only(self): + """Gets the reduce_only of this TrailOrder. # noqa: E501 + + Reduce Position Only # noqa: E501 + + :return: The reduce_only of this TrailOrder. # noqa: E501 + :rtype: bool + """ + return self._reduce_only + + @reduce_only.setter + def reduce_only(self, reduce_only): + """Sets the reduce_only of this TrailOrder. + + Reduce Position Only # noqa: E501 + + :param reduce_only: The reduce_only of this TrailOrder. # noqa: E501 + :type: bool + """ + + self._reduce_only = reduce_only + + @property + def position_related(self): + """Gets the position_related of this TrailOrder. # noqa: E501 + + Whether bound to position # noqa: E501 + + :return: The position_related of this TrailOrder. # noqa: E501 + :rtype: bool + """ + return self._position_related + + @position_related.setter + def position_related(self, position_related): + """Sets the position_related of this TrailOrder. + + Whether bound to position # noqa: E501 + + :param position_related: The position_related of this TrailOrder. # noqa: E501 + :type: bool + """ + + self._position_related = position_related + + @property + def created_at(self): + """Gets the created_at of this TrailOrder. # noqa: E501 + + Created time # noqa: E501 + + :return: The created_at of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this TrailOrder. + + Created time # noqa: E501 + + :param created_at: The created_at of this TrailOrder. # noqa: E501 + :type: int + """ + + self._created_at = created_at + + @property + def activated_at(self): + """Gets the activated_at of this TrailOrder. # noqa: E501 + + Activation time # noqa: E501 + + :return: The activated_at of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._activated_at + + @activated_at.setter + def activated_at(self, activated_at): + """Sets the activated_at of this TrailOrder. + + Activation time # noqa: E501 + + :param activated_at: The activated_at of this TrailOrder. # noqa: E501 + :type: int + """ + + self._activated_at = activated_at + + @property + def finished_at(self): + """Gets the finished_at of this TrailOrder. # noqa: E501 + + End time # noqa: E501 + + :return: The finished_at of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._finished_at + + @finished_at.setter + def finished_at(self, finished_at): + """Sets the finished_at of this TrailOrder. + + End time # noqa: E501 + + :param finished_at: The finished_at of this TrailOrder. # noqa: E501 + :type: int + """ + + self._finished_at = finished_at + + @property + def create_time(self): + """Gets the create_time of this TrailOrder. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this TrailOrder. + + Created time # noqa: E501 + + :param create_time: The create_time of this TrailOrder. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def active_time(self): + """Gets the active_time of this TrailOrder. # noqa: E501 + + Activation time # noqa: E501 + + :return: The active_time of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._active_time + + @active_time.setter + def active_time(self, active_time): + """Sets the active_time of this TrailOrder. + + Activation time # noqa: E501 + + :param active_time: The active_time of this TrailOrder. # noqa: E501 + :type: int + """ + + self._active_time = active_time + + @property + def finish_time(self): + """Gets the finish_time of this TrailOrder. # noqa: E501 + + End time # noqa: E501 + + :return: The finish_time of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._finish_time + + @finish_time.setter + def finish_time(self, finish_time): + """Sets the finish_time of this TrailOrder. + + End time # noqa: E501 + + :param finish_time: The finish_time of this TrailOrder. # noqa: E501 + :type: int + """ + + self._finish_time = finish_time + + @property + def reason(self): + """Gets the reason of this TrailOrder. # noqa: E501 + + End reason # noqa: E501 + + :return: The reason of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this TrailOrder. + + End reason # noqa: E501 + + :param reason: The reason of this TrailOrder. # noqa: E501 + :type: str + """ + + self._reason = reason + + @property + def suborder_text(self): + """Gets the suborder_text of this TrailOrder. # noqa: E501 + + Sub-order text field # noqa: E501 + + :return: The suborder_text of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._suborder_text + + @suborder_text.setter + def suborder_text(self, suborder_text): + """Sets the suborder_text of this TrailOrder. + + Sub-order text field # noqa: E501 + + :param suborder_text: The suborder_text of this TrailOrder. # noqa: E501 + :type: str + """ + + self._suborder_text = suborder_text + + @property + def is_dual_mode(self): + """Gets the is_dual_mode of this TrailOrder. # noqa: E501 + + Whether dual position mode when creating order # noqa: E501 + + :return: The is_dual_mode of this TrailOrder. # noqa: E501 + :rtype: bool + """ + return self._is_dual_mode + + @is_dual_mode.setter + def is_dual_mode(self, is_dual_mode): + """Sets the is_dual_mode of this TrailOrder. + + Whether dual position mode when creating order # noqa: E501 + + :param is_dual_mode: The is_dual_mode of this TrailOrder. # noqa: E501 + :type: bool + """ + + self._is_dual_mode = is_dual_mode + + @property + def trigger_price(self): + """Gets the trigger_price of this TrailOrder. # noqa: E501 + + Trigger price # noqa: E501 + + :return: The trigger_price of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._trigger_price + + @trigger_price.setter + def trigger_price(self, trigger_price): + """Sets the trigger_price of this TrailOrder. + + Trigger price # noqa: E501 + + :param trigger_price: The trigger_price of this TrailOrder. # noqa: E501 + :type: str + """ + + self._trigger_price = trigger_price + + @property + def suborder_id(self): + """Gets the suborder_id of this TrailOrder. # noqa: E501 + + Sub-order ID # noqa: E501 + + :return: The suborder_id of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._suborder_id + + @suborder_id.setter + def suborder_id(self, suborder_id): + """Sets the suborder_id of this TrailOrder. + + Sub-order ID # noqa: E501 + + :param suborder_id: The suborder_id of this TrailOrder. # noqa: E501 + :type: int + """ + + self._suborder_id = suborder_id + + @property + def side_label(self): + """Gets the side_label of this TrailOrder. # noqa: E501 + + Order direction label: long/short/open long/open short/close long/close short # noqa: E501 + + :return: The side_label of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._side_label + + @side_label.setter + def side_label(self, side_label): + """Sets the side_label of this TrailOrder. + + Order direction label: long/short/open long/open short/close long/close short # noqa: E501 + + :param side_label: The side_label of this TrailOrder. # noqa: E501 + :type: str + """ + + self._side_label = side_label + + @property + def original_status(self): + """Gets the original_status of this TrailOrder. # noqa: E501 + + Order status # noqa: E501 + + :return: The original_status of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._original_status + + @original_status.setter + def original_status(self, original_status): + """Sets the original_status of this TrailOrder. + + Order status # noqa: E501 + + :param original_status: The original_status of this TrailOrder. # noqa: E501 + :type: int + """ + + self._original_status = original_status + + @property + def status(self): + """Gets the status of this TrailOrder. # noqa: E501 + + Simplified order status: open/finished # noqa: E501 + + :return: The status of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this TrailOrder. + + Simplified order status: open/finished # noqa: E501 + + :param status: The status of this TrailOrder. # noqa: E501 + :type: str + """ + allowed_values = ["open", "finished"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def position_side_output(self): + """Gets the position_side_output of this TrailOrder. # noqa: E501 + + Same as side_label, client requires consistency with other order types # noqa: E501 + + :return: The position_side_output of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._position_side_output + + @position_side_output.setter + def position_side_output(self, position_side_output): + """Sets the position_side_output of this TrailOrder. + + Same as side_label, client requires consistency with other order types # noqa: E501 + + :param position_side_output: The position_side_output of this TrailOrder. # noqa: E501 + :type: str + """ + + self._position_side_output = position_side_output + + @property + def updated_at(self): + """Gets the updated_at of this TrailOrder. # noqa: E501 + + Update time # noqa: E501 + + :return: The updated_at of this TrailOrder. # noqa: E501 + :rtype: int + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this TrailOrder. + + Update time # noqa: E501 + + :param updated_at: The updated_at of this TrailOrder. # noqa: E501 + :type: int + """ + + self._updated_at = updated_at + + @property + def extremum_price(self): + """Gets the extremum_price of this TrailOrder. # noqa: E501 + + Extremum price # noqa: E501 + + :return: The extremum_price of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._extremum_price + + @extremum_price.setter + def extremum_price(self, extremum_price): + """Sets the extremum_price of this TrailOrder. + + Extremum price # noqa: E501 + + :param extremum_price: The extremum_price of this TrailOrder. # noqa: E501 + :type: str + """ + + self._extremum_price = extremum_price + + @property + def status_code(self): + """Gets the status_code of this TrailOrder. # noqa: E501 + + Status code value # noqa: E501 + + :return: The status_code of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._status_code + + @status_code.setter + def status_code(self, status_code): + """Sets the status_code of this TrailOrder. + + Status code value # noqa: E501 + + :param status_code: The status_code of this TrailOrder. # noqa: E501 + :type: str + """ + + self._status_code = status_code + + @property + def created_at_precise(self): + """Gets the created_at_precise of this TrailOrder. # noqa: E501 + + Creation time (high precision, seconds.microseconds format) # noqa: E501 + + :return: The created_at_precise of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._created_at_precise + + @created_at_precise.setter + def created_at_precise(self, created_at_precise): + """Sets the created_at_precise of this TrailOrder. + + Creation time (high precision, seconds.microseconds format) # noqa: E501 + + :param created_at_precise: The created_at_precise of this TrailOrder. # noqa: E501 + :type: str + """ + + self._created_at_precise = created_at_precise + + @property + def finished_at_precise(self): + """Gets the finished_at_precise of this TrailOrder. # noqa: E501 + + End time (high precision, seconds.microseconds format) # noqa: E501 + + :return: The finished_at_precise of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._finished_at_precise + + @finished_at_precise.setter + def finished_at_precise(self, finished_at_precise): + """Sets the finished_at_precise of this TrailOrder. + + End time (high precision, seconds.microseconds format) # noqa: E501 + + :param finished_at_precise: The finished_at_precise of this TrailOrder. # noqa: E501 + :type: str + """ + + self._finished_at_precise = finished_at_precise + + @property + def activated_at_precise(self): + """Gets the activated_at_precise of this TrailOrder. # noqa: E501 + + Activation time (high precision, seconds.microseconds format) # noqa: E501 + + :return: The activated_at_precise of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._activated_at_precise + + @activated_at_precise.setter + def activated_at_precise(self, activated_at_precise): + """Sets the activated_at_precise of this TrailOrder. + + Activation time (high precision, seconds.microseconds format) # noqa: E501 + + :param activated_at_precise: The activated_at_precise of this TrailOrder. # noqa: E501 + :type: str + """ + + self._activated_at_precise = activated_at_precise + + @property + def status_label(self): + """Gets the status_label of this TrailOrder. # noqa: E501 + + Status internationalization label (translated status text) # noqa: E501 + + :return: The status_label of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._status_label + + @status_label.setter + def status_label(self, status_label): + """Sets the status_label of this TrailOrder. + + Status internationalization label (translated status text) # noqa: E501 + + :param status_label: The status_label of this TrailOrder. # noqa: E501 + :type: str + """ + + self._status_label = status_label + + @property + def pos_margin_mode(self): + """Gets the pos_margin_mode of this TrailOrder. # noqa: E501 + + Position margin mode: isolated/cross # noqa: E501 + + :return: The pos_margin_mode of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._pos_margin_mode + + @pos_margin_mode.setter + def pos_margin_mode(self, pos_margin_mode): + """Sets the pos_margin_mode of this TrailOrder. + + Position margin mode: isolated/cross # noqa: E501 + + :param pos_margin_mode: The pos_margin_mode of this TrailOrder. # noqa: E501 + :type: str + """ + + self._pos_margin_mode = pos_margin_mode + + @property + def position_mode(self): + """Gets the position_mode of this TrailOrder. # noqa: E501 + + Position mode: single, dual, and dual_plus # noqa: E501 + + :return: The position_mode of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._position_mode + + @position_mode.setter + def position_mode(self, position_mode): + """Sets the position_mode of this TrailOrder. + + Position mode: single, dual, and dual_plus # noqa: E501 + + :param position_mode: The position_mode of this TrailOrder. # noqa: E501 + :type: str + """ + + self._position_mode = position_mode + + @property + def error_label(self): + """Gets the error_label of this TrailOrder. # noqa: E501 + + Error label # noqa: E501 + + :return: The error_label of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._error_label + + @error_label.setter + def error_label(self, error_label): + """Sets the error_label of this TrailOrder. + + Error label # noqa: E501 + + :param error_label: The error_label of this TrailOrder. # noqa: E501 + :type: str + """ + + self._error_label = error_label + + @property + def leverage(self): + """Gets the leverage of this TrailOrder. # noqa: E501 + + Leverage # noqa: E501 + + :return: The leverage of this TrailOrder. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this TrailOrder. + + Leverage # noqa: E501 + + :param leverage: The leverage of this TrailOrder. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TrailOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TrailOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trail_order_change_log_response.py b/gate_api/models/trail_order_change_log_response.py new file mode 100644 index 00000000..82e06853 --- /dev/null +++ b/gate_api/models/trail_order_change_log_response.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TrailOrderChangeLogResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'change_log': 'list[TrailChangeLog]' + } + + attribute_map = { + 'change_log': 'change_log' + } + + def __init__(self, change_log=None, local_vars_configuration=None): # noqa: E501 + # type: (list[TrailChangeLog], Configuration) -> None + """TrailOrderChangeLogResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._change_log = None + self.discriminator = None + + if change_log is not None: + self.change_log = change_log + + @property + def change_log(self): + """Gets the change_log of this TrailOrderChangeLogResponse. # noqa: E501 + + + :return: The change_log of this TrailOrderChangeLogResponse. # noqa: E501 + :rtype: list[TrailChangeLog] + """ + return self._change_log + + @change_log.setter + def change_log(self, change_log): + """Sets the change_log of this TrailOrderChangeLogResponse. + + + :param change_log: The change_log of this TrailOrderChangeLogResponse. # noqa: E501 + :type: list[TrailChangeLog] + """ + + self._change_log = change_log + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TrailOrderChangeLogResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TrailOrderChangeLogResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trail_order_detail_response.py b/gate_api/models/trail_order_detail_response.py new file mode 100644 index 00000000..b632eb85 --- /dev/null +++ b/gate_api/models/trail_order_detail_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TrailOrderDetailResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'code': 'int', + 'message': 'str', + 'data': 'TrailOrderResponse', + 'timestamp': 'int' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, code=None, message=None, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, TrailOrderResponse, int, Configuration) -> None + """TrailOrderDetailResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._code = None + self._message = None + self._data = None + self._timestamp = None + self.discriminator = None + + if code is not None: + self.code = code + if message is not None: + self.message = message + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def code(self): + """Gets the code of this TrailOrderDetailResponse. # noqa: E501 + + Status code, 0 means success # noqa: E501 + + :return: The code of this TrailOrderDetailResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this TrailOrderDetailResponse. + + Status code, 0 means success # noqa: E501 + + :param code: The code of this TrailOrderDetailResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this TrailOrderDetailResponse. # noqa: E501 + + Response message # noqa: E501 + + :return: The message of this TrailOrderDetailResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this TrailOrderDetailResponse. + + Response message # noqa: E501 + + :param message: The message of this TrailOrderDetailResponse. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def data(self): + """Gets the data of this TrailOrderDetailResponse. # noqa: E501 + + + :return: The data of this TrailOrderDetailResponse. # noqa: E501 + :rtype: TrailOrderResponse + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this TrailOrderDetailResponse. + + + :param data: The data of this TrailOrderDetailResponse. # noqa: E501 + :type: TrailOrderResponse + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this TrailOrderDetailResponse. # noqa: E501 + + Response timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this TrailOrderDetailResponse. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this TrailOrderDetailResponse. + + Response timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this TrailOrderDetailResponse. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TrailOrderDetailResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TrailOrderDetailResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trail_order_list_response.py b/gate_api/models/trail_order_list_response.py new file mode 100644 index 00000000..d1be0af4 --- /dev/null +++ b/gate_api/models/trail_order_list_response.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TrailOrderListResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'orders': 'list[TrailOrder]' + } + + attribute_map = { + 'orders': 'orders' + } + + def __init__(self, orders=None, local_vars_configuration=None): # noqa: E501 + # type: (list[TrailOrder], Configuration) -> None + """TrailOrderListResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._orders = None + self.discriminator = None + + if orders is not None: + self.orders = orders + + @property + def orders(self): + """Gets the orders of this TrailOrderListResponse. # noqa: E501 + + + :return: The orders of this TrailOrderListResponse. # noqa: E501 + :rtype: list[TrailOrder] + """ + return self._orders + + @orders.setter + def orders(self, orders): + """Sets the orders of this TrailOrderListResponse. + + + :param orders: The orders of this TrailOrderListResponse. # noqa: E501 + :type: list[TrailOrder] + """ + + self._orders = orders + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TrailOrderListResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TrailOrderListResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/trail_order_response.py b/gate_api/models/trail_order_response.py new file mode 100644 index 00000000..f0907d1c --- /dev/null +++ b/gate_api/models/trail_order_response.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TrailOrderResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order': 'TrailOrder' + } + + attribute_map = { + 'order': 'order' + } + + def __init__(self, order=None, local_vars_configuration=None): # noqa: E501 + # type: (TrailOrder, Configuration) -> None + """TrailOrderResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order = None + self.discriminator = None + + if order is not None: + self.order = order + + @property + def order(self): + """Gets the order of this TrailOrderResponse. # noqa: E501 + + + :return: The order of this TrailOrderResponse. # noqa: E501 + :rtype: TrailOrder + """ + return self._order + + @order.setter + def order(self, order): + """Sets the order of this TrailOrderResponse. + + + :param order: The order of this TrailOrderResponse. # noqa: E501 + :type: TrailOrder + """ + + self._order = order + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TrailOrderResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TrailOrderResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/transaction_item.py b/gate_api/models/transaction_item.py new file mode 100644 index 00000000..bc510adc --- /dev/null +++ b/gate_api/models/transaction_item.py @@ -0,0 +1,409 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TransactionItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'symbol': 'str', + 'symbol_display': 'str', + 'type': 'str', + 'type_desc': 'str', + 'change': 'str', + 'balance': 'str', + 'ref_id': 'str', + 'time': 'int', + 'unit_text': 'str', + 'detail': 'dict(str, object)' + } + + attribute_map = { + 'asset': 'asset', + 'symbol': 'symbol', + 'symbol_display': 'symbol_display', + 'type': 'type', + 'type_desc': 'type_desc', + 'change': 'change', + 'balance': 'balance', + 'ref_id': 'ref_id', + 'time': 'time', + 'unit_text': 'unit_text', + 'detail': 'detail' + } + + def __init__(self, asset=None, symbol=None, symbol_display=None, type=None, type_desc=None, change=None, balance=None, ref_id=None, time=None, unit_text=None, detail=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, int, str, dict(str, object), Configuration) -> None + """TransactionItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._symbol = None + self._symbol_display = None + self._type = None + self._type_desc = None + self._change = None + self._balance = None + self._ref_id = None + self._time = None + self._unit_text = None + self._detail = None + self.discriminator = None + + if asset is not None: + self.asset = asset + if symbol is not None: + self.symbol = symbol + if symbol_display is not None: + self.symbol_display = symbol_display + if type is not None: + self.type = type + if type_desc is not None: + self.type_desc = type_desc + if change is not None: + self.change = change + if balance is not None: + self.balance = balance + if ref_id is not None: + self.ref_id = ref_id + if time is not None: + self.time = time + if unit_text is not None: + self.unit_text = unit_text + if detail is not None: + self.detail = detail + + @property + def asset(self): + """Gets the asset of this TransactionItem. # noqa: E501 + + Asset # noqa: E501 + + :return: The asset of this TransactionItem. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this TransactionItem. + + Asset # noqa: E501 + + :param asset: The asset of this TransactionItem. # noqa: E501 + :type: str + """ + + self._asset = asset + + @property + def symbol(self): + """Gets the symbol of this TransactionItem. # noqa: E501 + + Symbol # noqa: E501 + + :return: The symbol of this TransactionItem. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this TransactionItem. + + Symbol # noqa: E501 + + :param symbol: The symbol of this TransactionItem. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def symbol_display(self): + """Gets the symbol_display of this TransactionItem. # noqa: E501 + + Symbol display name # noqa: E501 + + :return: The symbol_display of this TransactionItem. # noqa: E501 + :rtype: str + """ + return self._symbol_display + + @symbol_display.setter + def symbol_display(self, symbol_display): + """Sets the symbol_display of this TransactionItem. + + Symbol display name # noqa: E501 + + :param symbol_display: The symbol_display of this TransactionItem. # noqa: E501 + :type: str + """ + + self._symbol_display = symbol_display + + @property + def type(self): + """Gets the type of this TransactionItem. # noqa: E501 + + Transaction type. - deposit: Funds transfer in. - withdraw: Funds transfer out. - fee: Trading fee. - dividend: Dividend payout. - sell: Stock sale credit. - buy: Stock purchase debit. - award: Airdrop reward. - stock_transfer_in: Stock transfer in. - stock_transfer_out: Stock transfer out. # noqa: E501 + + :return: The type of this TransactionItem. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this TransactionItem. + + Transaction type. - deposit: Funds transfer in. - withdraw: Funds transfer out. - fee: Trading fee. - dividend: Dividend payout. - sell: Stock sale credit. - buy: Stock purchase debit. - award: Airdrop reward. - stock_transfer_in: Stock transfer in. - stock_transfer_out: Stock transfer out. # noqa: E501 + + :param type: The type of this TransactionItem. # noqa: E501 + :type: str + """ + allowed_values = ["deposit", "withdraw", "fee", "dividend", "sell", "buy", "award", "stock_transfer_in", "stock_transfer_out"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def type_desc(self): + """Gets the type_desc of this TransactionItem. # noqa: E501 + + Transaction type description # noqa: E501 + + :return: The type_desc of this TransactionItem. # noqa: E501 + :rtype: str + """ + return self._type_desc + + @type_desc.setter + def type_desc(self, type_desc): + """Sets the type_desc of this TransactionItem. + + Transaction type description # noqa: E501 + + :param type_desc: The type_desc of this TransactionItem. # noqa: E501 + :type: str + """ + + self._type_desc = type_desc + + @property + def change(self): + """Gets the change of this TransactionItem. # noqa: E501 + + Change amount # noqa: E501 + + :return: The change of this TransactionItem. # noqa: E501 + :rtype: str + """ + return self._change + + @change.setter + def change(self, change): + """Sets the change of this TransactionItem. + + Change amount # noqa: E501 + + :param change: The change of this TransactionItem. # noqa: E501 + :type: str + """ + + self._change = change + + @property + def balance(self): + """Gets the balance of this TransactionItem. # noqa: E501 + + Balance after change # noqa: E501 + + :return: The balance of this TransactionItem. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this TransactionItem. + + Balance after change # noqa: E501 + + :param balance: The balance of this TransactionItem. # noqa: E501 + :type: str + """ + + self._balance = balance + + @property + def ref_id(self): + """Gets the ref_id of this TransactionItem. # noqa: E501 + + Business idempotent ID # noqa: E501 + + :return: The ref_id of this TransactionItem. # noqa: E501 + :rtype: str + """ + return self._ref_id + + @ref_id.setter + def ref_id(self, ref_id): + """Sets the ref_id of this TransactionItem. + + Business idempotent ID # noqa: E501 + + :param ref_id: The ref_id of this TransactionItem. # noqa: E501 + :type: str + """ + + self._ref_id = ref_id + + @property + def time(self): + """Gets the time of this TransactionItem. # noqa: E501 + + Unix timestamp (seconds) # noqa: E501 + + :return: The time of this TransactionItem. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this TransactionItem. + + Unix timestamp (seconds) # noqa: E501 + + :param time: The time of this TransactionItem. # noqa: E501 + :type: int + """ + + self._time = time + + @property + def unit_text(self): + """Gets the unit_text of this TransactionItem. # noqa: E501 + + Unit display text # noqa: E501 + + :return: The unit_text of this TransactionItem. # noqa: E501 + :rtype: str + """ + return self._unit_text + + @unit_text.setter + def unit_text(self, unit_text): + """Sets the unit_text of this TransactionItem. + + Unit display text # noqa: E501 + + :param unit_text: The unit_text of this TransactionItem. # noqa: E501 + :type: str + """ + + self._unit_text = unit_text + + @property + def detail(self): + """Gets the detail of this TransactionItem. # noqa: E501 + + Business details # noqa: E501 + + :return: The detail of this TransactionItem. # noqa: E501 + :rtype: dict(str, object) + """ + return self._detail + + @detail.setter + def detail(self, detail): + """Sets the detail of this TransactionItem. + + Business details # noqa: E501 + + :param detail: The detail of this TransactionItem. # noqa: E501 + :type: dict(str, object) + """ + + self._detail = detail + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TransactionItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TransactionItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/transaction_list.py b/gate_api/models/transaction_list.py new file mode 100644 index 00000000..05e76c4c --- /dev/null +++ b/gate_api/models/transaction_list.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TransactionList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'TransactionListData', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (TransactionListData, int, Configuration) -> None + """TransactionList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this TransactionList. # noqa: E501 + + + :return: The data of this TransactionList. # noqa: E501 + :rtype: TransactionListData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this TransactionList. + + + :param data: The data of this TransactionList. # noqa: E501 + :type: TransactionListData + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this TransactionList. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this TransactionList. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this TransactionList. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this TransactionList. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TransactionList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TransactionList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/transaction_list2.py b/gate_api/models/transaction_list2.py new file mode 100644 index 00000000..f8fcaa72 --- /dev/null +++ b/gate_api/models/transaction_list2.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TransactionList2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'TransactionList2Data', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (TransactionList2Data, int, Configuration) -> None + """TransactionList2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this TransactionList2. # noqa: E501 + + + :return: The data of this TransactionList2. # noqa: E501 + :rtype: TransactionList2Data + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this TransactionList2. + + + :param data: The data of this TransactionList2. # noqa: E501 + :type: TransactionList2Data + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this TransactionList2. # noqa: E501 + + + :return: The timestamp of this TransactionList2. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this TransactionList2. + + + :param timestamp: The timestamp of this TransactionList2. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TransactionList2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TransactionList2): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/transaction_list2_data.py b/gate_api/models/transaction_list2_data.py new file mode 100644 index 00000000..ec5adef7 --- /dev/null +++ b/gate_api/models/transaction_list2_data.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TransactionList2Data(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'total': 'int', + 'total_page': 'int', + 'list': 'list[TransactionItem]' + } + + attribute_map = { + 'total': 'total', + 'total_page': 'total_page', + 'list': 'list' + } + + def __init__(self, total=None, total_page=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, list[TransactionItem], Configuration) -> None + """TransactionList2Data - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._total_page = None + self._list = None + self.discriminator = None + + if total is not None: + self.total = total + if total_page is not None: + self.total_page = total_page + if list is not None: + self.list = list + + @property + def total(self): + """Gets the total of this TransactionList2Data. # noqa: E501 + + + :return: The total of this TransactionList2Data. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this TransactionList2Data. + + + :param total: The total of this TransactionList2Data. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def total_page(self): + """Gets the total_page of this TransactionList2Data. # noqa: E501 + + + :return: The total_page of this TransactionList2Data. # noqa: E501 + :rtype: int + """ + return self._total_page + + @total_page.setter + def total_page(self, total_page): + """Sets the total_page of this TransactionList2Data. + + + :param total_page: The total_page of this TransactionList2Data. # noqa: E501 + :type: int + """ + + self._total_page = total_page + + @property + def list(self): + """Gets the list of this TransactionList2Data. # noqa: E501 + + Transaction record list # noqa: E501 + + :return: The list of this TransactionList2Data. # noqa: E501 + :rtype: list[TransactionItem] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this TransactionList2Data. + + Transaction record list # noqa: E501 + + :param list: The list of this TransactionList2Data. # noqa: E501 + :type: list[TransactionItem] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TransactionList2Data): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TransactionList2Data): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/transaction_list_data.py b/gate_api/models/transaction_list_data.py new file mode 100644 index 00000000..1a762b9c --- /dev/null +++ b/gate_api/models/transaction_list_data.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TransactionListData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'total': 'int', + 'total_page': 'int', + 'list': 'list[TransactionListDataList]' + } + + attribute_map = { + 'total': 'total', + 'total_page': 'total_page', + 'list': 'list' + } + + def __init__(self, total=None, total_page=None, list=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, list[TransactionListDataList], Configuration) -> None + """TransactionListData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._total = None + self._total_page = None + self._list = None + self.discriminator = None + + if total is not None: + self.total = total + if total_page is not None: + self.total_page = total_page + if list is not None: + self.list = list + + @property + def total(self): + """Gets the total of this TransactionListData. # noqa: E501 + + Total Records # noqa: E501 + + :return: The total of this TransactionListData. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this TransactionListData. + + Total Records # noqa: E501 + + :param total: The total of this TransactionListData. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def total_page(self): + """Gets the total_page of this TransactionListData. # noqa: E501 + + Total pages # noqa: E501 + + :return: The total_page of this TransactionListData. # noqa: E501 + :rtype: int + """ + return self._total_page + + @total_page.setter + def total_page(self, total_page): + """Sets the total_page of this TransactionListData. + + Total pages # noqa: E501 + + :param total_page: The total_page of this TransactionListData. # noqa: E501 + :type: int + """ + + self._total_page = total_page + + @property + def list(self): + """Gets the list of this TransactionListData. # noqa: E501 + + Record List # noqa: E501 + + :return: The list of this TransactionListData. # noqa: E501 + :rtype: list[TransactionListDataList] + """ + return self._list + + @list.setter + def list(self, list): + """Sets the list of this TransactionListData. + + Record List # noqa: E501 + + :param list: The list of this TransactionListData. # noqa: E501 + :type: list[TransactionListDataList] + """ + + self._list = list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TransactionListData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TransactionListData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/transaction_list_data_list.py b/gate_api/models/transaction_list_data_list.py new file mode 100644 index 00000000..e1f6c8ac --- /dev/null +++ b/gate_api/models/transaction_list_data_list.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class TransactionListDataList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'asset': 'str', + 'type': 'str', + 'type_desc': 'str', + 'change': 'str', + 'balance': 'str', + 'time': 'int' + } + + attribute_map = { + 'asset': 'asset', + 'type': 'type', + 'type_desc': 'type_desc', + 'change': 'change', + 'balance': 'balance', + 'time': 'time' + } + + def __init__(self, asset=None, type=None, type_desc=None, change=None, balance=None, time=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, int, Configuration) -> None + """TransactionListDataList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._asset = None + self._type = None + self._type_desc = None + self._change = None + self._balance = None + self._time = None + self.discriminator = None + + if asset is not None: + self.asset = asset + if type is not None: + self.type = type + if type_desc is not None: + self.type_desc = type_desc + if change is not None: + self.change = change + if balance is not None: + self.balance = balance + if time is not None: + self.time = time + + @property + def asset(self): + """Gets the asset of this TransactionListDataList. # noqa: E501 + + Asset Type # noqa: E501 + + :return: The asset of this TransactionListDataList. # noqa: E501 + :rtype: str + """ + return self._asset + + @asset.setter + def asset(self, asset): + """Sets the asset of this TransactionListDataList. + + Asset Type # noqa: E501 + + :param asset: The asset of this TransactionListDataList. # noqa: E501 + :type: str + """ + + self._asset = asset + + @property + def type(self): + """Gets the type of this TransactionListDataList. # noqa: E501 + + Trading Type # noqa: E501 + + :return: The type of this TransactionListDataList. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this TransactionListDataList. + + Trading Type # noqa: E501 + + :param type: The type of this TransactionListDataList. # noqa: E501 + :type: str + """ + allowed_values = ["deposit-转入", "withdraw-转出", "dividend-分红结息", "fill_negative-填平负余额"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def type_desc(self): + """Gets the type_desc of this TransactionListDataList. # noqa: E501 + + Transaction Type Description # noqa: E501 + + :return: The type_desc of this TransactionListDataList. # noqa: E501 + :rtype: str + """ + return self._type_desc + + @type_desc.setter + def type_desc(self, type_desc): + """Sets the type_desc of this TransactionListDataList. + + Transaction Type Description # noqa: E501 + + :param type_desc: The type_desc of this TransactionListDataList. # noqa: E501 + :type: str + """ + + self._type_desc = type_desc + + @property + def change(self): + """Gets the change of this TransactionListDataList. # noqa: E501 + + Change amount # noqa: E501 + + :return: The change of this TransactionListDataList. # noqa: E501 + :rtype: str + """ + return self._change + + @change.setter + def change(self, change): + """Sets the change of this TransactionListDataList. + + Change amount # noqa: E501 + + :param change: The change of this TransactionListDataList. # noqa: E501 + :type: str + """ + + self._change = change + + @property + def balance(self): + """Gets the balance of this TransactionListDataList. # noqa: E501 + + Current Balance # noqa: E501 + + :return: The balance of this TransactionListDataList. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this TransactionListDataList. + + Current Balance # noqa: E501 + + :param balance: The balance of this TransactionListDataList. # noqa: E501 + :type: str + """ + + self._balance = balance + + @property + def time(self): + """Gets the time of this TransactionListDataList. # noqa: E501 + + Occurrence Time (Second-level Timestamp) # noqa: E501 + + :return: The time of this TransactionListDataList. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this TransactionListDataList. + + Occurrence Time (Second-level Timestamp) # noqa: E501 + + :param time: The time of this TransactionListDataList. # noqa: E501 + :type: int + """ + + self._time = time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TransactionListDataList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TransactionListDataList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/transfer.py b/gate_api/models/transfer.py index aaf24691..7db54f8e 100644 --- a/gate_api/models/transfer.py +++ b/gate_api/models/transfer.py @@ -165,7 +165,7 @@ def to(self, to): def amount(self): """Gets the amount of this Transfer. # noqa: E501 - Transfer amount # noqa: E501 + Transfer Amount, supports up to 8 decimal places, must be greater than 0 # noqa: E501 :return: The amount of this Transfer. # noqa: E501 :rtype: str @@ -176,7 +176,7 @@ def amount(self): def amount(self, amount): """Sets the amount of this Transfer. - Transfer amount # noqa: E501 + Transfer Amount, supports up to 8 decimal places, must be greater than 0 # noqa: E501 :param amount: The amount of this Transfer. # noqa: E501 :type: str diff --git a/gate_api/models/trigger_order_response.py b/gate_api/models/trigger_order_response.py index 2e0b5605..81447dc5 100644 --- a/gate_api/models/trigger_order_response.py +++ b/gate_api/models/trigger_order_response.py @@ -33,25 +33,30 @@ class TriggerOrderResponse(object): and the value is json key in definition. """ openapi_types = { - 'id': 'int' + 'id': 'int', + 'id_string': 'str' } attribute_map = { - 'id': 'id' + 'id': 'id', + 'id_string': 'id_string' } - def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 - # type: (int, Configuration) -> None + def __init__(self, id=None, id_string=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None """TriggerOrderResponse - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._id = None + self._id_string = None self.discriminator = None if id is not None: self.id = id + if id_string is not None: + self.id_string = id_string @property def id(self): @@ -76,6 +81,29 @@ def id(self, id): self._id = id + @property + def id_string(self): + """Gets the id_string of this TriggerOrderResponse. # noqa: E501 + + String form of the auto order ID; the same order as numeric `id`, as the decimal string of `id` to avoid int64 precision loss in JavaScript and similar environments. Prefer this field to display the order ID or when a string unique identifier is needed; one-to-one with `id`. Same meaning as the field of the same name in futures price-trigger REST APIs and in `futures.orders` / `futures.autoorders` WebSocket pushes. # noqa: E501 + + :return: The id_string of this TriggerOrderResponse. # noqa: E501 + :rtype: str + """ + return self._id_string + + @id_string.setter + def id_string(self, id_string): + """Sets the id_string of this TriggerOrderResponse. + + String form of the auto order ID; the same order as numeric `id`, as the decimal string of `id` to avoid int64 precision loss in JavaScript and similar environments. Prefer this field to display the order ID or when a string unique identifier is needed; one-to-one with `id`. Same meaning as the field of the same name in futures price-trigger REST APIs and in `futures.orders` / `futures.autoorders` WebSocket pushes. # noqa: E501 + + :param id_string: The id_string of this TriggerOrderResponse. # noqa: E501 + :type: str + """ + + self._id_string = id_string + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/uid_push_withdrawal_resp.py b/gate_api/models/uid_push_withdrawal_resp.py index 7afe6eb4..9263a3b6 100644 --- a/gate_api/models/uid_push_withdrawal_resp.py +++ b/gate_api/models/uid_push_withdrawal_resp.py @@ -33,7 +33,7 @@ class UidPushWithdrawalResp(object): and the value is json key in definition. """ openapi_types = { - 'id': 'int' + 'id': 'str' } attribute_map = { @@ -41,7 +41,7 @@ class UidPushWithdrawalResp(object): } def __init__(self, id=None, local_vars_configuration=None): # noqa: E501 - # type: (int, Configuration) -> None + # type: (str, Configuration) -> None """UidPushWithdrawalResp - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -60,7 +60,7 @@ def id(self): Order ID # noqa: E501 :return: The id of this UidPushWithdrawalResp. # noqa: E501 - :rtype: int + :rtype: str """ return self._id @@ -71,7 +71,7 @@ def id(self, id): Order ID # noqa: E501 :param id: The id of this UidPushWithdrawalResp. # noqa: E501 - :type: int + :type: str """ self._id = id diff --git a/gate_api/models/uni_chart_point.py b/gate_api/models/uni_chart_point.py new file mode 100644 index 00000000..71f30272 --- /dev/null +++ b/gate_api/models/uni_chart_point.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UniChartPoint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'time': 'int', + 'value': 'str' + } + + attribute_map = { + 'time': 'time', + 'value': 'value' + } + + def __init__(self, time=None, value=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, Configuration) -> None + """UniChartPoint - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._time = None + self._value = None + self.discriminator = None + + if time is not None: + self.time = time + if value is not None: + self.value = value + + @property + def time(self): + """Gets the time of this UniChartPoint. # noqa: E501 + + + :return: The time of this UniChartPoint. # noqa: E501 + :rtype: int + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this UniChartPoint. + + + :param time: The time of this UniChartPoint. # noqa: E501 + :type: int + """ + + self._time = time + + @property + def value(self): + """Gets the value of this UniChartPoint. # noqa: E501 + + + :return: The value of this UniChartPoint. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this UniChartPoint. + + + :param value: The value of this UniChartPoint. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UniChartPoint): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniChartPoint): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/uni_currency_pair.py b/gate_api/models/uni_currency_pair.py index 362d6b17..4e87b9cd 100644 --- a/gate_api/models/uni_currency_pair.py +++ b/gate_api/models/uni_currency_pair.py @@ -141,7 +141,7 @@ def quote_min_borrow_amount(self, quote_min_borrow_amount): def leverage(self): """Gets the leverage of this UniCurrencyPair. # noqa: E501 - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :return: The leverage of this UniCurrencyPair. # noqa: E501 :rtype: str @@ -152,7 +152,7 @@ def leverage(self): def leverage(self, leverage): """Sets the leverage of this UniCurrencyPair. - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :param leverage: The leverage of this UniCurrencyPair. # noqa: E501 :type: str diff --git a/gate_api/models/uni_estimated_rate.py b/gate_api/models/uni_estimated_rate.py new file mode 100644 index 00000000..c0db2a01 --- /dev/null +++ b/gate_api/models/uni_estimated_rate.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UniEstimatedRate(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency': 'str', + 'est_rate': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'est_rate': 'est_rate' + } + + def __init__(self, currency=None, est_rate=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """UniEstimatedRate - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._est_rate = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if est_rate is not None: + self.est_rate = est_rate + + @property + def currency(self): + """Gets the currency of this UniEstimatedRate. # noqa: E501 + + + :return: The currency of this UniEstimatedRate. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UniEstimatedRate. + + + :param currency: The currency of this UniEstimatedRate. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def est_rate(self): + """Gets the est_rate of this UniEstimatedRate. # noqa: E501 + + Estimated Annualized Rate, e.g., `est_rate`: `0.8014` represents an annualized rate of 80.14% # noqa: E501 + + :return: The est_rate of this UniEstimatedRate. # noqa: E501 + :rtype: str + """ + return self._est_rate + + @est_rate.setter + def est_rate(self, est_rate): + """Sets the est_rate of this UniEstimatedRate. + + Estimated Annualized Rate, e.g., `est_rate`: `0.8014` represents an annualized rate of 80.14% # noqa: E501 + + :param est_rate: The est_rate of this UniEstimatedRate. # noqa: E501 + :type: str + """ + + self._est_rate = est_rate + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UniEstimatedRate): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UniEstimatedRate): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_account.py b/gate_api/models/unified_account.py index 6f4e6b97..a7294d67 100644 --- a/gate_api/models/unified_account.py +++ b/gate_api/models/unified_account.py @@ -33,6 +33,7 @@ class UnifiedAccount(object): and the value is json key in definition. """ openapi_types = { + 'mode': 'str', 'user_id': 'int', 'refresh_time': 'int', 'locked': 'bool', @@ -57,6 +58,7 @@ class UnifiedAccount(object): } attribute_map = { + 'mode': 'mode', 'user_id': 'user_id', 'refresh_time': 'refresh_time', 'locked': 'locked', @@ -80,13 +82,14 @@ class UnifiedAccount(object): 'is_all_collateral': 'is_all_collateral' } - def __init__(self, user_id=None, refresh_time=None, locked=None, balances=None, total=None, borrowed=None, total_initial_margin=None, total_margin_balance=None, total_maintenance_margin=None, total_initial_margin_rate=None, total_maintenance_margin_rate=None, total_available_margin=None, unified_account_total=None, unified_account_total_liab=None, unified_account_total_equity=None, leverage=None, spot_order_loss=None, options_order_loss=None, spot_hedge=None, use_funding=None, is_all_collateral=None, local_vars_configuration=None): # noqa: E501 - # type: (int, int, bool, dict(str, UnifiedBalance), str, str, str, str, str, str, str, str, str, str, str, str, str, str, bool, bool, bool, Configuration) -> None + def __init__(self, mode=None, user_id=None, refresh_time=None, locked=None, balances=None, total=None, borrowed=None, total_initial_margin=None, total_margin_balance=None, total_maintenance_margin=None, total_initial_margin_rate=None, total_maintenance_margin_rate=None, total_available_margin=None, unified_account_total=None, unified_account_total_liab=None, unified_account_total_equity=None, leverage=None, spot_order_loss=None, options_order_loss=None, spot_hedge=None, use_funding=None, is_all_collateral=None, local_vars_configuration=None): # noqa: E501 + # type: (str, int, int, bool, dict(str, UnifiedBalance), str, str, str, str, str, str, str, str, str, str, str, str, str, str, bool, bool, bool, Configuration) -> None """UnifiedAccount - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration + self._mode = None self._user_id = None self._refresh_time = None self._locked = None @@ -110,6 +113,8 @@ def __init__(self, user_id=None, refresh_time=None, locked=None, balances=None, self._is_all_collateral = None self.discriminator = None + if mode is not None: + self.mode = mode if user_id is not None: self.user_id = user_id if refresh_time is not None: @@ -153,6 +158,29 @@ def __init__(self, user_id=None, refresh_time=None, locked=None, balances=None, if is_all_collateral is not None: self.is_all_collateral = is_all_collateral + @property + def mode(self): + """Gets the mode of this UnifiedAccount. # noqa: E501 + + Unified account mode: - classic: Classic account mode - multi_currency: Multi-currency margin mode - portfolio: Portfolio margin mode - single_currency: Single-currency margin mode # noqa: E501 + + :return: The mode of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this UnifiedAccount. + + Unified account mode: - classic: Classic account mode - multi_currency: Multi-currency margin mode - portfolio: Portfolio margin mode - single_currency: Single-currency margin mode # noqa: E501 + + :param mode: The mode of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._mode = mode + @property def user_id(self): """Gets the user_id of this UnifiedAccount. # noqa: E501 @@ -293,7 +321,7 @@ def borrowed(self, borrowed): def total_initial_margin(self): """Gets the total_initial_margin of this UnifiedAccount. # noqa: E501 - Total initial margin, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + Total initial margin (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :return: The total_initial_margin of this UnifiedAccount. # noqa: E501 :rtype: str @@ -304,7 +332,7 @@ def total_initial_margin(self): def total_initial_margin(self, total_initial_margin): """Sets the total_initial_margin of this UnifiedAccount. - Total initial margin, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + Total initial margin (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :param total_initial_margin: The total_initial_margin of this UnifiedAccount. # noqa: E501 :type: str @@ -316,7 +344,7 @@ def total_initial_margin(self, total_initial_margin): def total_margin_balance(self): """Gets the total_margin_balance of this UnifiedAccount. # noqa: E501 - Total margin balance, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + Total margin balance (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :return: The total_margin_balance of this UnifiedAccount. # noqa: E501 :rtype: str @@ -327,7 +355,7 @@ def total_margin_balance(self): def total_margin_balance(self, total_margin_balance): """Sets the total_margin_balance of this UnifiedAccount. - Total margin balance, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + Total margin balance (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :param total_margin_balance: The total_margin_balance of this UnifiedAccount. # noqa: E501 :type: str @@ -339,7 +367,7 @@ def total_margin_balance(self, total_margin_balance): def total_maintenance_margin(self): """Gets the total_maintenance_margin of this UnifiedAccount. # noqa: E501 - Total maintenance margin is valid in cross-currency margin/combined margin mode, and is 0 in other modes such as single-currency margin mode # noqa: E501 + Total maintenance margin (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :return: The total_maintenance_margin of this UnifiedAccount. # noqa: E501 :rtype: str @@ -350,7 +378,7 @@ def total_maintenance_margin(self): def total_maintenance_margin(self, total_maintenance_margin): """Sets the total_maintenance_margin of this UnifiedAccount. - Total maintenance margin is valid in cross-currency margin/combined margin mode, and is 0 in other modes such as single-currency margin mode # noqa: E501 + Total maintenance margin (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :param total_maintenance_margin: The total_maintenance_margin of this UnifiedAccount. # noqa: E501 :type: str @@ -362,7 +390,7 @@ def total_maintenance_margin(self, total_maintenance_margin): def total_initial_margin_rate(self): """Gets the total_initial_margin_rate of this UnifiedAccount. # noqa: E501 - Total initial margin rate, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + Total initial margin rate (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :return: The total_initial_margin_rate of this UnifiedAccount. # noqa: E501 :rtype: str @@ -373,7 +401,7 @@ def total_initial_margin_rate(self): def total_initial_margin_rate(self, total_initial_margin_rate): """Sets the total_initial_margin_rate of this UnifiedAccount. - Total initial margin rate, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + Total initial margin rate (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :param total_initial_margin_rate: The total_initial_margin_rate of this UnifiedAccount. # noqa: E501 :type: str @@ -385,7 +413,7 @@ def total_initial_margin_rate(self, total_initial_margin_rate): def total_maintenance_margin_rate(self): """Gets the total_maintenance_margin_rate of this UnifiedAccount. # noqa: E501 - Total maintenance margin rate, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + Total maintenance margin rate (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :return: The total_maintenance_margin_rate of this UnifiedAccount. # noqa: E501 :rtype: str @@ -396,7 +424,7 @@ def total_maintenance_margin_rate(self): def total_maintenance_margin_rate(self, total_maintenance_margin_rate): """Sets the total_maintenance_margin_rate of this UnifiedAccount. - Total maintenance margin rate, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + Total maintenance margin rate (cross), effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :param total_maintenance_margin_rate: The total_maintenance_margin_rate of this UnifiedAccount. # noqa: E501 :type: str @@ -431,7 +459,7 @@ def total_available_margin(self, total_available_margin): def unified_account_total(self): """Gets the unified_account_total of this UnifiedAccount. # noqa: E501 - Total unified account assets, valid in single currency margin/cross-currency margin/combined margin mode # noqa: E501 + Total unified account assets, includes both cross and isolated total assets in single-currency/multi-currency mode, only cross total assets in portfolio margin mode # noqa: E501 :return: The unified_account_total of this UnifiedAccount. # noqa: E501 :rtype: str @@ -442,7 +470,7 @@ def unified_account_total(self): def unified_account_total(self, unified_account_total): """Sets the unified_account_total of this UnifiedAccount. - Total unified account assets, valid in single currency margin/cross-currency margin/combined margin mode # noqa: E501 + Total unified account assets, includes both cross and isolated total assets in single-currency/multi-currency mode, only cross total assets in portfolio margin mode # noqa: E501 :param unified_account_total: The unified_account_total of this UnifiedAccount. # noqa: E501 :type: str @@ -454,7 +482,7 @@ def unified_account_total(self, unified_account_total): def unified_account_total_liab(self): """Gets the unified_account_total_liab of this UnifiedAccount. # noqa: E501 - Total unified account borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + Total unified account borrowed, i.e. total cross borrowed, effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :return: The unified_account_total_liab of this UnifiedAccount. # noqa: E501 :rtype: str @@ -465,7 +493,7 @@ def unified_account_total_liab(self): def unified_account_total_liab(self, unified_account_total_liab): """Sets the unified_account_total_liab of this UnifiedAccount. - Total unified account borrowed amount, valid in cross-currency margin/combined margin mode, 0 in other modes such as single-currency margin mode # noqa: E501 + Total unified account borrowed, i.e. total cross borrowed, effective in multi-currency margin/portfolio margin mode, 0 in single-currency margin mode # noqa: E501 :param unified_account_total_liab: The unified_account_total_liab of this UnifiedAccount. # noqa: E501 :type: str @@ -477,7 +505,7 @@ def unified_account_total_liab(self, unified_account_total_liab): def unified_account_total_equity(self): """Gets the unified_account_total_equity of this UnifiedAccount. # noqa: E501 - Total unified account equity, valid in single currency margin/cross-currency margin/combined margin mode # noqa: E501 + Total unified account equity, includes both cross and isolated total equity in single-currency/multi-currency mode, only cross total equity in portfolio margin mode # noqa: E501 :return: The unified_account_total_equity of this UnifiedAccount. # noqa: E501 :rtype: str @@ -488,7 +516,7 @@ def unified_account_total_equity(self): def unified_account_total_equity(self, unified_account_total_equity): """Sets the unified_account_total_equity of this UnifiedAccount. - Total unified account equity, valid in single currency margin/cross-currency margin/combined margin mode # noqa: E501 + Total unified account equity, includes both cross and isolated total equity in single-currency/multi-currency mode, only cross total equity in portfolio margin mode # noqa: E501 :param unified_account_total_equity: The unified_account_total_equity of this UnifiedAccount. # noqa: E501 :type: str @@ -500,7 +528,7 @@ def unified_account_total_equity(self, unified_account_total_equity): def leverage(self): """Gets the leverage of this UnifiedAccount. # noqa: E501 - Actual leverage ratio, valid in cross-currency margin/combined margin mode # noqa: E501 + Account leverage multiplier, effective in multi-currency/portfolio margin mode (deprecated). Currency leverage query API: GET /unified/leverage/user_currency_setting # noqa: E501 :return: The leverage of this UnifiedAccount. # noqa: E501 :rtype: str @@ -511,7 +539,7 @@ def leverage(self): def leverage(self, leverage): """Sets the leverage of this UnifiedAccount. - Actual leverage ratio, valid in cross-currency margin/combined margin mode # noqa: E501 + Account leverage multiplier, effective in multi-currency/portfolio margin mode (deprecated). Currency leverage query API: GET /unified/leverage/user_currency_setting # noqa: E501 :param leverage: The leverage of this UnifiedAccount. # noqa: E501 :type: str diff --git a/gate_api/models/unified_balance.py b/gate_api/models/unified_balance.py index 03d2cab9..12e2aff3 100644 --- a/gate_api/models/unified_balance.py +++ b/gate_api/models/unified_balance.py @@ -52,7 +52,8 @@ class UnifiedBalance(object): 'mmr': 'str', 'margin_balance': 'str', 'available_margin': 'str', - 'enabled_collateral': 'bool' + 'enabled_collateral': 'bool', + 'balance_version': 'float' } attribute_map = { @@ -75,11 +76,12 @@ class UnifiedBalance(object): 'mmr': 'mmr', 'margin_balance': 'margin_balance', 'available_margin': 'available_margin', - 'enabled_collateral': 'enabled_collateral' + 'enabled_collateral': 'enabled_collateral', + 'balance_version': 'balance_version' } - def __init__(self, available=None, freeze=None, borrowed=None, negative_liab=None, futures_pos_liab=None, equity=None, total_freeze=None, total_liab=None, spot_in_use=None, funding=None, funding_version=None, cross_balance=None, iso_balance=None, im=None, mm=None, imr=None, mmr=None, margin_balance=None, available_margin=None, enabled_collateral=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, bool, Configuration) -> None + def __init__(self, available=None, freeze=None, borrowed=None, negative_liab=None, futures_pos_liab=None, equity=None, total_freeze=None, total_liab=None, spot_in_use=None, funding=None, funding_version=None, cross_balance=None, iso_balance=None, im=None, mm=None, imr=None, mmr=None, margin_balance=None, available_margin=None, enabled_collateral=None, balance_version=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, bool, float, Configuration) -> None """UnifiedBalance - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -105,6 +107,7 @@ def __init__(self, available=None, freeze=None, borrowed=None, negative_liab=Non self._margin_balance = None self._available_margin = None self._enabled_collateral = None + self._balance_version = None self.discriminator = None if available is not None: @@ -147,12 +150,14 @@ def __init__(self, available=None, freeze=None, borrowed=None, negative_liab=Non self.available_margin = available_margin if enabled_collateral is not None: self.enabled_collateral = enabled_collateral + if balance_version is not None: + self.balance_version = balance_version @property def available(self): """Gets the available of this UnifiedBalance. # noqa: E501 - Available balance, valid in single currency margin/cross-currency margin/combined margin mode, calculation varies by mode # noqa: E501 + Cross available balance, deducted futures isolated margin occupation and frozen amount (futures isolated occupation, i.e. futures isolated balance), effective in single-currency/multi-currency/portfolio margin mode. # noqa: E501 :return: The available of this UnifiedBalance. # noqa: E501 :rtype: str @@ -163,7 +168,7 @@ def available(self): def available(self, available): """Sets the available of this UnifiedBalance. - Available balance, valid in single currency margin/cross-currency margin/combined margin mode, calculation varies by mode # noqa: E501 + Cross available balance, deducted futures isolated margin occupation and frozen amount (futures isolated occupation, i.e. futures isolated balance), effective in single-currency/multi-currency/portfolio margin mode. # noqa: E501 :param available: The available of this UnifiedBalance. # noqa: E501 :type: str @@ -175,7 +180,7 @@ def available(self, available): def freeze(self): """Gets the freeze of this UnifiedBalance. # noqa: E501 - Locked balance, valid in single currency margin/cross-currency margin/combined margin mode # noqa: E501 + Frozen amount, effective in single-currency/multi-currency/portfolio margin mode # noqa: E501 :return: The freeze of this UnifiedBalance. # noqa: E501 :rtype: str @@ -186,7 +191,7 @@ def freeze(self): def freeze(self, freeze): """Sets the freeze of this UnifiedBalance. - Locked balance, valid in single currency margin/cross-currency margin/combined margin mode # noqa: E501 + Frozen amount, effective in single-currency/multi-currency/portfolio margin mode # noqa: E501 :param freeze: The freeze of this UnifiedBalance. # noqa: E501 :type: str @@ -267,7 +272,7 @@ def futures_pos_liab(self, futures_pos_liab): def equity(self): """Gets the equity of this UnifiedBalance. # noqa: E501 - Equity, valid in single currency margin/cross currency margin/combined margin mode # noqa: E501 + Currency equity amount (cross), effective in single-currency/multi-currency/portfolio margin mode # noqa: E501 :return: The equity of this UnifiedBalance. # noqa: E501 :rtype: str @@ -278,7 +283,7 @@ def equity(self): def equity(self, equity): """Sets the equity of this UnifiedBalance. - Equity, valid in single currency margin/cross currency margin/combined margin mode # noqa: E501 + Currency equity amount (cross), effective in single-currency/multi-currency/portfolio margin mode # noqa: E501 :param equity: The equity of this UnifiedBalance. # noqa: E501 :type: str @@ -428,7 +433,7 @@ def cross_balance(self, cross_balance): def iso_balance(self): """Gets the iso_balance of this UnifiedBalance. # noqa: E501 - Isolated Margin Balance applies to Single-Currency Margin Mode and Cross-Currency Margin Mode, and is 0 in other modes such as Portfolio Margin Mode. # noqa: E501 + Futures isolated balance, effective in single-currency and multi-currency margin mode, 0 in portfolio margin mode # noqa: E501 :return: The iso_balance of this UnifiedBalance. # noqa: E501 :rtype: str @@ -439,7 +444,7 @@ def iso_balance(self): def iso_balance(self, iso_balance): """Sets the iso_balance of this UnifiedBalance. - Isolated Margin Balance applies to Single-Currency Margin Mode and Cross-Currency Margin Mode, and is 0 in other modes such as Portfolio Margin Mode. # noqa: E501 + Futures isolated balance, effective in single-currency and multi-currency margin mode, 0 in portfolio margin mode # noqa: E501 :param iso_balance: The iso_balance of this UnifiedBalance. # noqa: E501 :type: str @@ -451,7 +456,7 @@ def iso_balance(self, iso_balance): def im(self): """Gets the im of this UnifiedBalance. # noqa: E501 - Full-position initial margin is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode # noqa: E501 + Cross initial margin, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :return: The im of this UnifiedBalance. # noqa: E501 :rtype: str @@ -462,7 +467,7 @@ def im(self): def im(self, im): """Sets the im of this UnifiedBalance. - Full-position initial margin is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode # noqa: E501 + Cross initial margin, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :param im: The im of this UnifiedBalance. # noqa: E501 :type: str @@ -474,7 +479,7 @@ def im(self, im): def mm(self): """Gets the mm of this UnifiedBalance. # noqa: E501 - Cross margin maintenance margin, valid in single-currency margin mode, 0 in other modes such as cross-currency margin/combined margin mode # noqa: E501 + Cross maintenance margin, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :return: The mm of this UnifiedBalance. # noqa: E501 :rtype: str @@ -485,7 +490,7 @@ def mm(self): def mm(self, mm): """Sets the mm of this UnifiedBalance. - Cross margin maintenance margin, valid in single-currency margin mode, 0 in other modes such as cross-currency margin/combined margin mode # noqa: E501 + Cross maintenance margin, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :param mm: The mm of this UnifiedBalance. # noqa: E501 :type: str @@ -497,7 +502,7 @@ def mm(self, mm): def imr(self): """Gets the imr of this UnifiedBalance. # noqa: E501 - Full-position initial margin rate is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode # noqa: E501 + Cross initial margin rate, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :return: The imr of this UnifiedBalance. # noqa: E501 :rtype: str @@ -508,7 +513,7 @@ def imr(self): def imr(self, imr): """Sets the imr of this UnifiedBalance. - Full-position initial margin rate is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode # noqa: E501 + Cross initial margin rate, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :param imr: The imr of this UnifiedBalance. # noqa: E501 :type: str @@ -520,7 +525,7 @@ def imr(self, imr): def mmr(self): """Gets the mmr of this UnifiedBalance. # noqa: E501 - Full-position maintenance margin rate is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode # noqa: E501 + Cross maintenance margin rate, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :return: The mmr of this UnifiedBalance. # noqa: E501 :rtype: str @@ -531,7 +536,7 @@ def mmr(self): def mmr(self, mmr): """Sets the mmr of this UnifiedBalance. - Full-position maintenance margin rate is valid in single-currency margin mode and is 0 in other modes such as cross-currency margin/combined margin mode # noqa: E501 + Cross maintenance margin rate, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :param mmr: The mmr of this UnifiedBalance. # noqa: E501 :type: str @@ -543,7 +548,7 @@ def mmr(self, mmr): def margin_balance(self): """Gets the margin_balance of this UnifiedBalance. # noqa: E501 - Full margin balance is valid in single currency margin mode and is 0 in other modes such as cross currency margin/combined margin mode # noqa: E501 + Cross margin balance, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :return: The margin_balance of this UnifiedBalance. # noqa: E501 :rtype: str @@ -554,7 +559,7 @@ def margin_balance(self): def margin_balance(self, margin_balance): """Sets the margin_balance of this UnifiedBalance. - Full margin balance is valid in single currency margin mode and is 0 in other modes such as cross currency margin/combined margin mode # noqa: E501 + Cross margin balance, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :param margin_balance: The margin_balance of this UnifiedBalance. # noqa: E501 :type: str @@ -566,7 +571,7 @@ def margin_balance(self, margin_balance): def available_margin(self): """Gets the available_margin of this UnifiedBalance. # noqa: E501 - Cross margin available balance, valid in single currency margin mode, 0 in other modes such as cross-currency margin/combined margin mode # noqa: E501 + Cross available margin, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :return: The available_margin of this UnifiedBalance. # noqa: E501 :rtype: str @@ -577,7 +582,7 @@ def available_margin(self): def available_margin(self, available_margin): """Sets the available_margin of this UnifiedBalance. - Cross margin available balance, valid in single currency margin mode, 0 in other modes such as cross-currency margin/combined margin mode # noqa: E501 + Cross available margin, only effective for USDT in single-currency margin mode, 0 in multi-currency/portfolio margin mode # noqa: E501 :param available_margin: The available_margin of this UnifiedBalance. # noqa: E501 :type: str @@ -608,6 +613,29 @@ def enabled_collateral(self, enabled_collateral): self._enabled_collateral = enabled_collateral + @property + def balance_version(self): + """Gets the balance_version of this UnifiedBalance. # noqa: E501 + + Balance version number # noqa: E501 + + :return: The balance_version of this UnifiedBalance. # noqa: E501 + :rtype: float + """ + return self._balance_version + + @balance_version.setter + def balance_version(self, balance_version): + """Sets the balance_version of this UnifiedBalance. + + Balance version number # noqa: E501 + + :param balance_version: The balance_version of this UnifiedBalance. # noqa: E501 + :type: float + """ + + self._balance_version = balance_version + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/unified_discount_tiers.py b/gate_api/models/unified_discount_tiers.py index 1487ce8a..fbb9b4a8 100644 --- a/gate_api/models/unified_discount_tiers.py +++ b/gate_api/models/unified_discount_tiers.py @@ -169,7 +169,7 @@ def upper_limit(self, upper_limit): def leverage(self): """Gets the leverage of this UnifiedDiscountTiers. # noqa: E501 - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :return: The leverage of this UnifiedDiscountTiers. # noqa: E501 :rtype: str @@ -180,7 +180,7 @@ def leverage(self): def leverage(self, leverage): """Sets the leverage of this UnifiedDiscountTiers. - Position leverage # noqa: E501 + Leverage multiplier # noqa: E501 :param leverage: The leverage of this UnifiedDiscountTiers. # noqa: E501 :type: str diff --git a/gate_api/models/spot_account.py b/gate_api/models/unified_quick_repay_available_item.py similarity index 58% rename from gate_api/models/spot_account.py rename to gate_api/models/unified_quick_repay_available_item.py index e4f1aba0..652cc2cf 100644 --- a/gate_api/models/spot_account.py +++ b/gate_api/models/unified_quick_repay_available_item.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class SpotAccount(object): +class UnifiedQuickRepayAvailableItem(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,57 +35,52 @@ class SpotAccount(object): openapi_types = { 'currency': 'str', 'available': 'str', - 'locked': 'str', - 'update_id': 'int' + 'estimated_usd': 'str' } attribute_map = { 'currency': 'currency', 'available': 'available', - 'locked': 'locked', - 'update_id': 'update_id' + 'estimated_usd': 'estimated_usd' } - def __init__(self, currency=None, available=None, locked=None, update_id=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, int, Configuration) -> None - """SpotAccount - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, currency=None, available=None, estimated_usd=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """UnifiedQuickRepayAvailableItem - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._currency = None self._available = None - self._locked = None - self._update_id = None + self._estimated_usd = None self.discriminator = None if currency is not None: self.currency = currency if available is not None: self.available = available - if locked is not None: - self.locked = locked - if update_id is not None: - self.update_id = update_id + if estimated_usd is not None: + self.estimated_usd = estimated_usd @property def currency(self): - """Gets the currency of this SpotAccount. # noqa: E501 + """Gets the currency of this UnifiedQuickRepayAvailableItem. # noqa: E501 - Currency detail # noqa: E501 + Currency name # noqa: E501 - :return: The currency of this SpotAccount. # noqa: E501 + :return: The currency of this UnifiedQuickRepayAvailableItem. # noqa: E501 :rtype: str """ return self._currency @currency.setter def currency(self, currency): - """Sets the currency of this SpotAccount. + """Sets the currency of this UnifiedQuickRepayAvailableItem. - Currency detail # noqa: E501 + Currency name # noqa: E501 - :param currency: The currency of this SpotAccount. # noqa: E501 + :param currency: The currency of this UnifiedQuickRepayAvailableItem. # noqa: E501 :type: str """ @@ -93,72 +88,49 @@ def currency(self, currency): @property def available(self): - """Gets the available of this SpotAccount. # noqa: E501 + """Gets the available of this UnifiedQuickRepayAvailableItem. # noqa: E501 - Available amount # noqa: E501 + Available Balance # noqa: E501 - :return: The available of this SpotAccount. # noqa: E501 + :return: The available of this UnifiedQuickRepayAvailableItem. # noqa: E501 :rtype: str """ return self._available @available.setter def available(self, available): - """Sets the available of this SpotAccount. + """Sets the available of this UnifiedQuickRepayAvailableItem. - Available amount # noqa: E501 + Available Balance # noqa: E501 - :param available: The available of this SpotAccount. # noqa: E501 + :param available: The available of this UnifiedQuickRepayAvailableItem. # noqa: E501 :type: str """ self._available = available @property - def locked(self): - """Gets the locked of this SpotAccount. # noqa: E501 + def estimated_usd(self): + """Gets the estimated_usd of this UnifiedQuickRepayAvailableItem. # noqa: E501 - Locked amount, used in trading # noqa: E501 + Estimated USD value # noqa: E501 - :return: The locked of this SpotAccount. # noqa: E501 + :return: The estimated_usd of this UnifiedQuickRepayAvailableItem. # noqa: E501 :rtype: str """ - return self._locked + return self._estimated_usd - @locked.setter - def locked(self, locked): - """Sets the locked of this SpotAccount. + @estimated_usd.setter + def estimated_usd(self, estimated_usd): + """Sets the estimated_usd of this UnifiedQuickRepayAvailableItem. - Locked amount, used in trading # noqa: E501 + Estimated USD value # noqa: E501 - :param locked: The locked of this SpotAccount. # noqa: E501 + :param estimated_usd: The estimated_usd of this UnifiedQuickRepayAvailableItem. # noqa: E501 :type: str """ - self._locked = locked - - @property - def update_id(self): - """Gets the update_id of this SpotAccount. # noqa: E501 - - Version number # noqa: E501 - - :return: The update_id of this SpotAccount. # noqa: E501 - :rtype: int - """ - return self._update_id - - @update_id.setter - def update_id(self, update_id): - """Sets the update_id of this SpotAccount. - - Version number # noqa: E501 - - :param update_id: The update_id of this SpotAccount. # noqa: E501 - :type: int - """ - - self._update_id = update_id + self._estimated_usd = estimated_usd def to_dict(self): """Returns the model properties as a dict""" @@ -194,14 +166,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, SpotAccount): + if not isinstance(other, UnifiedQuickRepayAvailableItem): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, SpotAccount): + if not isinstance(other, UnifiedQuickRepayAvailableItem): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_quick_repay_debt_item.py b/gate_api/models/unified_quick_repay_debt_item.py new file mode 100644 index 00000000..bb942086 --- /dev/null +++ b/gate_api/models/unified_quick_repay_debt_item.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedQuickRepayDebtItem(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency': 'str', + 'debt_amount': 'str', + 'estimated_usd': 'str', + 'borrowed': 'str', + 'neg_balance': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'debt_amount': 'debt_amount', + 'estimated_usd': 'estimated_usd', + 'borrowed': 'borrowed', + 'neg_balance': 'neg_balance' + } + + def __init__(self, currency=None, debt_amount=None, estimated_usd=None, borrowed=None, neg_balance=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, Configuration) -> None + """UnifiedQuickRepayDebtItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._debt_amount = None + self._estimated_usd = None + self._borrowed = None + self._neg_balance = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if debt_amount is not None: + self.debt_amount = debt_amount + if estimated_usd is not None: + self.estimated_usd = estimated_usd + if borrowed is not None: + self.borrowed = borrowed + if neg_balance is not None: + self.neg_balance = neg_balance + + @property + def currency(self): + """Gets the currency of this UnifiedQuickRepayDebtItem. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UnifiedQuickRepayDebtItem. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedQuickRepayDebtItem. + + Currency name # noqa: E501 + + :param currency: The currency of this UnifiedQuickRepayDebtItem. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def debt_amount(self): + """Gets the debt_amount of this UnifiedQuickRepayDebtItem. # noqa: E501 + + Debt Quantity # noqa: E501 + + :return: The debt_amount of this UnifiedQuickRepayDebtItem. # noqa: E501 + :rtype: str + """ + return self._debt_amount + + @debt_amount.setter + def debt_amount(self, debt_amount): + """Sets the debt_amount of this UnifiedQuickRepayDebtItem. + + Debt Quantity # noqa: E501 + + :param debt_amount: The debt_amount of this UnifiedQuickRepayDebtItem. # noqa: E501 + :type: str + """ + + self._debt_amount = debt_amount + + @property + def estimated_usd(self): + """Gets the estimated_usd of this UnifiedQuickRepayDebtItem. # noqa: E501 + + Estimated USD value # noqa: E501 + + :return: The estimated_usd of this UnifiedQuickRepayDebtItem. # noqa: E501 + :rtype: str + """ + return self._estimated_usd + + @estimated_usd.setter + def estimated_usd(self, estimated_usd): + """Sets the estimated_usd of this UnifiedQuickRepayDebtItem. + + Estimated USD value # noqa: E501 + + :param estimated_usd: The estimated_usd of this UnifiedQuickRepayDebtItem. # noqa: E501 + :type: str + """ + + self._estimated_usd = estimated_usd + + @property + def borrowed(self): + """Gets the borrowed of this UnifiedQuickRepayDebtItem. # noqa: E501 + + Borrowed amount # noqa: E501 + + :return: The borrowed of this UnifiedQuickRepayDebtItem. # noqa: E501 + :rtype: str + """ + return self._borrowed + + @borrowed.setter + def borrowed(self, borrowed): + """Sets the borrowed of this UnifiedQuickRepayDebtItem. + + Borrowed amount # noqa: E501 + + :param borrowed: The borrowed of this UnifiedQuickRepayDebtItem. # noqa: E501 + :type: str + """ + + self._borrowed = borrowed + + @property + def neg_balance(self): + """Gets the neg_balance of this UnifiedQuickRepayDebtItem. # noqa: E501 + + Negative balance # noqa: E501 + + :return: The neg_balance of this UnifiedQuickRepayDebtItem. # noqa: E501 + :rtype: str + """ + return self._neg_balance + + @neg_balance.setter + def neg_balance(self, neg_balance): + """Sets the neg_balance of this UnifiedQuickRepayDebtItem. + + Negative balance # noqa: E501 + + :param neg_balance: The neg_balance of this UnifiedQuickRepayDebtItem. # noqa: E501 + :type: str + """ + + self._neg_balance = neg_balance + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedQuickRepayDebtItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedQuickRepayDebtItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_quick_repay_repaid_info.py b/gate_api/models/unified_quick_repay_repaid_info.py new file mode 100644 index 00000000..cd2a2880 --- /dev/null +++ b/gate_api/models/unified_quick_repay_repaid_info.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedQuickRepayRepaidInfo(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'currency': 'str', + 'repaid': 'str', + 'left': 'str' + } + + attribute_map = { + 'currency': 'currency', + 'repaid': 'repaid', + 'left': 'left' + } + + def __init__(self, currency=None, repaid=None, left=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, Configuration) -> None + """UnifiedQuickRepayRepaidInfo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._repaid = None + self._left = None + self.discriminator = None + + self.currency = currency + self.repaid = repaid + self.left = left + + @property + def currency(self): + """Gets the currency of this UnifiedQuickRepayRepaidInfo. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this UnifiedQuickRepayRepaidInfo. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedQuickRepayRepaidInfo. + + Currency name # noqa: E501 + + :param currency: The currency of this UnifiedQuickRepayRepaidInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501 + raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501 + + self._currency = currency + + @property + def repaid(self): + """Gets the repaid of this UnifiedQuickRepayRepaidInfo. # noqa: E501 + + Repaid amount # noqa: E501 + + :return: The repaid of this UnifiedQuickRepayRepaidInfo. # noqa: E501 + :rtype: str + """ + return self._repaid + + @repaid.setter + def repaid(self, repaid): + """Sets the repaid of this UnifiedQuickRepayRepaidInfo. + + Repaid amount # noqa: E501 + + :param repaid: The repaid of this UnifiedQuickRepayRepaidInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and repaid is None: # noqa: E501 + raise ValueError("Invalid value for `repaid`, must not be `None`") # noqa: E501 + + self._repaid = repaid + + @property + def left(self): + """Gets the left of this UnifiedQuickRepayRepaidInfo. # noqa: E501 + + Remaining liability amount # noqa: E501 + + :return: The left of this UnifiedQuickRepayRepaidInfo. # noqa: E501 + :rtype: str + """ + return self._left + + @left.setter + def left(self, left): + """Sets the left of this UnifiedQuickRepayRepaidInfo. + + Remaining liability amount # noqa: E501 + + :param left: The left of this UnifiedQuickRepayRepaidInfo. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and left is None: # noqa: E501 + raise ValueError("Invalid value for `left`, must not be `None`") # noqa: E501 + + self._left = left + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedQuickRepayRepaidInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedQuickRepayRepaidInfo): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/user_total_amount.py b/gate_api/models/unified_quick_repay_used_info.py similarity index 58% rename from gate_api/models/user_total_amount.py rename to gate_api/models/unified_quick_repay_used_info.py index 759f31e7..b6f54b04 100644 --- a/gate_api/models/user_total_amount.py +++ b/gate_api/models/unified_quick_repay_used_info.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class UserTotalAmount(object): +class UnifiedQuickRepayUsedInfo(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -33,76 +33,78 @@ class UserTotalAmount(object): and the value is json key in definition. """ openapi_types = { - 'borrow_amount': 'str', - 'collateral_amount': 'str' + 'currency': 'str', + 'used': 'str' } attribute_map = { - 'borrow_amount': 'borrow_amount', - 'collateral_amount': 'collateral_amount' + 'currency': 'currency', + 'used': 'used' } - def __init__(self, borrow_amount=None, collateral_amount=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, currency=None, used=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, Configuration) -> None - """UserTotalAmount - a model defined in OpenAPI""" # noqa: E501 + """UnifiedQuickRepayUsedInfo - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration - self._borrow_amount = None - self._collateral_amount = None + self._currency = None + self._used = None self.discriminator = None - if borrow_amount is not None: - self.borrow_amount = borrow_amount - if collateral_amount is not None: - self.collateral_amount = collateral_amount + self.currency = currency + self.used = used @property - def borrow_amount(self): - """Gets the borrow_amount of this UserTotalAmount. # noqa: E501 + def currency(self): + """Gets the currency of this UnifiedQuickRepayUsedInfo. # noqa: E501 - Total borrowing amount in USDT # noqa: E501 + Currency name # noqa: E501 - :return: The borrow_amount of this UserTotalAmount. # noqa: E501 + :return: The currency of this UnifiedQuickRepayUsedInfo. # noqa: E501 :rtype: str """ - return self._borrow_amount + return self._currency - @borrow_amount.setter - def borrow_amount(self, borrow_amount): - """Sets the borrow_amount of this UserTotalAmount. + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedQuickRepayUsedInfo. - Total borrowing amount in USDT # noqa: E501 + Currency name # noqa: E501 - :param borrow_amount: The borrow_amount of this UserTotalAmount. # noqa: E501 + :param currency: The currency of this UnifiedQuickRepayUsedInfo. # noqa: E501 :type: str """ + if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501 + raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501 - self._borrow_amount = borrow_amount + self._currency = currency @property - def collateral_amount(self): - """Gets the collateral_amount of this UserTotalAmount. # noqa: E501 + def used(self): + """Gets the used of this UnifiedQuickRepayUsedInfo. # noqa: E501 - Total collateral amount in USDT # noqa: E501 + Amount converted # noqa: E501 - :return: The collateral_amount of this UserTotalAmount. # noqa: E501 + :return: The used of this UnifiedQuickRepayUsedInfo. # noqa: E501 :rtype: str """ - return self._collateral_amount + return self._used - @collateral_amount.setter - def collateral_amount(self, collateral_amount): - """Sets the collateral_amount of this UserTotalAmount. + @used.setter + def used(self, used): + """Sets the used of this UnifiedQuickRepayUsedInfo. - Total collateral amount in USDT # noqa: E501 + Amount converted # noqa: E501 - :param collateral_amount: The collateral_amount of this UserTotalAmount. # noqa: E501 + :param used: The used of this UnifiedQuickRepayUsedInfo. # noqa: E501 :type: str """ + if self.local_vars_configuration.client_side_validation and used is None: # noqa: E501 + raise ValueError("Invalid value for `used`, must not be `None`") # noqa: E501 - self._collateral_amount = collateral_amount + self._used = used def to_dict(self): """Returns the model properties as a dict""" @@ -138,14 +140,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, UserTotalAmount): + if not isinstance(other, UnifiedQuickRepayUsedInfo): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, UserTotalAmount): + if not isinstance(other, UnifiedQuickRepayUsedInfo): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/inline_object.py b/gate_api/models/update_dual_comp_position_cross_mode_request.py similarity index 75% rename from gate_api/models/inline_object.py rename to gate_api/models/update_dual_comp_position_cross_mode_request.py index a0345001..270ff3c0 100644 --- a/gate_api/models/inline_object.py +++ b/gate_api/models/update_dual_comp_position_cross_mode_request.py @@ -18,7 +18,7 @@ from gate_api.configuration import Configuration -class InlineObject(object): +class UpdateDualCompPositionCrossModeRequest(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -44,7 +44,7 @@ class InlineObject(object): def __init__(self, mode=None, contract=None, local_vars_configuration=None): # noqa: E501 # type: (str, str, Configuration) -> None - """InlineObject - a model defined in OpenAPI""" # noqa: E501 + """UpdateDualCompPositionCrossModeRequest - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration @@ -58,22 +58,22 @@ def __init__(self, mode=None, contract=None, local_vars_configuration=None): # @property def mode(self): - """Gets the mode of this InlineObject. # noqa: E501 + """Gets the mode of this UpdateDualCompPositionCrossModeRequest. # noqa: E501 - Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode # noqa: E501 + Cross/isolated margin mode. ISOLATED - isolated margin, CROSS - cross margin # noqa: E501 - :return: The mode of this InlineObject. # noqa: E501 + :return: The mode of this UpdateDualCompPositionCrossModeRequest. # noqa: E501 :rtype: str """ return self._mode @mode.setter def mode(self, mode): - """Sets the mode of this InlineObject. + """Sets the mode of this UpdateDualCompPositionCrossModeRequest. - Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode # noqa: E501 + Cross/isolated margin mode. ISOLATED - isolated margin, CROSS - cross margin # noqa: E501 - :param mode: The mode of this InlineObject. # noqa: E501 + :param mode: The mode of this UpdateDualCompPositionCrossModeRequest. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and mode is None: # noqa: E501 @@ -83,22 +83,22 @@ def mode(self, mode): @property def contract(self): - """Gets the contract of this InlineObject. # noqa: E501 + """Gets the contract of this UpdateDualCompPositionCrossModeRequest. # noqa: E501 Futures market # noqa: E501 - :return: The contract of this InlineObject. # noqa: E501 + :return: The contract of this UpdateDualCompPositionCrossModeRequest. # noqa: E501 :rtype: str """ return self._contract @contract.setter def contract(self, contract): - """Sets the contract of this InlineObject. + """Sets the contract of this UpdateDualCompPositionCrossModeRequest. Futures market # noqa: E501 - :param contract: The contract of this InlineObject. # noqa: E501 + :param contract: The contract of this UpdateDualCompPositionCrossModeRequest. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and contract is None: # noqa: E501 @@ -140,14 +140,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineObject): + if not isinstance(other, UpdateDualCompPositionCrossModeRequest): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, InlineObject): + if not isinstance(other, UpdateDualCompPositionCrossModeRequest): return True return self.to_dict() != other.to_dict() diff --git a/gate_api/models/update_order.py b/gate_api/models/update_order.py new file mode 100644 index 00000000..471af4f3 --- /dev/null +++ b/gate_api/models/update_order.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UpdateOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'UpdateOrderData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, UpdateOrderData, Configuration) -> None + """UpdateOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this UpdateOrder. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this UpdateOrder. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this UpdateOrder. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this UpdateOrder. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this UpdateOrder. # noqa: E501 + + + :return: The data of this UpdateOrder. # noqa: E501 + :rtype: UpdateOrderData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this UpdateOrder. + + + :param data: The data of this UpdateOrder. # noqa: E501 + :type: UpdateOrderData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdateOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UpdateOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/update_order2.py b/gate_api/models/update_order2.py new file mode 100644 index 00000000..ff42589a --- /dev/null +++ b/gate_api/models/update_order2.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UpdateOrder2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'UpdateOrder2Data', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (UpdateOrder2Data, int, Configuration) -> None + """UpdateOrder2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this UpdateOrder2. # noqa: E501 + + + :return: The data of this UpdateOrder2. # noqa: E501 + :rtype: UpdateOrder2Data + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this UpdateOrder2. + + + :param data: The data of this UpdateOrder2. # noqa: E501 + :type: UpdateOrder2Data + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this UpdateOrder2. # noqa: E501 + + + :return: The timestamp of this UpdateOrder2. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this UpdateOrder2. + + + :param timestamp: The timestamp of this UpdateOrder2. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdateOrder2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UpdateOrder2): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/update_order2_data.py b/gate_api/models/update_order2_data.py new file mode 100644 index 00000000..b5f2d5dc --- /dev/null +++ b/gate_api/models/update_order2_data.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UpdateOrder2Data(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'int' + } + + attribute_map = { + 'order_id': 'order_id' + } + + def __init__(self, order_id=None, local_vars_configuration=None): # noqa: E501 + # type: (int, Configuration) -> None + """UpdateOrder2Data - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + + @property + def order_id(self): + """Gets the order_id of this UpdateOrder2Data. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this UpdateOrder2Data. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this UpdateOrder2Data. + + Order ID # noqa: E501 + + :param order_id: The order_id of this UpdateOrder2Data. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdateOrder2Data): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UpdateOrder2Data): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/update_order_data.py b/gate_api/models/update_order_data.py new file mode 100644 index 00000000..a31ff2d8 --- /dev/null +++ b/gate_api/models/update_order_data.py @@ -0,0 +1,291 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UpdateOrderData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'order_id': 'int', + 'symbol': 'str', + 'state': 'str', + 'volume': 'str', + 'price': 'str', + 'price_tp': 'str', + 'price_sl': 'str' + } + + attribute_map = { + 'order_id': 'order_id', + 'symbol': 'symbol', + 'state': 'state', + 'volume': 'volume', + 'price': 'price', + 'price_tp': 'price_tp', + 'price_sl': 'price_sl' + } + + def __init__(self, order_id=None, symbol=None, state=None, volume=None, price=None, price_tp=None, price_sl=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, str, str, str, Configuration) -> None + """UpdateOrderData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._order_id = None + self._symbol = None + self._state = None + self._volume = None + self._price = None + self._price_tp = None + self._price_sl = None + self.discriminator = None + + if order_id is not None: + self.order_id = order_id + if symbol is not None: + self.symbol = symbol + if state is not None: + self.state = state + if volume is not None: + self.volume = volume + if price is not None: + self.price = price + if price_tp is not None: + self.price_tp = price_tp + if price_sl is not None: + self.price_sl = price_sl + + @property + def order_id(self): + """Gets the order_id of this UpdateOrderData. # noqa: E501 + + Order ID # noqa: E501 + + :return: The order_id of this UpdateOrderData. # noqa: E501 + :rtype: int + """ + return self._order_id + + @order_id.setter + def order_id(self, order_id): + """Sets the order_id of this UpdateOrderData. + + Order ID # noqa: E501 + + :param order_id: The order_id of this UpdateOrderData. # noqa: E501 + :type: int + """ + + self._order_id = order_id + + @property + def symbol(self): + """Gets the symbol of this UpdateOrderData. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The symbol of this UpdateOrderData. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this UpdateOrderData. + + Currency pair # noqa: E501 + + :param symbol: The symbol of this UpdateOrderData. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def state(self): + """Gets the state of this UpdateOrderData. # noqa: E501 + + Order status code # noqa: E501 + + :return: The state of this UpdateOrderData. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this UpdateOrderData. + + Order status code # noqa: E501 + + :param state: The state of this UpdateOrderData. # noqa: E501 + :type: str + """ + + self._state = state + + @property + def volume(self): + """Gets the volume of this UpdateOrderData. # noqa: E501 + + Order quantity # noqa: E501 + + :return: The volume of this UpdateOrderData. # noqa: E501 + :rtype: str + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this UpdateOrderData. + + Order quantity # noqa: E501 + + :param volume: The volume of this UpdateOrderData. # noqa: E501 + :type: str + """ + + self._volume = volume + + @property + def price(self): + """Gets the price of this UpdateOrderData. # noqa: E501 + + Current price # noqa: E501 + + :return: The price of this UpdateOrderData. # noqa: E501 + :rtype: str + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this UpdateOrderData. + + Current price # noqa: E501 + + :param price: The price of this UpdateOrderData. # noqa: E501 + :type: str + """ + + self._price = price + + @property + def price_tp(self): + """Gets the price_tp of this UpdateOrderData. # noqa: E501 + + Current take profit price # noqa: E501 + + :return: The price_tp of this UpdateOrderData. # noqa: E501 + :rtype: str + """ + return self._price_tp + + @price_tp.setter + def price_tp(self, price_tp): + """Sets the price_tp of this UpdateOrderData. + + Current take profit price # noqa: E501 + + :param price_tp: The price_tp of this UpdateOrderData. # noqa: E501 + :type: str + """ + + self._price_tp = price_tp + + @property + def price_sl(self): + """Gets the price_sl of this UpdateOrderData. # noqa: E501 + + Current stop loss price # noqa: E501 + + :return: The price_sl of this UpdateOrderData. # noqa: E501 + :rtype: str + """ + return self._price_sl + + @price_sl.setter + def price_sl(self, price_sl): + """Sets the price_sl of this UpdateOrderData. + + Current stop loss price # noqa: E501 + + :param price_sl: The price_sl of this UpdateOrderData. # noqa: E501 + :type: str + """ + + self._price_sl = price_sl + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdateOrderData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UpdateOrderData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/update_position.py b/gate_api/models/update_position.py new file mode 100644 index 00000000..1d7375aa --- /dev/null +++ b/gate_api/models/update_position.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UpdatePosition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'object' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, object, Configuration) -> None + """UpdatePosition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this UpdatePosition. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this UpdatePosition. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this UpdatePosition. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this UpdatePosition. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this UpdatePosition. # noqa: E501 + + + :return: The data of this UpdatePosition. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this UpdatePosition. + + + :param data: The data of this UpdatePosition. # noqa: E501 + :type: object + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdatePosition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UpdatePosition): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/update_trail_order.py b/gate_api/models/update_trail_order.py new file mode 100644 index 00000000..e3dd65ae --- /dev/null +++ b/gate_api/models/update_trail_order.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UpdateTrailOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'amount': 'str', + 'activation_price': 'str', + 'is_gte_str': 'str', + 'price_type': 'int', + 'price_offset': 'str' + } + + attribute_map = { + 'id': 'id', + 'amount': 'amount', + 'activation_price': 'activation_price', + 'is_gte_str': 'is_gte_str', + 'price_type': 'price_type', + 'price_offset': 'price_offset' + } + + def __init__(self, id=None, amount=None, activation_price=None, is_gte_str=None, price_type=None, price_offset=None, local_vars_configuration=None): # noqa: E501 + # type: (int, str, str, str, int, str, Configuration) -> None + """UpdateTrailOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._amount = None + self._activation_price = None + self._is_gte_str = None + self._price_type = None + self._price_offset = None + self.discriminator = None + + self.id = id + if amount is not None: + self.amount = amount + if activation_price is not None: + self.activation_price = activation_price + if is_gte_str is not None: + self.is_gte_str = is_gte_str + if price_type is not None: + self.price_type = price_type + if price_offset is not None: + self.price_offset = price_offset + + @property + def id(self): + """Gets the id of this UpdateTrailOrder. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this UpdateTrailOrder. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UpdateTrailOrder. + + Order ID # noqa: E501 + + :param id: The id of this UpdateTrailOrder. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def amount(self): + """Gets the amount of this UpdateTrailOrder. # noqa: E501 + + Total trading quantity in contracts, positive for buy, negative for sell, 0 means no modification # noqa: E501 + + :return: The amount of this UpdateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UpdateTrailOrder. + + Total trading quantity in contracts, positive for buy, negative for sell, 0 means no modification # noqa: E501 + + :param amount: The amount of this UpdateTrailOrder. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def activation_price(self): + """Gets the activation_price of this UpdateTrailOrder. # noqa: E501 + + Activation price, 0 means trigger immediately, empty means no modification # noqa: E501 + + :return: The activation_price of this UpdateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._activation_price + + @activation_price.setter + def activation_price(self, activation_price): + """Sets the activation_price of this UpdateTrailOrder. + + Activation price, 0 means trigger immediately, empty means no modification # noqa: E501 + + :param activation_price: The activation_price of this UpdateTrailOrder. # noqa: E501 + :type: str + """ + + self._activation_price = activation_price + + @property + def is_gte_str(self): + """Gets the is_gte_str of this UpdateTrailOrder. # noqa: E501 + + true: activate when market price >= activation price, false: <= activation price, empty means no modification # noqa: E501 + + :return: The is_gte_str of this UpdateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._is_gte_str + + @is_gte_str.setter + def is_gte_str(self, is_gte_str): + """Sets the is_gte_str of this UpdateTrailOrder. + + true: activate when market price >= activation price, false: <= activation price, empty means no modification # noqa: E501 + + :param is_gte_str: The is_gte_str of this UpdateTrailOrder. # noqa: E501 + :type: str + """ + + self._is_gte_str = is_gte_str + + @property + def price_type(self): + """Gets the price_type of this UpdateTrailOrder. # noqa: E501 + + Activation price type, not provided or 0 means no modification, 1-latest price, 2-index price, 3-mark price # noqa: E501 + + :return: The price_type of this UpdateTrailOrder. # noqa: E501 + :rtype: int + """ + return self._price_type + + @price_type.setter + def price_type(self, price_type): + """Sets the price_type of this UpdateTrailOrder. + + Activation price type, not provided or 0 means no modification, 1-latest price, 2-index price, 3-mark price # noqa: E501 + + :param price_type: The price_type of this UpdateTrailOrder. # noqa: E501 + :type: int + """ + allowed_values = [0, 1, 2, 3] # noqa: E501 + if self.local_vars_configuration.client_side_validation and price_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `price_type` ({0}), must be one of {1}" # noqa: E501 + .format(price_type, allowed_values) + ) + + self._price_type = price_type + + @property + def price_offset(self): + """Gets the price_offset of this UpdateTrailOrder. # noqa: E501 + + Callback ratio or price distance, e.g., `0.1` or `0.1%`; empty means no modification # noqa: E501 + + :return: The price_offset of this UpdateTrailOrder. # noqa: E501 + :rtype: str + """ + return self._price_offset + + @price_offset.setter + def price_offset(self, price_offset): + """Sets the price_offset of this UpdateTrailOrder. + + Callback ratio or price distance, e.g., `0.1` or `0.1%`; empty means no modification # noqa: E501 + + :param price_offset: The price_offset of this UpdateTrailOrder. # noqa: E501 + :type: str + """ + + self._price_offset = price_offset + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdateTrailOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UpdateTrailOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/upload_chat_file.py b/gate_api/models/upload_chat_file.py new file mode 100644 index 00000000..827b4567 --- /dev/null +++ b/gate_api/models/upload_chat_file.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UploadChatFile(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'image_content_type': 'str', + 'base64_img': 'str' + } + + attribute_map = { + 'image_content_type': 'image_content_type', + 'base64_img': 'base64_img' + } + + def __init__(self, image_content_type=None, base64_img=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """UploadChatFile - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._image_content_type = None + self._base64_img = None + self.discriminator = None + + self.image_content_type = image_content_type + self.base64_img = base64_img + + @property + def image_content_type(self): + """Gets the image_content_type of this UploadChatFile. # noqa: E501 + + File MIME type: supports `image/jpeg`, `image/jpg`, `image/png`, `video/mp4`. # noqa: E501 + + :return: The image_content_type of this UploadChatFile. # noqa: E501 + :rtype: str + """ + return self._image_content_type + + @image_content_type.setter + def image_content_type(self, image_content_type): + """Sets the image_content_type of this UploadChatFile. + + File MIME type: supports `image/jpeg`, `image/jpg`, `image/png`, `video/mp4`. # noqa: E501 + + :param image_content_type: The image_content_type of this UploadChatFile. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and image_content_type is None: # noqa: E501 + raise ValueError("Invalid value for `image_content_type`, must not be `None`") # noqa: E501 + allowed_values = ["image/jpeg", "image/jpg", "image/png", "video/mp4"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and image_content_type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `image_content_type` ({0}), must be one of {1}" # noqa: E501 + .format(image_content_type, allowed_values) + ) + + self._image_content_type = image_content_type + + @property + def base64_img(self): + """Gets the base64_img of this UploadChatFile. # noqa: E501 + + Base64 file content; max 20 MB. # noqa: E501 + + :return: The base64_img of this UploadChatFile. # noqa: E501 + :rtype: str + """ + return self._base64_img + + @base64_img.setter + def base64_img(self, base64_img): + """Sets the base64_img of this UploadChatFile. + + Base64 file content; max 20 MB. # noqa: E501 + + :param base64_img: The base64_img of this UploadChatFile. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and base64_img is None: # noqa: E501 + raise ValueError("Invalid value for `base64_img`, must not be `None`") # noqa: E501 + + self._base64_img = base64_img + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UploadChatFile): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UploadChatFile): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/user_asset_resp.py b/gate_api/models/user_asset_resp.py new file mode 100644 index 00000000..bab024a0 --- /dev/null +++ b/gate_api/models/user_asset_resp.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UserAssetResp(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timestamp': 'int', + 'data': 'UserAssetRespData' + } + + attribute_map = { + 'timestamp': 'timestamp', + 'data': 'data' + } + + def __init__(self, timestamp=None, data=None, local_vars_configuration=None): # noqa: E501 + # type: (int, UserAssetRespData, Configuration) -> None + """UserAssetResp - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._timestamp = None + self._data = None + self.discriminator = None + + if timestamp is not None: + self.timestamp = timestamp + if data is not None: + self.data = data + + @property + def timestamp(self): + """Gets the timestamp of this UserAssetResp. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this UserAssetResp. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this UserAssetResp. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this UserAssetResp. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + @property + def data(self): + """Gets the data of this UserAssetResp. # noqa: E501 + + + :return: The data of this UserAssetResp. # noqa: E501 + :rtype: UserAssetRespData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this UserAssetResp. + + + :param data: The data of this UserAssetResp. # noqa: E501 + :type: UserAssetRespData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserAssetResp): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UserAssetResp): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/user_asset_resp2.py b/gate_api/models/user_asset_resp2.py new file mode 100644 index 00000000..206aa922 --- /dev/null +++ b/gate_api/models/user_asset_resp2.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UserAssetResp2(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'UserAssetResp2Data', + 'timestamp': 'int' + } + + attribute_map = { + 'data': 'data', + 'timestamp': 'timestamp' + } + + def __init__(self, data=None, timestamp=None, local_vars_configuration=None): # noqa: E501 + # type: (UserAssetResp2Data, int, Configuration) -> None + """UserAssetResp2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self._timestamp = None + self.discriminator = None + + if data is not None: + self.data = data + if timestamp is not None: + self.timestamp = timestamp + + @property + def data(self): + """Gets the data of this UserAssetResp2. # noqa: E501 + + + :return: The data of this UserAssetResp2. # noqa: E501 + :rtype: UserAssetResp2Data + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this UserAssetResp2. + + + :param data: The data of this UserAssetResp2. # noqa: E501 + :type: UserAssetResp2Data + """ + + self._data = data + + @property + def timestamp(self): + """Gets the timestamp of this UserAssetResp2. # noqa: E501 + + Server timestamp (milliseconds) # noqa: E501 + + :return: The timestamp of this UserAssetResp2. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this UserAssetResp2. + + Server timestamp (milliseconds) # noqa: E501 + + :param timestamp: The timestamp of this UserAssetResp2. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserAssetResp2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UserAssetResp2): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/user_asset_resp2_data.py b/gate_api/models/user_asset_resp2_data.py new file mode 100644 index 00000000..c7954a50 --- /dev/null +++ b/gate_api/models/user_asset_resp2_data.py @@ -0,0 +1,291 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UserAssetResp2Data(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'equity': 'str', + 'balance': 'str', + 'available': 'str', + 'position_market_value': 'str', + 'position_pnl': 'str', + 'today_pnl': 'str', + 'user_exists': 'bool' + } + + attribute_map = { + 'equity': 'equity', + 'balance': 'balance', + 'available': 'available', + 'position_market_value': 'position_market_value', + 'position_pnl': 'position_pnl', + 'today_pnl': 'today_pnl', + 'user_exists': 'user_exists' + } + + def __init__(self, equity=None, balance=None, available=None, position_market_value=None, position_pnl=None, today_pnl=None, user_exists=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, bool, Configuration) -> None + """UserAssetResp2Data - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._equity = None + self._balance = None + self._available = None + self._position_market_value = None + self._position_pnl = None + self._today_pnl = None + self._user_exists = None + self.discriminator = None + + if equity is not None: + self.equity = equity + if balance is not None: + self.balance = balance + if available is not None: + self.available = available + if position_market_value is not None: + self.position_market_value = position_market_value + if position_pnl is not None: + self.position_pnl = position_pnl + if today_pnl is not None: + self.today_pnl = today_pnl + if user_exists is not None: + self.user_exists = user_exists + + @property + def equity(self): + """Gets the equity of this UserAssetResp2Data. # noqa: E501 + + Account equity # noqa: E501 + + :return: The equity of this UserAssetResp2Data. # noqa: E501 + :rtype: str + """ + return self._equity + + @equity.setter + def equity(self, equity): + """Sets the equity of this UserAssetResp2Data. + + Account equity # noqa: E501 + + :param equity: The equity of this UserAssetResp2Data. # noqa: E501 + :type: str + """ + + self._equity = equity + + @property + def balance(self): + """Gets the balance of this UserAssetResp2Data. # noqa: E501 + + Account Balance # noqa: E501 + + :return: The balance of this UserAssetResp2Data. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this UserAssetResp2Data. + + Account Balance # noqa: E501 + + :param balance: The balance of this UserAssetResp2Data. # noqa: E501 + :type: str + """ + + self._balance = balance + + @property + def available(self): + """Gets the available of this UserAssetResp2Data. # noqa: E501 + + Available Balance # noqa: E501 + + :return: The available of this UserAssetResp2Data. # noqa: E501 + :rtype: str + """ + return self._available + + @available.setter + def available(self, available): + """Sets the available of this UserAssetResp2Data. + + Available Balance # noqa: E501 + + :param available: The available of this UserAssetResp2Data. # noqa: E501 + :type: str + """ + + self._available = available + + @property + def position_market_value(self): + """Gets the position_market_value of this UserAssetResp2Data. # noqa: E501 + + Position market value # noqa: E501 + + :return: The position_market_value of this UserAssetResp2Data. # noqa: E501 + :rtype: str + """ + return self._position_market_value + + @position_market_value.setter + def position_market_value(self, position_market_value): + """Sets the position_market_value of this UserAssetResp2Data. + + Position market value # noqa: E501 + + :param position_market_value: The position_market_value of this UserAssetResp2Data. # noqa: E501 + :type: str + """ + + self._position_market_value = position_market_value + + @property + def position_pnl(self): + """Gets the position_pnl of this UserAssetResp2Data. # noqa: E501 + + Position P&L # noqa: E501 + + :return: The position_pnl of this UserAssetResp2Data. # noqa: E501 + :rtype: str + """ + return self._position_pnl + + @position_pnl.setter + def position_pnl(self, position_pnl): + """Sets the position_pnl of this UserAssetResp2Data. + + Position P&L # noqa: E501 + + :param position_pnl: The position_pnl of this UserAssetResp2Data. # noqa: E501 + :type: str + """ + + self._position_pnl = position_pnl + + @property + def today_pnl(self): + """Gets the today_pnl of this UserAssetResp2Data. # noqa: E501 + + Today's P&L # noqa: E501 + + :return: The today_pnl of this UserAssetResp2Data. # noqa: E501 + :rtype: str + """ + return self._today_pnl + + @today_pnl.setter + def today_pnl(self, today_pnl): + """Sets the today_pnl of this UserAssetResp2Data. + + Today's P&L # noqa: E501 + + :param today_pnl: The today_pnl of this UserAssetResp2Data. # noqa: E501 + :type: str + """ + + self._today_pnl = today_pnl + + @property + def user_exists(self): + """Gets the user_exists of this UserAssetResp2Data. # noqa: E501 + + Whether the user has activated the service # noqa: E501 + + :return: The user_exists of this UserAssetResp2Data. # noqa: E501 + :rtype: bool + """ + return self._user_exists + + @user_exists.setter + def user_exists(self, user_exists): + """Sets the user_exists of this UserAssetResp2Data. + + Whether the user has activated the service # noqa: E501 + + :param user_exists: The user_exists of this UserAssetResp2Data. # noqa: E501 + :type: bool + """ + + self._user_exists = user_exists + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserAssetResp2Data): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UserAssetResp2Data): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/user_asset_resp_data.py b/gate_api/models/user_asset_resp_data.py new file mode 100644 index 00000000..785c45e3 --- /dev/null +++ b/gate_api/models/user_asset_resp_data.py @@ -0,0 +1,291 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UserAssetRespData(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'equity': 'str', + 'margin_level': 'str', + 'balance': 'str', + 'margin': 'str', + 'margin_free': 'str', + 'unrealized_pnl': 'str', + 'mt5_uid': 'str' + } + + attribute_map = { + 'equity': 'equity', + 'margin_level': 'margin_level', + 'balance': 'balance', + 'margin': 'margin', + 'margin_free': 'margin_free', + 'unrealized_pnl': 'unrealized_pnl', + 'mt5_uid': 'mt5_uid' + } + + def __init__(self, equity=None, margin_level=None, balance=None, margin=None, margin_free=None, unrealized_pnl=None, mt5_uid=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, str, str, str, str, str, Configuration) -> None + """UserAssetRespData - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._equity = None + self._margin_level = None + self._balance = None + self._margin = None + self._margin_free = None + self._unrealized_pnl = None + self._mt5_uid = None + self.discriminator = None + + if equity is not None: + self.equity = equity + if margin_level is not None: + self.margin_level = margin_level + if balance is not None: + self.balance = balance + if margin is not None: + self.margin = margin + if margin_free is not None: + self.margin_free = margin_free + if unrealized_pnl is not None: + self.unrealized_pnl = unrealized_pnl + if mt5_uid is not None: + self.mt5_uid = mt5_uid + + @property + def equity(self): + """Gets the equity of this UserAssetRespData. # noqa: E501 + + Account equity # noqa: E501 + + :return: The equity of this UserAssetRespData. # noqa: E501 + :rtype: str + """ + return self._equity + + @equity.setter + def equity(self, equity): + """Sets the equity of this UserAssetRespData. + + Account equity # noqa: E501 + + :param equity: The equity of this UserAssetRespData. # noqa: E501 + :type: str + """ + + self._equity = equity + + @property + def margin_level(self): + """Gets the margin_level of this UserAssetRespData. # noqa: E501 + + Margin level (percentage) # noqa: E501 + + :return: The margin_level of this UserAssetRespData. # noqa: E501 + :rtype: str + """ + return self._margin_level + + @margin_level.setter + def margin_level(self, margin_level): + """Sets the margin_level of this UserAssetRespData. + + Margin level (percentage) # noqa: E501 + + :param margin_level: The margin_level of this UserAssetRespData. # noqa: E501 + :type: str + """ + + self._margin_level = margin_level + + @property + def balance(self): + """Gets the balance of this UserAssetRespData. # noqa: E501 + + Account Balance # noqa: E501 + + :return: The balance of this UserAssetRespData. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this UserAssetRespData. + + Account Balance # noqa: E501 + + :param balance: The balance of this UserAssetRespData. # noqa: E501 + :type: str + """ + + self._balance = balance + + @property + def margin(self): + """Gets the margin of this UserAssetRespData. # noqa: E501 + + Used margin # noqa: E501 + + :return: The margin of this UserAssetRespData. # noqa: E501 + :rtype: str + """ + return self._margin + + @margin.setter + def margin(self, margin): + """Sets the margin of this UserAssetRespData. + + Used margin # noqa: E501 + + :param margin: The margin of this UserAssetRespData. # noqa: E501 + :type: str + """ + + self._margin = margin + + @property + def margin_free(self): + """Gets the margin_free of this UserAssetRespData. # noqa: E501 + + Available Margin # noqa: E501 + + :return: The margin_free of this UserAssetRespData. # noqa: E501 + :rtype: str + """ + return self._margin_free + + @margin_free.setter + def margin_free(self, margin_free): + """Sets the margin_free of this UserAssetRespData. + + Available Margin # noqa: E501 + + :param margin_free: The margin_free of this UserAssetRespData. # noqa: E501 + :type: str + """ + + self._margin_free = margin_free + + @property + def unrealized_pnl(self): + """Gets the unrealized_pnl of this UserAssetRespData. # noqa: E501 + + Unrealized PNL # noqa: E501 + + :return: The unrealized_pnl of this UserAssetRespData. # noqa: E501 + :rtype: str + """ + return self._unrealized_pnl + + @unrealized_pnl.setter + def unrealized_pnl(self, unrealized_pnl): + """Sets the unrealized_pnl of this UserAssetRespData. + + Unrealized PNL # noqa: E501 + + :param unrealized_pnl: The unrealized_pnl of this UserAssetRespData. # noqa: E501 + :type: str + """ + + self._unrealized_pnl = unrealized_pnl + + @property + def mt5_uid(self): + """Gets the mt5_uid of this UserAssetRespData. # noqa: E501 + + MT5 userID # noqa: E501 + + :return: The mt5_uid of this UserAssetRespData. # noqa: E501 + :rtype: str + """ + return self._mt5_uid + + @mt5_uid.setter + def mt5_uid(self, mt5_uid): + """Sets the mt5_uid of this UserAssetRespData. + + MT5 userID # noqa: E501 + + :param mt5_uid: The mt5_uid of this UserAssetRespData. # noqa: E501 + :type: str + """ + + self._mt5_uid = mt5_uid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserAssetRespData): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UserAssetRespData): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/user_leverage_setting.py b/gate_api/models/user_leverage_setting.py new file mode 100644 index 00000000..db43bf48 --- /dev/null +++ b/gate_api/models/user_leverage_setting.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Gate API + + Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 + + Contact: support@mail.gate.com + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UserLeverageSetting(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'leverage': 'str' + } + + attribute_map = { + 'leverage': 'leverage' + } + + def __init__(self, leverage=None, local_vars_configuration=None): # noqa: E501 + # type: (str, Configuration) -> None + """UserLeverageSetting - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._leverage = None + self.discriminator = None + + if leverage is not None: + self.leverage = leverage + + @property + def leverage(self): + """Gets the leverage of this UserLeverageSetting. # noqa: E501 + + Leverage. Values exceeding a currency's leverage limit are capped at that limit. # noqa: E501 + + :return: The leverage of this UserLeverageSetting. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this UserLeverageSetting. + + Leverage. Values exceeding a currency's leverage limit are capped at that limit. # noqa: E501 + + :param leverage: The leverage of this UserLeverageSetting. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserLeverageSetting): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UserLeverageSetting): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/user_ltv_info.py b/gate_api/models/user_ltv_info.py deleted file mode 100644 index e56f15a1..00000000 --- a/gate_api/models/user_ltv_info.py +++ /dev/null @@ -1,291 +0,0 @@ -# coding: utf-8 - -""" - Gate API - - Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 - - Contact: support@mail.gate.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from gate_api.configuration import Configuration - - -class UserLtvInfo(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - openapi_types = { - 'collateral_currency': 'str', - 'borrow_currency': 'str', - 'init_ltv': 'str', - 'alert_ltv': 'str', - 'liquidate_ltv': 'str', - 'min_borrow_amount': 'str', - 'left_borrowable_amount': 'str' - } - - attribute_map = { - 'collateral_currency': 'collateral_currency', - 'borrow_currency': 'borrow_currency', - 'init_ltv': 'init_ltv', - 'alert_ltv': 'alert_ltv', - 'liquidate_ltv': 'liquidate_ltv', - 'min_borrow_amount': 'min_borrow_amount', - 'left_borrowable_amount': 'left_borrowable_amount' - } - - def __init__(self, collateral_currency=None, borrow_currency=None, init_ltv=None, alert_ltv=None, liquidate_ltv=None, min_borrow_amount=None, left_borrowable_amount=None, local_vars_configuration=None): # noqa: E501 - # type: (str, str, str, str, str, str, str, Configuration) -> None - """UserLtvInfo - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._collateral_currency = None - self._borrow_currency = None - self._init_ltv = None - self._alert_ltv = None - self._liquidate_ltv = None - self._min_borrow_amount = None - self._left_borrowable_amount = None - self.discriminator = None - - if collateral_currency is not None: - self.collateral_currency = collateral_currency - if borrow_currency is not None: - self.borrow_currency = borrow_currency - if init_ltv is not None: - self.init_ltv = init_ltv - if alert_ltv is not None: - self.alert_ltv = alert_ltv - if liquidate_ltv is not None: - self.liquidate_ltv = liquidate_ltv - if min_borrow_amount is not None: - self.min_borrow_amount = min_borrow_amount - if left_borrowable_amount is not None: - self.left_borrowable_amount = left_borrowable_amount - - @property - def collateral_currency(self): - """Gets the collateral_currency of this UserLtvInfo. # noqa: E501 - - Collateral currency # noqa: E501 - - :return: The collateral_currency of this UserLtvInfo. # noqa: E501 - :rtype: str - """ - return self._collateral_currency - - @collateral_currency.setter - def collateral_currency(self, collateral_currency): - """Sets the collateral_currency of this UserLtvInfo. - - Collateral currency # noqa: E501 - - :param collateral_currency: The collateral_currency of this UserLtvInfo. # noqa: E501 - :type: str - """ - - self._collateral_currency = collateral_currency - - @property - def borrow_currency(self): - """Gets the borrow_currency of this UserLtvInfo. # noqa: E501 - - Borrowed currency # noqa: E501 - - :return: The borrow_currency of this UserLtvInfo. # noqa: E501 - :rtype: str - """ - return self._borrow_currency - - @borrow_currency.setter - def borrow_currency(self, borrow_currency): - """Sets the borrow_currency of this UserLtvInfo. - - Borrowed currency # noqa: E501 - - :param borrow_currency: The borrow_currency of this UserLtvInfo. # noqa: E501 - :type: str - """ - - self._borrow_currency = borrow_currency - - @property - def init_ltv(self): - """Gets the init_ltv of this UserLtvInfo. # noqa: E501 - - Initial collateralization rate # noqa: E501 - - :return: The init_ltv of this UserLtvInfo. # noqa: E501 - :rtype: str - """ - return self._init_ltv - - @init_ltv.setter - def init_ltv(self, init_ltv): - """Sets the init_ltv of this UserLtvInfo. - - Initial collateralization rate # noqa: E501 - - :param init_ltv: The init_ltv of this UserLtvInfo. # noqa: E501 - :type: str - """ - - self._init_ltv = init_ltv - - @property - def alert_ltv(self): - """Gets the alert_ltv of this UserLtvInfo. # noqa: E501 - - Warning collateralization rate # noqa: E501 - - :return: The alert_ltv of this UserLtvInfo. # noqa: E501 - :rtype: str - """ - return self._alert_ltv - - @alert_ltv.setter - def alert_ltv(self, alert_ltv): - """Sets the alert_ltv of this UserLtvInfo. - - Warning collateralization rate # noqa: E501 - - :param alert_ltv: The alert_ltv of this UserLtvInfo. # noqa: E501 - :type: str - """ - - self._alert_ltv = alert_ltv - - @property - def liquidate_ltv(self): - """Gets the liquidate_ltv of this UserLtvInfo. # noqa: E501 - - Liquidation collateralization rate # noqa: E501 - - :return: The liquidate_ltv of this UserLtvInfo. # noqa: E501 - :rtype: str - """ - return self._liquidate_ltv - - @liquidate_ltv.setter - def liquidate_ltv(self, liquidate_ltv): - """Sets the liquidate_ltv of this UserLtvInfo. - - Liquidation collateralization rate # noqa: E501 - - :param liquidate_ltv: The liquidate_ltv of this UserLtvInfo. # noqa: E501 - :type: str - """ - - self._liquidate_ltv = liquidate_ltv - - @property - def min_borrow_amount(self): - """Gets the min_borrow_amount of this UserLtvInfo. # noqa: E501 - - Minimum borrowable amount for the loan currency # noqa: E501 - - :return: The min_borrow_amount of this UserLtvInfo. # noqa: E501 - :rtype: str - """ - return self._min_borrow_amount - - @min_borrow_amount.setter - def min_borrow_amount(self, min_borrow_amount): - """Sets the min_borrow_amount of this UserLtvInfo. - - Minimum borrowable amount for the loan currency # noqa: E501 - - :param min_borrow_amount: The min_borrow_amount of this UserLtvInfo. # noqa: E501 - :type: str - """ - - self._min_borrow_amount = min_borrow_amount - - @property - def left_borrowable_amount(self): - """Gets the left_borrowable_amount of this UserLtvInfo. # noqa: E501 - - Remaining borrowable amount for the loan currency # noqa: E501 - - :return: The left_borrowable_amount of this UserLtvInfo. # noqa: E501 - :rtype: str - """ - return self._left_borrowable_amount - - @left_borrowable_amount.setter - def left_borrowable_amount(self, left_borrowable_amount): - """Sets the left_borrowable_amount of this UserLtvInfo. - - Remaining borrowable amount for the loan currency # noqa: E501 - - :param left_borrowable_amount: The left_borrowable_amount of this UserLtvInfo. # noqa: E501 - :type: str - """ - - self._left_borrowable_amount = left_borrowable_amount - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, UserLtvInfo): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, UserLtvInfo): - return True - - return self.to_dict() != other.to_dict() diff --git a/gate_api/models/withdrawal_record.py b/gate_api/models/withdrawal_record.py index c671b40c..54c00bb5 100644 --- a/gate_api/models/withdrawal_record.py +++ b/gate_api/models/withdrawal_record.py @@ -381,7 +381,7 @@ def fail_reason(self, fail_reason): def timestamp2(self): """Gets the timestamp2 of this WithdrawalRecord. # noqa: E501 - Withdrawal final time, i.e.: withdrawal cancellation time or withdrawal success time When status = CANCEL, corresponds to cancellation time When status = DONE and block_number > 0, it is the withdrawal success time # noqa: E501 + Withdrawal final time, i.e.: withdrawal cancellation time or withdrawal success time When status = CANCEL, corresponds to cancellation time When status = DONE, it is the withdrawal success time # noqa: E501 :return: The timestamp2 of this WithdrawalRecord. # noqa: E501 :rtype: str @@ -392,7 +392,7 @@ def timestamp2(self): def timestamp2(self, timestamp2): """Sets the timestamp2 of this WithdrawalRecord. - Withdrawal final time, i.e.: withdrawal cancellation time or withdrawal success time When status = CANCEL, corresponds to cancellation time When status = DONE and block_number > 0, it is the withdrawal success time # noqa: E501 + Withdrawal final time, i.e.: withdrawal cancellation time or withdrawal success time When status = CANCEL, corresponds to cancellation time When status = DONE, it is the withdrawal success time # noqa: E501 :param timestamp2: The timestamp2 of this WithdrawalRecord. # noqa: E501 :type: str @@ -427,7 +427,7 @@ def memo(self, memo): def status(self): """Gets the status of this WithdrawalRecord. # noqa: E501 - Transaction Status - BCODE: Deposit Code Operation - CANCEL: Cancelled - CANCELPEND: Withdrawal Cancellation Pending - DONE: Completed (Only considered truly on-chain when block_number > 0) - EXTPEND: Sent and Waiting for Confirmation - FAIL: On-Chain Failure Pending Confirmation - FVERIFY: Facial Verification in Progress - LOCKED: Wallet-Side Order Locked - MANUAL: Pending Manual Review - REJECT: Rejected - REQUEST: Request in Progress - REVIEW: Under Review # noqa: E501 + Transaction Status - BCODE: Deposit Code Operation - CANCEL: Cancelled - CANCELPEND: Withdrawal Cancellation Pending - DONE: Completed - EXTPEND: Sent and Waiting for Confirmation - FAIL: On-Chain Failure Pending Confirmation - FVERIFY: Facial Verification in Progress - LOCKED: Wallet-Side Order Locked - MANUAL: Pending Manual Review - REJECT: Rejected - REQUEST: Request in Progress - REVIEW: Under Review # noqa: E501 :return: The status of this WithdrawalRecord. # noqa: E501 :rtype: str @@ -438,7 +438,7 @@ def status(self): def status(self, status): """Sets the status of this WithdrawalRecord. - Transaction Status - BCODE: Deposit Code Operation - CANCEL: Cancelled - CANCELPEND: Withdrawal Cancellation Pending - DONE: Completed (Only considered truly on-chain when block_number > 0) - EXTPEND: Sent and Waiting for Confirmation - FAIL: On-Chain Failure Pending Confirmation - FVERIFY: Facial Verification in Progress - LOCKED: Wallet-Side Order Locked - MANUAL: Pending Manual Review - REJECT: Rejected - REQUEST: Request in Progress - REVIEW: Under Review # noqa: E501 + Transaction Status - BCODE: Deposit Code Operation - CANCEL: Cancelled - CANCELPEND: Withdrawal Cancellation Pending - DONE: Completed - EXTPEND: Sent and Waiting for Confirmation - FAIL: On-Chain Failure Pending Confirmation - FVERIFY: Facial Verification in Progress - LOCKED: Wallet-Side Order Locked - MANUAL: Pending Manual Review - REJECT: Rejected - REQUEST: Request in Progress - REVIEW: Under Review # noqa: E501 :param status: The status of this WithdrawalRecord. # noqa: E501 :type: str diff --git a/setup.py b/setup.py index 0d452d1a..06376623 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "gate-api" -VERSION = "7.2.8" +VERSION = "7.2.123" # To install the library, run the following # # python setup.py install